You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72129 lines
4.7 MiB
72129 lines
4.7 MiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html lang="en-US-x-Hixie"><title>HTML5</title><style type="text/css">
|
|
pre { margin-left: 2em; white-space: pre-wrap; }
|
|
h2 { margin: 3em 0 1em 0; }
|
|
h3 { margin: 2.5em 0 1em 0; }
|
|
h4 { margin: 2.5em 0 0.75em 0; }
|
|
h5, h6 { margin: 2.5em 0 1em; }
|
|
h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
|
|
h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
|
|
p { margin: 1em 0; }
|
|
hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
|
|
dl, dd { margin-top: 0; margin-bottom: 0; }
|
|
dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
|
|
dt + dt { margin-top: 0; }
|
|
dd dt { margin-top: 0.25em; margin-bottom: 0; }
|
|
dd p { margin-top: 0; }
|
|
dd dl + p { margin-top: 1em; }
|
|
dd table + p { margin-top: 1em; }
|
|
p + * > li, dd li { margin: 1em 0; }
|
|
dt, dfn { font-weight: bold; font-style: normal; }
|
|
dt dfn { font-style: italic; }
|
|
pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
|
|
pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
|
|
pre em { font-weight: bolder; font-style: normal; }
|
|
@media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
|
|
var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
|
|
table { border-collapse: collapse; border-style: hidden hidden none hidden; }
|
|
table thead, table tbody { border-bottom: solid; }
|
|
table tbody th:first-child { border-left: solid; }
|
|
table tbody th { text-align: left; }
|
|
table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
|
|
blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }
|
|
|
|
.bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
|
|
.matrix, .matrix td { border: none; text-align: right; }
|
|
.matrix { margin-left: 2em; }
|
|
.dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
|
|
.dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
|
|
.dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
|
|
|
|
.toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
|
|
img.extra { float: right; }
|
|
pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; }
|
|
pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
|
|
pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
|
|
pre.css:first-line { color: #AAAA50; }
|
|
dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
|
|
hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
|
|
dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
|
|
dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
|
|
dl.domintro dd p { margin: 0.5em 0; }
|
|
dl.switch { padding-left: 2em; }
|
|
dl.switch > dt { text-indent: -1.5em; }
|
|
dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
|
|
dl.triple { padding: 0 0 0 1em; }
|
|
dl.triple dt, dl.triple dd { margin: 0; display: inline }
|
|
dl.triple dt:after { content: ':'; }
|
|
dl.triple dd:after { content: '\A'; white-space: pre; }
|
|
.diff-old { text-decoration: line-through; color: silver; background: transparent; }
|
|
.diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
|
|
a .diff-new { border-bottom: 1px blue solid; }
|
|
|
|
h2 { page-break-before: always; }
|
|
h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
|
|
h1 + h2, hr + h2.no-toc { page-break-before: auto; }
|
|
|
|
p > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]),
|
|
li > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]), { border-bottom: solid #9999CC; }
|
|
|
|
div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
|
|
div.head p { margin: 0; }
|
|
div.head h1 { margin: 0; }
|
|
div.head .logo { float: right; margin: 0 1em; }
|
|
div.head .logo img { border: none } /* remove border from top image */
|
|
div.head dl { margin: 1em 0; }
|
|
div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }
|
|
|
|
body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
|
|
body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
|
|
body > .toc > li > * { margin-bottom: 0.5em; }
|
|
body > .toc > li > * > li > * { margin-bottom: 0.25em; }
|
|
.toc, .toc li { list-style: none; }
|
|
|
|
.brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
|
|
.brief li { margin: 0; padding: 0; }
|
|
.brief li p { margin: 0; padding: 0; }
|
|
|
|
.category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
|
|
.category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
|
|
.category-list li { display: inline; }
|
|
.category-list li:not(:last-child)::after { content: ', '; }
|
|
.category-list li > span, .category-list li > a { text-transform: lowercase; }
|
|
.category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */
|
|
|
|
.XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
|
|
.XXX > :first-child { margin-top: 0; }
|
|
p .XXX { line-height: 3em; }
|
|
.annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
|
|
.annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
|
|
.annotation :link, .annotation :visited { color: inherit; }
|
|
.annotation :link:hover, .annotation :visited:hover { background: transparent; }
|
|
.annotation span { border: none ! important; }
|
|
.note { color: green; background: transparent; font-family: sans-serif; }
|
|
.warning { color: red; background: transparent; }
|
|
.note, .warning { font-weight: bolder; font-style: italic; }
|
|
p.note, div.note { padding: 0.5em 2em; }
|
|
span.note { padding: 0 2em; }
|
|
.note p:first-child, .warning p:first-child { margin-top: 0; }
|
|
.note p:last-child, .warning p:last-child { margin-bottom: 0; }
|
|
.warning:before { font-style: normal; }
|
|
p.note:before { content: 'Note: '; }
|
|
p.warning:before { content: '\26A0 Warning! '; }
|
|
|
|
.bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
|
|
.bookkeeping { font-size: 0.8em; margin: 2em 0; }
|
|
.bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }
|
|
.bookkeeping dt { margin: 0.5em 2em 0; }
|
|
.bookkeeping dd { margin: 0 3em 0.5em; }
|
|
|
|
h4 { position: relative; z-index: 3; }
|
|
h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
|
|
.element {
|
|
background: #EEEEFF;
|
|
color: black;
|
|
margin: 0 0 1em 0.15em;
|
|
padding: 0 1em 0.25em 0.75em;
|
|
border-left: solid #9999FF 0.25em;
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
.element:before {
|
|
position: absolute;
|
|
z-index: 2;
|
|
top: 0;
|
|
left: -1.15em;
|
|
height: 2em;
|
|
width: 0.9em;
|
|
background: #EEEEFF;
|
|
content: ' ';
|
|
border-style: none none solid solid;
|
|
border-color: #9999FF;
|
|
border-width: 0.25em;
|
|
}
|
|
|
|
.example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
|
|
td > .example:only-child { margin: 0 0 0 0.1em; }
|
|
|
|
ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
|
|
ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
|
|
ul.domTree li li { list-style: none; }
|
|
ul.domTree li:first-child::before { position: absolute; top: 0; height: 0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
|
|
ul.domTree li:not(:last-child)::after { position: absolute; top: 0; bottom: -0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
|
|
ul.domTree span { font-style: italic; font-family: serif; }
|
|
ul.domTree .t1 code { color: purple; font-weight: bold; }
|
|
ul.domTree .t2 { font-style: normal; font-family: monospace; }
|
|
ul.domTree .t2 .name { color: black; font-weight: bold; }
|
|
ul.domTree .t2 .value { color: blue; font-weight: normal; }
|
|
ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
|
|
ul.domTree .t7 code, .domTree .t8 code { color: green; }
|
|
ul.domTree .t10 code { color: teal; }
|
|
|
|
body.dfnEnabled dfn { cursor: pointer; }
|
|
.dfnPanel {
|
|
display: inline;
|
|
position: absolute;
|
|
z-index: 10;
|
|
height: auto;
|
|
width: auto;
|
|
padding: 0.5em 0.75em;
|
|
font: small sans-serif, Droid Sans Fallback;
|
|
background: #DDDDDD;
|
|
color: black;
|
|
border: outset 0.2em;
|
|
}
|
|
.dfnPanel * { margin: 0; padding: 0; font: inherit; text-indent: 0; }
|
|
.dfnPanel :link, .dfnPanel :visited { color: black; }
|
|
.dfnPanel p { font-weight: bolder; }
|
|
.dfnPanel * + p { margin-top: 0.25em; }
|
|
.dfnPanel li { list-style-position: inside; }
|
|
|
|
#configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
|
|
#configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
|
|
#configUI p label { display: block; }
|
|
#configUI #updateUI, #configUI .loginUI { text-align: center; }
|
|
#configUI input[type=button] { display: block; margin: auto; }
|
|
|
|
fieldset { margin: 1em; padding: 0.5em 1em; }
|
|
fieldset > legend + * { margin-top: 0; }
|
|
fieldset > :last-child { margin-bottom: 0; }
|
|
fieldset p { margin: 0.5em 0; }
|
|
|
|
.stability {
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0; right: 0;
|
|
margin: 0 auto 0 auto !important;
|
|
z-index: 1000;
|
|
width: 50%;
|
|
background: maroon; color: yellow;
|
|
-webkit-border-radius: 1em 1em 0 0;
|
|
-moz-border-radius: 1em 1em 0 0;
|
|
border-radius: 1em 1em 0 0;
|
|
-moz-box-shadow: 0 0 1em #500;
|
|
-webkit-box-shadow: 0 0 1em #500;
|
|
box-shadow: 0 0 1em red;
|
|
padding: 0.5em 1em;
|
|
text-align: center;
|
|
}
|
|
.stability strong {
|
|
display: block;
|
|
}
|
|
.stability input {
|
|
appearance: none; margin: 0; border: 0; padding: 0.25em 0.5em; background: transparent; color: black;
|
|
position: absolute; top: -0.5em; right: 0; font: 1.25em sans-serif; text-align: center;
|
|
}
|
|
.stability input:hover {
|
|
color: white;
|
|
text-shadow: 0 0 2px black;
|
|
}
|
|
.stability input:active {
|
|
padding: 0.3em 0.45em 0.2em 0.55em;
|
|
}
|
|
.stability :link, .stability :visited,
|
|
.stability :link:hover, .stability :visited:hover {
|
|
background: transparent;
|
|
color: white;
|
|
}
|
|
|
|
</style>
|
|
<link href="data:text/css,.impl%20{%20display:%20none;%20}%0Ahtml%20{%20border:%20solid%20yellow;%20}%20.domintro:before%20{%20display:%20none;%20}"
|
|
id="author" rel="alternate stylesheet" title="Author documentation only">
|
|
<link href="data:text/css,.impl%20{%20background:%20%23FFEEEE;%20}%20.domintro:before%20{%20background:%20%23FFEEEE;%20}"
|
|
id="highlight" rel="alternate stylesheet" title="Highlight implementation
|
|
requirements">
|
|
<link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type="text/css">
|
|
<style type="text/css">
|
|
|
|
.applies thead th > * { display: block; }
|
|
.applies thead code { display: block; }
|
|
.applies tbody th { whitespace: nowrap; }
|
|
.applies td { text-align: center; }
|
|
.applies .yes { background: yellow; }
|
|
|
|
.matrix, .matrix td { border: hidden; text-align: right; }
|
|
.matrix { margin-left: 2em; }
|
|
|
|
.dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
|
|
.dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
|
|
.dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
|
|
|
|
td.eg { border-width: thin; text-align: center; }
|
|
|
|
#table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
|
|
#table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
|
|
#table-example-1 caption { padding-bottom: 0.5em; }
|
|
#table-example-1 thead, #table-example-1 tbody { border: none; }
|
|
#table-example-1 th, #table-example-1 td { border: solid thin; }
|
|
#table-example-1 th { font-weight: normal; }
|
|
#table-example-1 td { border-style: none solid; vertical-align: top; }
|
|
#table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
|
|
#table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
|
|
#table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
|
|
#table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
|
|
#table-example-1 tbody td:first-child::after { content: leader(". "); }
|
|
#table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
|
|
#table-example-1 tbody td:first-child + td { width: 10em; }
|
|
#table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
|
|
#table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
|
|
|
|
.apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
|
|
.apple-table-examples * { font-family: "Times", serif; }
|
|
.apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
|
|
.apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
|
|
.apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
|
|
.apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
|
|
.apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
|
|
.apple-table-examples td { text-align: right; vertical-align: top; }
|
|
.apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
|
|
.apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
|
|
.apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
|
|
.apple-table-examples sup { line-height: 0; }
|
|
|
|
.details-example img { vertical-align: top; }
|
|
|
|
#base64-table {
|
|
white-space: nowrap;
|
|
font-size: 0.6em;
|
|
column-width: 6em;
|
|
column-count: 5;
|
|
column-gap: 1em;
|
|
-moz-column-width: 6em;
|
|
-moz-column-count: 5;
|
|
-moz-column-gap: 1em;
|
|
-webkit-column-width: 6em;
|
|
-webkit-column-count: 5;
|
|
-webkit-column-gap: 1em;
|
|
}
|
|
#base64-table thead { display: none; }
|
|
#base64-table * { border: none; }
|
|
#base64-table tbody td:first-child:after { content: ':'; }
|
|
#base64-table tbody td:last-child { text-align: right; }
|
|
|
|
#named-character-references-table {
|
|
white-space: nowrap;
|
|
font-size: 0.6em;
|
|
column-width: 30em;
|
|
column-gap: 1em;
|
|
-moz-column-width: 30em;
|
|
-moz-column-gap: 1em;
|
|
-webkit-column-width: 30em;
|
|
-webkit-column-gap: 1em;
|
|
}
|
|
#named-character-references-table > table > tbody > tr > td:first-child + td,
|
|
#named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
|
|
#named-character-references-table > table > tbody > tr > td:last-child:hover > span { position: absolute; top: auto; left: auto; margin-left: 0.5em; line-height: 1.2; font-size: 5em; border: outset; padding: 0.25em 0.5em; background: white; width: 1.25em; height: auto; text-align: center; }
|
|
#named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
|
|
|
|
.glyph.control { color: red; }
|
|
|
|
@font-face {
|
|
font-family: 'Essays1743';
|
|
src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743.ttf');
|
|
}
|
|
@font-face {
|
|
font-family: 'Essays1743';
|
|
font-weight: bold;
|
|
src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Bold.ttf');
|
|
}
|
|
@font-face {
|
|
font-family: 'Essays1743';
|
|
font-style: italic;
|
|
src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Italic.ttf');
|
|
}
|
|
@font-face {
|
|
font-family: 'Essays1743';
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-BoldItalic.ttf');
|
|
}
|
|
|
|
</style><style type="text/css">
|
|
.domintro:before { display: table; margin: -1em -0.5em -0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: black; font-style: italic; border: solid 2px; background: white; padding: 0 0.25em; }
|
|
</style>
|
|
<script src="toc.js" type="text/javascript"></script>
|
|
<script type="text/javascript">
|
|
function getCookie(name) {
|
|
var params = location.search.substr(1).split("&");
|
|
for (var index = 0; index < params.length; index++) {
|
|
if (params[index] == name)
|
|
return "1";
|
|
var data = params[index].split("=");
|
|
if (data[0] == name)
|
|
return unescape(data[1]);
|
|
}
|
|
var cookies = document.cookie.split("; ");
|
|
for (var index = 0; index < cookies.length; index++) {
|
|
var data = cookies[index].split("=");
|
|
if (data[0] == name)
|
|
return unescape(data[1]);
|
|
}
|
|
return null;
|
|
}
|
|
</script>
|
|
<body onload="initToc()">
|
|
<div class="head" id="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>HTML5</h1>
|
|
<h2 class="no-num no-toc" id="a-vocabulary-and-associated-apis-for-html-and-xhtml">A vocabulary and associated APIs for HTML and XHTML</h2>
|
|
<h2 class="no-num no-toc" id="w3c-working-draft-25-may-2011">W3C Working Draft 25 May 2011</h2>
|
|
<dl><dt>This Version:</dt>
|
|
<dd><a href="http://www.w3.org/TR/2011/WD-html5-20110525/">http://www.w3.org/TR/2011/WD-html5-20110525/</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 class="latest-link" href="http://dev.w3.org/html5/spec/Overview.html">http://dev.w3.org/html5/spec/Overview.html</a></dd>
|
|
|
|
<dt>Previous Versions:</dt>
|
|
<dd><a href="http://www.w3.org/TR/2011/WD-html5-20110405/">http://www.w3.org/TR/2011/WD-html5-20110405/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2011/WD-html5-20110113/">http://www.w3.org/TR/2011/WD-html5-20110113/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2010/WD-html5-20101019/">http://www.w3.org/TR/2010/WD-html5-20101019/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2010/WD-html5-20100624/">http://www.w3.org/TR/2010/WD-html5-20100624/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2010/WD-html5-20100304/">http://www.w3.org/TR/2010/WD-html5-20100304/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2009/WD-html5-20090825/">http://www.w3.org/TR/2009/WD-html5-20090825/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2009/WD-html5-20090423/">http://www.w3.org/TR/2009/WD-html5-20090423/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2009/WD-html5-20090212/">http://www.w3.org/TR/2009/WD-html5-20090212/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2008/WD-html5-20080610/">http://www.w3.org/TR/2008/WD-html5-20080610/</a></dd>
|
|
<dd><a href="http://www.w3.org/TR/2008/WD-html5-20080122/">http://www.w3.org/TR/2008/WD-html5-20080122/</a></dd>
|
|
<!-- :ZZZ -->
|
|
<dt>Editor:</dt>
|
|
<dd><a href="mailto:ian@hixie.ch">Ian Hickson</a>, Google, Inc.</dd>
|
|
</dl><p>This specification is available in the following formats:
|
|
<a href="Overview.html">single page HTML</a>,
|
|
<a href="spec.html">multipage HTML</a>,
|
|
<a href="author/">web developer edition</a>.
|
|
This is Revision: 1.4938.
|
|
</p>
|
|
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
|
|
© 2011 <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>
|
|
|
|
|
|
<!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
|
|
<p class="alt">The bulk of the text of this specification is also
|
|
available in the WHATWG <a href="http://www.whatwg.org/specs/web-apps/current-work/complete.html">Web Applications 1.0</a> specification, under a license that permits
|
|
reuse of the specification text.</p>
|
|
<!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
|
|
|
|
|
|
</div><hr class="top"><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 Web: the Hypertext Markup Language
|
|
(HTML). 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.<h2 class="no-num no-toc" id="status-of-this-document">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 most recently
|
|
formally published 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 in a manner
|
|
that is tracked by the W3C, please submit them via using <a href="http://www.w3.org/Bugs/Public/enter_bug.cgi?product=HTML%20WG">our
|
|
public bug database</a>. If you do not have an account then you can
|
|
enter feedback using this form:<form action="http://www.whatwg.org/specs/web-apps/current-work/file-spam.cgi" method="post">
|
|
<fieldset><legend>Feedback Comments</legend>
|
|
<input name="id" type="hidden" value="top"><input name="component" type="hidden" value="HTML5 spec (editor: Ian Hickson)"><input name="response" type="hidden" value="html"><p><label for="feedbackBox">Please enter your feedback, carefully
|
|
indicating the title of the section for which you are submitting
|
|
feedback, quoting the text that's wrong today if appropriate. If
|
|
you're suggesting a new feature, it's really important to say
|
|
<em>what</em> the problem you're trying to solve is. That's more
|
|
important than the solution, in fact.</label></p>
|
|
<p><textarea cols="79" id="feedbackBox" name="text" rows="10"></textarea></p>
|
|
<p class="note">Please don't use section numbers as these tend to
|
|
change rapidly and make your feedback harder to understand.</p>
|
|
<script type="text/javascript">
|
|
function checkFeedbackForm(form) {
|
|
if (form.elements.text.value.match(/^ *</)) {
|
|
alert('Please don\'t start your feedback with an angle bracket, instead explain what topic your feedback is about first.');
|
|
return true;
|
|
} else if (form.elements.text.value.match(/ [^ ]+ [^ ]+ [^ ]+ [^ ]+ /)) {
|
|
if (form.elements.text.value.match(/^Please enter your feedback, carefully/)) {
|
|
alert('Please enter your feedback, explaining what is wrong, and without repeating the instructions. Thanks!');
|
|
return true;
|
|
} else if (form.elements.text.value.match(/ [^ ]+ [^ ]+ [^ ]+ [^ ]+ /)) {
|
|
form.action = "http://www.whatwg.org/specs/web-apps/current-work/file-bug.cgi";
|
|
return true;
|
|
} else {
|
|
alert('Please include significantly more detail about exactly what problem you are trying to solve.');
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
</script><p>
|
|
<input onclick="return checkFeedbackForm(form)" type="submit" value="Submit feedback"><small>(Note: Your IP address and user agent will be publicly recorded for spam prevention purposes.)</small>
|
|
</p>
|
|
</fieldset></form><p>If you cannot do this then you can also e-mail feedback 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>),
|
|
and arrangements will be made to transpose the comments to our
|
|
public bug database.
|
|
|
|
<!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING SENTENCE TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
|
|
Alternatively, you can e-mail feedback to <a href="mailto:whatwg@whatwg.org">whatwg@whatwg.org</a> (<a href="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">subscribe</a>,
|
|
<a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/">archives</a>).
|
|
The editor guarantees that all substantive feedback sent to this
|
|
list will receive a reply. However, such feedback is not considered
|
|
formal feedback for the W3C process.
|
|
<!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING SENTENCE TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
|
|
|
|
All feedback is welcome.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>The working groups maintains <a href="http://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=exact&email1=ian%40hixie.ch&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">a
|
|
list of all bug reports that the editor has not yet tried to
|
|
address</a> and <a href="http://www.w3.org/html/wg/tracker/products/1">a list of issues
|
|
for which the chairs have not yet declared a decision</a>. The
|
|
editor also maintains <a href="http://www.whatwg.org/issues/">a list
|
|
of all e-mails that he has not yet tried to address</a>. These bugs,
|
|
issues, and e-mails apply to multiple HTML-related specifications,
|
|
not just this one.</p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><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.
|
|
|
|
<div id="multipage-common">
|
|
<p class="stability" id="wip"><strong>This is a work in
|
|
progress!</strong> For the latest updates from the HTML WG, possibly
|
|
including important bug fixes, please look at the <a href="http://dev.w3.org/html5/spec/Overview.html">editor's draft</a> instead.
|
|
There may also be a more
|
|
<a href="http://www.w3.org/TR/html5">up-to-date Working Draft</a>
|
|
with changes based on resolution of Last Call issues.
|
|
<input onclick="closeWarning(this.parentNode)" type="button" value="╳⃝"></p>
|
|
<script type="text/javascript">
|
|
function closeWarning(element) {
|
|
element.parentNode.removeChild(element);
|
|
var date = new Date();
|
|
date.setDate(date.getDate()+4);
|
|
document.cookie = 'hide-obsolescence-warning=1; expires=' + date.toGMTString();
|
|
}
|
|
if (getCookie('hide-obsolescence-warning') == '1')
|
|
setTimeout(function () { document.getElementById('wip').parentNode.removeChild(document.getElementById('wip')); }, 2000);
|
|
</script></div>
|
|
|
|
<p>The publication of this document by the W3C as a W3C Last Call 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><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
|
|
|
|
<p>A number of <strong><a href="http://dev.w3.org/html5/status/formal-objection-status.html">formal objections</a></strong>
|
|
are open against this document:</p>
|
|
<ul>
|
|
<li><a href="http://dev.w3.org/html5/status/formal-objection-status.html#ISSUE-031b">issue 31 (Adopt the REQUIREMENTS portion of the "Provide detailed instructions and examples for doing so to all readers of the HTML specification.")</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/formal-objection-status.html#ISSUE-041">issue 41 (Don't provide an explicit means for others to define custom elements and attributes within HTML markup)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/formal-objection-status.html#ISSUE-142">issue 142 (The video poster is conceptually part of the media resource itself. Any short text alternative should apply to the resource as a whole, not just the poster image.)</a></li>
|
|
</ul>
|
|
<p>The HTML Working Group chairs maintain a
|
|
<a href="http://dev.w3.org/html5/status/formal-objection-status.html">complete list of all current formal objections</a>;
|
|
that list may change as this document progresses.</p>
|
|
|
|
<p>There are also a number of
|
|
<strong><a href="http://dev.w3.org/html5/status/issue-status.html">open issues</a></strong>
|
|
related to this document, for which working-group decisions still need to be made:</p>
|
|
<ul>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-030">issue 30 (longdesc)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-133">issue 133 (modal attribute)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-134">issue 134 (tab states)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-150">issue 150 (code-point verbosity)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-151">issue 151 (whatwg references)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-153">issue 153 (link-external)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-154">issue 154 (link-sidebar)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-163">issue 163 (navigating tracks)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-164">issue 164 (no hgroup)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/issue-status.html#ISSUE-165">issue 165 (rel-pingback)</a></li>
|
|
</ul>
|
|
<p>The HTML Working Group chairs maintain a
|
|
<a href="http://dev.w3.org/html5/status/issue-status.html">complete list of all currently open HTML Working Group issues</a>;
|
|
that list may change as this document progresses.</p>
|
|
|
|
<p>Activities are being pursued by some members of the HTML Working Group
|
|
to provide
|
|
<strong><a href="http://dev.w3.org/html5/status/new-information-status.html">new information</a></strong>
|
|
related to this document, with the intent of reopening the following issues:</p>
|
|
|
|
<ul>
|
|
<li><a href="http://dev.w3.org/html5/status/new-information-status.html#ISSUE-031b">issue 31 (Adopt the REQUIREMENTS portion of the "Provide detailed instructions and examples for doing so to all readers of the HTML specification.")</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/new-information-status.html#ISSUE-031c">issue 31 (The presence of <meta name=generator> makes missing alt conforming)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/new-information-status.html#ISSUE-032">issue 32 (Drop the summary="" attribute (in favor of the aria-describedby attribute)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/new-information-status.html#ISSUE-080">issue 80 (The presence of title makes missing alt conforming)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/new-information-status.html#ISSUE-142">issue 142 (The video poster is conceptually part of the media resource itself. Any short text alternative should apply to the resource as a whole, not just the poster image.)</a></li>
|
|
<li><a href="http://dev.w3.org/html5/status/new-information-status.html#ISSUE-155">issue 155 (Enable all users to distinguish the cells of a table.)</a></li>
|
|
</ul>
|
|
|
|
<p>The HTML Working Group chairs maintain a
|
|
<a href="http://dev.w3.org/html5/status/new-information-status.html">complete list of all HTML Working Group issues for which new information is known to be being pursued</a>;
|
|
that list may change as this document progresses.</p>
|
|
|
|
<p>A list of other potential
|
|
<a href='http://www.w3.org/WAI/PF/HTML/wiki/Work_Topics'>accessibility related issues</a>
|
|
is also available.</p>
|
|
|
|
<p>W3C anticipates that there will be changes to this specification as a
|
|
result of the resolution of Last Call issues. Per the usual W3C Process,
|
|
any significant changes to the specification will trigger a subsequent Last
|
|
Call.</p>
|
|
|
|
<p>The latest stable version of the editor's draft of this
|
|
specification is always available on <a href="http://dev.w3.org/html5/">the W3C CVS server</a> and in the <a href="http://svn.whatwg.org/webapps/">WHATWG Subversion
|
|
repository</a>. The <a href="http://www.whatwg.org/specs/web-apps/current-work/complete.html">latest
|
|
editor's working copy</a> (which may contain unfinished text in the
|
|
process of being prepared) contains the latest draft text of this
|
|
specification (amongst others). For more details, please see the <a href="http://wiki.whatwg.org/wiki/FAQ#What_are_the_various_versions_of_the_spec.3F">WHATWG
|
|
FAQ</a>.</p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>There are various ways to follow the change history for the
|
|
HTML specifications:<dl><dt>E-mail notifications of changes</dt>
|
|
<dd>HTML-Diffs mailing list (diff-marked HTML versions for each change): <a href="http://lists.w3.org/Archives/Public/public-html-diffs/latest">http://lists.w3.org/Archives/Public/public-html-diffs/latest</a></dd>
|
|
<dd>Commit-Watchers mailing list (complete source diffs): <a href="http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org">http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org</a></dd>
|
|
<dt>Real-time notifications of changes:</dt>
|
|
<dd>Generated diff-marked HTML versions for each change: <a href="http://twitter.com/HTML5">http://twitter.com/HTML5</a></dd>
|
|
<dt>Browsable version-control record of all changes:</dt>
|
|
<dd>CVSWeb interface with side-by-side diffs: <a href="http://dev.w3.org/cvsweb/html5/">http://dev.w3.org/cvsweb/html5/</a></dd>
|
|
<dd>Annotated summary with unified diffs: <a href="http://html5.org/tools/web-apps-tracker">http://html5.org/tools/web-apps-tracker</a></dd>
|
|
<dd>Raw Subversion interface: <code>svn checkout http://svn.whatwg.org/webapps/</code></dd>
|
|
</dl><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>The 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 25 May 2011 Last Call Working Draft.
|
|
<!-- * The Last Call period ends 03 August 2011. -->
|
|
The Last Call period ends 03 August 2011.
|
|
|
|
</p><!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><p>Work on this specification is also done at the <a href="http://www.whatwg.org/">WHATWG</a>. The W3C HTML working group
|
|
actively pursues convergence with the WHATWG, as required by the <a href="http://www.w3.org/2007/03/HTML-WG-charter">W3C HTML working
|
|
group charter</a>.</p><!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST --><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>.<h2 class="no-num no-toc" id="contents">Table of Contents</h2>
|
|
<ol class="toc">
|
|
<li><a href="#introduction"><span class="secno">1 </span>Introduction</a>
|
|
<ol>
|
|
<li><a href="#background"><span class="secno">1.1 </span>Background</a></li>
|
|
<li><a href="#audience"><span class="secno">1.2 </span>Audience</a></li>
|
|
<li><a href="#scope"><span class="secno">1.3 </span>Scope</a></li>
|
|
<li><a href="#history-1"><span class="secno">1.4 </span>History</a></li>
|
|
<li><a href="#design-notes"><span class="secno">1.5 </span>Design notes</a>
|
|
<ol>
|
|
<li><a href="#serializability-of-script-execution"><span class="secno">1.5.1 </span>Serializability of script execution</a></li>
|
|
<li><a href="#compliance-with-other-specifications"><span class="secno">1.5.2 </span>Compliance with other specifications</a></ol></li>
|
|
<li><a href="#html-vs-xhtml"><span class="secno">1.6 </span>HTML vs XHTML</a></li>
|
|
<li><a href="#structure-of-this-specification"><span class="secno">1.7 </span>Structure of this specification</a>
|
|
<ol>
|
|
<li><a href="#how-to-read-this-specification"><span class="secno">1.7.1 </span>How to read this specification</a></li>
|
|
<li><a href="#typographic-conventions"><span class="secno">1.7.2 </span>Typographic conventions</a></ol></li>
|
|
<li><a href="#a-quick-introduction-to-html"><span class="secno">1.8 </span>A quick introduction to HTML</a></li>
|
|
<li><a href="#conformance-requirements-for-authors"><span class="secno">1.9 </span>Conformance requirements for authors</a>
|
|
<ol>
|
|
<li><a href="#presentational-markup"><span class="secno">1.9.1 </span>Presentational markup</a></li>
|
|
<li><a href="#syntax-errors"><span class="secno">1.9.2 </span>Syntax errors</a></li>
|
|
<li><a href="#restrictions-on-content-models-and-on-attribute-values"><span class="secno">1.9.3 </span>Restrictions on content models and on attribute values</a></ol></li>
|
|
<li><a href="#recommended-reading"><span class="secno">1.10 </span>Recommended reading</a></ol></li>
|
|
<li><a href="#infrastructure"><span class="secno">2 </span>Common infrastructure</a>
|
|
<ol>
|
|
<li><a href="#terminology"><span class="secno">2.1 </span>Terminology</a>
|
|
<ol>
|
|
<li><a href="#resources"><span class="secno">2.1.1 </span>Resources</a></li>
|
|
<li><a href="#xml"><span class="secno">2.1.2 </span>XML</a></li>
|
|
<li><a href="#dom-trees"><span class="secno">2.1.3 </span>DOM trees</a></li>
|
|
<li><a href="#scripting-0"><span class="secno">2.1.4 </span>Scripting</a></li>
|
|
<li><a href="#plugins"><span class="secno">2.1.5 </span>Plugins</a></li>
|
|
<li><a href="#character-encodings"><span class="secno">2.1.6 </span>Character encodings</a></ol></li>
|
|
<li><a href="#conformance-requirements"><span class="secno">2.2 </span>Conformance requirements</a>
|
|
<ol>
|
|
<li><a href="#conformance-classes"><span class="secno">2.2.1 </span>Conformance classes</a></li>
|
|
<li><a href="#dependencies"><span class="secno">2.2.2 </span>Dependencies</a></li>
|
|
<li><a href="#extensibility"><span class="secno">2.2.3 </span>Extensibility</a></ol></li>
|
|
<li><a href="#case-sensitivity-and-string-comparison"><span class="secno">2.3 </span>Case-sensitivity and string comparison</a></li>
|
|
<li><a href="#utf-8"><span class="secno">2.4 </span>UTF-8</a></li>
|
|
<li><a href="#common-microsyntaxes"><span class="secno">2.5 </span>Common microsyntaxes</a>
|
|
<ol>
|
|
<li><a href="#common-parser-idioms"><span class="secno">2.5.1 </span>Common parser idioms</a></li>
|
|
<li><a href="#boolean-attributes"><span class="secno">2.5.2 </span>Boolean attributes</a></li>
|
|
<li><a href="#keywords-and-enumerated-attributes"><span class="secno">2.5.3 </span>Keywords and enumerated attributes</a></li>
|
|
<li><a href="#numbers"><span class="secno">2.5.4 </span>Numbers</a>
|
|
<ol>
|
|
<li><a href="#non-negative-integers"><span class="secno">2.5.4.1 </span>Non-negative integers</a></li>
|
|
<li><a href="#signed-integers"><span class="secno">2.5.4.2 </span>Signed integers</a></li>
|
|
<li><a href="#real-numbers"><span class="secno">2.5.4.3 </span>Real numbers</a></li>
|
|
<li><a href="#percentages-and-dimensions"><span class="secno">2.5.4.4 </span>Percentages and lengths</a></li>
|
|
<li><a href="#lists-of-integers"><span class="secno">2.5.4.5 </span>Lists of integers</a></li>
|
|
<li><a href="#lists-of-dimensions"><span class="secno">2.5.4.6 </span>Lists of dimensions</a></ol></li>
|
|
<li><a href="#dates-and-times"><span class="secno">2.5.5 </span>Dates and times</a>
|
|
<ol>
|
|
<li><a href="#months"><span class="secno">2.5.5.1 </span>Months</a></li>
|
|
<li><a href="#dates"><span class="secno">2.5.5.2 </span>Dates</a></li>
|
|
<li><a href="#times"><span class="secno">2.5.5.3 </span>Times</a></li>
|
|
<li><a href="#local-dates-and-times"><span class="secno">2.5.5.4 </span>Local dates and times</a></li>
|
|
<li><a href="#global-dates-and-times"><span class="secno">2.5.5.5 </span>Global dates and times</a></li>
|
|
<li><a href="#weeks"><span class="secno">2.5.5.6 </span>Weeks</a></li>
|
|
<li><a href="#vaguer-moments-in-time"><span class="secno">2.5.5.7 </span>Vaguer moments in time</a></ol></li>
|
|
<li><a href="#colors"><span class="secno">2.5.6 </span>Colors</a></li>
|
|
<li><a href="#space-separated-tokens"><span class="secno">2.5.7 </span>Space-separated tokens</a></li>
|
|
<li><a href="#comma-separated-tokens"><span class="secno">2.5.8 </span>Comma-separated tokens</a></li>
|
|
<li><a href="#syntax-references"><span class="secno">2.5.9 </span>References</a></li>
|
|
<li><a href="#mq"><span class="secno">2.5.10 </span>Media queries</a></ol></li>
|
|
<li><a href="#urls"><span class="secno">2.6 </span>URLs</a>
|
|
<ol>
|
|
<li><a href="#terminology-0"><span class="secno">2.6.1 </span>Terminology</a></li>
|
|
<li><a href="#parsing-urls"><span class="secno">2.6.2 </span>Parsing URLs</a></li>
|
|
<li><a href="#resolving-urls"><span class="secno">2.6.3 </span>Resolving URLs</a></li>
|
|
<li><a href="#url-manipulation-and-creation"><span class="secno">2.6.4 </span>URL manipulation and creation</a></li>
|
|
<li><a href="#dynamic-changes-to-base-urls"><span class="secno">2.6.5 </span>Dynamic changes to base URLs</a></li>
|
|
<li><a href="#interfaces-for-url-manipulation"><span class="secno">2.6.6 </span>Interfaces for URL manipulation</a></ol></li>
|
|
<li><a href="#fetching-resources"><span class="secno">2.7 </span>Fetching resources</a>
|
|
<ol>
|
|
<li><a href="#concept-http-equivalent"><span class="secno">2.7.1 </span>Protocol concepts</a></li>
|
|
<li><a href="#encrypted-http-and-related-security-concerns"><span class="secno">2.7.2 </span>Encrypted HTTP and related security concerns</a></li>
|
|
<li><a href="#content-type-sniffing"><span class="secno">2.7.3 </span>Determining the type of a resource</a></li>
|
|
<li><a href="#extracting-encodings-from-meta-elements"><span class="secno">2.7.4 </span>Extracting encodings from <code>meta</code> elements</a></ol></li>
|
|
<li><a href="#common-dom-interfaces"><span class="secno">2.8 </span>Common DOM interfaces</a>
|
|
<ol>
|
|
<li><a href="#reflecting-content-attributes-in-idl-attributes"><span class="secno">2.8.1 </span>Reflecting content attributes in IDL attributes</a></li>
|
|
<li><a href="#collections-0"><span class="secno">2.8.2 </span>Collections</a>
|
|
<ol>
|
|
<li><a href="#htmlcollection-0"><span class="secno">2.8.2.1 </span>HTMLCollection</a></li>
|
|
<li><a href="#htmlallcollection-0"><span class="secno">2.8.2.2 </span>HTMLAllCollection</a></li>
|
|
<li><a href="#htmlformcontrolscollection-0"><span class="secno">2.8.2.3 </span>HTMLFormControlsCollection</a></li>
|
|
<li><a href="#htmloptionscollection-0"><span class="secno">2.8.2.4 </span>HTMLOptionsCollection</a></ol></li>
|
|
<li><a href="#domtokenlist-0"><span class="secno">2.8.3 </span>DOMTokenList</a></li>
|
|
<li><a href="#domsettabletokenlist-0"><span class="secno">2.8.4 </span>DOMSettableTokenList</a></li>
|
|
<li><a href="#safe-passing-of-structured-data"><span class="secno">2.8.5 </span>Safe passing of structured data</a></li>
|
|
<li><a href="#domstringmap-0"><span class="secno">2.8.6 </span>DOMStringMap</a></li>
|
|
<li><a href="#dom-feature-strings"><span class="secno">2.8.7 </span>DOM feature strings</a></li>
|
|
<li><a href="#exceptions"><span class="secno">2.8.8 </span>Exceptions</a></li>
|
|
<li><a href="#garbage-collection"><span class="secno">2.8.9 </span>Garbage collection</a></ol></li>
|
|
<li><a href="#namespaces"><span class="secno">2.9 </span>Namespaces</a></ol></li>
|
|
<li><a href="#dom"><span class="secno">3 </span>Semantics, structure, and APIs of HTML documents</a>
|
|
<ol>
|
|
<li><a href="#documents"><span class="secno">3.1 </span>Documents</a>
|
|
<ol>
|
|
<li><a href="#documents-in-the-dom"><span class="secno">3.1.1 </span>Documents in the DOM</a></li>
|
|
<li><a href="#security-document"><span class="secno">3.1.2 </span>Security</a></li>
|
|
<li><a href="#resource-metadata-management"><span class="secno">3.1.3 </span>Resource metadata management</a></li>
|
|
<li><a href="#dom-tree-accessors"><span class="secno">3.1.4 </span>DOM tree accessors</a></li>
|
|
<li><a href="#creating-documents"><span class="secno">3.1.5 </span>Creating documents</a></li>
|
|
<li><a href="#loading-xml-documents"><span class="secno">3.1.6 </span>Loading XML documents</a></ol></li>
|
|
<li><a href="#elements"><span class="secno">3.2 </span>Elements</a>
|
|
<ol>
|
|
<li><a href="#semantics-0"><span class="secno">3.2.1 </span>Semantics</a></li>
|
|
<li><a href="#elements-in-the-dom"><span class="secno">3.2.2 </span>Elements in the DOM</a></li>
|
|
<li><a href="#global-attributes"><span class="secno">3.2.3 </span>Global attributes</a>
|
|
<ol>
|
|
<li><a href="#the-id-attribute"><span class="secno">3.2.3.1 </span>The <code>id</code> attribute</a></li>
|
|
<li><a href="#the-title-attribute"><span class="secno">3.2.3.2 </span>The <code>title</code> attribute</a></li>
|
|
<li><a href="#the-lang-and-xml:lang-attributes"><span class="secno">3.2.3.3 </span>The <code title="attr-lang">lang</code> and <code title="attr-xml-lang">xml:lang</code> attributes</a></li>
|
|
<li><a href="#the-xml:base-attribute-xml-only"><span class="secno">3.2.3.4 </span>The <code>xml:base</code>
|
|
attribute (XML only)</a></li>
|
|
<li><a href="#the-dir-attribute"><span class="secno">3.2.3.5 </span>The <code>dir</code> attribute</a></li>
|
|
<li><a href="#classes"><span class="secno">3.2.3.6 </span>The <code>class</code> attribute</a></li>
|
|
<li><a href="#the-style-attribute"><span class="secno">3.2.3.7 </span>The <code>style</code> attribute</a></li>
|
|
<li><a href="#embedding-custom-non-visible-data-with-the-data-attributes"><span class="secno">3.2.3.8 </span>Embedding custom non-visible data with the <code title="attr-data-*">data-*</code> attributes</a></ol></li>
|
|
<li><a href="#element-definitions"><span class="secno">3.2.4 </span>Element definitions</a>
|
|
<ol>
|
|
<li><a href="#attributes"><span class="secno">3.2.4.1 </span>Attributes</a></ol></li>
|
|
<li><a href="#content-models"><span class="secno">3.2.5 </span>Content models</a>
|
|
<ol>
|
|
<li><a href="#kinds-of-content"><span class="secno">3.2.5.1 </span>Kinds of content</a>
|
|
<ol>
|
|
<li><a href="#metadata-content-0"><span class="secno">3.2.5.1.1 </span>Metadata content</a></li>
|
|
<li><a href="#flow-content-0"><span class="secno">3.2.5.1.2 </span>Flow content</a></li>
|
|
<li><a href="#sectioning-content-0"><span class="secno">3.2.5.1.3 </span>Sectioning content</a></li>
|
|
<li><a href="#heading-content-0"><span class="secno">3.2.5.1.4 </span>Heading content</a></li>
|
|
<li><a href="#phrasing-content-0"><span class="secno">3.2.5.1.5 </span>Phrasing content</a></li>
|
|
<li><a href="#embedded-content-0"><span class="secno">3.2.5.1.6 </span>Embedded content</a></li>
|
|
<li><a href="#interactive-content-0"><span class="secno">3.2.5.1.7 </span>Interactive content</a></ol></li>
|
|
<li><a href="#transparent-content-models"><span class="secno">3.2.5.2 </span>Transparent content models</a></li>
|
|
<li><a href="#paragraphs"><span class="secno">3.2.5.3 </span>Paragraphs</a></ol></li>
|
|
<li><a href="#requirements-relating-to-bidirectional-algorithm-formatting-characters"><span class="secno">3.2.6 </span>Requirements relating to bidirectional-algorithm formatting
|
|
characters</a></li>
|
|
<li><a href="#wai-aria"><span class="secno">3.2.7 </span>WAI-ARIA</a></ol></li>
|
|
<li><a href="#apis-in-html-documents"><span class="secno">3.3 </span>APIs in HTML documents</a></li>
|
|
<li><a href="#interactions-with-xpath-and-xslt"><span class="secno">3.4 </span>Interactions with XPath and XSLT</a></li>
|
|
<li><a href="#dynamic-markup-insertion"><span class="secno">3.5 </span>Dynamic markup insertion</a>
|
|
<ol>
|
|
<li><a href="#opening-the-input-stream"><span class="secno">3.5.1 </span>Opening the input stream</a></li>
|
|
<li><a href="#closing-the-input-stream"><span class="secno">3.5.2 </span>Closing the input stream</a></li>
|
|
<li><a href="#document.write"><span class="secno">3.5.3 </span><code title="dom-document-write">document.write()</code></a></li>
|
|
<li><a href="#document.writeln"><span class="secno">3.5.4 </span><code title="dom-document-writeln">document.writeln()</code></a></li>
|
|
<li><a href="#innerhtml"><span class="secno">3.5.5 </span><code title="dom-innerHTML">innerHTML</code></a></li>
|
|
<li><a href="#outerhtml"><span class="secno">3.5.6 </span><code title="dom-outerHTML">outerHTML</code></a></li>
|
|
<li><a href="#insertadjacenthtml"><span class="secno">3.5.7 </span><code title="dom-insertAdjacentHTML">insertAdjacentHTML()</code></a></ol></ol></li>
|
|
<li><a href="#semantics"><span class="secno">4 </span>The elements of HTML</a>
|
|
<ol>
|
|
<li><a href="#the-root-element"><span class="secno">4.1 </span>The root element</a>
|
|
<ol>
|
|
<li><a href="#the-html-element"><span class="secno">4.1.1 </span>The <code>html</code> element</a></ol></li>
|
|
<li><a href="#document-metadata"><span class="secno">4.2 </span>Document metadata</a>
|
|
<ol>
|
|
<li><a href="#the-head-element"><span class="secno">4.2.1 </span>The <code>head</code> element</a></li>
|
|
<li><a href="#the-title-element"><span class="secno">4.2.2 </span>The <code>title</code> element</a></li>
|
|
<li><a href="#the-base-element"><span class="secno">4.2.3 </span>The <code>base</code> element</a></li>
|
|
<li><a href="#the-link-element"><span class="secno">4.2.4 </span>The <code>link</code> element</a></li>
|
|
<li><a href="#the-meta-element"><span class="secno">4.2.5 </span>The <code>meta</code> element</a>
|
|
<ol>
|
|
<li><a href="#standard-metadata-names"><span class="secno">4.2.5.1 </span>Standard metadata names</a></li>
|
|
<li><a href="#other-metadata-names"><span class="secno">4.2.5.2 </span>Other metadata names</a></li>
|
|
<li><a href="#pragma-directives"><span class="secno">4.2.5.3 </span>Pragma directives</a></li>
|
|
<li><a href="#other-pragma-directives"><span class="secno">4.2.5.4 </span>Other pragma directives</a></li>
|
|
<li><a href="#charset"><span class="secno">4.2.5.5 </span>Specifying the document's character encoding</a></ol></li>
|
|
<li><a href="#the-style-element"><span class="secno">4.2.6 </span>The <code>style</code> element</a></li>
|
|
<li><a href="#styling"><span class="secno">4.2.7 </span>Styling</a></ol></li>
|
|
<li><a href="#scripting-1"><span class="secno">4.3 </span>Scripting</a>
|
|
<ol>
|
|
<li><a href="#the-script-element"><span class="secno">4.3.1 </span>The <code>script</code> element</a>
|
|
<ol>
|
|
<li><a href="#scriptingLanguages"><span class="secno">4.3.1.1 </span>Scripting languages</a></li>
|
|
<li><a href="#restrictions-for-contents-of-script-elements"><span class="secno">4.3.1.2 </span>Restrictions for contents of <code>script</code> elements</a></li>
|
|
<li><a href="#inline-documentation-for-external-scripts"><span class="secno">4.3.1.3 </span>Inline documentation for external scripts</a></li>
|
|
<li><a href="#scriptTagXSLT"><span class="secno">4.3.1.4 </span>Interaction of <code>script</code> elements and XSLT</a></ol></li>
|
|
<li><a href="#the-noscript-element"><span class="secno">4.3.2 </span>The <code>noscript</code> element</a></ol></li>
|
|
<li><a href="#sections"><span class="secno">4.4 </span>Sections</a>
|
|
<ol>
|
|
<li><a href="#the-body-element"><span class="secno">4.4.1 </span>The <code>body</code> element</a></li>
|
|
<li><a href="#the-section-element"><span class="secno">4.4.2 </span>The <code>section</code> element</a></li>
|
|
<li><a href="#the-nav-element"><span class="secno">4.4.3 </span>The <code>nav</code> element</a></li>
|
|
<li><a href="#the-article-element"><span class="secno">4.4.4 </span>The <code>article</code> element</a></li>
|
|
<li><a href="#the-aside-element"><span class="secno">4.4.5 </span>The <code>aside</code> element</a></li>
|
|
<li><a href="#the-h1-h2-h3-h4-h5-and-h6-elements"><span class="secno">4.4.6 </span>The <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>, and <code>h6</code> elements</a></li>
|
|
<li><a href="#the-hgroup-element"><span class="secno">4.4.7 </span>The <code>hgroup</code> element</a></li>
|
|
<li><a href="#the-header-element"><span class="secno">4.4.8 </span>The <code>header</code> element</a></li>
|
|
<li><a href="#the-footer-element"><span class="secno">4.4.9 </span>The <code>footer</code> element</a></li>
|
|
<li><a href="#the-address-element"><span class="secno">4.4.10 </span>The <code>address</code> element</a></li>
|
|
<li><a href="#headings-and-sections"><span class="secno">4.4.11 </span>Headings and sections</a>
|
|
<ol>
|
|
<li><a href="#outlines"><span class="secno">4.4.11.1 </span>Creating an outline</a></ol></ol></li>
|
|
<li><a href="#grouping-content"><span class="secno">4.5 </span>Grouping content</a>
|
|
<ol>
|
|
<li><a href="#the-p-element"><span class="secno">4.5.1 </span>The <code>p</code> element</a></li>
|
|
<li><a href="#the-hr-element"><span class="secno">4.5.2 </span>The <code>hr</code> element</a></li>
|
|
<li><a href="#the-pre-element"><span class="secno">4.5.3 </span>The <code>pre</code> element</a></li>
|
|
<li><a href="#the-blockquote-element"><span class="secno">4.5.4 </span>The <code>blockquote</code> element</a></li>
|
|
<li><a href="#the-ol-element"><span class="secno">4.5.5 </span>The <code>ol</code> element</a></li>
|
|
<li><a href="#the-ul-element"><span class="secno">4.5.6 </span>The <code>ul</code> element</a></li>
|
|
<li><a href="#the-li-element"><span class="secno">4.5.7 </span>The <code>li</code> element</a></li>
|
|
<li><a href="#the-dl-element"><span class="secno">4.5.8 </span>The <code>dl</code> element</a></li>
|
|
<li><a href="#the-dt-element"><span class="secno">4.5.9 </span>The <code>dt</code> element</a></li>
|
|
<li><a href="#the-dd-element"><span class="secno">4.5.10 </span>The <code>dd</code> element</a></li>
|
|
<li><a href="#the-figure-element"><span class="secno">4.5.11 </span>The <code>figure</code> element</a></li>
|
|
<li><a href="#the-figcaption-element"><span class="secno">4.5.12 </span>The <code>figcaption</code> element</a></li>
|
|
<li><a href="#the-div-element"><span class="secno">4.5.13 </span>The <code>div</code> element</a></ol></li>
|
|
<li><a href="#text-level-semantics"><span class="secno">4.6 </span>Text-level semantics</a>
|
|
<ol>
|
|
<li><a href="#the-a-element"><span class="secno">4.6.1 </span>The <code>a</code> element</a></li>
|
|
<li><a href="#the-em-element"><span class="secno">4.6.2 </span>The <code>em</code> element</a></li>
|
|
<li><a href="#the-strong-element"><span class="secno">4.6.3 </span>The <code>strong</code> element</a></li>
|
|
<li><a href="#the-small-element"><span class="secno">4.6.4 </span>The <code>small</code> element</a></li>
|
|
<li><a href="#the-s-element"><span class="secno">4.6.5 </span>The <code>s</code> element</a></li>
|
|
<li><a href="#the-cite-element"><span class="secno">4.6.6 </span>The <code>cite</code> element</a></li>
|
|
<li><a href="#the-q-element"><span class="secno">4.6.7 </span>The <code>q</code> element</a></li>
|
|
<li><a href="#the-dfn-element"><span class="secno">4.6.8 </span>The <code>dfn</code> element</a></li>
|
|
<li><a href="#the-abbr-element"><span class="secno">4.6.9 </span>The <code>abbr</code> element</a></li>
|
|
<li><a href="#the-time-element"><span class="secno">4.6.10 </span>The <code>time</code> element</a></li>
|
|
<li><a href="#the-code-element"><span class="secno">4.6.11 </span>The <code>code</code> element</a></li>
|
|
<li><a href="#the-var-element"><span class="secno">4.6.12 </span>The <code>var</code> element</a></li>
|
|
<li><a href="#the-samp-element"><span class="secno">4.6.13 </span>The <code>samp</code> element</a></li>
|
|
<li><a href="#the-kbd-element"><span class="secno">4.6.14 </span>The <code>kbd</code> element</a></li>
|
|
<li><a href="#the-sub-and-sup-elements"><span class="secno">4.6.15 </span>The <code>sub</code> and <code>sup</code> elements</a></li>
|
|
<li><a href="#the-i-element"><span class="secno">4.6.16 </span>The <code>i</code> element</a></li>
|
|
<li><a href="#the-b-element"><span class="secno">4.6.17 </span>The <code>b</code> element</a></li>
|
|
<li><a href="#the-u-element"><span class="secno">4.6.18 </span>The <code>u</code> element</a></li>
|
|
<li><a href="#the-mark-element"><span class="secno">4.6.19 </span>The <code>mark</code> element</a></li>
|
|
<li><a href="#the-ruby-element"><span class="secno">4.6.20 </span>The <code>ruby</code> element</a></li>
|
|
<li><a href="#the-rt-element"><span class="secno">4.6.21 </span>The <code>rt</code> element</a></li>
|
|
<li><a href="#the-rp-element"><span class="secno">4.6.22 </span>The <code>rp</code> element</a></li>
|
|
<li><a href="#the-bdi-element"><span class="secno">4.6.23 </span>The <code>bdi</code> element</a></li>
|
|
<li><a href="#the-bdo-element"><span class="secno">4.6.24 </span>The <code>bdo</code> element</a></li>
|
|
<li><a href="#the-span-element"><span class="secno">4.6.25 </span>The <code>span</code> element</a></li>
|
|
<li><a href="#the-br-element"><span class="secno">4.6.26 </span>The <code>br</code> element</a></li>
|
|
<li><a href="#the-wbr-element"><span class="secno">4.6.27 </span>The <code>wbr</code> element</a></li>
|
|
<li><a href="#usage-summary"><span class="secno">4.6.28 </span>Usage summary</a></ol></li>
|
|
<li><a href="#edits"><span class="secno">4.7 </span>Edits</a>
|
|
<ol>
|
|
<li><a href="#the-ins-element"><span class="secno">4.7.1 </span>The <code>ins</code> element</a></li>
|
|
<li><a href="#the-del-element"><span class="secno">4.7.2 </span>The <code>del</code> element</a></li>
|
|
<li><a href="#attributes-common-to-ins-and-del-elements"><span class="secno">4.7.3 </span>Attributes common to <code>ins</code> and <code>del</code> elements</a></li>
|
|
<li><a href="#edits-and-paragraphs"><span class="secno">4.7.4 </span>Edits and paragraphs</a></li>
|
|
<li><a href="#edits-and-lists"><span class="secno">4.7.5 </span>Edits and lists</a></ol></li>
|
|
<li><a href="#embedded-content-1"><span class="secno">4.8 </span>Embedded content</a>
|
|
<ol>
|
|
<li><a href="#the-img-element"><span class="secno">4.8.1 </span>The <code>img</code> element</a>
|
|
<ol>
|
|
<li><a href="#alt"><span class="secno">4.8.1.1 </span>Requirements for providing text to act as an alternative for images</a>
|
|
<ol>
|
|
<li><a href="#general-guidelines"><span class="secno">4.8.1.1.1 </span>General guidelines</a></li>
|
|
<li><a href="#a-link-or-button-containing-nothing-but-the-image"><span class="secno">4.8.1.1.2 </span>A link or button containing nothing but the image</a></li>
|
|
<li><a href="#a-phrase-or-paragraph-with-an-alternative-graphical-representation:-charts-diagrams-graphs-maps-illustrations"><span class="secno">4.8.1.1.3 </span>A phrase or paragraph with an alternative graphical representation: charts, diagrams, graphs, maps, illustrations</a></li>
|
|
<li><a href="#a-short-phrase-or-label-with-an-alternative-graphical-representation:-icons-logos"><span class="secno">4.8.1.1.4 </span>A short phrase or label with an alternative graphical representation: icons, logos</a></li>
|
|
<li><a href="#text-that-has-been-rendered-to-a-graphic-for-typographical-effect"><span class="secno">4.8.1.1.5 </span>Text that has been rendered to a graphic for typographical effect</a></li>
|
|
<li><a href="#a-graphical-representation-of-some-of-the-surrounding-text"><span class="secno">4.8.1.1.6 </span>A graphical representation of some of the surrounding text</a></li>
|
|
<li><a href="#a-purely-decorative-image-that-doesn-t-add-any-information"><span class="secno">4.8.1.1.7 </span>A purely decorative image that doesn't add any information</a></li>
|
|
<li><a href="#a-group-of-images-that-form-a-single-larger-picture-with-no-links"><span class="secno">4.8.1.1.8 </span>A group of images that form a single larger picture with no links</a></li>
|
|
<li><a href="#a-group-of-images-that-form-a-single-larger-picture-with-links"><span class="secno">4.8.1.1.9 </span>A group of images that form a single larger picture with links</a></li>
|
|
<li><a href="#a-key-part-of-the-content"><span class="secno">4.8.1.1.10 </span>A key part of the content</a></li>
|
|
<li><a href="#an-image-not-intended-for-the-user"><span class="secno">4.8.1.1.11 </span>An image not intended for the user</a></li>
|
|
<li><a href="#guidance-for-markup-generators"><span class="secno">4.8.1.1.12 </span>Guidance for markup generators</a></li>
|
|
<li><a href="#guidance-for-conformance-checkers"><span class="secno">4.8.1.1.13 </span>Guidance for conformance checkers</a></ol></ol></li>
|
|
<li><a href="#the-iframe-element"><span class="secno">4.8.2 </span>The <code>iframe</code> element</a></li>
|
|
<li><a href="#the-embed-element"><span class="secno">4.8.3 </span>The <code>embed</code> element</a></li>
|
|
<li><a href="#the-object-element"><span class="secno">4.8.4 </span>The <code>object</code> element</a></li>
|
|
<li><a href="#the-param-element"><span class="secno">4.8.5 </span>The <code>param</code> element</a></li>
|
|
<li><a href="#the-video-element"><span class="secno">4.8.6 </span>The <code>video</code> element</a></li>
|
|
<li><a href="#the-audio-element"><span class="secno">4.8.7 </span>The <code>audio</code> element</a></li>
|
|
<li><a href="#the-source-element"><span class="secno">4.8.8 </span>The <code>source</code> element</a></li>
|
|
<li><a href="#the-track-element"><span class="secno">4.8.9 </span>The <code>track</code> element</a></li>
|
|
<li><a href="#media-elements"><span class="secno">4.8.10 </span>Media elements</a>
|
|
<ol>
|
|
<li><a href="#error-codes"><span class="secno">4.8.10.1 </span>Error codes</a></li>
|
|
<li><a href="#location-of-the-media-resource"><span class="secno">4.8.10.2 </span>Location of the media resource</a></li>
|
|
<li><a href="#mime-types"><span class="secno">4.8.10.3 </span>MIME types</a></li>
|
|
<li><a href="#network-states"><span class="secno">4.8.10.4 </span>Network states</a></li>
|
|
<li><a href="#loading-the-media-resource"><span class="secno">4.8.10.5 </span>Loading the media resource</a></li>
|
|
<li><a href="#offsets-into-the-media-resource"><span class="secno">4.8.10.6 </span>Offsets into the media resource</a></li>
|
|
<li><a href="#the-ready-states"><span class="secno">4.8.10.7 </span>The ready states</a></li>
|
|
<li><a href="#playing-the-media-resource"><span class="secno">4.8.10.8 </span>Playing the media resource</a></li>
|
|
<li><a href="#seeking"><span class="secno">4.8.10.9 </span>Seeking</a></li>
|
|
<li><a href="#media-resources-with-multiple-media-tracks"><span class="secno">4.8.10.10 </span>Media resources with multiple media tracks</a>
|
|
<ol>
|
|
<li><a href="#tracklist-objects"><span class="secno">4.8.10.10.1 </span><code>TrackList</code> objects</a></li>
|
|
<li><a href="#selecting-specific-audio-and-video-tracks-declaratively"><span class="secno">4.8.10.10.2 </span>Selecting specific audio and video tracks declaratively</a></ol></li>
|
|
<li><a href="#synchronising-multiple-media-elements"><span class="secno">4.8.10.11 </span>Synchronising multiple media elements</a>
|
|
<ol>
|
|
<li><a href="#introduction-0"><span class="secno">4.8.10.11.1 </span>Introduction</a></li>
|
|
<li><a href="#media-controllers"><span class="secno">4.8.10.11.2 </span>Media controllers</a></li>
|
|
<li><a href="#assigning-a-media-controller-declaratively"><span class="secno">4.8.10.11.3 </span>Assigning a media controller declaratively</a></ol></li>
|
|
<li><a href="#timed-text-tracks"><span class="secno">4.8.10.12 </span>Timed text tracks</a>
|
|
<ol>
|
|
<li><a href="#text-track-model"><span class="secno">4.8.10.12.1 </span>Text track model</a></li>
|
|
<li><a href="#sourcing-in-band-text-tracks"><span class="secno">4.8.10.12.2 </span>Sourcing in-band text tracks</a></li>
|
|
<li><a href="#sourcing-out-of-band-text-tracks"><span class="secno">4.8.10.12.3 </span>Sourcing out-of-band text tracks</a></li>
|
|
<li><a href="#text-track-api"><span class="secno">4.8.10.12.4 </span>Text track API</a></li>
|
|
<li><a href="#cue-events"><span class="secno">4.8.10.12.5 </span>Event definitions</a></ol></li>
|
|
<li><a href="#user-interface"><span class="secno">4.8.10.13 </span>User interface</a></li>
|
|
<li><a href="#time-ranges"><span class="secno">4.8.10.14 </span>Time ranges</a></li>
|
|
<li><a href="#mediaevents"><span class="secno">4.8.10.15 </span>Event summary</a></li>
|
|
<li><a href="#security-and-privacy-considerations"><span class="secno">4.8.10.16 </span>Security and privacy considerations</a></li>
|
|
<li><a href="#best-practices-for-authors-using-media-elements"><span class="secno">4.8.10.17 </span>Best practices for authors using media elements</a></li>
|
|
<li><a href="#best-practices-for-implementors-of-media-elements"><span class="secno">4.8.10.18 </span>Best practices for implementors of media elements</a></ol></li>
|
|
<li><a href="#the-canvas-element"><span class="secno">4.8.11 </span>The <code>canvas</code> element</a>
|
|
<ol>
|
|
<li><a href="#color-spaces-and-color-correction"><span class="secno">4.8.11.1 </span>Color spaces and color correction</a></li>
|
|
<li><a href="#security-with-canvas-elements"><span class="secno">4.8.11.2 </span>Security with <code>canvas</code> elements</a></ol></li>
|
|
<li><a href="#the-map-element"><span class="secno">4.8.12 </span>The <code>map</code> element</a></li>
|
|
<li><a href="#the-area-element"><span class="secno">4.8.13 </span>The <code>area</code> element</a></li>
|
|
<li><a href="#image-maps"><span class="secno">4.8.14 </span>Image maps</a>
|
|
<ol>
|
|
<li><a href="#authoring"><span class="secno">4.8.14.1 </span>Authoring</a></li>
|
|
<li><a href="#processing-model"><span class="secno">4.8.14.2 </span>Processing model</a></ol></li>
|
|
<li><a href="#mathml"><span class="secno">4.8.15 </span>MathML</a></li>
|
|
<li><a href="#svg-0"><span class="secno">4.8.16 </span>SVG</a></li>
|
|
<li><a href="#dimension-attributes"><span class="secno">4.8.17 </span>Dimension attributes</a></ol></li>
|
|
<li><a href="#tabular-data"><span class="secno">4.9 </span>Tabular data</a>
|
|
<ol>
|
|
<li><a href="#the-table-element"><span class="secno">4.9.1 </span>The <code>table</code> element</a>
|
|
<ol>
|
|
<li><a href="#table-descriptions-techniques"><span class="secno">4.9.1.1 </span>Techniques for describing tables</a></li>
|
|
<li><a href="#table-layout-techniques"><span class="secno">4.9.1.2 </span>Techniques for table layout</a></ol></li>
|
|
<li><a href="#the-caption-element"><span class="secno">4.9.2 </span>The <code>caption</code> element</a></li>
|
|
<li><a href="#the-colgroup-element"><span class="secno">4.9.3 </span>The <code>colgroup</code> element</a></li>
|
|
<li><a href="#the-col-element"><span class="secno">4.9.4 </span>The <code>col</code> element</a></li>
|
|
<li><a href="#the-tbody-element"><span class="secno">4.9.5 </span>The <code>tbody</code> element</a></li>
|
|
<li><a href="#the-thead-element"><span class="secno">4.9.6 </span>The <code>thead</code> element</a></li>
|
|
<li><a href="#the-tfoot-element"><span class="secno">4.9.7 </span>The <code>tfoot</code> element</a></li>
|
|
<li><a href="#the-tr-element"><span class="secno">4.9.8 </span>The <code>tr</code> element</a></li>
|
|
<li><a href="#the-td-element"><span class="secno">4.9.9 </span>The <code>td</code> element</a></li>
|
|
<li><a href="#the-th-element"><span class="secno">4.9.10 </span>The <code>th</code> element</a></li>
|
|
<li><a href="#attributes-common-to-td-and-th-elements"><span class="secno">4.9.11 </span>Attributes common to <code>td</code> and <code>th</code> elements</a></li>
|
|
<li><a href="#processing-model-0"><span class="secno">4.9.12 </span>Processing model</a>
|
|
<ol>
|
|
<li><a href="#forming-a-table"><span class="secno">4.9.12.1 </span>Forming a table</a></li>
|
|
<li><a href="#header-and-data-cell-semantics"><span class="secno">4.9.12.2 </span>Forming relationships between data cells and header cells</a></ol></li>
|
|
<li><a href="#examples"><span class="secno">4.9.13 </span>Examples</a></ol></li>
|
|
<li><a href="#forms"><span class="secno">4.10 </span>Forms</a>
|
|
<ol>
|
|
<li><a href="#introduction-1"><span class="secno">4.10.1 </span>Introduction</a>
|
|
<ol>
|
|
<li><a href="#writing-a-form-s-user-interface"><span class="secno">4.10.1.1 </span>Writing a form's user interface</a></li>
|
|
<li><a href="#implementing-the-server-side-processing-for-a-form"><span class="secno">4.10.1.2 </span>Implementing the server-side processing for a form</a></li>
|
|
<li><a href="#configuring-a-form-to-communicate-with-a-server"><span class="secno">4.10.1.3 </span>Configuring a form to communicate with a server</a></li>
|
|
<li><a href="#client-side-form-validation"><span class="secno">4.10.1.4 </span>Client-side form validation</a></ol></li>
|
|
<li><a href="#categories"><span class="secno">4.10.2 </span>Categories</a></li>
|
|
<li><a href="#the-form-element"><span class="secno">4.10.3 </span>The <code>form</code> element</a></li>
|
|
<li><a href="#the-fieldset-element"><span class="secno">4.10.4 </span>The <code>fieldset</code> element</a></li>
|
|
<li><a href="#the-legend-element"><span class="secno">4.10.5 </span>The <code>legend</code> element</a></li>
|
|
<li><a href="#the-label-element"><span class="secno">4.10.6 </span>The <code>label</code> element</a></li>
|
|
<li><a href="#the-input-element"><span class="secno">4.10.7 </span>The <code>input</code> element</a>
|
|
<ol>
|
|
<li><a href="#states-of-the-type-attribute"><span class="secno">4.10.7.1 </span>States of the <code title="attr-input-type">type</code> attribute</a>
|
|
<ol>
|
|
<li><a href="#hidden-state"><span class="secno">4.10.7.1.1 </span>Hidden state</a></li>
|
|
<li><a href="#text-state-and-search-state"><span class="secno">4.10.7.1.2 </span>Text state and Search state</a></li>
|
|
<li><a href="#telephone-state"><span class="secno">4.10.7.1.3 </span>Telephone state</a></li>
|
|
<li><a href="#url-state"><span class="secno">4.10.7.1.4 </span>URL state</a></li>
|
|
<li><a href="#e-mail-state"><span class="secno">4.10.7.1.5 </span>E-mail state</a></li>
|
|
<li><a href="#password-state"><span class="secno">4.10.7.1.6 </span>Password state</a></li>
|
|
<li><a href="#date-and-time-state"><span class="secno">4.10.7.1.7 </span>Date and Time state</a></li>
|
|
<li><a href="#date-state"><span class="secno">4.10.7.1.8 </span>Date state</a></li>
|
|
<li><a href="#month-state"><span class="secno">4.10.7.1.9 </span>Month state</a></li>
|
|
<li><a href="#week-state"><span class="secno">4.10.7.1.10 </span>Week state</a></li>
|
|
<li><a href="#time-state"><span class="secno">4.10.7.1.11 </span>Time state</a></li>
|
|
<li><a href="#local-date-and-time-state"><span class="secno">4.10.7.1.12 </span>Local Date and Time state</a></li>
|
|
<li><a href="#number-state"><span class="secno">4.10.7.1.13 </span>Number state</a></li>
|
|
<li><a href="#range-state"><span class="secno">4.10.7.1.14 </span>Range state</a></li>
|
|
<li><a href="#color-state"><span class="secno">4.10.7.1.15 </span>Color state</a></li>
|
|
<li><a href="#checkbox-state"><span class="secno">4.10.7.1.16 </span>Checkbox state</a></li>
|
|
<li><a href="#radio-button-state"><span class="secno">4.10.7.1.17 </span>Radio Button state</a></li>
|
|
<li><a href="#file-upload-state"><span class="secno">4.10.7.1.18 </span>File Upload state</a></li>
|
|
<li><a href="#submit-button-state"><span class="secno">4.10.7.1.19 </span>Submit Button state</a></li>
|
|
<li><a href="#image-button-state"><span class="secno">4.10.7.1.20 </span>Image Button state</a></li>
|
|
<li><a href="#reset-button-state"><span class="secno">4.10.7.1.21 </span>Reset Button state</a></li>
|
|
<li><a href="#button-state"><span class="secno">4.10.7.1.22 </span>Button state</a></ol></li>
|
|
<li><a href="#common-input-element-attributes"><span class="secno">4.10.7.2 </span>Common <code>input</code> element attributes</a>
|
|
<ol>
|
|
<li><a href="#the-autocomplete-attribute"><span class="secno">4.10.7.2.1 </span>The <code title="attr-input-autocomplete">autocomplete</code> attribute</a></li>
|
|
<li><a href="#the-dirname-attribute"><span class="secno">4.10.7.2.2 </span>The <code title="attr-input-dirname">dirname</code> attribute</a></li>
|
|
<li><a href="#the-list-attribute"><span class="secno">4.10.7.2.3 </span>The <code title="attr-input-list">list</code> attribute</a></li>
|
|
<li><a href="#the-readonly-attribute"><span class="secno">4.10.7.2.4 </span>The <code title="attr-input-readonly">readonly</code> attribute</a></li>
|
|
<li><a href="#the-size-attribute"><span class="secno">4.10.7.2.5 </span>The <code title="attr-input-size">size</code> attribute</a></li>
|
|
<li><a href="#the-required-attribute"><span class="secno">4.10.7.2.6 </span>The <code title="attr-input-required">required</code> attribute</a></li>
|
|
<li><a href="#the-multiple-attribute"><span class="secno">4.10.7.2.7 </span>The <code title="attr-input-multiple">multiple</code> attribute</a></li>
|
|
<li><a href="#the-maxlength-attribute"><span class="secno">4.10.7.2.8 </span>The <code title="attr-input-maxlength">maxlength</code> attribute</a></li>
|
|
<li><a href="#the-pattern-attribute"><span class="secno">4.10.7.2.9 </span>The <code title="attr-input-pattern">pattern</code> attribute</a></li>
|
|
<li><a href="#the-min-and-max-attributes"><span class="secno">4.10.7.2.10 </span>The <code title="attr-input-min">min</code> and <code title="attr-input-max">max</code> attributes</a></li>
|
|
<li><a href="#the-step-attribute"><span class="secno">4.10.7.2.11 </span>The <code title="attr-input-step">step</code> attribute</a></li>
|
|
<li><a href="#the-placeholder-attribute"><span class="secno">4.10.7.2.12 </span>The <code title="attr-input-placeholder">placeholder</code> attribute</a></ol></li>
|
|
<li><a href="#common-input-element-apis"><span class="secno">4.10.7.3 </span>Common <code>input</code> element APIs</a></li>
|
|
<li><a href="#common-event-behaviors"><span class="secno">4.10.7.4 </span>Common event behaviors</a></ol></li>
|
|
<li><a href="#the-button-element"><span class="secno">4.10.8 </span>The <code>button</code> element</a></li>
|
|
<li><a href="#the-select-element"><span class="secno">4.10.9 </span>The <code>select</code> element</a></li>
|
|
<li><a href="#the-datalist-element"><span class="secno">4.10.10 </span>The <code>datalist</code> element</a></li>
|
|
<li><a href="#the-optgroup-element"><span class="secno">4.10.11 </span>The <code>optgroup</code> element</a></li>
|
|
<li><a href="#the-option-element"><span class="secno">4.10.12 </span>The <code>option</code> element</a></li>
|
|
<li><a href="#the-textarea-element"><span class="secno">4.10.13 </span>The <code>textarea</code> element</a></li>
|
|
<li><a href="#the-keygen-element"><span class="secno">4.10.14 </span>The <code>keygen</code> element</a></li>
|
|
<li><a href="#the-output-element"><span class="secno">4.10.15 </span>The <code>output</code> element</a></li>
|
|
<li><a href="#the-progress-element"><span class="secno">4.10.16 </span>The <code>progress</code> element</a></li>
|
|
<li><a href="#the-meter-element"><span class="secno">4.10.17 </span>The <code>meter</code> element</a></li>
|
|
<li><a href="#association-of-controls-and-forms"><span class="secno">4.10.18 </span>Association of controls and forms</a></li>
|
|
<li><a href="#attributes-common-to-form-controls"><span class="secno">4.10.19 </span>Attributes common to form controls</a>
|
|
<ol>
|
|
<li><a href="#naming-form-controls"><span class="secno">4.10.19.1 </span>Naming form controls</a></li>
|
|
<li><a href="#enabling-and-disabling-form-controls"><span class="secno">4.10.19.2 </span>Enabling and disabling form controls</a></li>
|
|
<li><a href="#a-form-control-s-value"><span class="secno">4.10.19.3 </span>A form control's value</a></li>
|
|
<li><a href="#autofocusing-a-form-control"><span class="secno">4.10.19.4 </span>Autofocusing a form control</a></li>
|
|
<li><a href="#limiting-user-input-length"><span class="secno">4.10.19.5 </span>Limiting user input length</a></li>
|
|
<li><a href="#form-submission-0"><span class="secno">4.10.19.6 </span>Form submission</a></li>
|
|
<li><a href="#submitting-element-directionality"><span class="secno">4.10.19.7 </span>Submitting element directionality</a></ol></li>
|
|
<li><a href="#textFieldSelection"><span class="secno">4.10.20 </span>APIs for the text field selections</a></li>
|
|
<li><a href="#constraints"><span class="secno">4.10.21 </span>Constraints</a>
|
|
<ol>
|
|
<li><a href="#definitions"><span class="secno">4.10.21.1 </span>Definitions</a></li>
|
|
<li><a href="#constraint-validation"><span class="secno">4.10.21.2 </span>Constraint validation</a></li>
|
|
<li><a href="#the-constraint-validation-api"><span class="secno">4.10.21.3 </span>The constraint validation API</a></li>
|
|
<li><a href="#security-forms"><span class="secno">4.10.21.4 </span>Security</a></ol></li>
|
|
<li><a href="#form-submission"><span class="secno">4.10.22 </span>Form submission</a>
|
|
<ol>
|
|
<li><a href="#introduction-2"><span class="secno">4.10.22.1 </span>Introduction</a></li>
|
|
<li><a href="#implicit-submission"><span class="secno">4.10.22.2 </span>Implicit submission</a></li>
|
|
<li><a href="#form-submission-algorithm"><span class="secno">4.10.22.3 </span>Form submission algorithm</a></li>
|
|
<li><a href="#constructing-form-data-set"><span class="secno">4.10.22.4 </span>Constructing the form data set</a></li>
|
|
<li><a href="#url-encoded-form-data"><span class="secno">4.10.22.5 </span>URL-encoded form data</a></li>
|
|
<li><a href="#multipart-form-data"><span class="secno">4.10.22.6 </span>Multipart form data</a></li>
|
|
<li><a href="#plain-text-form-data"><span class="secno">4.10.22.7 </span>Plain text form data</a></ol></li>
|
|
<li><a href="#resetting-a-form"><span class="secno">4.10.23 </span>Resetting a form</a></ol></li>
|
|
<li><a href="#interactive-elements"><span class="secno">4.11 </span>Interactive elements</a>
|
|
<ol>
|
|
<li><a href="#the-details-element"><span class="secno">4.11.1 </span>The <code>details</code> element</a></li>
|
|
<li><a href="#the-summary-element"><span class="secno">4.11.2 </span>The <code>summary</code> element</a></li>
|
|
<li><a href="#the-command-element"><span class="secno">4.11.3 </span>The <code>command</code> element</a></li>
|
|
<li><a href="#the-menu-element"><span class="secno">4.11.4 </span>The <code>menu</code> element</a>
|
|
<ol>
|
|
<li><a href="#menus-intro"><span class="secno">4.11.4.1 </span>Introduction</a></li>
|
|
<li><a href="#building-menus-and-toolbars"><span class="secno">4.11.4.2 </span>Building menus and toolbars</a></li>
|
|
<li><a href="#context-menus"><span class="secno">4.11.4.3 </span>Context menus</a></li>
|
|
<li><a href="#toolbars"><span class="secno">4.11.4.4 </span>Toolbars</a></ol></li>
|
|
<li><a href="#commands"><span class="secno">4.11.5 </span>Commands</a>
|
|
<ol>
|
|
<li><a href="#using-the-a-element-to-define-a-command"><span class="secno">4.11.5.1 </span>Using the <code>a</code> element to define a command</a></li>
|
|
<li><a href="#using-the-button-element-to-define-a-command"><span class="secno">4.11.5.2 </span>Using the <code>button</code> element to define a command</a></li>
|
|
<li><a href="#using-the-input-element-to-define-a-command"><span class="secno">4.11.5.3 </span>Using the <code>input</code> element to define a command</a></li>
|
|
<li><a href="#using-the-option-element-to-define-a-command"><span class="secno">4.11.5.4 </span>Using the <code>option</code> element to define a command</a></li>
|
|
<li><a href="#using-the-command-element-to-define-a-command"><span class="secno">4.11.5.5 </span>Using the <code>command</code> element to define
|
|
a command</a></li>
|
|
<li><a href="#using-the-accesskey-attribute-on-a-label-element-to-define-a-command"><span class="secno">4.11.5.6 </span>Using the <code title="attr-accesskey">accesskey</code> attribute on a <code>label</code> element to define a command</a></li>
|
|
<li><a href="#using-the-accesskey-attribute-on-a-legend-element-to-define-a-command"><span class="secno">4.11.5.7 </span>Using the <code title="attr-accesskey">accesskey</code> attribute on a <code>legend</code> element to define a command</a></li>
|
|
<li><a href="#using-the-accesskey-attribute-to-define-a-command-on-other-elements"><span class="secno">4.11.5.8 </span>Using the <code title="attr-accesskey">accesskey</code> attribute to define a command on other elements</a></ol></ol></li>
|
|
<li><a href="#links"><span class="secno">4.12 </span>Links</a>
|
|
<ol>
|
|
<li><a href="#introduction-3"><span class="secno">4.12.1 </span>Introduction</a></li>
|
|
<li><a href="#links-created-by-a-and-area-elements"><span class="secno">4.12.2 </span>Links created by <code>a</code> and <code>area</code> elements</a></li>
|
|
<li><a href="#following-hyperlinks"><span class="secno">4.12.3 </span>Following hyperlinks</a></li>
|
|
<li><a href="#linkTypes"><span class="secno">4.12.4 </span>Link types</a>
|
|
<ol>
|
|
<li><a href="#rel-alternate"><span class="secno">4.12.4.1 </span>Link type "<code>alternate</code>"</a></li>
|
|
<li><a href="#link-type-author"><span class="secno">4.12.4.2 </span>Link type "<code>author</code>"</a></li>
|
|
<li><a href="#link-type-bookmark"><span class="secno">4.12.4.3 </span>Link type "<code>bookmark</code>"</a></li>
|
|
<li><a href="#link-type-external"><span class="secno">4.12.4.4 </span>Link type "<code>external</code>"</a></li>
|
|
<li><a href="#link-type-help"><span class="secno">4.12.4.5 </span>Link type "<code>help</code>"</a></li>
|
|
<li><a href="#rel-icon"><span class="secno">4.12.4.6 </span>Link type "<code>icon</code>"</a></li>
|
|
<li><a href="#link-type-license"><span class="secno">4.12.4.7 </span>Link type "<code>license</code>"</a></li>
|
|
<li><a href="#link-type-nofollow"><span class="secno">4.12.4.8 </span>Link type "<code>nofollow</code>"</a></li>
|
|
<li><a href="#link-type-noreferrer"><span class="secno">4.12.4.9 </span>Link type "<code>noreferrer</code>"</a></li>
|
|
<li><a href="#link-type-pingback"><span class="secno">4.12.4.10 </span>Link type "<code>pingback</code>"</a></li>
|
|
<li><a href="#link-type-prefetch"><span class="secno">4.12.4.11 </span>Link type "<code>prefetch</code>"</a></li>
|
|
<li><a href="#link-type-search"><span class="secno">4.12.4.12 </span>Link type "<code>search</code>"</a></li>
|
|
<li><a href="#link-type-sidebar"><span class="secno">4.12.4.13 </span>Link type "<code>sidebar</code>"</a></li>
|
|
<li><a href="#link-type-stylesheet"><span class="secno">4.12.4.14 </span>Link type "<code>stylesheet</code>"</a></li>
|
|
<li><a href="#link-type-tag"><span class="secno">4.12.4.15 </span>Link type "<code>tag</code>"</a></li>
|
|
<li><a href="#sequential-link-types"><span class="secno">4.12.4.16 </span>Sequential link types</a>
|
|
<ol>
|
|
<li><a href="#link-type-next"><span class="secno">4.12.4.16.1 </span>Link type "<code>next</code>"</a></li>
|
|
<li><a href="#link-type-prev"><span class="secno">4.12.4.16.2 </span>Link type "<code>prev</code>"</a></ol></li>
|
|
<li><a href="#other-link-types"><span class="secno">4.12.4.17 </span>Other link types</a></ol></ol></li>
|
|
<li><a href="#common-idioms-without-dedicated-elements"><span class="secno">4.13 </span>Common idioms without dedicated elements</a>
|
|
<ol>
|
|
<li><a href="#the-main-part-of-the-content"><span class="secno">4.13.1 </span>The main part of the content</a></li>
|
|
<li><a href="#rel-up"><span class="secno">4.13.2 </span>Bread crumb navigation</a></li>
|
|
<li><a href="#tag-clouds"><span class="secno">4.13.3 </span>Tag clouds</a></li>
|
|
<li><a href="#conversations"><span class="secno">4.13.4 </span>Conversations</a></li>
|
|
<li><a href="#footnotes"><span class="secno">4.13.5 </span>Footnotes</a></ol></li>
|
|
<li><a href="#matching-html-elements-using-selectors"><span class="secno">4.14 </span>Matching HTML elements using selectors</a>
|
|
<ol>
|
|
<li><a href="#selectors"><span class="secno">4.14.1 </span>Case-sensitivity</a></li>
|
|
<li><a href="#pseudo-classes"><span class="secno">4.14.2 </span>Pseudo-classes</a></ol></ol></li>
|
|
<li><a href="#browsers"><span class="secno">5 </span>Loading Web pages</a>
|
|
<ol>
|
|
<li><a href="#windows"><span class="secno">5.1 </span>Browsing contexts</a>
|
|
<ol>
|
|
<li><a href="#nested-browsing-contexts"><span class="secno">5.1.1 </span>Nested browsing contexts</a>
|
|
<ol>
|
|
<li><a href="#navigating-nested-browsing-contexts-in-the-dom"><span class="secno">5.1.1.1 </span>Navigating nested browsing contexts in the DOM</a></ol></li>
|
|
<li><a href="#auxiliary-browsing-contexts"><span class="secno">5.1.2 </span>Auxiliary browsing contexts</a>
|
|
<ol>
|
|
<li><a href="#navigating-auxiliary-browsing-contexts-in-the-dom"><span class="secno">5.1.2.1 </span>Navigating auxiliary browsing contexts in the DOM</a></ol></li>
|
|
<li><a href="#secondary-browsing-contexts"><span class="secno">5.1.3 </span>Secondary browsing contexts</a></li>
|
|
<li><a href="#security-nav"><span class="secno">5.1.4 </span>Security</a></li>
|
|
<li><a href="#groupings-of-browsing-contexts"><span class="secno">5.1.5 </span>Groupings of browsing contexts</a></li>
|
|
<li><a href="#browsing-context-names"><span class="secno">5.1.6 </span>Browsing context names</a></ol></li>
|
|
<li><a href="#the-window-object"><span class="secno">5.2 </span>The <code>Window</code> object</a>
|
|
<ol>
|
|
<li><a href="#security-window"><span class="secno">5.2.1 </span>Security</a></li>
|
|
<li><a href="#apis-for-creating-and-navigating-browsing-contexts-by-name"><span class="secno">5.2.2 </span>APIs for creating and navigating browsing contexts by name</a></li>
|
|
<li><a href="#accessing-other-browsing-contexts"><span class="secno">5.2.3 </span>Accessing other browsing contexts</a></li>
|
|
<li><a href="#named-access-on-the-window-object"><span class="secno">5.2.4 </span>Named access on the <code>Window</code> object</a></li>
|
|
<li><a href="#garbage-collection-and-browsing-contexts"><span class="secno">5.2.5 </span>Garbage collection and browsing contexts</a></li>
|
|
<li><a href="#browser-interface-elements"><span class="secno">5.2.6 </span>Browser interface elements</a></li>
|
|
<li><a href="#the-windowproxy-object"><span class="secno">5.2.7 </span>The <code>WindowProxy</code> object</a></ol></li>
|
|
<li><a href="#origin-0"><span class="secno">5.3 </span>Origin</a>
|
|
<ol>
|
|
<li><a href="#relaxing-the-same-origin-restriction"><span class="secno">5.3.1 </span>Relaxing the same-origin restriction</a></ol></li>
|
|
<li><a href="#history"><span class="secno">5.4 </span>Session history and navigation</a>
|
|
<ol>
|
|
<li><a href="#the-session-history-of-browsing-contexts"><span class="secno">5.4.1 </span>The session history of browsing contexts</a></li>
|
|
<li><a href="#the-history-interface"><span class="secno">5.4.2 </span>The <code>History</code> interface</a></li>
|
|
<li><a href="#the-location-interface"><span class="secno">5.4.3 </span>The <code>Location</code> interface</a>
|
|
<ol>
|
|
<li><a href="#security-location"><span class="secno">5.4.3.1 </span>Security</a></ol></li>
|
|
<li><a href="#history-notes"><span class="secno">5.4.4 </span>Implementation notes for session history</a></ol></li>
|
|
<li><a href="#browsing-the-web"><span class="secno">5.5 </span>Browsing the Web</a>
|
|
<ol>
|
|
<li><a href="#navigating-across-documents"><span class="secno">5.5.1 </span>Navigating across documents</a></li>
|
|
<li><a href="#read-html"><span class="secno">5.5.2 </span>Page load processing model for HTML files</a></li>
|
|
<li><a href="#read-xml"><span class="secno">5.5.3 </span>Page load processing model for XML files</a></li>
|
|
<li><a href="#read-text"><span class="secno">5.5.4 </span>Page load processing model for text files</a></li>
|
|
<li><a href="#read-image"><span class="secno">5.5.5 </span>Page load processing model for images</a></li>
|
|
<li><a href="#read-plugin"><span class="secno">5.5.6 </span>Page load processing model for content that uses plugins</a></li>
|
|
<li><a href="#read-ua-inline"><span class="secno">5.5.7 </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">5.5.8 </span>Navigating to a fragment identifier</a></li>
|
|
<li><a href="#history-traversal"><span class="secno">5.5.9 </span>History traversal</a>
|
|
<ol>
|
|
<li><a href="#event-definitions"><span class="secno">5.5.9.1 </span>Event definitions</a></ol></li>
|
|
<li><a href="#unloading-documents"><span class="secno">5.5.10 </span>Unloading documents</a>
|
|
<ol>
|
|
<li><a href="#event-definition"><span class="secno">5.5.10.1 </span>Event definition</a></ol></li>
|
|
<li><a href="#aborting-a-document-load"><span class="secno">5.5.11 </span>Aborting a document load</a></ol></li>
|
|
<li><a href="#offline"><span class="secno">5.6 </span>Offline Web applications</a>
|
|
<ol>
|
|
<li><a href="#introduction-4"><span class="secno">5.6.1 </span>Introduction</a>
|
|
<ol>
|
|
<li><a href="#appcacheevents"><span class="secno">5.6.1.1 </span>Event summary</a></ol></li>
|
|
<li><a href="#appcache"><span class="secno">5.6.2 </span>Application caches</a></li>
|
|
<li><a href="#manifests"><span class="secno">5.6.3 </span>The cache manifest syntax</a>
|
|
<ol>
|
|
<li><a href="#some-sample-manifests"><span class="secno">5.6.3.1 </span>Some sample manifests</a></li>
|
|
<li><a href="#writing-cache-manifests"><span class="secno">5.6.3.2 </span>Writing cache manifests</a></li>
|
|
<li><a href="#parsing-cache-manifests"><span class="secno">5.6.3.3 </span>Parsing cache manifests</a></ol></li>
|
|
<li><a href="#downloading-or-updating-an-application-cache"><span class="secno">5.6.4 </span>Downloading or updating an application cache</a></li>
|
|
<li><a href="#the-application-cache-selection-algorithm"><span class="secno">5.6.5 </span>The application cache selection algorithm</a></li>
|
|
<li><a href="#changesToNetworkingModel"><span class="secno">5.6.6 </span>Changes to the networking model</a></li>
|
|
<li><a href="#expiring-application-caches"><span class="secno">5.6.7 </span>Expiring application caches</a></li>
|
|
<li><a href="#disk-space"><span class="secno">5.6.8 </span>Disk space</a></li>
|
|
<li><a href="#application-cache-api"><span class="secno">5.6.9 </span>Application cache API</a></li>
|
|
<li><a href="#browser-state"><span class="secno">5.6.10 </span>Browser state</a></ol></ol></li>
|
|
<li><a href="#webappapis"><span class="secno">6 </span>Web application APIs</a>
|
|
<ol>
|
|
<li><a href="#scripting"><span class="secno">6.1 </span>Scripting</a>
|
|
<ol>
|
|
<li><a href="#introduction-5"><span class="secno">6.1.1 </span>Introduction</a></li>
|
|
<li><a href="#enabling-and-disabling-scripting"><span class="secno">6.1.2 </span>Enabling and disabling scripting</a></li>
|
|
<li><a href="#processing-model-1"><span class="secno">6.1.3 </span>Processing model</a>
|
|
<ol>
|
|
<li><a href="#definitions-0"><span class="secno">6.1.3.1 </span>Definitions</a></li>
|
|
<li><a href="#calling-scripts"><span class="secno">6.1.3.2 </span>Calling scripts</a></li>
|
|
<li><a href="#creating-scripts"><span class="secno">6.1.3.3 </span>Creating scripts</a></li>
|
|
<li><a href="#killing-scripts"><span class="secno">6.1.3.4 </span>Killing scripts</a></li>
|
|
<li><a href="#runtime-script-errors"><span class="secno">6.1.3.5 </span>Runtime script errors</a></ol></li>
|
|
<li><a href="#event-loops"><span class="secno">6.1.4 </span>Event loops</a>
|
|
<ol>
|
|
<li><a href="#definitions-1"><span class="secno">6.1.4.1 </span>Definitions</a></li>
|
|
<li><a href="#processing-model-2"><span class="secno">6.1.4.2 </span>Processing model</a></li>
|
|
<li><a href="#generic-task-sources"><span class="secno">6.1.4.3 </span>Generic task sources</a></ol></li>
|
|
<li><a href="#javascript-protocol"><span class="secno">6.1.5 </span>The <code title="">javascript:</code> URL scheme</a></li>
|
|
<li><a href="#events"><span class="secno">6.1.6 </span>Events</a>
|
|
<ol>
|
|
<li><a href="#event-handler-attributes"><span class="secno">6.1.6.1 </span>Event handlers</a></li>
|
|
<li><a href="#event-handlers-on-elements-document-objects-and-window-objects"><span class="secno">6.1.6.2 </span>Event handlers on elements, <code>Document</code> objects, and <code>Window</code> objects</a></li>
|
|
<li><a href="#event-firing"><span class="secno">6.1.6.3 </span>Event firing</a></li>
|
|
<li><a href="#events-and-the-window-object"><span class="secno">6.1.6.4 </span>Events and the <code>Window</code> object</a></ol></ol></li>
|
|
<li><a href="#atob"><span class="secno">6.2 </span>Base64 utility methods</a></li>
|
|
<li><a href="#timers"><span class="secno">6.3 </span>Timers</a></li>
|
|
<li><a href="#user-prompts"><span class="secno">6.4 </span>User prompts</a>
|
|
<ol>
|
|
<li><a href="#simple-dialogs"><span class="secno">6.4.1 </span>Simple dialogs</a></li>
|
|
<li><a href="#printing"><span class="secno">6.4.2 </span>Printing</a></li>
|
|
<li><a href="#dialogs-implemented-using-separate-documents"><span class="secno">6.4.3 </span>Dialogs implemented using separate documents</a></ol></li>
|
|
<li><a href="#system-state-and-capabilities:-the-navigator-object"><span class="secno">6.5 </span>System state and capabilities: the <code>Navigator</code> object</a>
|
|
<ol>
|
|
<li><a href="#client-identification"><span class="secno">6.5.1 </span>Client identification</a></li>
|
|
<li><a href="#custom-handlers"><span class="secno">6.5.2 </span>Custom scheme and content handlers</a>
|
|
<ol>
|
|
<li><a href="#security-and-privacy"><span class="secno">6.5.2.1 </span>Security and privacy</a></li>
|
|
<li><a href="#sample-handler-impl"><span class="secno">6.5.2.2 </span>Sample user interface</a></ol></li>
|
|
<li><a href="#manually-releasing-the-storage-mutex"><span class="secno">6.5.3 </span>Manually releasing the storage mutex</a></ol></ol></li>
|
|
<li><a href="#editing"><span class="secno">7 </span>User interaction</a>
|
|
<ol>
|
|
<li><a href="#the-hidden-attribute"><span class="secno">7.1 </span>The <code>hidden</code> attribute</a></li>
|
|
<li><a href="#activation"><span class="secno">7.2 </span>Activation</a></li>
|
|
<li><a href="#focus"><span class="secno">7.3 </span>Focus</a>
|
|
<ol>
|
|
<li><a href="#sequential-focus-navigation-and-the-tabindex-attribute"><span class="secno">7.3.1 </span>Sequential focus navigation and the <code title="attr-tabindex">tabindex</code> attribute</a></li>
|
|
<li><a href="#focus-management"><span class="secno">7.3.2 </span>Focus management</a></li>
|
|
<li><a href="#document-level-focus-apis"><span class="secno">7.3.3 </span>Document-level focus APIs</a></li>
|
|
<li><a href="#element-level-focus-apis"><span class="secno">7.3.4 </span>Element-level focus APIs</a></ol></li>
|
|
<li><a href="#assigning-keyboard-shortcuts"><span class="secno">7.4 </span>Assigning keyboard shortcuts</a>
|
|
<ol>
|
|
<li><a href="#introduction-6"><span class="secno">7.4.1 </span>Introduction</a></li>
|
|
<li><a href="#the-accesskey-attribute"><span class="secno">7.4.2 </span>The <code>accesskey</code> attribute</a></li>
|
|
<li><a href="#processing-model-3"><span class="secno">7.4.3 </span>Processing model</a></ol></li>
|
|
<li><a href="#contenteditable"><span class="secno">7.5 </span>The <code title="attr-contenteditable">contenteditable</code> attribute</a>
|
|
<ol>
|
|
<li><a href="#user-editing-actions"><span class="secno">7.5.1 </span>User editing actions</a></li>
|
|
<li><a href="#making-entire-documents-editable"><span class="secno">7.5.2 </span>Making entire documents editable</a></ol></li>
|
|
<li><a href="#spelling-and-grammar-checking"><span class="secno">7.6 </span>Spelling and grammar checking</a></li>
|
|
<li><a href="#dnd"><span class="secno">7.7 </span>Drag and drop</a>
|
|
<ol>
|
|
<li><a href="#introduction-7"><span class="secno">7.7.1 </span>Introduction</a></li>
|
|
<li><a href="#the-drag-data-store"><span class="secno">7.7.2 </span>The drag data store</a></li>
|
|
<li><a href="#the-datatransfer-interface"><span class="secno">7.7.3 </span>The <code>DataTransfer</code> interface</a>
|
|
<ol>
|
|
<li><a href="#the-datatransferitems-interface"><span class="secno">7.7.3.1 </span>The <code>DataTransferItems</code> interface</a></li>
|
|
<li><a href="#the-datatransferitem-interface"><span class="secno">7.7.3.2 </span>The <code>DataTransferItem</code> interface</a></ol></li>
|
|
<li><a href="#the-dragevent-interface"><span class="secno">7.7.4 </span>The <code>DragEvent</code> interface</a></li>
|
|
<li><a href="#drag-and-drop-processing-model"><span class="secno">7.7.5 </span>Drag-and-drop processing model</a></li>
|
|
<li><a href="#dndevents"><span class="secno">7.7.6 </span>Events summary</a></li>
|
|
<li><a href="#the-draggable-attribute"><span class="secno">7.7.7 </span>The <code>draggable</code> attribute</a></li>
|
|
<li><a href="#the-dropzone-attribute"><span class="secno">7.7.8 </span>The <code>dropzone</code> attribute</a></li>
|
|
<li><a href="#security-risks-in-the-drag-and-drop-model"><span class="secno">7.7.9 </span>Security risks in the drag-and-drop model</a></ol></li>
|
|
<li><a href="#editing-apis"><span class="secno">7.8 </span>Editing APIs</a></ol></li>
|
|
<li><a href="#syntax"><span class="secno">8 </span>The HTML syntax</a>
|
|
<ol>
|
|
<li><a href="#writing"><span class="secno">8.1 </span>Writing HTML documents</a>
|
|
<ol>
|
|
<li><a href="#the-doctype"><span class="secno">8.1.1 </span>The DOCTYPE</a></li>
|
|
<li><a href="#elements-0"><span class="secno">8.1.2 </span>Elements</a>
|
|
<ol>
|
|
<li><a href="#start-tags"><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="#attributes-0"><span class="secno">8.1.2.3 </span>Attributes</a></li>
|
|
<li><a href="#optional-tags"><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 raw text and RCDATA elements</a></ol></li>
|
|
<li><a href="#text-0"><span class="secno">8.1.3 </span>Text</a>
|
|
<ol>
|
|
<li><a href="#newlines"><span class="secno">8.1.3.1 </span>Newlines</a></ol></li>
|
|
<li><a href="#character-references"><span class="secno">8.1.4 </span>Character references</a></li>
|
|
<li><a href="#cdata-sections"><span class="secno">8.1.5 </span>CDATA sections</a></li>
|
|
<li><a href="#comments"><span class="secno">8.1.6 </span>Comments</a></ol></li>
|
|
<li><a href="#parsing"><span class="secno">8.2 </span>Parsing HTML documents</a>
|
|
<ol>
|
|
<li><a href="#overview-of-the-parsing-model"><span class="secno">8.2.1 </span>Overview of the parsing model</a></li>
|
|
<li><a href="#the-input-stream"><span class="secno">8.2.2 </span>The input stream</a>
|
|
<ol>
|
|
<li><a href="#determining-the-character-encoding"><span class="secno">8.2.2.1 </span>Determining the character encoding</a></li>
|
|
<li><a href="#character-encodings-0"><span class="secno">8.2.2.2 </span>Character encodings</a></li>
|
|
<li><a href="#preprocessing-the-input-stream"><span class="secno">8.2.2.3 </span>Preprocessing the input stream</a></li>
|
|
<li><a href="#changing-the-encoding-while-parsing"><span class="secno">8.2.2.4 </span>Changing the encoding while parsing</a></ol></li>
|
|
<li><a href="#parse-state"><span class="secno">8.2.3 </span>Parse state</a>
|
|
<ol>
|
|
<li><a href="#the-insertion-mode"><span class="secno">8.2.3.1 </span>The insertion mode</a></li>
|
|
<li><a href="#the-stack-of-open-elements"><span class="secno">8.2.3.2 </span>The stack of open elements</a></li>
|
|
<li><a href="#the-list-of-active-formatting-elements"><span class="secno">8.2.3.3 </span>The list of active formatting elements</a></li>
|
|
<li><a href="#the-element-pointers"><span class="secno">8.2.3.4 </span>The element pointers</a></li>
|
|
<li><a href="#other-parsing-state-flags"><span class="secno">8.2.3.5 </span>Other parsing state flags</a></ol></li>
|
|
<li><a href="#tokenization"><span class="secno">8.2.4 </span>Tokenization</a>
|
|
<ol>
|
|
<li><a href="#data-state"><span class="secno">8.2.4.1 </span>Data state</a></li>
|
|
<li><a href="#character-reference-in-data-state"><span class="secno">8.2.4.2 </span>Character reference in data state</a></li>
|
|
<li><a href="#rcdata-state"><span class="secno">8.2.4.3 </span>RCDATA state</a></li>
|
|
<li><a href="#character-reference-in-rcdata-state"><span class="secno">8.2.4.4 </span>Character reference in RCDATA state</a></li>
|
|
<li><a href="#rawtext-state"><span class="secno">8.2.4.5 </span>RAWTEXT state</a></li>
|
|
<li><a href="#script-data-state"><span class="secno">8.2.4.6 </span>Script data state</a></li>
|
|
<li><a href="#plaintext-state"><span class="secno">8.2.4.7 </span>PLAINTEXT state</a></li>
|
|
<li><a href="#tag-open-state"><span class="secno">8.2.4.8 </span>Tag open state</a></li>
|
|
<li><a href="#end-tag-open-state"><span class="secno">8.2.4.9 </span>End tag open state</a></li>
|
|
<li><a href="#tag-name-state"><span class="secno">8.2.4.10 </span>Tag name state</a></li>
|
|
<li><a href="#rcdata-less-than-sign-state"><span class="secno">8.2.4.11 </span>RCDATA less-than sign state</a></li>
|
|
<li><a href="#rcdata-end-tag-open-state"><span class="secno">8.2.4.12 </span>RCDATA end tag open state</a></li>
|
|
<li><a href="#rcdata-end-tag-name-state"><span class="secno">8.2.4.13 </span>RCDATA end tag name state</a></li>
|
|
<li><a href="#rawtext-less-than-sign-state"><span class="secno">8.2.4.14 </span>RAWTEXT less-than sign state</a></li>
|
|
<li><a href="#rawtext-end-tag-open-state"><span class="secno">8.2.4.15 </span>RAWTEXT end tag open state</a></li>
|
|
<li><a href="#rawtext-end-tag-name-state"><span class="secno">8.2.4.16 </span>RAWTEXT end tag name state</a></li>
|
|
<li><a href="#script-data-less-than-sign-state"><span class="secno">8.2.4.17 </span>Script data less-than sign state</a></li>
|
|
<li><a href="#script-data-end-tag-open-state"><span class="secno">8.2.4.18 </span>Script data end tag open state</a></li>
|
|
<li><a href="#script-data-end-tag-name-state"><span class="secno">8.2.4.19 </span>Script data end tag name state</a></li>
|
|
<li><a href="#script-data-escape-start-state"><span class="secno">8.2.4.20 </span>Script data escape start state</a></li>
|
|
<li><a href="#script-data-escape-start-dash-state"><span class="secno">8.2.4.21 </span>Script data escape start dash state</a></li>
|
|
<li><a href="#script-data-escaped-state"><span class="secno">8.2.4.22 </span>Script data escaped state</a></li>
|
|
<li><a href="#script-data-escaped-dash-state"><span class="secno">8.2.4.23 </span>Script data escaped dash state</a></li>
|
|
<li><a href="#script-data-escaped-dash-dash-state"><span class="secno">8.2.4.24 </span>Script data escaped dash dash state</a></li>
|
|
<li><a href="#script-data-escaped-less-than-sign-state"><span class="secno">8.2.4.25 </span>Script data escaped less-than sign state</a></li>
|
|
<li><a href="#script-data-escaped-end-tag-open-state"><span class="secno">8.2.4.26 </span>Script data escaped end tag open state</a></li>
|
|
<li><a href="#script-data-escaped-end-tag-name-state"><span class="secno">8.2.4.27 </span>Script data escaped end tag name state</a></li>
|
|
<li><a href="#script-data-double-escape-start-state"><span class="secno">8.2.4.28 </span>Script data double escape start state</a></li>
|
|
<li><a href="#script-data-double-escaped-state"><span class="secno">8.2.4.29 </span>Script data double escaped state</a></li>
|
|
<li><a href="#script-data-double-escaped-dash-state"><span class="secno">8.2.4.30 </span>Script data double escaped dash state</a></li>
|
|
<li><a href="#script-data-double-escaped-dash-dash-state"><span class="secno">8.2.4.31 </span>Script data double escaped dash dash state</a></li>
|
|
<li><a href="#script-data-double-escaped-less-than-sign-state"><span class="secno">8.2.4.32 </span>Script data double escaped less-than sign state</a></li>
|
|
<li><a href="#script-data-double-escape-end-state"><span class="secno">8.2.4.33 </span>Script data double escape end state</a></li>
|
|
<li><a href="#before-attribute-name-state"><span class="secno">8.2.4.34 </span>Before attribute name state</a></li>
|
|
<li><a href="#attribute-name-state"><span class="secno">8.2.4.35 </span>Attribute name state</a></li>
|
|
<li><a href="#after-attribute-name-state"><span class="secno">8.2.4.36 </span>After attribute name state</a></li>
|
|
<li><a href="#before-attribute-value-state"><span class="secno">8.2.4.37 </span>Before attribute value state</a></li>
|
|
<li><a href="#attribute-value-double-quoted-state"><span class="secno">8.2.4.38 </span>Attribute value (double-quoted) state</a></li>
|
|
<li><a href="#attribute-value-single-quoted-state"><span class="secno">8.2.4.39 </span>Attribute value (single-quoted) state</a></li>
|
|
<li><a href="#attribute-value-unquoted-state"><span class="secno">8.2.4.40 </span>Attribute value (unquoted) state</a></li>
|
|
<li><a href="#character-reference-in-attribute-value-state"><span class="secno">8.2.4.41 </span>Character reference in attribute value state</a></li>
|
|
<li><a href="#after-attribute-value-quoted-state"><span class="secno">8.2.4.42 </span>After attribute value (quoted) state</a></li>
|
|
<li><a href="#self-closing-start-tag-state"><span class="secno">8.2.4.43 </span>Self-closing start tag state</a></li>
|
|
<li><a href="#bogus-comment-state"><span class="secno">8.2.4.44 </span>Bogus comment state</a></li>
|
|
<li><a href="#markup-declaration-open-state"><span class="secno">8.2.4.45 </span>Markup declaration open state</a></li>
|
|
<li><a href="#comment-start-state"><span class="secno">8.2.4.46 </span>Comment start state</a></li>
|
|
<li><a href="#comment-start-dash-state"><span class="secno">8.2.4.47 </span>Comment start dash state</a></li>
|
|
<li><a href="#comment-state"><span class="secno">8.2.4.48 </span>Comment state</a></li>
|
|
<li><a href="#comment-end-dash-state"><span class="secno">8.2.4.49 </span>Comment end dash state</a></li>
|
|
<li><a href="#comment-end-state"><span class="secno">8.2.4.50 </span>Comment end state</a></li>
|
|
<li><a href="#comment-end-bang-state"><span class="secno">8.2.4.51 </span>Comment end bang state</a></li>
|
|
<li><a href="#doctype-state"><span class="secno">8.2.4.52 </span>DOCTYPE state</a></li>
|
|
<li><a href="#before-doctype-name-state"><span class="secno">8.2.4.53 </span>Before DOCTYPE name state</a></li>
|
|
<li><a href="#doctype-name-state"><span class="secno">8.2.4.54 </span>DOCTYPE name state</a></li>
|
|
<li><a href="#after-doctype-name-state"><span class="secno">8.2.4.55 </span>After DOCTYPE name state</a></li>
|
|
<li><a href="#after-doctype-public-keyword-state"><span class="secno">8.2.4.56 </span>After DOCTYPE public keyword state</a></li>
|
|
<li><a href="#before-doctype-public-identifier-state"><span class="secno">8.2.4.57 </span>Before DOCTYPE public identifier state</a></li>
|
|
<li><a href="#doctype-public-identifier-double-quoted-state"><span class="secno">8.2.4.58 </span>DOCTYPE public identifier (double-quoted) state</a></li>
|
|
<li><a href="#doctype-public-identifier-single-quoted-state"><span class="secno">8.2.4.59 </span>DOCTYPE public identifier (single-quoted) state</a></li>
|
|
<li><a href="#after-doctype-public-identifier-state"><span class="secno">8.2.4.60 </span>After DOCTYPE public identifier state</a></li>
|
|
<li><a href="#between-doctype-public-and-system-identifiers-state"><span class="secno">8.2.4.61 </span>Between DOCTYPE public and system identifiers state</a></li>
|
|
<li><a href="#after-doctype-system-keyword-state"><span class="secno">8.2.4.62 </span>After DOCTYPE system keyword state</a></li>
|
|
<li><a href="#before-doctype-system-identifier-state"><span class="secno">8.2.4.63 </span>Before DOCTYPE system identifier state</a></li>
|
|
<li><a href="#doctype-system-identifier-double-quoted-state"><span class="secno">8.2.4.64 </span>DOCTYPE system identifier (double-quoted) state</a></li>
|
|
<li><a href="#doctype-system-identifier-single-quoted-state"><span class="secno">8.2.4.65 </span>DOCTYPE system identifier (single-quoted) state</a></li>
|
|
<li><a href="#after-doctype-system-identifier-state"><span class="secno">8.2.4.66 </span>After DOCTYPE system identifier state</a></li>
|
|
<li><a href="#bogus-doctype-state"><span class="secno">8.2.4.67 </span>Bogus DOCTYPE state</a></li>
|
|
<li><a href="#cdata-section-state"><span class="secno">8.2.4.68 </span>CDATA section state</a></li>
|
|
<li><a href="#tokenizing-character-references"><span class="secno">8.2.4.69 </span>Tokenizing character references</a></ol></li>
|
|
<li><a href="#tree-construction"><span class="secno">8.2.5 </span>Tree construction</a>
|
|
<ol>
|
|
<li><a href="#creating-and-inserting-elements"><span class="secno">8.2.5.1 </span>Creating and inserting elements</a></li>
|
|
<li><a href="#closing-elements-that-have-implied-end-tags"><span class="secno">8.2.5.2 </span>Closing elements that have implied end tags</a></li>
|
|
<li><a href="#foster-parenting"><span class="secno">8.2.5.3 </span>Foster parenting</a></li>
|
|
<li><a href="#parsing-main-inhtml"><span class="secno">8.2.5.4 </span>The rules for parsing tokens in HTML content</a>
|
|
<ol>
|
|
<li><a href="#the-initial-insertion-mode"><span class="secno">8.2.5.4.1 </span>The "initial" insertion mode</a></li>
|
|
<li><a href="#the-before-html-insertion-mode"><span class="secno">8.2.5.4.2 </span>The "before html" insertion mode</a></li>
|
|
<li><a href="#the-before-head-insertion-mode"><span class="secno">8.2.5.4.3 </span>The "before head" insertion mode</a></li>
|
|
<li><a href="#parsing-main-inhead"><span class="secno">8.2.5.4.4 </span>The "in head" insertion mode</a></li>
|
|
<li><a href="#parsing-main-inheadnoscript"><span class="secno">8.2.5.4.5 </span>The "in head noscript" insertion mode</a></li>
|
|
<li><a href="#the-after-head-insertion-mode"><span class="secno">8.2.5.4.6 </span>The "after head" insertion mode</a></li>
|
|
<li><a href="#parsing-main-inbody"><span class="secno">8.2.5.4.7 </span>The "in body" insertion mode</a></li>
|
|
<li><a href="#parsing-main-incdata"><span class="secno">8.2.5.4.8 </span>The "text" insertion mode</a></li>
|
|
<li><a href="#parsing-main-intable"><span class="secno">8.2.5.4.9 </span>The "in table" insertion mode</a></li>
|
|
<li><a href="#parsing-main-intabletext"><span class="secno">8.2.5.4.10 </span>The "in table text" insertion mode</a></li>
|
|
<li><a href="#parsing-main-incaption"><span class="secno">8.2.5.4.11 </span>The "in caption" insertion mode</a></li>
|
|
<li><a href="#parsing-main-incolgroup"><span class="secno">8.2.5.4.12 </span>The "in column group" insertion mode</a></li>
|
|
<li><a href="#parsing-main-intbody"><span class="secno">8.2.5.4.13 </span>The "in table body" insertion mode</a></li>
|
|
<li><a href="#parsing-main-intr"><span class="secno">8.2.5.4.14 </span>The "in row" insertion mode</a></li>
|
|
<li><a href="#parsing-main-intd"><span class="secno">8.2.5.4.15 </span>The "in cell" insertion mode</a></li>
|
|
<li><a href="#parsing-main-inselect"><span class="secno">8.2.5.4.16 </span>The "in select" insertion mode</a></li>
|
|
<li><a href="#parsing-main-inselectintable"><span class="secno">8.2.5.4.17 </span>The "in select in table" insertion mode</a></li>
|
|
<li><a href="#parsing-main-afterbody"><span class="secno">8.2.5.4.18 </span>The "after body" insertion mode</a></li>
|
|
<li><a href="#parsing-main-inframeset"><span class="secno">8.2.5.4.19 </span>The "in frameset" insertion mode</a></li>
|
|
<li><a href="#parsing-main-afterframeset"><span class="secno">8.2.5.4.20 </span>The "after frameset" insertion mode</a></li>
|
|
<li><a href="#the-after-after-body-insertion-mode"><span class="secno">8.2.5.4.21 </span>The "after after body" insertion mode</a></li>
|
|
<li><a href="#the-after-after-frameset-insertion-mode"><span class="secno">8.2.5.4.22 </span>The "after after frameset" insertion mode</a></ol></li>
|
|
<li><a href="#parsing-main-inforeign"><span class="secno">8.2.5.5 </span>The rules for parsing tokens in foreign content</a></ol></li>
|
|
<li><a href="#the-end"><span class="secno">8.2.6 </span>The end</a></li>
|
|
<li><a href="#coercing-an-html-dom-into-an-infoset"><span class="secno">8.2.7 </span>Coercing an HTML DOM into an infoset</a></li>
|
|
<li><a href="#an-introduction-to-error-handling-and-strange-cases-in-the-parser"><span class="secno">8.2.8 </span>An introduction to error handling and strange cases in the parser</a>
|
|
<ol>
|
|
<li><a href="#misnested-tags:-b-i-b-i"><span class="secno">8.2.8.1 </span>Misnested tags: <b><i></b></i></a></li>
|
|
<li><a href="#misnested-tags:-b-p-b-p"><span class="secno">8.2.8.2 </span>Misnested tags: <b><p></b></p></a></li>
|
|
<li><a href="#unexpected-markup-in-tables"><span class="secno">8.2.8.3 </span>Unexpected markup in tables</a></li>
|
|
<li><a href="#scripts-that-modify-the-page-as-it-is-being-parsed"><span class="secno">8.2.8.4 </span>Scripts that modify the page as it is being parsed</a></li>
|
|
<li><a href="#the-execution-of-scripts-that-are-moving-across-multiple-documents"><span class="secno">8.2.8.5 </span>The execution of scripts that are moving across multiple documents</a></li>
|
|
<li><a href="#unclosed-formatting-elements"><span class="secno">8.2.8.6 </span>Unclosed formatting elements</a></ol></ol></li>
|
|
<li><a href="#serializing-html-fragments"><span class="secno">8.3 </span>Serializing HTML fragments</a></li>
|
|
<li><a href="#parsing-html-fragments"><span class="secno">8.4 </span>Parsing HTML fragments</a></li>
|
|
<li><a href="#named-character-references"><span class="secno">8.5 </span>Named character references</a></ol></li>
|
|
<li><a href="#the-xhtml-syntax"><span class="secno">9 </span>The XHTML syntax</a>
|
|
<ol>
|
|
<li><a href="#writing-xhtml-documents"><span class="secno">9.1 </span>Writing XHTML documents</a></li>
|
|
<li><a href="#parsing-xhtml-documents"><span class="secno">9.2 </span>Parsing XHTML documents</a></li>
|
|
<li><a href="#serializing-xhtml-fragments"><span class="secno">9.3 </span>Serializing XHTML fragments</a></li>
|
|
<li><a href="#parsing-xhtml-fragments"><span class="secno">9.4 </span>Parsing XHTML fragments</a></ol></li>
|
|
<li><a href="#rendering"><span class="secno">10 </span>Rendering</a>
|
|
<ol>
|
|
<li><a href="#introduction-8"><span class="secno">10.1 </span>Introduction</a></li>
|
|
<li><a href="#the-css-user-agent-style-sheet-and-presentational-hints"><span class="secno">10.2 </span>The CSS user agent style sheet and presentational hints</a>
|
|
<ol>
|
|
<li><a href="#introduction-9"><span class="secno">10.2.1 </span>Introduction</a></li>
|
|
<li><a href="#display-types"><span class="secno">10.2.2 </span>Display types</a></li>
|
|
<li><a href="#margins-and-padding"><span class="secno">10.2.3 </span>Margins and padding</a></li>
|
|
<li><a href="#alignment"><span class="secno">10.2.4 </span>Alignment</a></li>
|
|
<li><a href="#fonts-and-colors"><span class="secno">10.2.5 </span>Fonts and colors</a></li>
|
|
<li><a href="#punctuation-and-decorations"><span class="secno">10.2.6 </span>Punctuation and decorations</a></li>
|
|
<li><a href="#resetting-rules-for-inherited-properties"><span class="secno">10.2.7 </span>Resetting rules for inherited properties</a></li>
|
|
<li><a href="#the-hr-element-0"><span class="secno">10.2.8 </span>The <code>hr</code> element</a></li>
|
|
<li><a href="#the-fieldset-element-0"><span class="secno">10.2.9 </span>The <code>fieldset</code> element</a></ol></li>
|
|
<li><a href="#replaced-elements"><span class="secno">10.3 </span>Replaced elements</a>
|
|
<ol>
|
|
<li><a href="#embedded-content-2"><span class="secno">10.3.1 </span>Embedded content</a></li>
|
|
<li><a href="#timed-text-tracks-0"><span class="secno">10.3.2 </span>Timed text tracks</a>
|
|
<ol>
|
|
<li><a href="#webvtt-cue-text-rendering-rules"><span class="secno">10.3.2.1 </span>WebVTT cue text rendering rules</a></li>
|
|
<li><a href="#applying-css-properties-to-webvtt-node-objects"><span class="secno">10.3.2.2 </span>Applying CSS properties to <span title="WebVTT Node Object">WebVTT Node Objects</span></a></li>
|
|
<li><a href="#css-extensions"><span class="secno">10.3.2.3 </span>CSS extensions</a>
|
|
<ol>
|
|
<li><a href="#the-::cue-pseudo-element"><span class="secno">10.3.2.3.1 </span>The '::cue' pseudo-element</a></li>
|
|
<li><a href="#the-:past-and-:future-pseudo-classes"><span class="secno">10.3.2.3.2 </span>The ':past' and ':future' pseudo-classes</a></ol></ol></li>
|
|
<li><a href="#images"><span class="secno">10.3.3 </span>Images</a></li>
|
|
<li><a href="#attributes-for-embedded-content-and-images"><span class="secno">10.3.4 </span>Attributes for embedded content and images</a></li>
|
|
<li><a href="#image-maps-0"><span class="secno">10.3.5 </span>Image maps</a></li>
|
|
<li><a href="#toolbars-0"><span class="secno">10.3.6 </span>Toolbars</a></ol></li>
|
|
<li><a href="#bindings"><span class="secno">10.4 </span>Bindings</a>
|
|
<ol>
|
|
<li><a href="#introduction-10"><span class="secno">10.4.1 </span>Introduction</a></li>
|
|
<li><a href="#the-button-element-0"><span class="secno">10.4.2 </span>The <code>button</code> element</a></li>
|
|
<li><a href="#the-details-element-0"><span class="secno">10.4.3 </span>The <code>details</code> element</a></li>
|
|
<li><a href="#the-input-element-as-a-text-entry-widget"><span class="secno">10.4.4 </span>The <code>input</code> element as a text entry widget</a></li>
|
|
<li><a href="#the-input-element-as-domain-specific-widgets"><span class="secno">10.4.5 </span>The <code>input</code> element as domain-specific widgets</a></li>
|
|
<li><a href="#the-input-element-as-a-range-control"><span class="secno">10.4.6 </span>The <code>input</code> element as a range control</a></li>
|
|
<li><a href="#the-input-element-as-a-color-well"><span class="secno">10.4.7 </span>The <code>input</code> element as a color well</a></li>
|
|
<li><a href="#the-input-element-as-a-checkbox-and-radio-button-widgets"><span class="secno">10.4.8 </span>The <code>input</code> element as a checkbox and radio button widgets</a></li>
|
|
<li><a href="#the-input-element-as-a-file-upload-control"><span class="secno">10.4.9 </span>The <code>input</code> element as a file upload control</a></li>
|
|
<li><a href="#the-input-element-as-a-button"><span class="secno">10.4.10 </span>The <code>input</code> element as a button</a></li>
|
|
<li><a href="#the-marquee-element-0"><span class="secno">10.4.11 </span>The <code>marquee</code> element</a></li>
|
|
<li><a href="#the-meter-element-0"><span class="secno">10.4.12 </span>The <code>meter</code> element</a></li>
|
|
<li><a href="#the-progress-element-0"><span class="secno">10.4.13 </span>The <code>progress</code> element</a></li>
|
|
<li><a href="#the-select-element-0"><span class="secno">10.4.14 </span>The <code>select</code> element</a></li>
|
|
<li><a href="#the-textarea-element-0"><span class="secno">10.4.15 </span>The <code>textarea</code> element</a></li>
|
|
<li><a href="#the-keygen-element-0"><span class="secno">10.4.16 </span>The <code>keygen</code> element</a></li>
|
|
<li><a href="#the-time-element-0"><span class="secno">10.4.17 </span>The <code>time</code> element</a></ol></li>
|
|
<li><a href="#frames-and-framesets"><span class="secno">10.5 </span>Frames and framesets</a></li>
|
|
<li><a href="#interactive-media"><span class="secno">10.6 </span>Interactive media</a>
|
|
<ol>
|
|
<li><a href="#links-forms-and-navigation"><span class="secno">10.6.1 </span>Links, forms, and navigation</a></li>
|
|
<li><a href="#the-title-attribute-0"><span class="secno">10.6.2 </span>The <code title="attr-title">title</code> attribute</a></li>
|
|
<li><a href="#editing-hosts"><span class="secno">10.6.3 </span>Editing hosts</a></li>
|
|
<li><a href="#text-rendered-in-native-user-interfaces"><span class="secno">10.6.4 </span>Text rendered in native user interfaces</a></ol></li>
|
|
<li><a href="#print-media"><span class="secno">10.7 </span>Print media</a></ol></li>
|
|
<li><a href="#obsolete"><span class="secno">11 </span>Obsolete features</a>
|
|
<ol>
|
|
<li><a href="#obsolete-but-conforming-features"><span class="secno">11.1 </span>Obsolete but conforming features</a>
|
|
<ol>
|
|
<li><a href="#warnings-for-obsolete-but-conforming-features"><span class="secno">11.1.1 </span>Warnings for obsolete but conforming features</a></ol></li>
|
|
<li><a href="#non-conforming-features"><span class="secno">11.2 </span>Non-conforming features</a></li>
|
|
<li><a href="#requirements-for-implementations"><span class="secno">11.3 </span>Requirements for implementations</a>
|
|
<ol>
|
|
<li><a href="#the-applet-element"><span class="secno">11.3.1 </span>The <code>applet</code> element</a></li>
|
|
<li><a href="#the-marquee-element"><span class="secno">11.3.2 </span>The <code>marquee</code> element</a></li>
|
|
<li><a href="#frames"><span class="secno">11.3.3 </span>Frames</a></li>
|
|
<li><a href="#other-elements-attributes-and-apis"><span class="secno">11.3.4 </span>Other elements, attributes and APIs</a></ol></ol></li>
|
|
<li><a href="#iana"><span class="secno">12 </span>IANA considerations</a>
|
|
<ol>
|
|
<li><a href="#text-html"><span class="secno">12.1 </span><code>text/html</code></a></li>
|
|
<li><a href="#text-html-sandboxed"><span class="secno">12.2 </span><code>text/html-sandboxed</code></a></li>
|
|
<li><a href="#application-xhtml-xml"><span class="secno">12.3 </span><code>application/xhtml+xml</code></a></li>
|
|
<li><a href="#text-cache-manifest"><span class="secno">12.4 </span><code>text/cache-manifest</code></a></ol></li>
|
|
<li><a class="no-num" href="#index">Index</a>
|
|
<ol>
|
|
<li><a class="no-num" href="#elements-1">Elements</a></li>
|
|
<li><a class="no-num" href="#element-content-categories">Element content categories</a></li>
|
|
<li><a class="no-num" href="#attributes-1">Attributes</a></li>
|
|
<li><a class="no-num" href="#interfaces">Interfaces</a></li>
|
|
<li><a class="no-num" href="#events-0">Events</a></ol></li>
|
|
<li><a class="no-num" href="#references">References</a></li>
|
|
<li><a class="no-num" href="#acknowledgements">Acknowledgements</a></ol>
|
|
<hr><h2 id="introduction"><span class="secno">1 </span>Introduction</h2><h3 id="background"><span class="secno">1.1 </span>Background</h3><p><i>This section is non-normative.</i><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 have enabled it to be used to describe a number of
|
|
other types of documents.<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.<h3 id="audience"><span class="secno">1.2 </span>Audience</h3><p><i>This section is non-normative.</i><p>This specification is intended for authors of documents and
|
|
scripts that use the features defined in this specification<span class="impl">, implementors of tools that operate on pages that use
|
|
the features defined in this specification, and individuals wishing
|
|
to establish the correctness of documents or implementations with
|
|
respect to the requirements of this specification</span>.<p>This document is probably not suited to readers who do not
|
|
already have at least a passing familiarity with Web technologies,
|
|
as in places it sacrifices clarity for precision, and brevity for
|
|
completeness. More approachable tutorials and authoring guides can
|
|
provide a gentler introduction to the topic.<p>In particular, familiarity with the basics of DOM Core and DOM
|
|
Events is necessary for a complete understanding of some of the more
|
|
technical parts of this specification. An understanding of Web IDL,
|
|
HTTP, XML, Unicode, character encodings, JavaScript, and CSS will
|
|
also be helpful in places but is not essential.<h3 id="scope"><span class="secno">1.3 </span>Scope</h3><p><i>This section is non-normative.</i><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>The scope of this specification does not include providing
|
|
mechanisms for media-specific customization of presentation
|
|
(although default rendering rules for Web browsers are included at
|
|
the end of this specification, and several mechanisms for hooking
|
|
into CSS are provided as part of the language).<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.<h3 id="history-1"><span class="secno">1.4 </span>History</h3><p><i>This section is non-normative.</i><p>For its first five years (1990-1995), HTML went through a number
|
|
of revisions and experienced a number of extensions, primarily
|
|
hosted first at CERN, and then at the IETF.<p>With the creation of the W3C, HTML's development changed venue
|
|
again. A first abortive attempt at extending HTML in 1995 known as
|
|
HTML 3.0 then made way to a more pragmatic approach known as HTML
|
|
3.2, which was completed in 1997. HTML4 followed, reaching
|
|
completion in 1998.<p>At this time, the W3C membership decided to stop evolving HTML
|
|
and instead begin work on an XML-based equivalent, called
|
|
XHTML. This effort started with a reformulation of HTML4 in XML,
|
|
known as XHTML 1.0, which added no new features except the new
|
|
serialization, and which was completed in 2000. After XHTML 1.0, the
|
|
W3C's focus turned to making it easier for other working groups to
|
|
extend XHTML, under the banner of XHTML Modularization. In parallel
|
|
with this, the W3C also worked on a new language that was not
|
|
compatible with the earlier HTML and XHTML languages, calling it
|
|
XHTML2.<p>Around the time that HTML's evolution was stopped in 1998, parts
|
|
of the API for HTML developed by browser vendors were specified and
|
|
published under the name DOM Level 1 (in 1998) and DOM Level 2 Core
|
|
and DOM Level 2 HTML (starting in 2000 and culminating in
|
|
2003). These efforts then petered out, with some DOM Level 3
|
|
specifications published in 2004 but the working group being closed
|
|
before all the Level 3 drafts were completed.<p>In 2003, the publication of XForms, a technology which was
|
|
positioned as the next generation of Web forms, sparked a renewed
|
|
interest in evolving HTML itself, rather than finding replacements
|
|
for it. This interest was borne from the realization that XML's
|
|
deployment as a Web technology was limited to entirely new
|
|
technologies (like RSS and later Atom), rather than as a replacement
|
|
for existing deployed technologies (like HTML).<p>A proof of concept to show that it was possible to extend HTML4's
|
|
forms to provide many of the features that XForms 1.0 introduced,
|
|
without requiring browsers to implement rendering engines that were
|
|
incompatible with existing HTML Web pages, was the first result of
|
|
this renewed interest. At this early stage, while the draft was
|
|
already publicly available, and input was already being solicited
|
|
from all sources, the specification was only under Opera Software's
|
|
copyright.<p>The idea that HTML's evolution should be reopened was tested at a
|
|
W3C workshop in 2004, where some of the principles that underlie the
|
|
HTML5 work (described below), as well as the aforementioned early
|
|
draft proposal covering just forms-related features, were presented
|
|
to the W3C jointly by Mozilla and Opera. The proposal was rejected
|
|
on the grounds that the proposal conflicted with the previously
|
|
chosen direction for the Web's evolution; the W3C staff and
|
|
membership voted to continue developing XML-based replacements
|
|
instead.<p>Shortly thereafter, Apple, Mozilla, and Opera jointly announced
|
|
their intent to continue working on the effort under the umbrella of
|
|
a new venue called the WHATWG. A public mailing list was created,
|
|
and the draft was moved to the WHATWG site. The copyright was
|
|
subsequently amended to be jointly owned by all three vendors, and
|
|
to allow reuse of the specification.<p>The WHATWG was based on several core principles, in particular
|
|
that technologies need to be backwards compatible, that
|
|
specifications and implementations need to match even if this means
|
|
changing the specification rather than the implementations, and that
|
|
specifications need to be detailed enough that implementations can
|
|
achieve complete interoperability without reverse-engineering each
|
|
other.<p>The latter requirement in particular required that the scope of
|
|
the HTML5 specification include what had previously been specified
|
|
in three separate documents: HTML4, XHTML1, and DOM2 HTML. It also
|
|
meant including significantly more detail than had previously been
|
|
considered the norm.<p>In 2006, the W3C indicated an interest to participate in the
|
|
development of HTML5 after all, and in 2007 formed a working group
|
|
chartered to work with the WHATWG on the development of the HTML5
|
|
specification. Apple, Mozilla, and Opera allowed the W3C to publish
|
|
the specification under the W3C copyright, while keeping a version
|
|
with the less restrictive license on the WHATWG site.<p>Since then, both groups have been working together.</p><p>The <a href="http://www.whatwg.org/specs/web-apps/current-work/">HTML
|
|
specification</a> published by the WHATWG is not identical to
|
|
this specification. At the time of this publication, the main
|
|
differences were that the WHATWG version included features not
|
|
included in this W3C version: some features have been omitted, but
|
|
may be considered for future revisions of HTML beyond HTML5; and
|
|
other features were omitted because at the W3C they are published as
|
|
separate specifications.</p><p>A separate document has been published by the W3C HTML working
|
|
group to document the differences between this specification and the
|
|
language described in the HTML4 specification. <a href="#refsHTMLDIFF">[HTMLDIFF]</a><h3 id="design-notes"><span class="secno">1.5 </span>Design notes</h3><p><i>This section is non-normative.</i><p>It must be admitted that many aspects of HTML appear at first
|
|
glance to be nonsensical and inconsistent.<p>HTML, its supporting DOM APIs, as well as many of its supporting
|
|
technologies, have been developed over a period of several decades
|
|
by a wide array of people with different priorities who, in many
|
|
cases, did not know of each other's existence.<p>Features have thus arisen from many sources, and have not always
|
|
been designed in especially consistent ways. Furthermore, because of
|
|
the unique characteristics of the Web, implementation bugs have
|
|
often become de-facto, and now de-jure, standards, as content is
|
|
often unintentionally written in ways that rely on them before they
|
|
can be fixed.<p>Despite all this, efforts have been made to adhere to certain
|
|
design goals. These are described in the next few subsections.<h4 id="serializability-of-script-execution"><span class="secno">1.5.1 </span>Serializability of script execution</h4><p><i>This section is non-normative.</i><p>To avoid exposing Web authors to the complexities of
|
|
multithreading, the HTML and DOM APIs are designed such that no
|
|
script can ever detect the simultaneous execution of other
|
|
scripts. Even with <span title="Worker">workers</span>, the intent
|
|
is that the behavior of implementations can be thought of as
|
|
completely serializing the execution of all scripts in all <a href="#browsing-context" title="browsing context">browsing contexts</a>.<p class="note">The <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">navigator.yieldForStorageUpdates()</a></code>
|
|
method, in this model, is equivalent to allowing other scripts to
|
|
run while the calling script is blocked.<h4 id="compliance-with-other-specifications"><span class="secno">1.5.2 </span>Compliance with other specifications</h4><p><i>This section is non-normative.</i><p>This specification interacts with and relies on a wide variety of
|
|
other specifications. In certain circumstances, unfortunately,
|
|
conflicting needs have led to this specification violating the
|
|
requirements of these other specifications. Whenever this has
|
|
occurred, the transgressions have each been noted as a "<dfn id="willful-violation">willful
|
|
violation</dfn>", and the reason for the violation has been
|
|
noted.<h3 id="html-vs-xhtml"><span class="secno">1.6 </span>HTML vs XHTML</h3><p><i>This section is non-normative.</i><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>The in-memory representation is known as "DOM HTML", or "the DOM"
|
|
for short. This specification defines version 5 of DOM HTML, known
|
|
as "DOM5 HTML".<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>The first such concrete syntax is the HTML syntax. This is the
|
|
format suggested for most authors. It is compatible with most legacy
|
|
Web browsers. If a document is transmitted with an <a href="#html-mime-type">HTML MIME
|
|
type</a>, such as <code><a href="#text-html">text/html</a></code>, then it will be
|
|
processed as an HTML document by Web browsers.
|
|
|
|
|
|
This specification defines version 5 of the HTML syntax, known as
|
|
"HTML5".
|
|
|
|
<p>The second concrete syntax is the XHTML syntax, which is an
|
|
application of XML. When a document is transmitted with an <a href="#xml-mime-type">XML
|
|
MIME type</a>, such as <code><a href="#application-xhtml-xml">application/xhtml+xml</a></code>, then
|
|
it is treated as an XML document by Web browsers, to be parsed by an
|
|
XML processor. Authors are reminded that the processing for XML and
|
|
HTML differs; in particular, even minor syntax errors will prevent a
|
|
document labeled as XML from being rendered fully, whereas they
|
|
would be ignored in the HTML syntax.
|
|
|
|
|
|
This specification defines version 5 of the XHTML syntax, known as
|
|
"XHTML5".
|
|
|
|
<p>The DOM, the HTML syntax, and XML cannot all represent the same
|
|
content. For example, namespaces cannot be represented using the
|
|
HTML syntax, but they are supported in the DOM and in XML.
|
|
Similarly, documents that use the <code><a href="#the-noscript-element">noscript</a></code> feature can
|
|
be represented using the HTML syntax, but cannot be represented with
|
|
the DOM or in XML. Comments that contain the string "<code title="">--></code>" can only be represented in the DOM, not in
|
|
the HTML and XML syntaxes.<h3 id="structure-of-this-specification"><span class="secno">1.7 </span>Structure of this specification</h3><p><i>This section is non-normative.</i><p>This specification is divided into the following major
|
|
sections:<dl><dt><a href="#infrastructure">Common infrastructure</a></dt>
|
|
|
|
<dd>The conformance classes, algorithms, definitions, and the
|
|
common underpinnings of the rest of the specification.</dd>
|
|
|
|
|
|
<dt><a href="#dom">Semantics, structure, and APIs of HTML documents</a></dt>
|
|
|
|
<dd>Documents are built from elements. These elements form a tree
|
|
using the DOM. This section defines the features of this DOM, as
|
|
well as introducing the features common to all elements, and the
|
|
concepts used in defining elements.</dd>
|
|
|
|
|
|
<dt><a href="#semantics">The elements of HTML</a></dt>
|
|
|
|
<dd>Each element has a predefined meaning, which is explained in
|
|
this section. Rules for authors on how to use the element<span class="impl">, along with user agent requirements for how to handle
|
|
each element,</span> are also given.</dd>
|
|
|
|
|
|
<dt><a href="#browsers">Loading Web pages</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.</dd>
|
|
|
|
<dt><a href="#webappapis">Web application APIs</a></dt>
|
|
|
|
<dd>This section introduces basic features for scripting of
|
|
applications in HTML.</dd>
|
|
|
|
<dt><a href="#editing">User interaction</a></dt>
|
|
|
|
<dd>HTML documents can provide a number of mechanisms for users to
|
|
interact with and modify content, which are described in this
|
|
section.</dd>
|
|
|
|
|
|
|
|
|
|
|
|
<dt><a href="#syntax">The HTML syntax</a></dt>
|
|
<dt><a href="#xhtml">The XHTML syntax</a></dt>
|
|
|
|
<dd>All of these features would be for naught if they couldn't be
|
|
represented in a serialized form and sent to other people, and so
|
|
these sections define the syntaxes of HTML, along with rules for
|
|
how to parse content using those syntaxes.</dd>
|
|
|
|
|
|
</dl><p>There are also some appendices, defining <a href="#rendering">rendering rules</a> for Web browsers and listing
|
|
<a href="#obsolete">obsolete features</a> and <a href="#iana">IANA
|
|
considerations</a>.<h4 id="how-to-read-this-specification"><span class="secno">1.7.1 </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.<h4 id="typographic-conventions"><span class="secno">1.7.2 </span>Typographic conventions</h4><p>This is a definition, requirement, or explanation.<p class="note">This is a note.<p class="example">This is an example.<p class="XXX">This is an open issue.<p class="warning">This is a warning.<pre class="idl extract">interface <dfn title="">Example</dfn> {
|
|
// this is an IDL definition
|
|
};</pre><dl class="domintro"><dt><var title="">variable</var> = <var title="">object</var> . <code title="">method</code>( [ <var title="">optionalArgument</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>This is a note to authors describing the usage of an interface.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><pre class="css">/* this is a CSS fragment */</pre><p>The defining instance of a term is marked up like <dfn id="x-this" title="x-this">this</dfn>. Uses of that term are marked up like
|
|
<a href="#x-this" title="x-this">this</a> or like <i title="x-this"><a href="#x-this">this</a></i>.<p>The defining instance of an element, attribute, or API is marked
|
|
up like <dfn id="x-that" title="x-that"><code>this</code></dfn>. References to
|
|
that element, attribute, or API are marked up like <code title="x-that"><a href="#x-that">this</a></code>.<p>Other code fragments are marked up <code title="">like
|
|
this</code>.<p>Variables are marked up like <var title="">this</var>.<p class="impl">This is an implementation requirement.<h3 id="a-quick-introduction-to-html"><span class="secno">1.8 </span>A quick introduction to HTML</h3><p><i>This section is non-normative.</i><p>A basic HTML document looks like this:<pre id="intro-early-example"><!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Sample page</title>
|
|
</head>
|
|
<body>
|
|
<h1>Sample page</h1>
|
|
<p>This is a <a href="demo.html">simple</a> sample.</p>
|
|
<!-- this is a comment -->
|
|
</body>
|
|
</html></pre><p>HTML documents consist of a tree of elements and text. Each
|
|
element is denoted in the source by a <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a>, such as "<code title=""><body></code>", and an <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a>, such as "<code title=""></body></code>". (Certain
|
|
start tags and end tags can in certain cases be <a href="#syntax-tag-omission" title="syntax-tag-omission">omitted</a> and are implied by other
|
|
tags.)<p>Tags have to be nested such that elements are all completely
|
|
within each other, without overlapping:<pre class="bad"><p>This is <em>very <strong>wrong</em>!</strong></p></pre><pre><p>This <em>is <strong>correct</strong>.</em></p></pre><p>This specification defines a set of elements that can be used in
|
|
HTML, along with rules about the ways in which the elements can be
|
|
nested.<p>Elements can have attributes, which control how the elements
|
|
work. In the example below, there is a <a href="#hyperlink">hyperlink</a>,
|
|
formed using the <code><a href="#the-a-element">a</a></code> element and its <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute:<pre><a href="demo.html">simple</a></pre><p><a href="#syntax-attributes" title="syntax-attributes">Attributes</a> are placed
|
|
inside the start tag, and consist of a <a href="#syntax-attribute-name" title="syntax-attribute-name">name</a> and a <a href="#syntax-attribute-value" title="syntax-attribute-value">value</a>, separated by an "<code title="">=</code>" character. The attribute value can remain <a href="#unquoted">unquoted</a> if it doesn't contain spaces or any of
|
|
<code title="">"</code> <code title="">'</code> <code title="">`</code> <code title="">=</code> <code title=""><</code>
|
|
or <code title="">></code>. Otherwise, it has to be quoted using
|
|
either single or double quotes. The value, along with the "<code title="">=</code>" character, can be omitted altogether if the value
|
|
is the empty string.<pre><!-- empty attributes -->
|
|
<input name=address disabled>
|
|
<input name=address disabled="">
|
|
|
|
<!-- attributes with a value -->
|
|
<input name=address maxlength=200>
|
|
<input name=address maxlength='200'>
|
|
<input name=address maxlength="200"></pre><p>HTML user agents (e.g. Web browsers) then <i>parse</i> this
|
|
markup, turning it into a DOM (Document Object Model) tree. A DOM
|
|
tree is an in-memory representation of a document.<p>DOM trees contain several kinds of nodes, in particular a DOCTYPE
|
|
node, elements, text nodes, and comment nodes.<p>The <a href="#intro-early-example">markup snippet at the top of
|
|
this section</a> would be turned into the following DOM tree:<ul class="domTree"><li class="t10">DOCTYPE: <code title="">html</code><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><ul><li class="t3"><code>#text</code>: <span title="">⏎␣␣</span><li class="t1"><code><a href="#the-title-element">title</a></code><ul><li class="t3"><code>#text</code>: <span title="">Sample page</span></ul><li class="t3"><code>#text</code>: <span title="">⏎␣</span></ul><li class="t3"><code>#text</code>: <span title="">⏎␣</span><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t3"><code>#text</code>: <span title="">⏎␣␣</span><li class="t1"><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code><ul><li class="t3"><code>#text</code>: <span title="">Sample page</span></ul><li class="t3"><code>#text</code>: <span title="">⏎␣␣</span><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t3"><code>#text</code>: <span title="">This is a </span><li class="t1"><code><a href="#the-a-element">a</a></code> <span class="t2" title=""><code class="attribute name">href</code>="<code class="attribute value">demo.html</code>"</span><ul><li class="t3"><code>#text</code>: <span title="">simple</span></ul><li class="t3"><code>#text</code>: <span title=""> sample.</span></ul><li class="t3"><code>#text</code>: <span title="">⏎␣␣</span><li class="t8"><code>#comment</code>: <span title=""> this is a comment </span><li class="t3"><code>#text</code>: <span title="">⏎␣⏎</span></ul></ul></ul><p>The <a href="#root-element">root element</a> of this tree is the
|
|
<code><a href="#the-html-element">html</a></code> element, which is the element always found at the
|
|
root of HTML documents. It contains two elements, <code><a href="#the-head-element">head</a></code>
|
|
and <code><a href="#the-body-element">body</a></code>, as well as a text node between them.<p>There are many more text nodes in the DOM tree than one would
|
|
initially expect, because the source contains a number of spaces
|
|
(represented here by "␣") and line breaks ("⏎") that
|
|
all end up as text nodes in the DOM. However, for historical reasons
|
|
not all of the spaces and line breaks in the original markup appear
|
|
in the DOM. In particular, all the whitespace before
|
|
<code><a href="#the-head-element">head</a></code> start tag ends up being dropped silently, and all
|
|
the whitespace after the <code><a href="#the-body-element">body</a></code> end tag ends up placed at
|
|
the end of the <code><a href="#the-body-element">body</a></code>.<p>The <code><a href="#the-head-element">head</a></code> element contains a <code><a href="#the-title-element">title</a></code>
|
|
element, which itself contains a text node with the text "Sample
|
|
page". Similarly, the <code><a href="#the-body-element">body</a></code> element contains an
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> element, a <code><a href="#the-p-element">p</a></code> element, and a
|
|
comment.<hr><p>This DOM tree can be manipulated from scripts in the
|
|
page. Scripts (typically in JavaScript) are small programs that can
|
|
be embedded using the <code><a href="#the-script-element">script</a></code> element or using
|
|
<a href="#event-handler-content-attributes">event handler content attributes</a>. For example, here is
|
|
a form with a script that sets the value of the form's
|
|
<code><a href="#the-output-element">output</a></code> element to say "Hello World":<pre><<a href="#the-form-element">form</a> <a href="#attr-form-name" title="attr-form-name">name</a>="main">
|
|
Result: <<a href="#the-output-element">output</a> <a href="#attr-fe-name" title="attr-fe-name">name</a>="result"></output>
|
|
<<a href="#the-script-element">script</a>>
|
|
<a href="#htmldocument" title="HTMLDocument">document</a>.<a href="#dom-document-forms" title="dom-document-forms">forms</a>.main.<a href="#dom-form-elements" title="dom-form-elements">elements</a>.result.<a href="#dom-output-value" title="dom-output-value">value</a> = 'Hello World';
|
|
</script>
|
|
</form></pre><p>Each element in the DOM tree is represented by an object, and
|
|
these objects have APIs so that they can be manipulated. For
|
|
instance, a link (e.g. the <code><a href="#the-a-element">a</a></code> element in the tree above)
|
|
can have its "<code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>"
|
|
attribute changed in several ways:<pre>var a = <a href="#htmldocument" title="HTMLDocument">document</a>.<a href="#dom-document-links" title="dom-document-links">links</a>[0]; // obtain the first link in the document
|
|
a.<a href="#dom-a-href" title="dom-a-href">href</a> = 'sample.html'; // change the destination URL of the link
|
|
a.<a href="#dom-uda-protocol" title="dom-uda-protocol">protocol</a> = 'https'; // change just the scheme part of the URL
|
|
a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</pre><p>Since DOM trees are used as the way to represent HTML documents
|
|
when they are processed and presented by implementations (especially
|
|
interactive implementations like Web browsers), this specification
|
|
is mostly phrased in terms of DOM trees, instead of the markup
|
|
described above.<hr><p>HTML documents represent a media-independent description of
|
|
interactive content. HTML documents might be rendered to a screen,
|
|
or through a speech synthesizer, or on a braille display. To
|
|
influence exactly how such rendering takes place, authors can use a
|
|
styling language such as CSS.<p>In the following example, the page has been made yellow-on-blue
|
|
using CSS.<pre><!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Sample styled page</title>
|
|
<style>
|
|
body { background: navy; color: yellow; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Sample styled page</h1>
|
|
<p>This page is just a demo.</p>
|
|
</body>
|
|
</html></pre><p>For more details on how to use HTML, authors are encouraged to
|
|
consult tutorials and guides. Some of the examples included in this
|
|
specification might also be of use, but the novice author is
|
|
cautioned that this specification, by necessity, defines the
|
|
language with a level of detail that might be difficult to
|
|
understand at first.<h3 id="conformance-requirements-for-authors"><span class="secno">1.9 </span>Conformance requirements for authors</h3><p><i>This section is non-normative.</i><p>Unlike previous versions of the HTML specification, this
|
|
specification defines in some detail the required processing for
|
|
invalid documents as well as valid documents.</p><p>However, even though the processing of invalid content is in most
|
|
cases well-defined, conformance requirements for documents are still
|
|
important: in practice, interoperability (the situation in which all
|
|
implementations process particular content in a reliable and
|
|
identical or equivalent way) is not the only goal of document
|
|
conformance requirements. This section details some of the more
|
|
common reasons for still distinguishing between a conforming
|
|
document and one with errors.<h4 id="presentational-markup"><span class="secno">1.9.1 </span>Presentational markup</h4><p><i>This section is non-normative.</i><p>The majority of presentational features from previous versions of
|
|
HTML are no longer allowed. Presentational markup in general has
|
|
been found to have a number of problems:<dl><dt>The use of presentational elements leads to poorer accessibility</dt>
|
|
|
|
<dd>
|
|
|
|
<p>While it is possible to use presentational markup in a way that
|
|
provides users of assistive technologies (ATs) with an acceptable
|
|
experience (e.g. using ARIA), doing so is significantly more
|
|
difficult than doing so when using semantically-appropriate
|
|
markup. Furthermore, even using such techniques doesn't help make
|
|
pages accessible for non-AT non-graphical users, such as users of
|
|
text-mode browsers.</p>
|
|
|
|
<p>Using media-independent markup, on the other hand, provides an
|
|
easy way for documents to be authored in such a way that they work
|
|
for more users (e.g. text browsers).</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Higher cost of maintenance</dt>
|
|
|
|
<dd>
|
|
|
|
<p>It is significantly easier to maintain a site written in such a
|
|
way that the markup is style-independent. For example, changing
|
|
the color of a site that uses <code><font color=""></code>
|
|
throughout requires changes across the entire site, whereas a
|
|
similar change to a site based on CSS can be done by changing a
|
|
single file.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Higher document sizes</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Presentational markup tends to be much more redundant, and thus
|
|
results in larger document sizes.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>For those reasons, presentational markup has been removed from
|
|
HTML in this version. This change should not come as a surprise;
|
|
HTML4 deprecated presentational markup many years ago and provided a
|
|
mode (HTML4 Transitional) to help authors move away from
|
|
presentational markup; later, XHTML 1.1 went further and obsoleted
|
|
those features altogether.<p>The only remaining presentational markup features in HTML are the
|
|
<code title="attr-style"><a href="#the-style-attribute">style</a></code> attribute and the
|
|
<code><a href="#the-style-element">style</a></code> element. Use of the <code title="attr-style"><a href="#the-style-attribute">style</a></code> attribute is somewhat discouraged in
|
|
production environments, but it can be useful for rapid prototyping
|
|
(where its rules can be directly moved into a separate style sheet
|
|
later) and for providing specific styles in unusual cases where a
|
|
separate style sheet would be inconvenient. Similarly, the
|
|
<code><a href="#the-style-element">style</a></code> element can be useful in syndication or for
|
|
page-specific styles, but in general an external style sheet is
|
|
likely to be more convenient when the styles apply to multiple
|
|
pages.<p>It is also worth noting that some elements that were previously
|
|
presentational have been redefined in this specification to be
|
|
media-independent: <code><a href="#the-b-element">b</a></code>, <code><a href="#the-i-element">i</a></code>, <code><a href="#the-hr-element">hr</a></code>,
|
|
<code><a href="#the-s-element">s</a></code>, <code><a href="#the-small-element">small</a></code>, and <code><a href="#the-u-element">u</a></code>.<h4 id="syntax-errors"><span class="secno">1.9.2 </span>Syntax errors</h4><p><i>This section is non-normative.</i><p>The syntax of HTML is constrained to avoid a wide variety of
|
|
problems.<dl><dt>Unintuitive error-handling behavior</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Certain invalid syntax constructs, when parsed, result in DOM
|
|
trees that are highly unintuitive.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, the following markup fragment results in a DOM
|
|
with an <code><a href="#the-hr-element">hr</a></code> element that is an <em>earlier</em>
|
|
sibling of the corresponding <code><a href="#the-table-element">table</a></code> element:</p>
|
|
|
|
<pre class="bad"><table><hr>...</pre>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors with optional error recovery</dt>
|
|
|
|
<dd>
|
|
|
|
<p>To allow user agents to be used in controlled environments
|
|
without having to implement the more bizarre and convoluted error
|
|
handling rules, user agents are permitted to fail whenever
|
|
encountering a <a href="#parse-error">parse error</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors where the error-handling behavior is not compatible with streaming user agents</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Some error-handling behavior, such as the behavior for the
|
|
<code title=""><table><hr>...</code> example mentioned
|
|
above, are incompatible with streaming user agents (user agents
|
|
that process HTML files in one pass, without storing state). To
|
|
avoid interoperability problems with such user agents, any syntax
|
|
resulting in such behavior is considered invalid.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that can result in infoset coercion</dt>
|
|
|
|
<dd>
|
|
|
|
<p>When a user agent based on XML is connected to an HTML parser,
|
|
it is possible that certain invariants that XML enforces, such as
|
|
comments never containing two consecutive hyphens, will be
|
|
violated by an HTML file. Handling this can require that the
|
|
parser coerce the HTML DOM into an XML-compatible infoset. Most
|
|
syntax constructs that require such handling are considered
|
|
invalid.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that result in disproportionally poor performance</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Certain syntax constructs can result in disproportionally poor
|
|
performance. To discourage the use of such constructs, they are
|
|
typically made non-conforming.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, the following markup results in poor performance,
|
|
since all the unclosed <code><a href="#the-i-element">i</a></code> elements have to be
|
|
reconstructed in each paragraph, resulting in progressively more
|
|
elements in each paragraph:</p>
|
|
|
|
<pre class="bad"><p><i>He dreamt.
|
|
<p><i>He dreamt that he ate breakfast.
|
|
<p><i>Then lunch.
|
|
<p><i>And finally dinner.</pre>
|
|
|
|
<p>The resulting DOM for this fragment would be:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t3"><code>#text</code>: <span title="">He dreamt.</span></ul></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t3"><code>#text</code>: <span title="">He dreamt that he ate breakfast.</span></ul></ul></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t3"><code>#text</code>: <span title="">Then lunch.</span></ul></ul></ul></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t3"><code>#text</code>: <span title="">And finally dinner.</span></ul></ul></ul></ul></ul></ul></div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors involving fragile syntax constructs</dt>
|
|
|
|
<dd>
|
|
|
|
<p>There are syntax constructs that, for historical reasons, are
|
|
relatively fragile. To help reduce the number of users who
|
|
accidentally run into such problems, they are made
|
|
non-conforming.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, the parsing of certain named character references
|
|
in attributes happens even with the closing semicolon being
|
|
omitted. It is safe to include an ampersand followed by letters
|
|
that do not form a named character reference, but if the letters
|
|
are changed to a string that <em>does</em> form a named character
|
|
reference, they will be interpreted as that character instead.</p>
|
|
|
|
<p>In this fragment, the attribute's value is "<code title="">?bill&ted</code>":</p>
|
|
|
|
<pre class="bad"><a href="?bill&ted">Bill and Ted</a></pre>
|
|
|
|
<p>In the following fragment, however, the attribute's value is
|
|
actually "<code title="">?art©</code>", <em>not</em> the
|
|
intended "<code title="">?art&copy</code>", because even
|
|
without the final semicolon, "<code title="">&copy</code>" is
|
|
handled the same as "<code title="">&copy;</code>" and thus
|
|
gets interpreted as "<code title="">©</code>":</p>
|
|
|
|
<pre class="bad"><a href="?art&copy">Art and Copy</a></pre>
|
|
|
|
<p>To avoid this problem, all named character references are
|
|
required to end with a semicolon, and uses of named character
|
|
references without a semicolon are flagged as errors.</p>
|
|
|
|
<p>Thus, the correct way to express the above cases is as
|
|
follows:</p>
|
|
|
|
<pre><a href="?bill&ted">Bill and Ted</a> <!-- &ted is ok, since it's not a named character reference --></pre>
|
|
<pre><a href="?art&amp;copy">Art and Copy</a> <!-- the & has to be escaped, since &copy <em>is</em> a named character reference --></pre>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors involving known interoperability problems in legacy user agents</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Certain syntax constructs are known to cause especially subtle
|
|
or serious problems in legacy user agents, and are therefore
|
|
marked as non-conforming to help authors avoid them.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, this is why the U+0060 GRAVE ACCENT character (`)
|
|
is not allowed in unquoted attributes. In certain legacy user
|
|
agents, it is sometimes treated as a quote
|
|
character.</p>
|
|
|
|
</div>
|
|
|
|
<div class="example">
|
|
|
|
<p>Another example of this is the DOCTYPE, which is required to
|
|
trigger <a href="#no-quirks-mode">no-quirks mode</a>, because the behavior of
|
|
legacy user agents in <a href="#quirks-mode">quirks mode</a> is often largely
|
|
undocumented.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that risk exposing authors to security attacks</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Certain restrictions exist purely to avoid known security
|
|
problems.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, the restriction on using UTF-7 exists purely to
|
|
avoid authors falling prey to a known cross-site-scripting attack
|
|
using UTF-7.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Cases where the author's intent is unclear</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Markup where the author's intent is very unclear is often made
|
|
non-conforming. Correcting these errors early makes later
|
|
maintenance easier.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, it is unclear whether the author intended the
|
|
following to be an <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> heading or an <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>
|
|
heading:</p>
|
|
|
|
<pre class="bad"><h1>Contact details</h2></pre>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Cases that are likely to be typos</dt>
|
|
|
|
<dd>
|
|
|
|
<p>When a user makes a simple typo, it is helpful if the error can
|
|
be caught early, as this can save the author a lot of debugging
|
|
time. This specification therefore usually considers it an error
|
|
to use element names, attribute names, and so forth, that do not
|
|
match the names defined in this specification.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, if the author typed <code><capton></code>
|
|
instead of <code><caption></code>, this would be flagged as an
|
|
error and the author could correct the typo immediately.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that could interfere with new syntax in the future</dt>
|
|
|
|
<dd>
|
|
|
|
<p>In order to allow the language syntax to be extended in the
|
|
future, certain otherwise harmless features are disallowed.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, "attributes" in end tags are ignored currently,
|
|
but they are invalid, in case a future change to the language
|
|
makes use of that syntax feature without conflicting with
|
|
already-deployed (and valid!) content.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
</dl><p>Some authors find it helpful to be in the practice of always
|
|
quoting all attributes and always including all optional tags,
|
|
preferring the consistency derived from such custom over the minor
|
|
benefits of terseness afforded by making use of the flexibility of
|
|
the HTML syntax. To aid such authors, conformance checkers can
|
|
provide modes of operation wherein such conventions are
|
|
enforced.<h4 id="restrictions-on-content-models-and-on-attribute-values"><span class="secno">1.9.3 </span>Restrictions on content models and on attribute values</h4><p><i>This section is non-normative.</i><p>Beyond the syntax of the language, this specification also places
|
|
restrictions on how elements and attributes can be specified. These
|
|
restrictions are present for similar reasons:<dl><dt>Errors involving content with dubious semantics</dt>
|
|
|
|
<dd>
|
|
|
|
<p>To avoid misuse of elements with defined meanings, content
|
|
models are defined that restrict how elements can be nested when
|
|
such nestings would be of dubious value.</p>
|
|
|
|
<p class="example">For example, this specification disallows
|
|
nesting a <code><a href="#the-section-element">section</a></code> element inside a <code><a href="#the-kbd-element">kbd</a></code>
|
|
element, since it is highly unlikely for an author to indicate
|
|
that an entire section should be keyed in.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that involve a conflict in expressed semantics</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Similarly, to draw the author's attention to mistakes in the
|
|
use of elements, clear contradictions in the semantics expressed
|
|
are also considered conformance errors.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>In the fragments below, for example, the semantics are
|
|
nonsensical: a separator cannot simultaneously be a cell, nor can
|
|
a radio button be a progress bar.</p>
|
|
|
|
<pre class="bad"><hr role="cell"></pre>
|
|
<pre class="bad"><input type=radio role=progressbar></pre>
|
|
|
|
</div>
|
|
|
|
<p class="example">Another example is the restrictions on the
|
|
content models of the <code><a href="#the-ul-element">ul</a></code> element, which only allows
|
|
<code><a href="#the-li-element">li</a></code> element children. Lists by definition consist just
|
|
of zero or more list items, so if a <code><a href="#the-ul-element">ul</a></code> element
|
|
contains something other than an <code><a href="#the-li-element">li</a></code> element, it's not
|
|
clear what was meant.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Cases where the default styles are likely to lead to confusion</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Certain elements have default styles or behaviors that make
|
|
certain combinations likely to lead to confusion. Where these have
|
|
equivalent alternatives without this problem, the confusing
|
|
combinations are disallowed.</p>
|
|
|
|
<p class="example">For example, <code><a href="#the-div-element">div</a></code> elements are
|
|
rendered as block boxes, and <code><a href="#the-span-element">span</a></code> elements as inline
|
|
boxes. Putting a block box in an inline box is unnecessarily
|
|
confusing; since either nesting just <code><a href="#the-div-element">div</a></code> elements, or
|
|
nesting just <code><a href="#the-span-element">span</a></code> elements, or nesting
|
|
<code><a href="#the-span-element">span</a></code> elements inside <code><a href="#the-div-element">div</a></code> elements all
|
|
serve the same purpose as nesting a <code><a href="#the-div-element">div</a></code> element in a
|
|
<code><a href="#the-span-element">span</a></code> element, but only the latter involves a block
|
|
box in an inline box, the latter combination is disallowed.</p>
|
|
|
|
<p class="example">Another example would be the way
|
|
<a href="#interactive-content">interactive content</a> cannot be nested. For example, a
|
|
<code><a href="#the-button-element">button</a></code> element cannot contain a <code><a href="#the-textarea-element">textarea</a></code>
|
|
element. This is because the default behavior of such nesting
|
|
interactive elements would be highly confusing to users. Instead
|
|
of nesting these elements, they can be placed side by side.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that indicate a likely misunderstanding of the specification</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Sometimes, something is disallowed because allowing it would
|
|
likely cause author confusion.</p>
|
|
|
|
<p class="example">For example, setting the <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> attribute to the value
|
|
"<code title="">false</code>" is disallowed, because despite the
|
|
appearance of meaning that the element is enabled, it in fact
|
|
means that the element is <em>disabled</em> (what matters for
|
|
implementations is the presence of the attribute, not its
|
|
value).</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors involving limits that have been imposed merely to simplify the language</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Some conformance errors simplify the language that authors need
|
|
to learn.</p>
|
|
|
|
<p class="example">For example, the <code><a href="#the-area-element">area</a></code> element's
|
|
<code title="attr-area-shape"><a href="#attr-area-shape">shape</a></code> attribute, despite
|
|
accepting both <code title="attr-area-shape-keyword-circ"><a href="#attr-area-shape-keyword-circ">circ</a></code> and <code title="attr-area-shape-keyword-circle"><a href="#attr-area-shape-keyword-circle">circle</a></code> values in
|
|
practice as synonyms, disallows the use of the <code title="attr-area-shape-keyword-circ"><a href="#attr-area-shape-keyword-circ">circ</a></code> value, so as to
|
|
simplify tutorials and other learning aids. There would be no
|
|
benefit to allowing both, but it would cause extra confusion when
|
|
teaching the language.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that involve peculiarities of the parser</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Certain elements are parsed in somewhat eccentric ways
|
|
(typically for historical reasons), and their content model
|
|
restrictions are intended to avoid exposing the author to these
|
|
issues.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, a <code><a href="#the-form-element">form</a></code> element isn't allowed inside
|
|
<a href="#phrasing-content">phrasing content</a>, because when parsed as HTML, a
|
|
<code><a href="#the-form-element">form</a></code> element's start tag will imply a <code><a href="#the-p-element">p</a></code>
|
|
element's end tag. Thus, the following markup results in two
|
|
<a href="#paragraph" title="paragraph">paragraphs</a>, not one:</p>
|
|
|
|
<pre><p>Welcome. <form><label>Name:</label> <input></form></pre>
|
|
|
|
<p>It is parsed exactly like the following:</p>
|
|
|
|
<pre><p>Welcome. </p><form><label>Name:</label> <input></form></pre>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that would likely result in scripts failing in hard-to-debug ways</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Some errors are intended to help prevent script problems that
|
|
would be hard to debug.</p>
|
|
|
|
<p class="example">This is why, for instance, it is non-conforming
|
|
to have two <code title="attr-id"><a href="#the-id-attribute">id</a></code> attributes with the
|
|
same value. Duplicate IDs lead to the wrong element being
|
|
selected, with sometimes disastrous effects whose cause is hard to
|
|
determine.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that waste authoring time</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Some constructs are disallowed because historically they have
|
|
been the cause of a lot of wasted authoring time, and by
|
|
encouraging authors to avoid making them, authors can save time in
|
|
future efforts.</p>
|
|
|
|
<p class="example">For example, a <code><a href="#the-script-element">script</a></code> element's
|
|
<code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute causes the
|
|
element's contents to be ignored. However, this isn't obvious,
|
|
especially if the element's contents appear to be executable
|
|
script — which can lead to authors spending a lot of time
|
|
trying to debug the inline script without realizing that it is not
|
|
executing. To reduce this problem, this specification makes it
|
|
non-conforming to have executable script in a <code><a href="#the-script-element">script</a></code>
|
|
element when the <code title="attr-script-src"><a href="#attr-script-src">src</a></code>
|
|
attribute is present. This means that authors who are validating
|
|
their documents are less likely to waste time with this kind of
|
|
mistake.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that involve areas that affect authors migrating to and from XHTML</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Some authors like to write files that can be interpreted as
|
|
both XML and HTML with similar results. Though this practice is
|
|
discouraged in general due to the myriad of subtle complications
|
|
involved (especially when involving scripting, styling, or any
|
|
kind of automated serialization), this specification has a few
|
|
restrictions intended to at least somewhat mitigate the
|
|
difficulties. This makes it easier for authors to use this as a
|
|
transitionary step when migrating between HTML and XHTML.</p>
|
|
|
|
<p class="example">For example, there are somewhat complicated
|
|
rules surrounding the <code title="attr-lang"><a href="#attr-lang">lang</a></code> and
|
|
<code title="attr-xml-lang"><a href="#attr-xml-lang">xml:lang</a></code> attributes intended
|
|
to keep the two synchronized.</p>
|
|
|
|
<p class="example">Another example would be the restrictions on
|
|
the values of <code title="">xmlns</code> attributes in the HTML
|
|
serialization, which are intended to ensure that elements in
|
|
conforming documents end up in the same namespaces whether
|
|
processed as HTML or XML.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that involve areas reserved for future expansion</dt>
|
|
|
|
<dd>
|
|
|
|
<p>As with the restrictions on the syntax intended to allow for
|
|
new syntax in future revisions of the language, some restrictions
|
|
on the content models of elements and values of attributes are
|
|
intended to allow for future expansion of the HTML vocabulary.</p>
|
|
|
|
<p class="example">For example, limiting the values of the <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code> attribute that start
|
|
with an U+005F LOW LINE character (_) to only specific predefined
|
|
values allows new predefined values to be introduced at a future
|
|
time without conflicting with author-defined values.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Errors that indicate a mis-use of other specifications</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Certain restrictions are intended to support the restrictions
|
|
made by other specifications.</p>
|
|
|
|
<p class="example">For example, requiring that attributes that
|
|
take media queries use only <em>valid</em> media queries
|
|
reinforces the importance of following the conformance rules of
|
|
that specification.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h3 id="recommended-reading"><span class="secno">1.10 </span>Recommended reading</h3><p><i>This section is non-normative.</i><p>The following documents might be of interest to readers of this
|
|
specification.<dl><dt><cite>Character Model for the World Wide Web 1.0: Fundamentals</cite> <a href="#refsCHARMOD">[CHARMOD]</a></dt>
|
|
|
|
<dd><blockquote><p>This Architectural Specification provides
|
|
authors of specifications, software developers, and content
|
|
developers with a common reference for interoperable text
|
|
manipulation on the World Wide Web, building on the Universal
|
|
Character Set, defined jointly by the Unicode Standard and ISO/IEC
|
|
10646. Topics addressed include use of the terms 'character',
|
|
'encoding' and 'string', a reference processing model, choice and
|
|
identification of character encodings, character escaping, and
|
|
string indexing.</blockquote></dd>
|
|
|
|
<dt><cite>Unicode Security Considerations</cite> <a href="#refsUTR36">[UTR36]</a></dt>
|
|
|
|
<dd><blockquote><p>Because Unicode contains such a large number of
|
|
characters and incorporates the varied writing systems of the
|
|
world, incorrect usage can expose programs or systems to possible
|
|
security attacks. This is especially important as more and more
|
|
products are internationalized. This document describes some of the
|
|
security considerations that programmers, system analysts,
|
|
standards developers, and users should take into account, and
|
|
provides specific recommendations to reduce the risk of
|
|
problems.</blockquote></dd>
|
|
|
|
<dt><cite>Web Content Accessibility Guidelines (WCAG) 2.0</cite> <a href="#refsWCAG">[WCAG]</a></dt>
|
|
|
|
<dd><blockquote><p>Web Content Accessibility Guidelines (WCAG) 2.0
|
|
covers a wide range of recommendations for making Web content more
|
|
accessible. Following these guidelines will make content accessible
|
|
to a wider range of people with disabilities, including blindness
|
|
and low vision, deafness and hearing loss, learning disabilities,
|
|
cognitive limitations, limited movement, speech disabilities,
|
|
photosensitivity and combinations of these. Following these
|
|
guidelines will also often make your Web content more usable to
|
|
users in general.</blockquote></dd>
|
|
|
|
<dt class="impl"><cite>Authoring Tool Accessibility Guidelines (ATAG) 2.0</cite> <a href="#refsATAG">[ATAG]</a></dt>
|
|
|
|
<dd class="impl"><blockquote><p>This specification provides
|
|
guidelines for designing Web content authoring tools that are more
|
|
accessible for people with disabilities. An authoring tool that
|
|
conforms to these guidelines will promote accessibility by
|
|
providing an accessible user interface to authors with disabilities
|
|
as well as by enabling, supporting, and promoting the production of
|
|
accessible Web content by all authors.</blockquote></dd>
|
|
|
|
<dt class="impl"><cite>User Agent Accessibility Guidelines (UAAG) 2.0</cite> <a href="#refsUAAG">[UAAG]</a></dt>
|
|
|
|
<dd class="impl"><blockquote><p>This document provides guidelines
|
|
for designing user agents that lower barriers to Web accessibility
|
|
for people with disabilities. User agents include browsers and
|
|
other types of software that retrieve and render Web content. A
|
|
user agent that conforms to these guidelines will promote
|
|
accessibility through its own user interface and through other
|
|
internal facilities, including its ability to communicate with
|
|
other technologies (especially assistive
|
|
technologies). Furthermore, all users, not just users with
|
|
disabilities, should find conforming user agents to be more
|
|
usable.</blockquote></dd>
|
|
|
|
<dt><cite>Polyglot Markup: HTML-Compatible XHTML Documents</cite> <a href="#refsPOLYGLOT">[POLYGLOT]</a></dt>
|
|
|
|
<dd><blockquote><p>A document that uses polyglot markup is a document
|
|
that is a stream of bytes that parses into identical document trees
|
|
(with the exception of the xmlns attribute on the root element)
|
|
when processed as HTML and when processed as XML. Polyglot markup
|
|
that meets a well defined set of constraints is interpreted as
|
|
compatible, regardless of whether they are processed as HTML or as
|
|
XHTML, per the HTML5 specification. Polyglot markup uses a specific
|
|
DOCTYPE, namespace declarations, and a specific case —
|
|
normally lower case but occasionally camel case — for element
|
|
and attribute names. Polyglot markup uses lower case for certain
|
|
attribute values. Further constraints include those on empty
|
|
elements, named entity references, and the use of scripts and
|
|
style.</blockquote></dd>
|
|
|
|
<dt><cite>HTML to Platform Accessibility APIs Implementation Guide</cite> <a href="#refsHPAAIG">[HPAAIG]</a></dt>
|
|
|
|
<dd><blockquote><p>This is draft documentation mapping HTML
|
|
elements and attributes to accessibility API Roles, States and
|
|
Properties on a variety of platforms. It provides recommendations
|
|
on deriving the accessible names and descriptions for HTML
|
|
elements. It also provides accessible feature implementation
|
|
examples.</blockquote></dd>
|
|
|
|
</dl><h2 id="infrastructure"><span class="secno">2 </span>Common infrastructure</h2><h3 id="terminology"><span class="secno">2.1 </span>Terminology</h3><p>This specification refers to both HTML and XML attributes and IDL
|
|
attributes, often in the same context. When it is not clear which is
|
|
being referred to, they are referred to as <dfn title="">content
|
|
attributes</dfn> for HTML and XML attributes, and <dfn title="">IDL
|
|
attributes</dfn> for those defined on IDL interfaces. Similarly, the
|
|
term "properties" is used for both JavaScript object properties and
|
|
CSS properties. When these are ambiguous they are qualified as <dfn title="">object properties</dfn> and <dfn title="">CSS
|
|
properties</dfn> respectively.<p>Generally, when the specification states that a feature applies
|
|
to <a href="#syntax">the HTML syntax</a> or <a href="#the-xhtml-syntax">the XHTML syntax</a>, 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>This specification uses the term <dfn title="">document</dfn> 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>For simplicity, terms such as <dfn title="">shown</dfn>, <dfn title="">displayed</dfn>, and <dfn title="">visible</dfn> 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.<div class="impl">
|
|
|
|
<p>When an algorithm B says to return to another algorithm A, it
|
|
implies that A called B. Upon returning to A, the implementation
|
|
must continue from where it left off in calling B.</p>
|
|
|
|
</div><p>The term "transparent black" refers to the color with red, green,
|
|
blue, and alpha channels all set to zero.<h4 id="resources"><span class="secno">2.1.1 </span>Resources</h4><p>The specification uses the term <dfn title="">supported</dfn>
|
|
when referring to whether a user agent has an implementation capable
|
|
of decoding the semantics of an external resource. A format or type
|
|
is said to be <i>supported</i> if the implementation can process an
|
|
external resource of that format or type without critical aspects of
|
|
the resource being ignored. Whether a specific resource is
|
|
<i>supported</i> can depend on what features of the resource's
|
|
format are in use.<p class="example">For example, a PNG image would be considered to
|
|
be in a supported format if its pixel data could be decoded and
|
|
rendered, even if, unbeknownst to the implementation, the image also
|
|
contained animation data.<p class="example">A MPEG4 video file would not be considered to be
|
|
in a supported format if the compression format used was not
|
|
supported, even if the implementation could determine the dimensions
|
|
of the movie from the file's metadata.<p>What some specifications, in particular the HTTP and URI
|
|
specifications, refer to as a <i>representation</i> is referred to
|
|
in this specification as a <dfn title="">resource</dfn>. <a href="#refsHTTP">[HTTP]</a> <a href="#refsRFC3986">[RFC3986]</a><p>The term <dfn id="mime-type">MIME type</dfn> is used to refer to what is
|
|
sometimes called an <i>Internet media type</i> in protocol
|
|
literature. The term <i>media type</i> in this specification is used
|
|
to refer to the type of media intended for presentation, as used by
|
|
the CSS specifications. <a href="#refsRFC2046">[RFC2046]</a> <a href="#refsMQ">[MQ]</a><p>A string is a <dfn id="valid-mime-type">valid MIME type</dfn> if it matches the <code title="">media-type</code> rule defined in section 3.7 "Media Types"
|
|
of RFC 2616. In particular, a <a href="#valid-mime-type">valid MIME type</a> may
|
|
include MIME type parameters. <a href="#refsHTTP">[HTTP]</a><p>A string is a <dfn id="valid-mime-type-with-no-parameters">valid MIME type with no parameters</dfn> if it
|
|
matches the <code title="">media-type</code> rule defined in section
|
|
3.7 "Media Types" of RFC 2616, but does not contain any U+003B
|
|
SEMICOLON characters (;). In other words, if it consists only of a
|
|
type and subtype, with no MIME Type parameters. <a href="#refsHTTP">[HTTP]</a><p>The term <dfn id="html-mime-type">HTML MIME type</dfn> is used to refer to the <a href="#mime-type" title="MIME type">MIME types</a> <code><a href="#text-html">text/html</a></code> and
|
|
<code><a href="#text-html-sandboxed">text/html-sandboxed</a></code>.<p>A resource's <dfn id="critical-subresources">critical subresources</dfn> are those that the
|
|
resource needs to have available to be correctly processed. Which
|
|
resources are considered critical or not is defined by the
|
|
specification that defines the resource's format. For CSS resources,
|
|
only <code title="">@import</code> rules introduce <a href="#critical-subresources">critical
|
|
subresources</a>; other resources, e.g. fonts or backgrounds, are
|
|
not.<p>The term <dfn id="data-protocol" title="data protocol"><code title="">data:</code>
|
|
URL</dfn> refers to <a href="#url" title="URL">URLs</a> that use the <code title="">data:</code> scheme. <a href="#refsRFC2397">[RFC2397]</a><h4 id="xml"><span class="secno">2.1.2 </span>XML</h4><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="html-elements">HTML
|
|
elements</dfn>", when used in this specification, refers to any
|
|
element in that namespace, and thus refers to both HTML and XHTML
|
|
elements.<p>Except where 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.<p>Attribute names are said to be <dfn id="xml-compatible">XML-compatible</dfn> if they
|
|
match the <a href="http://www.w3.org/TR/REC-xml/#NT-Name"><code title="">Name</code></a> production defined in XML, they contain no
|
|
U+003A COLON characters (:), and their first three characters are
|
|
not an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string
|
|
"<code title="">xml</code>". <a href="#refsXML">[XML]</a><p>The term <dfn id="xml-mime-type">XML MIME type</dfn> is used to refer to the <a href="#mime-type" title="MIME type">MIME types</a> <code title="">text/xml</code>,
|
|
<code title="">application/xml</code>, and any <a href="#mime-type">MIME
|
|
type</a> whose subtype ends with the four characters "<code title="">+xml</code>". <a href="#refsRFC3023">[RFC3023]</a><h4 id="dom-trees"><span class="secno">2.1.3 </span>DOM trees</h4><p>The <dfn id="root-element-of-a-document-object">root element of a <code>Document</code> object</dfn> is
|
|
that <code><a href="#document">Document</a></code>'s first element child, if any. If it does
|
|
not have one then the <code><a href="#document">Document</a></code> has no root element.<p>The term <dfn id="root-element">root element</dfn>, when not referring to a
|
|
<code><a href="#document">Document</a></code> object's root element, means the furthest
|
|
ancestor element node of whatever node is being discussed, or the
|
|
node itself if it has no ancestors. When the node is a part of the
|
|
document, then the node's <a href="#root-element">root element</a> is indeed the
|
|
document's root element; however, if the node is not currently part
|
|
of the document tree, the root element will be an orphaned node.<p>When an element's <a href="#root-element">root element</a> is the <a href="#root-element-of-a-document-object">root
|
|
element of a <code>Document</code> object</a>, it is said to be
|
|
<dfn id="in-a-document">in a <code>Document</code></dfn>. An element is said to have
|
|
been <dfn id="insert-an-element-into-a-document" title="insert an element into a document">inserted into a
|
|
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>. Analogously, an element is
|
|
said to have been <dfn id="remove-an-element-from-a-document" title="remove an element from a
|
|
document">removed from a document</dfn> when its <a href="#root-element">root
|
|
element</a> changes from being the document's <a href="#root-element">root
|
|
element</a> to being another element.<p>A node's <dfn id="home-subtree">home subtree</dfn> is the subtree rooted at that
|
|
node's <a href="#root-element">root element</a>. When a node is <a href="#in-a-document">in a
|
|
<code>Document</code></a>, its <a href="#home-subtree">home subtree</a> is that
|
|
<code><a href="#document">Document</a></code>'s tree.<p>The <code><a href="#document">Document</a></code> of a <code><a href="#node">Node</a></code> (such as an
|
|
element) is the <code><a href="#document">Document</a></code> that the <code><a href="#node">Node</a></code>'s
|
|
<code title="dom-Node-ownerDocument"><a href="#dom-node-ownerdocument">ownerDocument</a></code> IDL
|
|
attribute returns. When a <code><a href="#node">Node</a></code> is <a href="#in-a-document">in a
|
|
<code>Document</code></a> then that <code><a href="#document">Document</a></code> is
|
|
always the <code><a href="#node">Node</a></code>'s <code><a href="#document">Document</a></code>, and the
|
|
<code><a href="#node">Node</a></code>'s <code title="dom-Node-ownerDocument"><a href="#dom-node-ownerdocument">ownerDocument</a></code> IDL attribute
|
|
thus always returns that <code><a href="#document">Document</a></code>.<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="dom-Node-parentNode"><a href="#dom-node-parentnode">parentNode</a></code>/<code title="dom-Node-childNodes"><a href="#dom-node-childnodes">childNodes</a></code> relationship).<p>When it is stated that some element or attribute is <dfn id="ignore" 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. <span class="impl">A
|
|
user agent must not mutate the DOM in such situations.</span><p>The term <dfn id="text-node">text node</dfn> refers to any <code><a href="#text">Text</a></code>
|
|
node, including <code><a href="#cdatasection">CDATASection</a></code> nodes; specifically, any
|
|
<code><a href="#node">Node</a></code> with node type <code title="">TEXT_NODE</code> (3)
|
|
or <code title="">CDATA_SECTION_NODE</code> (4). <a href="#refsDOMCORE">[DOMCORE]</a><p>A content attribute is said to <dfn title="">change</dfn> value
|
|
only if its new value is different than its previous value; setting
|
|
an attribute to a value it already has does not change it.<p>The term <dfn title="">empty</dfn>, when used of an attribute
|
|
value, text node, or string, means that the length of the text is
|
|
zero (i.e. not even containing spaces or control characters).<p>Nodes can be <dfn id="concept-clone" title="concept-clone">cloned</dfn>, as
|
|
described in the DOM Core specification. For example, the <code title="dom-cloneNode">cloneNode()</code> and <code title="dom-importNode">importNode()</code> methods of the
|
|
<code><a href="#node">Node</a></code> interface both clone nodes, as do a number of
|
|
algorithms in this specification. Certain <a href="#html-elements">HTML elements</a>
|
|
(in particular, <code><a href="#the-input-element">input</a></code> and <code><a href="#the-script-element">script</a></code>) apply
|
|
additional requirements on how they are cloned. <a href="#refsDOMCORE">[DOMCORE]</a><h4 id="scripting-0"><span class="secno">2.1.4 </span>Scripting</h4><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>An IDL attribute is said to be <dfn title="">getting</dfn> when
|
|
its value is being retrieved (e.g. by author script), and is said to
|
|
be <dfn title="">setting</dfn> when a new value is assigned to
|
|
it.<p>If a DOM object is said to be <dfn id="live">live</dfn>, then the
|
|
attributes and methods on that object <span class="impl">must</span>
|
|
operate on the actual underlying data, not a snapshot of the
|
|
data.<p>The terms <dfn title="">fire</dfn> and <dfn title="">dispatch</dfn> are used interchangeably in the context of
|
|
events, as in the DOM Events specifications. The term <dfn id="concept-events-trusted" title="concept-events-trusted">trusted event</dfn> is used as
|
|
defined by the DOM Events specification. <a href="#refsDOMEVENTS">[DOMEVENTS]</a><h4 id="plugins"><span class="secno">2.1.5 </span>Plugins</h4><p>The term <dfn id="plugin">plugin</dfn> refers to a user-agent defined set of
|
|
content handlers used by the user agent that can take part in the
|
|
user agent's rendering of a <code><a href="#document">Document</a></code> object, but that
|
|
neither act as <a href="#child-browsing-context" title="child browsing context">child browsing
|
|
contexts</a> of the <code><a href="#document">Document</a></code> nor introduce any
|
|
<code><a href="#node">Node</a></code> objects to the <code><a href="#document">Document</a></code>'s DOM.<p>Typically such content handlers are provided by third parties,
|
|
though a user agent can also designate built-in content handlers as
|
|
plugins.<div class="impl">
|
|
|
|
<p>A user agent must not consider the types <code>text/plain</code>
|
|
and <code>application/octet-stream</code> as having a registered
|
|
<a href="#plugin">plugin</a>.</p>
|
|
</div><p class="example">One example of a plugin would be a PDF viewer
|
|
that is instantiated in a <a href="#browsing-context">browsing context</a> 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.<p class="note">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. Indeed, this
|
|
specification doesn't require user agents to support plugins at all.
|
|
<a href="#refsNPAPI">[NPAPI]</a><div class="impl">
|
|
|
|
<p class="warning">Browsers should take extreme care when
|
|
interacting with external content intended for <a href="#plugin" title="plugin">plugins</a>. 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.</p>
|
|
|
|
</div><h4 id="character-encodings"><span class="secno">2.1.6 </span>Character encodings</h4><p>The <dfn id="preferred-mime-name">preferred MIME name</dfn> of a character encoding is the
|
|
name or alias labeled as "preferred MIME name" in the IANA
|
|
<cite>Character Sets</cite> registry, if there is one, or the
|
|
encoding's name, if none of the aliases are so labeled. <a href="#refsIANACHARSET">[IANACHARSET]</a><p>An <dfn id="ascii-compatible-character-encoding">ASCII-compatible character encoding</dfn> is a
|
|
single-byte or variable-length encoding in which the bytes 0x09,
|
|
0x0A, 0x0C, 0x0D, 0x20 - 0x22, 0x26, 0x27, 0x2C - 0x3F, 0x41 - 0x5A,
|
|
and 0x61 - 0x7A, ignoring bytes that
|
|
are the second and later bytes of multibyte sequences, all
|
|
correspond to single-byte sequences that map to the same Unicode
|
|
characters as those bytes in ANSI_X3.4-1968 (US-ASCII). <a href="#refsRFC1345">[RFC1345]</a><p class="note">This includes such encodings as Shift_JIS,
|
|
HZ-GB-2312, and variants of ISO-2022, even though it is possible in
|
|
these encodings for bytes like 0x70 to be part of longer sequences
|
|
that are unrelated to their interpretation as ASCII. It excludes
|
|
such encodings as UTF-7, UTF-16, GSM03.38, and EBCDIC variants.</p><p>The term <dfn title="">Unicode character</dfn> is used to mean a
|
|
<i title="">Unicode scalar value</i> (i.e. any Unicode code point
|
|
that is not a surrogate code point). <a href="#refsUNICODE">[UNICODE]</a><h3 id="conformance-requirements"><span class="secno">2.2 </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>The key words "MUST", "MUST NOT", "REQUIRED", "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="#refsRFC2119">[RFC2119]</a><div class="impl">
|
|
|
|
<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>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>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="conformance-classes"><span class="secno">2.2.1 </span>Conformance classes</h4>
|
|
|
|
<p>This specification describes the conformance criteria for <span class="impl">user agents (relevant to implementors) and</span>
|
|
documents<span class="impl"> (relevant to authors and authoring tool
|
|
implementors)</span>.</p>
|
|
|
|
<p><dfn id="conforming-html5-documents">Conforming
|
|
HTML5
|
|
documents</dfn> are those that comply with all
|
|
the conformance criteria for documents. For readability, some of
|
|
these conformance requirements are phrased as conformance
|
|
requirements on authors; such requirements are implicitly
|
|
requirements on documents: by definition, all documents are assumed
|
|
to have had an author. (In some cases, that author may itself be a
|
|
user agent — such user agents are subject to additional rules,
|
|
as explained below.)</p>
|
|
|
|
<p class="example">For example, if a requirement states that
|
|
"authors must not use the <code title="">foobar</code> element", it
|
|
would imply that documents are not allowed to contain elements named
|
|
<code title="">foobar</code>.</p>
|
|
|
|
<p class="note">the conformance requirements for documents include
|
|
syntax (the <table> element is conforming as a child of
|
|
<body>, but not as a child ot <title>), and semantics (the
|
|
<table> elements denotes a multi-dimensional data table, not a
|
|
piece of furniture).</p>
|
|
|
|
<p class="note impl">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="#the-xhtml-syntax">the XHTML syntax</a> must
|
|
process elements and attributes from the <a href="#html-namespace-0">HTML
|
|
namespace</a> found in XML documents 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="#the-script-element">script</a></code> element in an XML document,
|
|
execute the script contained in that element. However, if the
|
|
element is found within a transformation expressed in XSLT
|
|
(assuming the user agent also supports XSLT), then the processor
|
|
would instead treat the <code><a href="#the-script-element">script</a></code> element as an opaque
|
|
element that forms part of the transform.</p>
|
|
|
|
<p>Web browsers that support <a href="#syntax">the HTML syntax</a> must
|
|
process documents labeled with an <a href="#html-mime-type">HTML MIME type</a> as
|
|
described in this specification, so that users can interact with
|
|
them.</p>
|
|
|
|
<p>User agents that support scripting must also be conforming
|
|
implementations of the IDL fragments in this specification, as
|
|
described in the Web IDL specification. <a href="#refsWEBIDL">[WEBIDL]</a></p>
|
|
|
|
<p class="note">Unless explicitly stated, specifications that
|
|
override the semantics of HTML elements do not override the
|
|
requirements on DOM objects representing those elements. For
|
|
example, the <code><a href="#the-script-element">script</a></code> element in the example above
|
|
would still implement the <code><a href="#htmlscriptelement">HTMLScriptElement</a></code>
|
|
interface.</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 id="renderingUA">Visual user agents that support the suggested default rendering</dt>
|
|
|
|
<dd>
|
|
|
|
<p>User agents, whether interactive or not, may be designated
|
|
(possibly as a user option) as supporting the suggested default
|
|
rendering defined by this specification.</p>
|
|
|
|
<p>User agents that are designated as supporting the suggested
|
|
default rendering must implement the rules in <a href="#rendering">the rendering section</a> that that section
|
|
defines as the behavior that user agents are <em>expected</em> to
|
|
implement.</p>
|
|
|
|
</dd>
|
|
|
|
<dt id="non-scripted">User agents with no scripting support</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Implementations that do not support scripting (or which have
|
|
their scripting features disabled entirely) 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. Automated conformance 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="#the-blockquote-element">blockquote</a></code> element is not a quote,
|
|
conformance checkers running without the input of human judgement
|
|
do not have to check that <code><a href="#the-blockquote-element">blockquote</a></code> elements only
|
|
contain quoted material).</p>
|
|
|
|
<p>Conformance checkers must check that the input document
|
|
conforms when parsed without a <a href="#browsing-context">browsing context</a>
|
|
(meaning that no scripts are run, and that the parser's
|
|
<a href="#scripting-flag">scripting flag</a> is disabled), and should also check
|
|
that the input document conforms when parsed with a <a href="#browsing-context">browsing
|
|
context</a> in which scripts execute, and that the scripts
|
|
never cause non-conforming states to occur other than transiently
|
|
during script execution itself. (This is only a "SHOULD" and not a
|
|
"MUST" requirement because it has been proven to be impossible. <a href="#refsCOMPUTABLE">[COMPUTABLE]</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 with 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
|
|
<a href="#conforming-html5-documents">conforming
|
|
HTML5
|
|
documents</a>. 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. However, authoring tools must not automatically misuse
|
|
elements or encourage their users to do so.</p>
|
|
|
|
<p class="example">For example, it is not conforming to use an
|
|
<code><a href="#the-address-element">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 tool is likely unable to determine the difference, an
|
|
authoring tool is exempt from that requirement. This does not
|
|
mean, though, that authoring tools can use <code><a href="#the-address-element">address</a></code>
|
|
elements for any block of italics text (for instance); it just
|
|
means that the authoring tool doesn't have to verify that when the
|
|
user uses a tool for inserting contact information for a section,
|
|
that the user really is doing that and not inserting something
|
|
else instead.</p>
|
|
|
|
<p class="note">In terms of conformance checking, an editor has 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 erroneous
|
|
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 legitimate. WYSIWYG tools should use
|
|
elements they know are appropriate, and should not use elements
|
|
that they do not know to be appropriate. This might in certain
|
|
extreme cases mean limiting the use of flow elements to just a few
|
|
elements, like <code><a href="#the-div-element">div</a></code>, <code><a href="#the-b-element">b</a></code>, <code><a href="#the-i-element">i</a></code>,
|
|
and <code><a href="#the-span-element">span</a></code> and making liberal use of the <code title="attr-style"><a href="#the-style-attribute">style</a></code> attribute.</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 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 <a href="#the-xhtml-syntax">the XHTML syntax</a>), and one using a <a href="#writing">custom format</a> inspired by SGML (referred to as
|
|
<a href="#syntax">the HTML syntax</a>). Implementations must support at least
|
|
one of these two formats, although supporting both is
|
|
encouraged.</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. 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.</p>
|
|
|
|
<p>Some conformance requirements are phrased as requirements on
|
|
elements, attributes, methods or objects. Such requirements fall
|
|
into two categories: those describing content model restrictions,
|
|
and those describing implementation behavior. Those in the former
|
|
category are requirements on documents and authoring tools. Those in
|
|
the second category are requirements on user agents. Similarly, some
|
|
conformance requirements are phrased as requirements on authors;
|
|
such requirements are to be interpreted as conformance requirements
|
|
on the documents that authors produce. (In other words, this
|
|
specification does not distinguish between conformance criteria on
|
|
authors and conformance criteria on documents.)</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="dependencies"><span class="secno">2.2.2 </span>Dependencies</h4>
|
|
|
|
<p>This specification relies on several other underlying
|
|
specifications.</p>
|
|
|
|
<dl><dt>XML</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Implementations that support <a href="#the-xhtml-syntax">the XHTML syntax</a> must
|
|
support some version of XML, as well as its corresponding
|
|
namespaces specification, because that syntax uses an XML
|
|
serialization with namespaces. <a href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt>DOM</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The Document Object Model (DOM) is a representation — a
|
|
model — of a document and its content. 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.
|
|
<a href="#refsDOMCORE">[DOMCORE]</a></p>
|
|
|
|
<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="#refsDOMCORE">[DOMCORE]</a> <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
<p>In particular, the following features are defined in the DOM
|
|
Core specification: <a href="#refsDOMCORE">[DOMCORE]</a></p>
|
|
|
|
<ul class="brief"><li><dfn id="attr"><code>Attr</code></dfn> interface</li>
|
|
<li><dfn id="cdatasection"><code>CDATASection</code></dfn> interface</li>
|
|
<li><dfn id="comment-0"><code>Comment</code></dfn> interface</li>
|
|
<li><dfn id="domimplementation"><code>DOMImplementation</code></dfn> interface</li>
|
|
<li><dfn id="document"><code>Document</code></dfn> interface</li>
|
|
<li><dfn id="documentfragment"><code>DocumentFragment</code></dfn> interface</li>
|
|
<li><dfn id="documenttype"><code>DocumentType</code></dfn> interface</li>
|
|
<li><dfn id="domexception"><code>DOMException</code></dfn> interface</li>
|
|
<li><dfn id="element"><code>Element</code></dfn> interface</li>
|
|
<li><dfn id="node"><code>Node</code></dfn> interface</li>
|
|
<li><dfn id="nodelist"><code>NodeList</code></dfn> interface</li>
|
|
<li><dfn id="processinginstruction"><code>ProcessingInstruction</code></dfn> interface</li>
|
|
<li><dfn id="text"><code>Text</code></dfn> interface</li>
|
|
|
|
<li><dfn id="dom-domimplementation-createdocument" title="dom-DOMImplementation-createDocument"><code>createDocument()</code></dfn> method</li>
|
|
<li><dfn id="dom-document-createelement" title="dom-Document-createElement"><code>createElement()</code></dfn> method</li>
|
|
<li><dfn id="dom-document-createelementns" title="dom-Document-createElementNS"><code>createElementNS()</code></dfn> method</li>
|
|
<li><dfn id="dom-document-getelementbyid" title="dom-Document-getElementById"><code>getElementById()</code></dfn> method</li>
|
|
<li><dfn id="dom-node-insertbefore" title="dom-Node-insertBefore"><code>insertBefore()</code></dfn> method</li>
|
|
|
|
<li><dfn id="dom-node-ownerdocument" title="dom-Node-ownerDocument"><code>ownerDocument</code></dfn> attribute</li>
|
|
<li><dfn id="dom-node-childnodes" title="dom-Node-childNodes"><code>childNodes</code></dfn> attribute</li>
|
|
<li><dfn id="dom-node-localname" title="dom-Node-localName"><code>localName</code></dfn> attribute</li>
|
|
<li><dfn id="dom-node-parentnode" title="dom-Node-parentNode"><code>parentNode</code></dfn> attribute</li>
|
|
<li><dfn id="dom-node-namespaceuri" title="dom-Node-namespaceURI"><code>namespaceURI</code></dfn> attribute</li>
|
|
<li><dfn id="dom-element-tagname" title="dom-Element-tagName"><code>tagName</code></dfn> attribute</li>
|
|
<li><dfn id="textcontent"><code>textContent</code></dfn> attribute</li>
|
|
|
|
</ul><p>The following features are defined in the DOM Events
|
|
specification: <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
<ul class="brief"><li><dfn id="event"><code>Event</code></dfn> interface</li>
|
|
<li><dfn id="eventtarget"><code>EventTarget</code></dfn> interface</li>
|
|
<li><dfn id="uievent"><code>UIEvent</code></dfn> interface</li>
|
|
<li><dfn id="mouseevent"><code>MouseEvent</code></dfn> interface</li>
|
|
|
|
<li><dfn id="event-click" title="event-click"><code>click</code></dfn> event</li>
|
|
|
|
<li><dfn id="dom-event-target" title="dom-Event-target"><code>target</code></dfn> attribute</li>
|
|
|
|
</ul></dd>
|
|
|
|
<dt>File API</dt>
|
|
|
|
<dd>
|
|
|
|
<p>This specification uses the following interfaces defined in the
|
|
File API specification: <a href="#refsFILEAPI">[FILEAPI]</a></p>
|
|
|
|
<ul class="brief"><li><dfn id="blob">Blob</dfn></li>
|
|
<li><dfn id="file">File</dfn></li>
|
|
<li><dfn id="filelist">FileList</dfn></li>
|
|
|
|
</ul></dd>
|
|
|
|
<dt>Web IDL</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The IDL fragments in this specification must be interpreted as
|
|
required for conforming IDL fragments, as described in the Web IDL
|
|
specification. <a href="#refsWEBIDL">[WEBIDL]</a></p>
|
|
|
|
<p>The terms <dfn id="supported-property-indices">supported property indices</dfn> and
|
|
<dfn id="supported-property-names">supported property names</dfn> are used as defined in the
|
|
WebIDL specification.</p>
|
|
|
|
<p id="float-nan">Except where otherwise specified, if an IDL
|
|
attribute that is a floating point number type (<code title="">double</code>) is assigned an Infinity or Not-a-Number
|
|
(NaN) value, a <code><a href="#not_supported_err">NOT_SUPPORTED_ERR</a></code> exception must be
|
|
raised.</p>
|
|
|
|
<p>Except where otherwise specified, if a method with an argument
|
|
that is a floating point number type (<code title="">double</code>)
|
|
is passed an Infinity or Not-a-Number (NaN) value, a
|
|
<code><a href="#not_supported_err">NOT_SUPPORTED_ERR</a></code> exception must be raised.</p>
|
|
|
|
<p>Except where otherwise specified, if a method has an argument
|
|
of type <code>DOMString</code>, or if an IDL attribute is assigned
|
|
a new value of type <code>DOMString</code>, the user agent must
|
|
<span title="dfn-obtain-unicode">convert the
|
|
<code>DOMString</code> to a sequence of Unicode characters</span>
|
|
to obtain the string on which the algorithms in this specification
|
|
are to operate. <a href="#refsWEBIDL">[WEBIDL]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt>JavaScript</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Some parts of the language described by this specification only
|
|
support JavaScript as the underlying scripting language. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
<p class="note">The term "JavaScript" is used to refer to ECMA262,
|
|
rather than the official term ECMAScript, since the term
|
|
JavaScript is more widely known. Similarly, the <a href="#mime-type">MIME
|
|
type</a> used to refer to JavaScript in this specification is
|
|
<code title="">text/javascript</code>, since that is the most
|
|
commonly used type, <a href="#willful-violation" title="willful violation">despite it
|
|
being an officially obsoleted type</a> according to RFC
|
|
4329. <a href="#refsRFC4329">[RFC4329]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt>Media Queries</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Implementations must support some version of the Media Queries
|
|
language. <a href="#refsMQ">[MQ]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt>URIs, IRIs, IDNA</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Implementations must support the semantics of <a href="#url" title="URL">URLs</a> defined in the URI and IRI specifications,
|
|
as well as the semantics of IDNA domain names defined in the
|
|
<cite>Internationalizing Domain Names in Applications
|
|
(IDNA)</cite> specification. <a href="#refsRFC3986">[RFC3986]</a>
|
|
<a href="#refsRFC3987">[RFC3987]</a> <a href="#refsRFC3490">[RFC3490]</a>
|
|
|
|
</dd>
|
|
|
|
<dt>CSS modules</dt>
|
|
|
|
<dd>
|
|
|
|
<p>While support for CSS as a whole is not required of
|
|
implementations of this specification (though it is encouraged, at
|
|
least for Web browsers), some features are defined in terms of
|
|
specific CSS requirements.</p>
|
|
|
|
<p>In particular, some features require that a string be
|
|
<dfn id="parsed-as-a-css-color-value">parsed as a CSS <color> value</dfn>. When parsing a CSS
|
|
value, user agents are required by the CSS specifications to apply
|
|
some error handling rules. These apply to this specification also.
|
|
<a href="#refsCSSCOLOR">[CSSCOLOR]</a> <a href="#refsCSS">[CSS]</a></p>
|
|
|
|
<p class="example">For example, user agents are required to close
|
|
all open constructs upon finding the end of a style sheet
|
|
unexpectedly. Thus, when parsing the string "<code title="">rgb(0,0,0</code>" (with a missing close-parenthesis) for
|
|
a color value, the close parenthesis is implied by this error
|
|
handling rule, and a value is obtained (the color 'black').
|
|
However, the similar construct "<code title="">rgb(0,0,</code>"
|
|
(with both a missing parenthesis and a missing "blue" value)
|
|
cannot be parsed, as closing the open construct does not result
|
|
in a viable value.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>This specification does not <em>require</em> support of any
|
|
particular network protocol, style sheet language, scripting
|
|
language, or any of the DOM specifications beyond those described
|
|
above. However, the language described by this specification is
|
|
biased towards CSS as the styling language, JavaScript 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>
|
|
|
|
</div><h4 id="extensibility"><span class="secno">2.2.3 </span>Extensibility</h4><p>HTML has a wide number of extensibility mechanisms that can be
|
|
used for adding semantics in a safe manner:<ul><li>Authors can use the <code title="attr-class"><a href="#classes">class</a></code>
|
|
attribute to extend elements, effectively creating their own
|
|
elements, while using the most applicable existing "real" HTML
|
|
element, so that browsers and other tools that don't know of the
|
|
extension can still support it somewhat well. This is the tack used
|
|
by Microformats, for example.</li>
|
|
|
|
<li>Authors can include data for inline client-side scripts or
|
|
server-side site-wide scripts to process using the <code title="attr-data-*"><a href="#attr-data">data-*=""</a></code> attributes. These are
|
|
guaranteed to never be touched by browsers, and allow scripts to
|
|
include data on HTML elements that scripts can then look for and
|
|
process.</li>
|
|
|
|
<li>Authors can use the <code title="meta"><a href="#the-meta-element"><meta name=""
|
|
content=""></a></code> mechanism to include page-wide metadata by
|
|
registering <a href="#concept-meta-extensions" title="concept-meta-extensions">extensions to the
|
|
predefined set of metadata names</a>.</li>
|
|
|
|
<li>Authors can use the <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel=""</a></code> mechanism to annotate
|
|
links with specific meanings by registering <a href="#concept-rel-extensions" title="concept-rel-extensions">extensions to the predefined set of
|
|
link types</a>. This is also used by Microformats.</li>
|
|
|
|
<li>Authors can embed raw data using the <code title="script"><a href="#the-script-element"><script type=""></a></code> mechanism with a custom
|
|
type, for further handling by inline or server-side scripts.</li>
|
|
|
|
<li>Authors can create <a href="#plugin" title="plugin">plugins</a> and
|
|
invoke them using the <code><a href="#the-embed-element">embed</a></code> element. This is how Flash
|
|
works.</li>
|
|
|
|
<li>Authors can extend APIs using the JavaScript prototyping
|
|
mechanism. This is widely used by script libraries, for
|
|
instance.</li>
|
|
|
|
|
|
</ul><div class="impl">
|
|
|
|
<hr><p>Vendor-specific proprietary user agent extensions to this
|
|
specification are strongly discouraged. Documents must not use such
|
|
extensions, as doing so reduces interoperability and fragments the
|
|
user base, allowing only users of specific user agents to access the
|
|
content in question.</p>
|
|
|
|
<p>If such extensions are nonetheless needed, e.g. for experimental
|
|
purposes, then vendors are strongly urged to use one of the
|
|
following extension mechanisms:</p>
|
|
|
|
<p>For markup-level features that can be limited to the XML
|
|
serialization and need not be supported in the HTML serialization,
|
|
vendors should use the namespace mechanism to define custom
|
|
namespaces in which the non-standard elements and attributes are
|
|
supported.</p>
|
|
|
|
<p>For markup-level features that are intended for use with
|
|
<a href="#syntax">the HTML syntax</a>, extensions should be limited to new
|
|
attributes of the form "<code title="">x-<var title="">vendor</var>-<var title="">feature</var></code>", where
|
|
<var title="">vendor</var> is a short string that identifies the
|
|
vendor responsible for the extension, and <var title="">feature</var> is the name of the feature. New element names
|
|
should not be created. Using attributes for such extensions
|
|
exclusively allows extensions from multiple vendors to co-exist on
|
|
the same element, which would not be possible with elements. Using
|
|
the "<code title="">x-<var title="">vendor</var>-<var title="">feature</var></code>" form allows extensions to be made
|
|
without risk of conflicting with future additions to the
|
|
specification.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For instance, a browser named "FerretBrowser" could use "ferret"
|
|
as a vendor prefix, while a browser named "Mellblom Browser" could
|
|
use "mb". If both of these browsers invented extensions that turned
|
|
elements into scratch-and-sniff areas, an author experimenting with
|
|
these features could write:</p>
|
|
|
|
<pre><p>This smells of lemons!
|
|
<span x-ferret-smellovision x-ferret-smellcode="LEM01"
|
|
x-mb-outputsmell x-mb-smell="lemon juice"></span></p></pre>
|
|
|
|
</div>
|
|
|
|
<p>Attribute names beginning with the two characters "<code title="">x-</code>" are reserved for user agent use and are
|
|
guaranteed to never be formally added to the HTML language. For
|
|
flexibility, attributes names containing underscores (the U+005F LOW
|
|
LINE character) are also reserved for experimental purposes and are
|
|
guaranteed to never be formally added to the HTML language.</p>
|
|
|
|
<p class="note">Pages that use such attributes are by definition
|
|
non-conforming.</p>
|
|
|
|
<p>For DOM extensions, e.g. new methods and IDL attributes, the new
|
|
members should be prefixed by vendor-specific strings to prevent
|
|
clashes with future versions of this specification.</p>
|
|
|
|
<p>For events, experimental event names should be prefixed with
|
|
vendor-specific strings.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, if a user agent called "Pleasold" were to
|
|
add an event to indicate when the user is going up in an elevator,
|
|
it could use the prefix "<code title="">pleasold</code>" and thus
|
|
name the event "<code title="">pleasoldgoingup</code>", possibly
|
|
with an event handler attribute named "<code title="">onpleasoldgoingup</code>".</p>
|
|
|
|
</div>
|
|
|
|
<p>All extensions must be defined so that the use of extensions
|
|
neither contradicts nor causes the non-conformance of functionality
|
|
defined in the specification.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, while strongly discouraged from doing so, an
|
|
implementation "Foo Browser" could add a new IDL attribute "<code title="">fooTypeTime</code>" to a control's DOM interface that
|
|
returned the time it took the user to select the current value of a
|
|
control (say). On the other hand, defining a new control that
|
|
appears in a form's <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code>
|
|
array would be in violation of the above requirement, as it would
|
|
violate the definition of <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> given in this
|
|
specification.</p>
|
|
|
|
</div>
|
|
|
|
<p>When adding new <a href="#reflect" title="reflect">reflecting</a> IDL
|
|
attributes corresponding to content attributes of the form "<code title="">x-<var title="">vendor</var>-<var title="">feature</var></code>", the IDL attribute should be named
|
|
"<code title=""><var title="">vendor</var><var title="">Feature</var></code>" (i.e. the "<code title="">x</code>"
|
|
is dropped from the IDL attribute's name).</p>
|
|
|
|
<hr><p>When vendor-neutral extensions to this specification are needed,
|
|
either this specification can be updated accordingly, or an
|
|
extension specification can be written that overrides the
|
|
requirements in this specification. When someone applying this
|
|
specification to their activities decides that they will recognize
|
|
the requirements of such an extension specification, it becomes an
|
|
<dfn id="other-applicable-specifications" title="other applicable specifications">applicable
|
|
specification</dfn>.
|
|
|
|
<p>The conformance terminology for documents depends on the nature
|
|
of the changes introduced by such applicable specificactions, and on
|
|
the content and intended interpretation of the document. Applicable
|
|
specifications MAY define new document content (e.g. a foobar
|
|
element), MAY prohibit certain otherwise conforming content (e.g.
|
|
prohibit use of <table>s), or MAY change the semantics, DOM
|
|
mappings, or other processing rules for content defined in this
|
|
specification. Whether a document is or is not a <a href="#conforming-html5-documents">conforming HTML5 document</a> does not
|
|
depend on the use of applicable specifications: if the syntax and
|
|
semantics of a given <a href="#conforming-html5-documents">conforming
|
|
HTML5 document </a>document is unchanged by the use of applicable
|
|
specification(s), then that document remains a <a href="#conforming-html5-documents">conforming HTML5 document</a>. If the
|
|
semantics or processing of a given (otherwise conforming) document
|
|
is changed by use of applicable specification(s), then it is not a
|
|
<a href="#conforming-html5-documents">conforming HTML5 document</a>. For
|
|
such cases, the applicable specifications SHOULD define conformance
|
|
terminology.</p>
|
|
|
|
<p class="note">As a suggested but not required convention, such
|
|
specifications might define conformance terminology such as:
|
|
"Conforming HTML5+XXX document", where XXX is a short
|
|
name for the applicable specification. (Example: "Conforming
|
|
HTML5+AutomotiveExtensions document").</p>
|
|
|
|
<p class="note">a consequence of the rule given above is that
|
|
certain syntactically correct HTML5 documents may not be <a href="#conforming-html5-documents">conforming HTML5 documents</a> in the
|
|
presence of applicable specifications. (Example: the applicable
|
|
specification defines <table> to be a piece of furniture —
|
|
a document written to that specification and containing a <table>
|
|
element is NOT a <a href="#conforming-html5-documents">conforming HTML5
|
|
document</a>, even if the element happens to be syntactically
|
|
correct HTML5.)</p>
|
|
|
|
<hr><p>User agents must treat elements and attributes that they do not
|
|
understand as semantically neutral; leaving them in the DOM (for DOM
|
|
processors), and styling them according to CSS (for CSS processors),
|
|
but not inferring any meaning from them.</p>
|
|
|
|
<p>When support for a feature is disabled (e.g. as an emergency
|
|
measure to mitigate a security problem, or to aid in development, or
|
|
for performance reasons), user agents must act as if they had no
|
|
support for the feature whatsoever, and as if the feature was not
|
|
mentioned in this specification. For example, if a particular
|
|
feature is accessed via an attribute in a Web IDL interface, the
|
|
attribute itself would be omitted from the objects that implement
|
|
that interface — leaving the attribute on the object but
|
|
making it return null or throw an exception is insufficient.</p>
|
|
|
|
</div><h3 id="case-sensitivity-and-string-comparison"><span class="secno">2.3 </span>Case-sensitivity and string comparison</h3><p>Comparing two strings in a <dfn id="case-sensitive">case-sensitive</dfn> manner means
|
|
comparing them exactly, code point for code point.<p>Comparing two strings in an <dfn id="ascii-case-insensitive">ASCII case-insensitive</dfn>
|
|
manner means comparing them exactly, code point for code point, except
|
|
that the characters in the range U+0041 to U+005A (i.e. LATIN
|
|
CAPITAL LETTER A to LATIN CAPITAL LETTER Z) and the corresponding
|
|
characters in the range U+0061 to U+007A (i.e. LATIN SMALL LETTER A
|
|
to LATIN SMALL LETTER Z) are considered to also match.<p>Comparing two strings in a <dfn id="compatibility-caseless">compatibility caseless</dfn>
|
|
manner means using the Unicode <i>compatibility caseless match</i>
|
|
operation to compare the two strings. <a href="#refsUNICODE">[UNICODE]</a><p>Except where otherwise stated, string comparisons must be
|
|
performed in a <a href="#case-sensitive">case-sensitive</a> manner.<div class="impl">
|
|
|
|
<p><dfn id="converted-to-ascii-uppercase" title="converted to ASCII uppercase">Converting a string to
|
|
ASCII uppercase</dfn> means replacing all characters in the range
|
|
U+0061 to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z)
|
|
with the corresponding characters in the range U+0041 to U+005A
|
|
(i.e. LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z).</p>
|
|
|
|
<p><dfn id="converted-to-ascii-lowercase" title="converted to ASCII lowercase">Converting a string to
|
|
ASCII lowercase</dfn> means replacing all characters in the range
|
|
U+0041 to U+005A (i.e. LATIN CAPITAL LETTER A to LATIN CAPITAL
|
|
LETTER Z) with the corresponding characters in the range U+0061
|
|
to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z).</p>
|
|
|
|
</div><p>A string <var title="">pattern</var> is a <dfn id="prefix-match">prefix match</dfn>
|
|
for a string <var title="">s</var> when <var title="">pattern</var>
|
|
is not longer than <var title="">s</var> and truncating <var title="">s</var> to <var title="">pattern</var>'s length leaves the
|
|
two strings as matches of each other.<div class="impl">
|
|
|
|
<h3 id="utf-8"><span class="secno">2.4 </span>UTF-8</h3>
|
|
|
|
<p>When a user agent is required to <dfn id="decoded-as-utf-8-with-error-handling" title="decoded as UTF-8,
|
|
with error handling">decode a byte string as UTF-8, with error
|
|
handling</dfn>, it means that the byte stream must be converted to a
|
|
Unicode string by interpreting it as UTF-8, except that any errors
|
|
must be handled as described in the following list. Bytes in the
|
|
following list are represented in hexadecimal. <a href="#refsRFC3629">[RFC3629]</a>
|
|
|
|
<dl class="switch"><dt>One byte in the range FE to FF</dt>
|
|
|
|
|
|
<dt><a href="#overlong-form" title="overlong form">Overlong forms</a> (e.g. F0 80 80 A0)</dt>
|
|
|
|
<dt>One byte in the range C0 to C1, followed by one byte in the range 80 to BF</dt>
|
|
|
|
|
|
<dt>One byte in the range F0 to F4, followed by three bytes in the range 80 to BF that represent a code point above U+10FFFF</dt>
|
|
|
|
<dt>One byte in the range F5 to F7, followed by three bytes in the range 80 to BF</dt>
|
|
|
|
<dt>One byte in the range F8 to FB, followed by four bytes in the range 80 to BF</dt>
|
|
|
|
<dt>One byte in the range FC to FD, followed by five bytes in the range 80 to BF</dt>
|
|
|
|
|
|
<dt>One byte in the range C0 to FD that is not followed by a byte in the range 80 to BF</dt>
|
|
|
|
<dt>One byte in the range E0 to FD, followed by a byte in the range 80 to BF that is not followed by a byte in the range 80 to BF</dt>
|
|
|
|
<dt>One byte in the range F0 to FD, followed by two bytes in the range 80 to BF, the last of which is not followed by a byte in the range 80 to BF</dt>
|
|
|
|
<dt>One byte in the range F8 to FD, followed by three bytes in the range 80 to BF, the last of which is not followed by a byte in the range 80 to BF</dt>
|
|
|
|
<dt>One byte in the range FC to FD, followed by four bytes in the range 80 to BF, the last of which is not followed by a byte in the range 80 to BF</dt>
|
|
|
|
|
|
<dt>Any byte sequence that represents a code point in the range U+D800 to U+DFFF</dt>
|
|
|
|
|
|
<dd>The whole matched sequence must be replaced by a single U+FFFD
|
|
REPLACEMENT CHARACTER.</dd>
|
|
|
|
|
|
<dt>One byte in the range 80 to BF not preceded by a byte in the range 80 to FD</dt>
|
|
|
|
<dt>One byte in the range 80 to BF preceded by a byte that is part of a complete UTF-8 sequence that does not include this byte</dt>
|
|
|
|
<dt>One byte in the range 80 to BF preceded by a byte that is part of a sequence that has been replaced by a U+FFFD REPLACEMENT CHARACTER, either alone or as part of a sequence</dt>
|
|
|
|
<dd>Each such byte must be replaced with a U+FFFD REPLACEMENT CHARACTER.</dd>
|
|
|
|
|
|
</dl><p>For the purposes of the above requirements, an <dfn id="overlong-form">overlong
|
|
form</dfn> in UTF-8 is a sequence that encodes a code point using
|
|
more bytes than the minimum needed to encode that code point in
|
|
UTF-8.</p>
|
|
|
|
<p class="example">For example, the byte string "41 98 BA 42 E2 98
|
|
43 E2 98 BA E2 98" would be converted to the string
|
|
"A��B�C☺�".</p>
|
|
|
|
</div><h3 id="common-microsyntaxes"><span class="secno">2.5 </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.<div class="impl">
|
|
|
|
<p class="note">Implementors are strongly urged to carefully examine
|
|
any third-party libraries they might consider using to implement the
|
|
parsing of syntaxes described below. For example, date libraries are
|
|
likely to implement error handling behavior that differs from what
|
|
is required in this specification, since error-handling behavior is
|
|
often not defined in specifications that describe date syntaxes
|
|
similar to those used in this specification, and thus
|
|
implementations tend to vary greatly in how they handle errors.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="common-parser-idioms"><span class="secno">2.5.1 </span>Common parser idioms</h4>
|
|
|
|
<p>The <dfn id="space-character" 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+000C FORM FEED (FF), and
|
|
U+000D CARRIAGE RETURN (CR).</p>
|
|
|
|
<p>The <dfn id="white_space" title="White_Space">White_Space characters</dfn> are
|
|
those that have the Unicode property "White_Space" in the Unicode
|
|
<code title="">PropList.txt</code> data file. <a href="#refsUNICODE">[UNICODE]</a></p>
|
|
|
|
<p class="note">This should not be confused with the "White_Space"
|
|
value (abbreviated "WS") of the "Bidi_Class" property in the <code title="">Unicode.txt</code> data file.</p>
|
|
|
|
<p>The <dfn id="alphanumeric-ascii-characters">alphanumeric ASCII characters</dfn> are those in the
|
|
ranges U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), U+0041 LATIN
|
|
CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z, U+0061 LATIN
|
|
SMALL LETTER A to U+007A LATIN SMALL LETTER Z.</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-a-sequence-of-characters">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.</li>
|
|
|
|
<li><p>Let <var title="">result</var> be the empty string.</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>.</li>
|
|
|
|
<li><p>Return <var title="">result</var>.</li>
|
|
|
|
</ol><p>The step <dfn id="skip-whitespace">skip whitespace</dfn> means that the user agent
|
|
must <a href="#collect-a-sequence-of-characters">collect a sequence of characters</a> that are <a href="#space-character" title="space character">space characters</a>. The step <dfn id="skip-white_space-characters">skip
|
|
White_Space characters</dfn> means that the user agent must
|
|
<a href="#collect-a-sequence-of-characters">collect a sequence of characters</a> that are
|
|
<a href="#white_space">White_Space</a> characters. In both cases, the collected
|
|
characters are not used. <a href="#refsUNICODE">[UNICODE]</a></p>
|
|
|
|
<p>When a user agent is to <dfn id="strip-line-breaks">strip line breaks</dfn> from a
|
|
string, the user agent must remove any U+000A LINE FEED (LF) and
|
|
U+000D CARRIAGE RETURN (CR) characters from that string.</p>
|
|
|
|
<p>When a user agent is to <dfn id="strip-leading-and-trailing-whitespace">strip leading and trailing
|
|
whitespace</dfn> from a string, the user agent must remove all <a href="#space-character" title="space character">space characters</a> that are at the
|
|
start or end of the string.</p>
|
|
|
|
<p>The <dfn id="code-point-length">code-point length</dfn> of a string is the number of
|
|
Unicode code points in that string.</p>
|
|
|
|
</div><h4 id="boolean-attributes"><span class="secno">2.5.2 </span>Boolean attributes</h4><p>A number of attributes are <dfn id="boolean-attribute" 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>If the attribute is present, its value must either be the empty
|
|
string or a value that is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a>
|
|
match for the attribute's canonical name, with no leading or
|
|
trailing whitespace.<p class="note">The values "true" and "false" are not allowed on
|
|
boolean attributes. To represent a false value, the attribute has to
|
|
be omitted altogether.<div class="example">
|
|
|
|
<p>Here is an example of a checkbox that is checked and disabled.
|
|
The <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code> and <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> attributes are the
|
|
boolean attributes.</p>
|
|
|
|
<pre><label><input type=checkbox checked name=cheese disabled> Cheese</label></pre>
|
|
|
|
<p>This could be equivalently written as this:
|
|
|
|
<pre><label><input type=checkbox checked=checked name=cheese disabled=disabled> Cheese</label></pre>
|
|
|
|
<p>You can also mix styles; the following is still equivalent:</p>
|
|
|
|
<pre><label><input type='checkbox' checked name=cheese disabled=""> Cheese</label></pre>
|
|
|
|
</div><h4 id="keywords-and-enumerated-attributes"><span class="secno">2.5.3 </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-attribute" 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 <i>invalid value default</i>, the second
|
|
is the <i>missing value default</i>.<p>If an enumerated attribute is specified, the attribute's value
|
|
must be an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for one of the
|
|
given keywords that are not said to be non-conforming, with no
|
|
leading or trailing whitespace.<p>When the attribute is specified, if its value is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for 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 <i>invalid value default</i>, then the attribute
|
|
represents that state. Otherwise, if the attribute value matches
|
|
none of the keywords but there is a <i>missing value default</i>
|
|
state defined, then <em>that</em> is the state represented by the
|
|
attribute. Otherwise, there is no default, and invalid values must
|
|
be ignored.<p>When the attribute is <em>not</em> specified, if there is a
|
|
<i>missing value default</i> 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 class="note">The empty string can be a valid keyword.<h4 id="numbers"><span class="secno">2.5.4 </span>Numbers</h4><h5 id="non-negative-integers"><span class="secno">2.5.4.1 </span>Non-negative integers</h5><p>A string is a <dfn id="valid-non-negative-integer">valid non-negative integer</dfn> if it
|
|
consists of one or more characters in the range U+0030 DIGIT ZERO
|
|
(0) to U+0039 DIGIT NINE (9).<p>A <a href="#valid-non-negative-integer">valid non-negative integer</a> represents the number
|
|
that is represented in base ten by that string of digits.<div class="impl">
|
|
|
|
<p>The <dfn id="rules-for-parsing-non-negative-integers">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 return either zero, a positive integer,
|
|
or an error.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is a U+002B PLUS SIGN character (+), advance <var title="">position</var> to the next character. (The "<code title="">+</code>" is ignored, but it is not conforming.)</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
|
|
return an error.</li>
|
|
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> in the range
|
|
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
|
|
resulting sequence as a base-ten integer. Let <var title="">value</var> be that integer.</li>
|
|
|
|
<li><p>Return <var title="">value</var>.</li>
|
|
|
|
</ol></div><h5 id="signed-integers"><span class="secno">2.5.4.2 </span>Signed integers</h5><p>A string is a <dfn id="valid-integer">valid integer</dfn> if it consists of one or
|
|
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>A <a href="#valid-integer">valid integer</a> without a U+002D HYPHEN-MINUS (-)
|
|
prefix represents the number that is represented in base ten by that
|
|
string of digits. A <a href="#valid-integer">valid integer</a> <em>with</em> a
|
|
U+002D HYPHEN-MINUS (-) prefix represents the number represented in
|
|
base ten by the string of digits that follows the U+002D
|
|
HYPHEN-MINUS, subtracted from zero.<div class="impl">
|
|
|
|
<p>The <dfn id="rules-for-parsing-integers">rules for parsing integers</dfn> are similar to the
|
|
<a href="#rules-for-parsing-non-negative-integers" title="rules for parsing non-negative integers">rules for
|
|
non-negative integers</a>, 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 return either an integer or an error.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>Let <var title="">sign</var> have the value
|
|
"positive".</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</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><p>Otherwise, if the character indicated by <var title="">position</var> (the first character) is a U+002B PLUS
|
|
SIGN character (+):</p>
|
|
|
|
<ol><li>Advance <var title="">position</var> to the next
|
|
character. (The "<code title="">+</code>" is ignored, but it is
|
|
not conforming.)</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 character indicated by <var title="">position</var>
|
|
is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
|
|
return an error.</li>
|
|
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> in the range
|
|
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
|
|
resulting sequence as a base-ten integer. Let <var title="">value</var> be that integer.</li>
|
|
|
|
<li><p>If <var title="">sign</var> is "positive", return <var title="">value</var>, otherwise return the result of subtracting
|
|
<var title="">value</var> from zero.</li>
|
|
|
|
</ol></div><h5 id="real-numbers"><span class="secno">2.5.4.3 </span>Real numbers</h5><p>A string is a <dfn id="valid-floating-point-number">valid floating point number</dfn> if it
|
|
consists of:<ol class="brief"><li>Optionally, a U+002D HYPHEN-MINUS character (-).</li>
|
|
|
|
<li>A series of one or more characters in the range U+0030 DIGIT
|
|
ZERO (0) to U+0039 DIGIT NINE (9).</li>
|
|
|
|
<li>Optionally:
|
|
|
|
<ol><li>A single U+002E FULL STOP character (.).</li>
|
|
|
|
<li>A series of one or more characters in the range U+0030 DIGIT
|
|
ZERO (0) to U+0039 DIGIT NINE (9).</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>Optionally:
|
|
|
|
<ol><li>Either a U+0065 LATIN SMALL LETTER E character (e) or a
|
|
U+0045 LATIN CAPITAL LETTER E character (E).</li>
|
|
|
|
<li>Optionally, a U+002D HYPHEN-MINUS character (-) or U+002B
|
|
PLUS SIGN character (+).</li>
|
|
|
|
<li>A series of one or more characters in the range U+0030 DIGIT
|
|
ZERO (0) to U+0039 DIGIT NINE (9).</li>
|
|
|
|
</ol></li>
|
|
|
|
</ol><p>A <a href="#valid-floating-point-number">valid floating point number</a> represents the number
|
|
obtained by multiplying the significand by ten raised to the power
|
|
of the exponent, where the significand is the first number,
|
|
interpreted as base ten (including the decimal point and the number
|
|
after the decimal point, if any, and interpreting the significand as
|
|
a negative number if the whole string starts with a U+002D
|
|
HYPHEN-MINUS character (-) and the number is not zero), and where
|
|
the exponent is the number after the E, if any (interpreted as a
|
|
negative number if there is a U+002D HYPHEN-MINUS character (-)
|
|
between the E and the number and the number is not zero, or else
|
|
ignoring a U+002B PLUS SIGN character (+) between the E and the
|
|
number if there is one). If there is no E, then the exponent is
|
|
treated as zero.<p class="note">The Infinity and Not-a-Number (NaN) values are not
|
|
<a href="#valid-floating-point-number" title="valid floating point number">valid floating point
|
|
numbers</a>.<div class="impl">
|
|
|
|
<p>The <dfn id="best-representation-of-the-number-as-a-floating-point-number" title="best representation of the number as a floating
|
|
point number">best representation of the number <var title="">n</var> as a floating point number</dfn> is the string
|
|
obtained from applying the JavaScript operator ToString to <var title="">n</var>. The JavaScript operator ToString is not uniquely
|
|
determined. When there are multiple possible strings that could be
|
|
obtained from the JavaScript operator ToString for a particular
|
|
value, the user agent must always return the same string for that
|
|
value (though it may differ from the value used by other user
|
|
agents).</p>
|
|
|
|
<p>The <dfn id="rules-for-parsing-floating-point-number-values">rules for parsing floating point number values</dfn> are
|
|
as given in the following algorithm. This algorithm must be aborted
|
|
at the first step that returns something. This algorithm will return
|
|
either a number or an error.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>Let <var title="">value</var> have the value 1.</li>
|
|
|
|
<li><p>Let <var title="">divisor</var> have the value 1.</li>
|
|
|
|
<li><p>Let <var title="">exponent</var> have the value 1.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the character indicated by <var title="">position</var> is a
|
|
U+002D HYPHEN-MINUS character (-):</p>
|
|
|
|
<ol><li>Change <var title="">value</var> and <var title="">divisor</var> to −1.</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><p>Otherwise, if the character indicated by <var title="">position</var> (the first character) is a U+002B PLUS
|
|
SIGN character (+):</p>
|
|
|
|
<ol><li>Advance <var title="">position</var> to the next
|
|
character. (The "<code title="">+</code>" is ignored, but it is
|
|
not conforming.)</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 character indicated by <var title="">position</var>
|
|
is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
|
|
return an error.</li>
|
|
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> in the range
|
|
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
|
|
resulting sequence as a base-ten integer. Multiply <var title="">value</var> by that integer.</li>
|
|
|
|
<li>If <var title="">position</var> is past the end of <var title="">input</var>, jump to the step labeled
|
|
<i>conversion</i>.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is a U+002E FULL STOP (.), run these substeps:</p>
|
|
|
|
<ol><li><p>Advance <var title="">position</var> to the next
|
|
character.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, or if the character indicated by <var title="">position</var> is not one of U+0030 DIGIT ZERO (0) to
|
|
U+0039 DIGIT NINE (9), U+0065 LATIN SMALL LETTER E (e), or U+0045
|
|
LATIN CAPITAL LETTER E (E), then jump to the step labeled
|
|
<i>conversion</i>.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN
|
|
CAPITAL LETTER E character (E), skip the remainder of these
|
|
substeps.</p>
|
|
|
|
<li><p><i>Fraction loop</i>: Multiply <var title="">divisor</var>
|
|
by ten.</li>
|
|
|
|
<li>Add the value of the character indicated by <var title="">position</var>, interpreted as a base-ten digit (0..9)
|
|
and divided by <var title="">divisor</var>, to <var title="">value</var>.</li>
|
|
|
|
<li><p>Advance <var title="">position</var> to the next
|
|
character.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then jump to the step labeled
|
|
<i>conversion</i>.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), jump
|
|
back to the step labeled <i>fraction loop</i> in these
|
|
substeps.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN
|
|
CAPITAL LETTER E character (E), run these substeps:</p>
|
|
|
|
<ol><li><p>Advance <var title="">position</var> to the next
|
|
character.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then jump to the step labeled
|
|
<i>conversion</i>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the character indicated by <var title="">position</var> is
|
|
a U+002D HYPHEN-MINUS character (-):</p>
|
|
|
|
<ol><li>Change <var title="">exponent</var> to −1.</li>
|
|
|
|
<li>Advance <var title="">position</var> to the next
|
|
character.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then jump to the step labeled
|
|
<i>conversion</i>.</li>
|
|
|
|
</ol><p>Otherwise, if the character indicated by <var title="">position</var> is a U+002B PLUS SIGN character (+):</p>
|
|
|
|
<ol><li>Advance <var title="">position</var> to the next
|
|
character.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then jump to the step labeled
|
|
<i>conversion</i>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
|
|
then jump to the step labeled <i>conversion</i>.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> in the range
|
|
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
|
|
resulting sequence as a base-ten integer. Multiply <var title="">exponent</var> by that integer.</li>
|
|
|
|
<li><p>Multiply <var title="">value</var> by ten raised to the
|
|
<var title="">exponent</var>th power.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p><i>Conversion</i>: Let <var title="">S</var> be the set of
|
|
finite IEEE 754 double-precision floating point values except
|
|
−0, but with two special values added: 2<sup title="">1024</sup> and −2<sup title="">1024</sup>.</li>
|
|
|
|
<li><p>Let <var title="">rounded-value</var> be the number in <var title="">S</var> that is closest to <var title="">value</var>,
|
|
selecting the number with an even significand if there are two
|
|
equally close values. (The two special values 2<sup title="">1024</sup> and −2<sup title="">1024</sup> are
|
|
considered to have even significands for this purpose.)</li>
|
|
|
|
<li><p>If <var title="">rounded-value</var> is 2<sup title="">1024</sup> or −2<sup title="">1024</sup>, return an
|
|
error.</li>
|
|
|
|
<li><p>Return <var title="">rounded-value</var>.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
<h5 id="percentages-and-dimensions"><span class="secno">2.5.4.4 </span>Percentages and lengths</h5>
|
|
<p>The <dfn id="rules-for-parsing-dimension-values">rules for parsing dimension values</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 return either a number greater than or
|
|
equal to 1.0, or an error; if a number is returned, then it is
|
|
further categorized as either a percentage or a length.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is a U+002B PLUS SIGN character (+), advance <var title="">position</var> to the next character.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> that are
|
|
U+0030 DIGIT ZERO (0) characters, and discard them.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is not one of U+0031 DIGIT ONE (1) to U+0039 DIGIT NINE (9), then
|
|
return an error.</li>
|
|
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> in the range
|
|
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
|
|
resulting sequence as a base-ten integer. Let <var title="">value</var> be that number.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return <var title="">value</var> as a
|
|
length.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the character indicated by <var title="">position</var> is a
|
|
U+002E FULL STOP character (.):</p>
|
|
|
|
<ol><li><p>Advance <var title="">position</var> to the next
|
|
character.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, or if the character indicated by <var title="">position</var> is not one of U+0030 DIGIT ZERO (0) to
|
|
U+0039 DIGIT NINE (9), then return <var title="">value</var> as a
|
|
length.</li>
|
|
|
|
<li><p>Let <var title="">divisor</var> have the value 1.</li>
|
|
|
|
<li><p><i>Fraction loop</i>: Multiply <var title="">divisor</var>
|
|
by ten.</li>
|
|
|
|
<li>Add the value of the character indicated by <var title="">position</var>, interpreted as a base-ten digit (0..9)
|
|
and divided by <var title="">divisor</var>, to <var title="">value</var>.</li>
|
|
|
|
<li><p>Advance <var title="">position</var> to the next
|
|
character.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then return <var title="">value</var> as a
|
|
length.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), return
|
|
to the step labeled <i>fraction loop</i> in these
|
|
substeps.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return <var title="">value</var> as a
|
|
length.</li>
|
|
|
|
<li><p>If the character indicated by <var title="">position</var>
|
|
is a U+0025 PERCENT SIGN character (%), return <var title="">value</var> as a percentage.</li>
|
|
|
|
<li><p>Return <var title="">value</var> as a length.</li>
|
|
|
|
</ol></div><h5 id="lists-of-integers"><span class="secno">2.5.4.5 </span>Lists of integers</h5><p>A <dfn id="valid-list-of-integers">valid list of integers</dfn> is a number of <a href="#valid-integer" title="valid integer">valid integers</a> separated by U+002C
|
|
COMMA characters, with no other characters (e.g. no <a href="#space-character" 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.<div class="impl">
|
|
|
|
<p>The <dfn id="rules-for-parsing-a-list-of-integers">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.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>Let <var title="">numbers</var> be an initially empty list
|
|
of integers. This list will be the result of this
|
|
algorithm.</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 a U+0020 SPACE, U+002C COMMA, or U+003B SEMICOLON
|
|
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.</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.</li>
|
|
|
|
<li><p>If the character in the string <var title="">input</var> at
|
|
position <var title="">position</var> is a U+0020 SPACE, U+002C
|
|
COMMA, or U+003B SEMICOLON character, then return to step 4.</li>
|
|
|
|
<li><p>Let <var title="">negated</var> be false.</li>
|
|
<li><p>Let <var title="">value</var> be 0.</li>
|
|
|
|
<li><p>Let <var title="">started</var> be false. This variable is
|
|
set to true when the parser sees a number or a U+002D HYPHEN-MINUS
|
|
character (-).</li>
|
|
|
|
<li><p>Let <var title="">got number</var> be false. This variable
|
|
is set to true when the parser sees a number.</li>
|
|
|
|
<li><p>Let <var title="">finished</var> be false. This variable is
|
|
set to true to switch parser into a mode where it ignores
|
|
characters until the next separator.</li>
|
|
|
|
<li><p>Let <var title="">bogus</var> be false.</li>
|
|
|
|
<li><p><i>Parser</i>: 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="">got number</var> is true, let <var title="">finished</var> be true.</li>
|
|
|
|
<li>If <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 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 (0) to U+0039 DIGIT
|
|
NINE (9)</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>Multiply <var title="">value</var> by ten.</li>
|
|
|
|
<li>Add the value of the digit, interpreted in base ten, to
|
|
<var title="">value</var>.</li>
|
|
|
|
<li>Let <var title="">started</var> be true.</li>
|
|
|
|
<li>Let <var title="">got number</var> be true.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>A U+0020 SPACE character</dt>
|
|
<dt>A U+002C COMMA character</dt>
|
|
<dt>A U+003B SEMICOLON character</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Follow these substeps:</p>
|
|
|
|
<ol><li>If <var title="">got number</var> is false, return the <var title="">numbers</var> list and abort. This happens if an entry
|
|
in the list has no digits, as in "<code title="">1,2,x,4</code>".</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 character in the range U+0001 to U+001F, U+0021 to U+002B, U+002D to U+002F, U+003A, U+003C to U+0040, U+005B to U+0060, <!-- A-Z --> U+007b to U+007F
|
|
(i.e. any other non-alphabetic ASCII character)</dt>
|
|
|
|
|
|
<dd>
|
|
|
|
<p>Follow these substeps:</p>
|
|
|
|
<ol><li>If <var title="">got number</var> is true, let <var title="">finished</var> be true.</li>
|
|
|
|
<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>
|
|
|
|
</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.</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 <i>Parser</i> step above.</li>
|
|
|
|
<li><p>If <var title="">negated</var> is true, then negate <var title="">value</var>.</li>
|
|
|
|
<li><p>If <var title="">got number</var> is true, then append <var title="">value</var> to the <var title="">numbers</var> list.</li>
|
|
|
|
<li><p>Return the <var title="">numbers</var> list and
|
|
abort.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h5 id="lists-of-dimensions"><span class="secno">2.5.4.6 </span>Lists of dimensions</h5>
|
|
|
|
|
|
<p>The <dfn id="rules-for-parsing-a-list-of-dimensions">rules for parsing a list of dimensions</dfn> are as
|
|
follows. These rules return a list of zero or more pairs consisting
|
|
of a number and a unit, the unit being one of <i>percentage</i>,
|
|
<i>relative</i>, and <i>absolute</i>.</p>
|
|
|
|
<ol><li><p>Let <var title="">raw input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>If the last character in <var title="">raw input</var> is a
|
|
U+002C COMMA character (,), then remove that character from <var title="">raw input</var>.</li>
|
|
|
|
<li><p><a href="#split-a-string-on-commas" title="split a string on commas">Split the string <var title="">raw input</var> on commas</a>. Let <var title="">raw
|
|
tokens</var> be the resulting list of tokens.</li>
|
|
|
|
<li><p>Let <var title="">result</var> be an empty list of
|
|
number/unit pairs.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each token in <var title="">raw tokens</var>, run the
|
|
following substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the token.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>Let <var title="">value</var> be the number 0.</li>
|
|
|
|
<li><p>Let <var title="">unit</var> be <i>absolute</i>.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, set <var title="">unit</var> to
|
|
<i>relative</i> and jump to the last substep.</li>
|
|
|
|
<li><p>If the character at <var title="">position</var> is a
|
|
character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
|
|
(9), <a href="#collect-a-sequence-of-characters">collect a sequence of characters</a> in the range
|
|
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), interpret the
|
|
resulting sequence as an integer in base ten, and increment <var title="">value</var> by that integer.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the character at <var title="">position</var> is a U+002E
|
|
FULL STOP character (.), run these substeps:</p>
|
|
|
|
<ol><li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> consisting
|
|
of <a href="#space-character" title="space character">space characters</a> and
|
|
characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
|
|
NINE (9). Let <var title="">s</var> be the resulting
|
|
sequence.</li>
|
|
|
|
<li><p>Remove all <a href="#space-character" title="space character">space
|
|
characters</a> in <var title="">s</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">s</var> is not the empty string, run these
|
|
subsubsteps:</p>
|
|
|
|
<ol><li><p>Let <var title="">length</var> be the number of
|
|
characters in <var title="">s</var> (after the spaces were
|
|
removed).</li>
|
|
|
|
<li><p>Let <var title="">fraction</var> be the result of
|
|
interpreting <var title="">s</var> as a base-ten integer, and
|
|
then dividing that number by <span title="">10<sup title=""><var title="">length</var></sup></span>.</li>
|
|
|
|
<li><p>Increment <var title="">value</var> by <var title="">fraction</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the character at <var title="">position</var> is a U+0025
|
|
PERCENT SIGN character (%), then set <var title="">unit</var> to
|
|
<i>percentage</i>.</p>
|
|
|
|
<p>Otherwise, if the character at <var title="">position</var>
|
|
is a U+002A ASTERISK character (*), then set <var title="">unit</var> to <i>relative</i>.</p>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><p>Add an entry to <var title="">result</var> consisting of
|
|
the number given by <var title="">value</var> and the unit given
|
|
by <var title="">unit</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Return the list <var title="">result</var>.</li>
|
|
|
|
</ol></div><h4 id="dates-and-times"><span class="secno">2.5.5 </span>Dates and times</h4><p>In the algorithms below, the <dfn id="number-of-days-in-month-month-of-year-year">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="#refsGREGORIAN">[GREGORIAN]</a><p>The <dfn id="concept-datetime-digit" title="concept-datetime-digit">digits</dfn> in the date
|
|
and time syntaxes defined in this section must be characters in the
|
|
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), used to
|
|
express numbers in base ten.<div class="impl">
|
|
|
|
<p class="note">While the formats described here are intended to be
|
|
subsets of the corresponding ISO8601 formats, this specification
|
|
defines parsing rules in much more detail than ISO8601.
|
|
Implementors are therefore encouraged to carefully examine any date
|
|
parsing libraries before using them to implement the parsing rules
|
|
described below; ISO8601 libraries might not parse dates and times
|
|
in exactly the same manner. <a href="#refsISO8601">[ISO8601]</a></p>
|
|
|
|
</div><h5 id="months"><span class="secno">2.5.5.1 </span>Months</h5><p>A <dfn id="concept-month" title="concept-month">month</dfn> consists of a specific
|
|
proleptic Gregorian date with no time-zone information and no date
|
|
information beyond a year and a month. <a href="#refsGREGORIAN">[GREGORIAN]</a><p>A string is a <dfn id="valid-month-string">valid month string</dfn> representing a year
|
|
<var title="">year</var> and month <var title="">month</var> if it
|
|
consists of the following components in the given order:<ol><li>Four or more <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>, representing <var title="">year</var>, where <var title="">year</var> > 0</li>
|
|
|
|
<li>A U+002D HYPHEN-MINUS character (-)</li>
|
|
|
|
<li>Two <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>,
|
|
representing the month <var title="">month</var>, in the range
|
|
1 ≤ <var title="">month</var> ≤ 12</li>
|
|
|
|
</ol><div class="impl">
|
|
|
|
<p>The rules to <dfn id="parse-a-month-string">parse a month string</dfn> are as follows. This
|
|
will return either a year and month, or nothing. If at any point the
|
|
algorithm says that it "fails", this means that it is aborted at
|
|
that point and returns nothing.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#parse-a-month-component">Parse a month component</a> to obtain <var title="">year</var> and <var title="">month</var>. If this returns
|
|
nothing, then fail.</p>
|
|
|
|
<li><p>If <var title="">position</var> is <em>not</em> beyond the
|
|
end of <var title="">input</var>, then fail.</li>
|
|
|
|
<li><p>Return <var title="">year</var> and <var title="">month</var>.</li>
|
|
|
|
</ol><p>The rules to <dfn id="parse-a-month-component">parse a month component</dfn>, given an <var title="">input</var> string and a <var title="">position</var>, are
|
|
as follows. This will return either a year and a month, or
|
|
nothing. If at any point the algorithm says that it "fails", this
|
|
means that it is aborted at that point and returns nothing.</p>
|
|
|
|
<ol><li><p><a href="#collect-a-sequence-of-characters">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 at least four characters long, then
|
|
fail. Otherwise, interpret the resulting sequence as a base-ten
|
|
integer. Let that number be the <var title="">year</var>.</li>
|
|
|
|
<li><p>If <var title="">year</var> is not a number greater than
|
|
zero, 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+002D HYPHEN-MINUS character,
|
|
then fail. Otherwise, move <var title="">position</var> forwards
|
|
one character.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">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 base-ten integer. Let that
|
|
number be the <var title="">month</var>.</li>
|
|
|
|
<li><p>If <var title="">month</var> is not a number in the range
|
|
1 ≤ <var title="">month</var> ≤ 12, then
|
|
fail.</li>
|
|
|
|
<li><p>Return <var title="">year</var> and <var title="">month</var>.</li>
|
|
|
|
</ol></div><h5 id="dates"><span class="secno">2.5.5.2 </span>Dates</h5><p>A <dfn id="concept-date" title="concept-date">date</dfn> consists of a specific
|
|
proleptic Gregorian date with no time-zone information, consisting
|
|
of a year, a month, and a day. <a href="#refsGREGORIAN">[GREGORIAN]</a><p>A string is a <dfn id="valid-date-string">valid date string</dfn> representing a year
|
|
<var title="">year</var>, month <var title="">month</var>, and day
|
|
<var title="">day</var> if it consists of the following components
|
|
in the given order:<ol><li>A <a href="#valid-month-string">valid month string</a>, representing <var title="">year</var> and <var title="">month</var></li>
|
|
|
|
<li>A U+002D HYPHEN-MINUS character (-)</li>
|
|
|
|
<li>Two <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>,
|
|
representing <var title="">day</var>, in the range
|
|
1 ≤ <var title="">day</var> ≤ <var title="">maxday</var> where <var title="">maxday</var> is the <a href="#number-of-days-in-month-month-of-year-year" title="number of days in month month of year year">number of days
|
|
in the month <var title="">month</var> and year <var title="">year</var></a></li>
|
|
|
|
</ol><div class="impl">
|
|
|
|
<p>The rules to <dfn id="parse-a-date-string">parse a date string</dfn> are as follows. This
|
|
will return either a date, or nothing. If at any point the algorithm
|
|
says that it "fails", this means that it is aborted at that point
|
|
and returns nothing.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#parse-a-date-component">Parse a date component</a> to obtain <var title="">year</var>, <var title="">month</var>, and <var title="">day</var>. If this returns nothing, then fail.</p>
|
|
|
|
<li><p>If <var title="">position</var> is <em>not</em> beyond the
|
|
end of <var title="">input</var>, then fail.</li>
|
|
|
|
<li><p>Let <var title="">date</var> be the date with year <var title="">year</var>, month <var title="">month</var>, and day <var title="">day</var>.</li>
|
|
|
|
<li><p>Return <var title="">date</var>.</li>
|
|
|
|
</ol><p>The rules to <dfn id="parse-a-date-component">parse a date component</dfn>, given an <var title="">input</var> string and a <var title="">position</var>, are
|
|
as follows. This will return either a year, a month, and a day, or
|
|
nothing. If at any point the algorithm says that it "fails", this
|
|
means that it is aborted at that point and returns nothing.</p>
|
|
|
|
<ol><li><p><a href="#parse-a-month-component">Parse a month component</a> to obtain <var title="">year</var> and <var title="">month</var>. If this returns
|
|
nothing, then fail.</li>
|
|
|
|
<li><p>Let <var title="">maxday</var> be the <a href="#number-of-days-in-month-month-of-year-year">number of days
|
|
in month <var title="">month</var> of year <var title="">year</var></a>.</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.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">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 base-ten integer. Let that
|
|
number be the <var title="">day</var>.</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 fail.</li>
|
|
|
|
<li><p>Return <var title="">year</var>, <var title="">month</var>,
|
|
and <var title="">day</var>.</li>
|
|
|
|
</ol></div><h5 id="times"><span class="secno">2.5.5.3 </span>Times</h5><p>A <dfn id="concept-time" title="concept-time">time</dfn> consists of a specific
|
|
time with no time-zone information, consisting of an hour, a minute,
|
|
a second, and a fraction of a second.<p>A string is a <dfn id="valid-time-string">valid time string</dfn> representing an hour
|
|
<var title="">hour</var>, a minute <var title="">minute</var>, and a
|
|
second <var title="">second</var> if it consists of the following
|
|
components in the given order:<ol><li>Two <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>,
|
|
representing <var title="">hour</var>, in the range
|
|
0 ≤ <var title="">hour</var> ≤ 23</li>
|
|
|
|
<li>A U+003A COLON character (:)</li>
|
|
|
|
<li>Two <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>,
|
|
representing <var title="">minute</var>, in the range
|
|
0 ≤ <var title="">minute</var> ≤ 59</li>
|
|
|
|
<li>Optionally (required if <var title="">second</var> is
|
|
non-zero):
|
|
|
|
<ol><li>A U+003A COLON character (:)</li>
|
|
|
|
<li>Two <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>,
|
|
representing the integer part of <var title="">second</var>, in
|
|
the range 0 ≤ <var title="">s</var> ≤ 59</li>
|
|
|
|
<li>Optionally (required if <var title="">second</var> is not an
|
|
integer):
|
|
|
|
<ol><li>A 002E FULL STOP character (.)</li>
|
|
|
|
<li>One or more <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>, representing the
|
|
fractional part of <var title="">second</var></li>
|
|
|
|
</ol></li>
|
|
|
|
</ol></li>
|
|
|
|
</ol><p class="note">The <var title="">second</var> component cannot be
|
|
60 or 61; leap seconds cannot be represented.<div class="impl">
|
|
|
|
<p>The rules to <dfn id="parse-a-time-string">parse a time string</dfn> are as follows. This
|
|
will return either a time, or nothing. If at any point the algorithm
|
|
says that it "fails", this means that it is aborted at that point
|
|
and returns nothing.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#parse-a-time-component">Parse a time component</a> to obtain <var title="">hour</var>, <var title="">minute</var>, and <var title="">second</var>. If this returns nothing, then fail.</p>
|
|
|
|
<li><p>If <var title="">position</var> is <em>not</em> beyond the
|
|
end of <var title="">input</var>, then fail.</li>
|
|
|
|
<li><p>Let <var title="">time</var> be the time with hour <var title="">hour</var>, minute <var title="">minute</var>, and second
|
|
<var title="">second</var>.</li>
|
|
|
|
<li><p>Return <var title="">time</var>.</li>
|
|
|
|
</ol><p>The rules to <dfn id="parse-a-time-component">parse a time component</dfn>, given an <var title="">input</var> string and a <var title="">position</var>, are
|
|
as follows. This will return either an hour, a minute, and a second,
|
|
or nothing. If at any point the algorithm says that it "fails", this
|
|
means that it is aborted at that point and returns nothing.</p>
|
|
|
|
<ol><li><p><a href="#collect-a-sequence-of-characters">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 base-ten integer. Let that
|
|
number be the <var title="">hour</var>.</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.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">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 base-ten integer. Let that
|
|
number be the <var title="">minute</var>.</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".</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">position</var> is not beyond the end of
|
|
<var title="">input</var> and the character at <var title="">position</var> is a U+003A COLON, then run these
|
|
substeps:</p>
|
|
|
|
<ol><li><p>Advance <var title="">position</var> to the next character
|
|
in <var title="">input</var>.</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.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">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.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Interpret <var title="">second</var> as a base-ten number
|
|
(possibly with a fractional part). Let <var title="">second</var>
|
|
be that number instead of the string version.</li>
|
|
|
|
<li><p>If <var title="">second</var> is not a number in the range
|
|
0 ≤ <var title="">second</var> < 60, then
|
|
fail.</li>
|
|
|
|
<li><p>Return <var title="">hour</var>, <var title="">minute</var>,
|
|
and <var title="">second</var>.</li>
|
|
|
|
</ol></div><h5 id="local-dates-and-times"><span class="secno">2.5.5.4 </span>Local dates and times</h5><p>A <dfn id="concept-datetime-local" title="concept-datetime-local">local date and time</dfn>
|
|
consists of a specific proleptic Gregorian date, consisting of a
|
|
year, a month, and a day, and a time, consisting of an hour, a
|
|
minute, a second, and a fraction of a second, but expressed without
|
|
a time zone. <a href="#refsGREGORIAN">[GREGORIAN]</a><p>A string is a <dfn id="valid-local-date-and-time-string">valid local date and time string</dfn>
|
|
representing a date and time if it consists of the following
|
|
components in the given order:<ol><li>A <a href="#valid-date-string">valid date string</a> representing the date.</li>
|
|
|
|
<li>A U+0054 LATIN CAPITAL LETTER T character (T).</li>
|
|
|
|
<li>A <a href="#valid-time-string">valid time string</a> representing the time.</li>
|
|
|
|
</ol><div class="impl">
|
|
|
|
<p>The rules to <dfn id="parse-a-local-date-and-time-string">parse a local date and time string</dfn> are as
|
|
follows. This will return either a date and time, or nothing. If at
|
|
any point the algorithm says that it "fails", this means that it is
|
|
aborted at that point and returns nothing.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#parse-a-date-component">Parse a date component</a> to obtain <var title="">year</var>, <var title="">month</var>, and <var title="">day</var>. If this returns nothing, then fail.</p>
|
|
|
|
<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+0054 LATIN CAPITAL LETTER T
|
|
character (T) then fail. Otherwise, move <var title="">position</var> forwards one character.</li>
|
|
|
|
<li><p><a href="#parse-a-time-component">Parse a time component</a> to obtain <var title="">hour</var>, <var title="">minute</var>, and <var title="">second</var>. If this returns nothing, then fail.</p>
|
|
|
|
<li><p>If <var title="">position</var> is <em>not</em> beyond the
|
|
end of <var title="">input</var>, then fail.</li>
|
|
|
|
<li><p>Let <var title="">date</var> be the date with year <var title="">year</var>, month <var title="">month</var>, and day <var title="">day</var>.</li>
|
|
|
|
<li><p>Let <var title="">time</var> be the time with hour <var title="">hour</var>, minute <var title="">minute</var>, and second
|
|
<var title="">second</var>.</li>
|
|
|
|
<li><p>Return <var title="">date</var> and <var title="">time</var>.</li>
|
|
|
|
</ol></div><h5 id="global-dates-and-times"><span class="secno">2.5.5.5 </span>Global dates and times</h5><p>A <dfn id="concept-datetime" title="concept-datetime">global date and time</dfn>
|
|
consists of a specific proleptic Gregorian date, consisting of a
|
|
year, a month, and a day, and a time, consisting of an hour, a
|
|
minute, a second, and a fraction of a second, expressed with a
|
|
time-zone offset, consisting of a signed number of hours and
|
|
minutes. <a href="#refsGREGORIAN">[GREGORIAN]</a><p>A string is a <dfn id="valid-global-date-and-time-string">valid global date and time string</dfn>
|
|
representing a date, time, and a time-zone offset if it consists of
|
|
the following components in the given order:<ol><li>A <a href="#valid-date-string">valid date string</a> representing the date</li>
|
|
|
|
<li>A U+0054 LATIN CAPITAL LETTER T character (T)</li>
|
|
|
|
<li>A <a href="#valid-time-string">valid time string</a> representing the time</li>
|
|
|
|
<li>Either:
|
|
|
|
<ul><li>A U+005A LATIN CAPITAL LETTER Z character (Z), allowed only
|
|
if the time zone is UTC</li>
|
|
|
|
<li>Or:
|
|
|
|
<ol><li>Either a U+002B PLUS SIGN character (+) or, if the
|
|
time-zone offset is not zero, a U+002D HYPHEN-MINUS character
|
|
(-), representing the sign of the time-zone offset</li>
|
|
|
|
<li>Two <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>,
|
|
representing the hours component <var title="">hour</var> of
|
|
the time-zone offset, in the range 0 ≤ <var title="">hour</var> ≤ 23</li>
|
|
|
|
<li>A U+003A COLON character (:)</li>
|
|
|
|
<li>Two <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>,
|
|
representing the minutes component <var title="">minute</var>
|
|
of the time-zone offset, in the range 0 ≤ <var title="">minute</var> ≤ 59</li>
|
|
|
|
</ol></li>
|
|
|
|
</ul></li>
|
|
|
|
</ol><p class="note">This format allows for time-zone offsets from -23:59
|
|
to +23:59. In practice, however, the range of offsets of actual time
|
|
zones is -12:00 to +14:00, and the minutes component of offsets of
|
|
actual time zones is always either 00, 30, or 45.<p>Times in dates before the formation of UTC in the mid twentieth
|
|
century must be expressed and interpreted in terms of UT1
|
|
(contemporary Earth solar time at the 0° longitude), not UTC
|
|
(the approximation of UT1 that ticks in SI seconds). Time before the
|
|
formation of time zones must be expressed and interpeted as UT1
|
|
times with explicit time zones that approximate the contemporary
|
|
difference between the appropriate local time and the time observed
|
|
at the location of Greenwich, London.<div class="example">
|
|
|
|
<p>The following are some examples of dates written as <a href="#valid-global-date-and-time-string" title="valid global date and time string">valid global date and
|
|
time strings</a>.</p>
|
|
|
|
<dl><dt>"<code>0037-12-13T00:00Z</code>"</dt>
|
|
|
|
<dd>Midnight in areas using London time on the birthday of Nero
|
|
(the Roman Emperor). See below for further discussion on which
|
|
date this actually corresponds to.</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 the USA during daylight saving
|
|
time.</dd>
|
|
|
|
<dt>"<code>8592-01-01T02: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, which is not currently a real time zone, but is nonetheless
|
|
allowed.</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 (insofar as moments in time
|
|
before the formation of UTC can be unambiguously identified), 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 proleptic
|
|
Gregorian Calendar.</li>
|
|
<li>The time and time-zone offset components are not optional.</li>
|
|
|
|
<li>Dates before the year one can't be represented as a datetime
|
|
in this version of HTML.</li>
|
|
|
|
<li>Times of specific events in ancient times are, at best,
|
|
approximations, since time was not well coordinated or measured
|
|
until relatively recent decades.</li>
|
|
|
|
<li>Time-zone offsets differ based on daylight savings time.</li>
|
|
|
|
</ul></div><div class="impl">
|
|
|
|
<p>The <dfn id="best-representation-of-the-global-date-and-time-string">best representation of the global date and time
|
|
string</dfn> <var title="">datetime</var> is the <a href="#valid-global-date-and-time-string">valid global
|
|
date and time string</a> representing <var title="">datetime</var>, with the <a href="#valid-time-string">valid time string</a>
|
|
component being given in its shortest possible form, with the last
|
|
character of the string not being a U+005A LATIN CAPITAL LETTER Z
|
|
character (Z), even if the time zone is UTC, and with a U+002B PLUS
|
|
SIGN character (+) representing the sign of the time-zone offset
|
|
when the time zone is UTC.</p>
|
|
|
|
<p>The rules to <dfn id="parse-a-global-date-and-time-string">parse a global date and time string</dfn> are
|
|
as follows. This will return either a time in UTC, with associated
|
|
time-zone offset information for round-tripping or display purposes,
|
|
or nothing. If at any point the algorithm says that it "fails", this
|
|
means that it is aborted at that point and returns nothing.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#parse-a-date-component">Parse a date component</a> to obtain <var title="">year</var>, <var title="">month</var>, and <var title="">day</var>. If this returns nothing, then fail.</p>
|
|
|
|
<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+0054 LATIN CAPITAL LETTER T
|
|
character (T) then fail. Otherwise, move <var title="">position</var> forwards one character.</li>
|
|
|
|
<li><p><a href="#parse-a-time-component">Parse a time component</a> to obtain <var title="">hour</var>, <var title="">minute</var>, and <var title="">second</var>. If this returns nothing, then fail.</p>
|
|
|
|
<li><p>If <var title="">position</var> is beyond the end of <var title="">input</var>, then fail.</li>
|
|
|
|
<li><p><a href="#parse-a-time-zone-offset-component">Parse a time-zone offset component</a> to obtain
|
|
<var title="">timezone<sub title="">hours</sub></var> and <var title="">timezone<sub title="">minutes</sub></var>. If this returns
|
|
nothing, then fail.</p>
|
|
|
|
<li><p>If <var title="">position</var> is <em>not</em> beyond the
|
|
end of <var title="">input</var>, then fail.</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
|
|
time zone.</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.</li>
|
|
|
|
<li><p>Return <var title="">time</var> and <var title="">timezone</var>.</li>
|
|
|
|
</ol><p>The rules to <dfn id="parse-a-time-zone-offset-component">parse a time-zone offset component</dfn>, given
|
|
an <var title="">input</var> string and a <var title="">position</var>, are as follows. This will return either
|
|
time-zone hours and time-zone minutes, or nothing. If at any point
|
|
the algorithm says that it "fails", this means that it is aborted at
|
|
that point and returns nothing.</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the character at <var title="">position</var> is a U+005A
|
|
LATIN CAPITAL LETTER Z character (Z), then:</p>
|
|
|
|
<ol><li><p>Let <var title="">timezone<sub title="">hours</sub></var>
|
|
be 0.</li>
|
|
|
|
<li><p>Let <var title="">timezone<sub title="">minutes</sub></var> be 0.</li>
|
|
|
|
<li><p>Advance <var title="">position</var> to the next character
|
|
in <var title="">input</var>.</li>
|
|
|
|
</ol><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".</li>
|
|
|
|
<li><p>Advance <var title="">position</var> to the next character
|
|
in <var title="">input</var>.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">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 base-ten
|
|
integer. Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</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.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">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 base-ten
|
|
integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</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><p>Otherwise, fail.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Return <var title="">timezone<sub title="">hours</sub></var>
|
|
and <var title="">timezone<sub title="">minutes</sub></var>.</li>
|
|
|
|
</ol></div><h5 id="weeks"><span class="secno">2.5.5.6 </span>Weeks</h5><p>A <dfn id="concept-week" title="concept-week">week</dfn> consists of a week-year
|
|
number and a week number representing a seven-day period starting on
|
|
a Monday. Each week-year in this calendaring system has either 52 or
|
|
53 such seven-day periods, as defined below. The seven-day period
|
|
starting on the Gregorian date Monday December 29th 1969
|
|
(1969-12-29) is defined as week number 1 in week-year
|
|
1970. Consecutive weeks are numbered sequentially. The week before
|
|
the number 1 week in a week-year is the last week in the previous
|
|
week-year, and vice versa. <a href="#refsGREGORIAN">[GREGORIAN]</a><p>A week-year with a number <var title="">year</var> has 53 weeks
|
|
if it corresponds to either a year <var title="">year</var> in the
|
|
proleptic Gregorian calendar that has a Thursday as its first day
|
|
(January 1st), or a year <var title="">year</var> in the proleptic
|
|
Gregorian calendar that has a Wednesday as its first day (January
|
|
1st) and where <var title="">year</var> is a number divisible by
|
|
400, or a number divisible by 4 but not by 100. All other week-years
|
|
have 52 weeks.<p>The <dfn id="week-number-of-the-last-day">week number of the last day</dfn> of a week-year with 53
|
|
weeks is 53; the week number of the last day of a week-year with 52
|
|
weeks is 52.<p class="note">The week-year number of a particular day can be
|
|
different than the number of the year that contains that day in the
|
|
proleptic Gregorian calendar. The first week in a week-year <var title="">y</var> is the week that contains the first Thursday of
|
|
the Gregorian year <var title="">y</var>.<p>A string is a <dfn id="valid-week-string">valid week string</dfn> representing a
|
|
week-year <var title="">year</var> and week <var title="">week</var>
|
|
if it consists of the following components in the given order:<ol><li>Four or more <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>, representing <var title="">year</var>, where <var title="">year</var> > 0</li>
|
|
|
|
<li>A U+002D HYPHEN-MINUS character (-)</li>
|
|
|
|
<li>A U+0057 LATIN CAPITAL LETTER W character (W)</li>
|
|
|
|
<li>Two <a href="#concept-datetime-digit" title="concept-datetime-digit">digits</a>,
|
|
representing the week <var title="">week</var>, in the range
|
|
1 ≤ <var title="">week</var> ≤ <var title="">maxweek</var>, where <var title="">maxweek</var> is the
|
|
<a href="#week-number-of-the-last-day">week number of the last day</a> of week-year <var title="">year</var></li>
|
|
|
|
</ol><div class="impl">
|
|
|
|
<p>The rules to <dfn id="parse-a-week-string">parse a week string</dfn> are as follows. This
|
|
will return either a week-year number and week number, or
|
|
nothing. If at any point the algorithm says that it "fails", this
|
|
means that it is aborted at that point and returns nothing.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">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 at least four characters long, then
|
|
fail. Otherwise, interpret the resulting sequence as a base-ten
|
|
integer. Let that number be the <var title="">year</var>.</li>
|
|
|
|
<li><p>If <var title="">year</var> is not a number greater than
|
|
zero, 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+002D HYPHEN-MINUS character,
|
|
then fail. Otherwise, move <var title="">position</var> forwards
|
|
one character.</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+0057 LATIN CAPITAL LETTER W
|
|
character (W), then fail. Otherwise, move <var title="">position</var> forwards one character.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">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 base-ten integer. Let that
|
|
number be the <var title="">week</var>.</li>
|
|
|
|
<li><p>Let <var title="">maxweek</var> be the <a href="#week-number-of-the-last-day">week number of
|
|
the last day</a> of year <var title="">year</var>.</li>
|
|
|
|
<li><p>If <var title="">week</var> is not a number in the range
|
|
1 ≤ <var title="">week</var> ≤ <var title="">maxweek</var>, then fail.</li>
|
|
|
|
<li><p>If <var title="">position</var> is <em>not</em> beyond the
|
|
end of <var title="">input</var>, then fail.</li>
|
|
|
|
<li><p>Return the week-year number <var title="">year</var> and the
|
|
week number <var title="">week</var>.</li>
|
|
|
|
</ol></div><h5 id="vaguer-moments-in-time"><span class="secno">2.5.5.7 </span>Vaguer moments in time</h5><p>A string is a <dfn id="valid-date-or-time-string">valid date or time string</dfn> if it is also
|
|
one of the following:<ul><li>A <a href="#valid-date-string">valid date string</a>.</li>
|
|
|
|
<li>A <a href="#valid-time-string">valid time string</a>.</li>
|
|
|
|
<li>A <a href="#valid-global-date-and-time-string">valid global date and time string</a>.</li>
|
|
|
|
</ul><p>A string is a <dfn id="valid-date-or-time-string-in-content">valid date or time string in content</dfn> if
|
|
it consists of zero or more <a href="#white_space">White_Space</a> characters,
|
|
followed by a <a href="#valid-date-or-time-string">valid date or time string</a>, followed by
|
|
zero or more further <a href="#white_space">White_Space</a> characters.<hr><p>A string is a <dfn id="valid-date-string-with-optional-time">valid date string with optional time</dfn> if
|
|
it is also one of the following:<ul><li>A <a href="#valid-date-string">valid date string</a>.</li>
|
|
|
|
<li>A <a href="#valid-global-date-and-time-string">valid global date and time string</a>.</li>
|
|
|
|
</ul><p>A string is a <dfn id="valid-date-string-in-content-with-optional-time">valid date string in content with optional
|
|
time</dfn> if it consists of zero or more <a href="#white_space">White_Space</a>
|
|
characters, followed by a <a href="#valid-date-string-with-optional-time">valid date string with optional
|
|
time</a>, followed by zero or more further
|
|
<a href="#white_space">White_Space</a> characters.<div class="impl">
|
|
|
|
<hr><p>The rules to <dfn id="parse-a-date-or-time-string">parse a date or time string</dfn> are as
|
|
follows. The algorithm is invoked with a flag indicating if the
|
|
<i>in attribute</i> variant or the <i>in content</i> variant is to
|
|
be used. The algorithm will return either a <a href="#concept-date" title="concept-date">date</a>, a <a href="#concept-time" title="concept-time">time</a>, a <a href="#concept-datetime" title="concept-datetime">global date and time</a>, or nothing. If
|
|
at any point the algorithm says that it "fails", this means that it
|
|
is aborted at that point and returns nothing.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>For the <i>in content</i> variant: <a href="#skip-white_space-characters">skip White_Space
|
|
characters</a>.</li>
|
|
|
|
<li><p>Set <var title="">start position</var> to the same position
|
|
as <var title="">position</var>.</li>
|
|
|
|
<li><p>Set the <var title="">date present</var> and <var title="">time present</var> flags to true.</li>
|
|
|
|
<li><p><a href="#parse-a-date-component">Parse a date component</a> to obtain <var title="">year</var>, <var title="">month</var>, and <var title="">day</var>. If this fails, then set the <var title="">date
|
|
present</var> flag to false.</p>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">date present</var> is true, and <var title="">position</var> is not beyond the end of <var title="">input</var>, and the character at <var title="">position</var> is a U+0054 LATIN CAPITAL LETTER T
|
|
character (T), then advance <var title="">position</var> to the
|
|
next character in <var title="">input</var>.</p>
|
|
|
|
<p>Otherwise, if <var title="">date present</var> is true, and
|
|
either <var title="">position</var> is beyond the end of <var title="">input</var> or the character at <var title="">position</var> is not a U+0054 LATIN CAPITAL LETTER T
|
|
character (T), then set <var title="">time present</var> to
|
|
false.</p>
|
|
|
|
<p>Otherwise, if <var title="">date present</var> is false, set
|
|
<var title="">position</var> back to the same position as <var title="">start position</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the <var title="">time present</var> flag is true, then
|
|
<a href="#parse-a-time-component">parse a time component</a> to obtain <var title="">hour</var>, <var title="">minute</var>, and <var title="">second</var>. If this returns nothing, then fail.</li>
|
|
|
|
<li><p>If the <var title="">date present</var> and <var title="">time present</var> flags are both true, but <var title="">position</var> is beyond the end of <var title="">input</var>, then fail.</li>
|
|
|
|
<li><p>If the <var title="">date present</var> and <var title="">time present</var> flags are both true, <a href="#parse-a-time-zone-offset-component">parse a
|
|
time-zone offset component</a> to obtain <var title="">timezone<sub title="">hours</sub></var> and <var title="">timezone<sub title="">minutes</sub></var>. If this returns
|
|
nothing, then fail.</p>
|
|
|
|
<li><p>For the <i>in content</i> variant: <a href="#skip-white_space-characters">skip White_Space
|
|
characters</a>.</li>
|
|
|
|
<li><p>If <var title="">position</var> is <em>not</em> beyond the
|
|
end of <var title="">input</var>, then fail.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">date present</var> flag is true and the
|
|
<var title="">time present</var> flag is false, then let <var title="">date</var> be the date with year <var title="">year</var>, month <var title="">month</var>, and day <var title="">day</var>, and return <var title="">date</var>.</p>
|
|
|
|
<p>Otherwise, if the <var title="">time present</var> flag is true
|
|
and the <var title="">date present</var> flag is false, then let
|
|
<var title="">time</var> be the time with hour <var title="">hour</var>, minute <var title="">minute</var>, and second
|
|
<var title="">second</var>, and return <var title="">time</var>.</p>
|
|
|
|
<p>Otherwise, 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 being a
|
|
moment in the UTC time zone; 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; and return <var title="">time</var> and <var title="">timezone</var>.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><h4 id="colors"><span class="secno">2.5.6 </span>Colors</h4><p>A <dfn id="simple-color">simple color</dfn> consists of three 8-bit numbers in the
|
|
range 0..255, representing the red, green, and blue components of
|
|
the color respectively, in the sRGB color space. <a href="#refsSRGB">[SRGB]</a><p>A string is a <dfn id="valid-simple-color">valid simple color</dfn> if it is exactly
|
|
seven characters long, and the first character is a U+0023 NUMBER
|
|
SIGN character (#), and the remaining six characters are all in the
|
|
range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), U+0041 LATIN
|
|
CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER F, U+0061 LATIN
|
|
SMALL LETTER A to U+0066 LATIN SMALL LETTER F, with the first two
|
|
digits representing the red component, the middle two digits
|
|
representing the green component, and the last two digits
|
|
representing the blue component, in hexadecimal.<p>A string is a <dfn id="valid-lowercase-simple-color">valid lowercase simple color</dfn> if it is a
|
|
<a href="#valid-simple-color">valid simple color</a> and doesn't use any characters in
|
|
the range U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL
|
|
LETTER F.<div class="impl">
|
|
|
|
<p>The <dfn id="rules-for-parsing-simple-color-values">rules for parsing simple color values</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 return either a <a href="#simple-color">simple color</a>
|
|
or an error.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>If <var title="">input</var> is not exactly seven characters
|
|
long, then return an error.</li>
|
|
|
|
<li><p>If the first character in <var title="">input</var> is not a
|
|
U+0023 NUMBER SIGN character (#), then return an error.</li>
|
|
|
|
<li><p>If the last six characters of <var title="">input</var> are
|
|
not all in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
|
|
(9), U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER
|
|
F, U+0061 LATIN SMALL LETTER A to U+0066 LATIN SMALL LETTER F, then
|
|
return an error.</li>
|
|
|
|
<li><p>Let <var title="">result</var> be a <a href="#simple-color">simple
|
|
color</a>.</p>
|
|
|
|
<li><p>Interpret the second and third characters as a hexadecimal
|
|
number and let the result be the red component of <var title="">result</var>.</p>
|
|
|
|
<li><p>Interpret the fourth and fifth characters as a hexadecimal
|
|
number and let the result be the green component of <var title="">result</var>.</p>
|
|
|
|
<li><p>Interpret the sixth and seventh characters as a hexadecimal
|
|
number and let the result be the blue component of <var title="">result</var>.</p>
|
|
|
|
<li><p>Return <var title="">result</var>.</p>
|
|
|
|
</ol><p>The <dfn id="rules-for-serializing-simple-color-values">rules for serializing simple color values</dfn> given a
|
|
<a href="#simple-color">simple color</a> are as given in the following
|
|
algorithm:</p>
|
|
|
|
<ol><li><p>Let <var title="">result</var> be a string consisting of a
|
|
single U+0023 NUMBER SIGN character (#).</li>
|
|
|
|
<li><p>Convert the red, green, and blue components in turn to
|
|
two-digit hexadecimal numbers using the digits U+0030 DIGIT ZERO
|
|
(0) to U+0039 DIGIT NINE (9) and U+0061 LATIN SMALL LETTER A
|
|
to U+0066 LATIN SMALL LETTER F, zero-padding if necessary, and
|
|
append these numbers to <var title="">result</var>, in the order
|
|
red, green, blue.</p>
|
|
|
|
<li><p>Return <var title="">result</var>, which will be a
|
|
<a href="#valid-lowercase-simple-color">valid lowercase simple color</a>.</li>
|
|
|
|
</ol><hr><p>Some obsolete legacy attributes parse colors in a more
|
|
complicated manner, using the <dfn id="rules-for-parsing-a-legacy-color-value">rules for parsing a legacy color
|
|
value</dfn>, which are 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 return
|
|
either a <a href="#simple-color">simple color</a> or an error.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>If <var title="">input</var> is the empty string, then
|
|
return an error.</li>
|
|
|
|
<li><p><a href="#strip-leading-and-trailing-whitespace">Strip leading and trailing whitespace</a> from <var title="">input</var>.</li>
|
|
|
|
<li><p>If <var title="">input</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">transparent</code>", then return an error.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">input</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for one of the keywords listed in
|
|
the <a href="http://www.w3.org/TR/css3-color/#svg-color">SVG color
|
|
keywords</a> section of the CSS3 Color specification,
|
|
then return the <a href="#simple-color">simple color</a> corresponding to that
|
|
keyword. <a href="#refsCSSCOLOR">[CSSCOLOR]</a></p>
|
|
|
|
<p class="note"><a href="http://www.w3.org/TR/css3-color/#css2-system">CSS2 System
|
|
Colors</a> are not recognised.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">input</var> is four characters long, and the
|
|
first character in <var title="">input</var> is a U+0023 NUMBER
|
|
SIGN character (#), and the last three characters of <var title="">input</var> are all in the range U+0030 DIGIT ZERO (0)
|
|
to U+0039 DIGIT NINE (9), U+0041 LATIN CAPITAL LETTER A to U+0046
|
|
LATIN CAPITAL LETTER F, and U+0061 LATIN SMALL LETTER A to U+0066
|
|
LATIN SMALL LETTER F, then run these substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">result</var> be a <a href="#simple-color">simple
|
|
color</a>.</p>
|
|
|
|
<li><p>Interpret the second character of <var title="">input</var> as a hexadecimal digit; let the red
|
|
component of <var title="">result</var> be the resulting number
|
|
multiplied by 17.</p>
|
|
|
|
<li><p>Interpret the third character of <var title="">input</var>
|
|
as a hexadecimal digit; let the green component of <var title="">result</var> be the resulting number multiplied by
|
|
17.</p>
|
|
|
|
<li><p>Interpret the fourth character of <var title="">input</var> as a hexadecimal digit; let the blue
|
|
component of <var title="">result</var> be the resulting number
|
|
multiplied by 17.</p>
|
|
|
|
<li><p>Return <var title="">result</var>.</p>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Replace any characters in <var title="">input</var> that
|
|
have a Unicode code point greater than U+FFFF (i.e. any characters
|
|
that are not in the basic multilingual plane) with the
|
|
two-character string "<code title="">00</code>".</li>
|
|
|
|
<li><p>If <var title="">input</var> is longer than 128 characters,
|
|
truncate <var title="">input</var>, leaving only the first 128
|
|
characters.</li>
|
|
|
|
<li><p>If the first character in <var title="">input</var> is a
|
|
U+0023 NUMBER SIGN character (#), remove it.</li>
|
|
|
|
<li><p>Replace any character in <var title="">input</var> that is
|
|
not in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
|
|
U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER F, and
|
|
U+0061 LATIN SMALL LETTER A to U+0066 LATIN SMALL LETTER F with the
|
|
character U+0030 DIGIT ZERO (0).</li>
|
|
|
|
<li><p>While <var title="">input</var>'s length is zero or not a
|
|
multiple of three, append a U+0030 DIGIT ZERO (0) character to <var title="">input</var>.</li>
|
|
|
|
<li><p>Split <var title="">input</var> into three strings of equal
|
|
length, to obtain three components. Let <var title="">length</var>
|
|
be the length of those components (one third the length of <var title="">input</var>).</li>
|
|
|
|
<li><p>If <var title="">length</var> is greater than 8, then remove
|
|
the leading <span title=""><var title="">length</var>-8</span>
|
|
characters in each component, and let <var title="">length</var> be
|
|
8.</li>
|
|
|
|
<li><p>While <var title="">length</var> is greater than two and the
|
|
first character in each component is a U+0030 DIGIT ZERO (0)
|
|
character, remove that character and reduce <var title="">length</var> by one.</li>
|
|
|
|
<li><p>If <var title="">length</var> is <em>still</em> greater than
|
|
two, truncate each component, leaving only the first two
|
|
characters in each.</li>
|
|
|
|
<li><p>Let <var title="">result</var> be a <a href="#simple-color">simple
|
|
color</a>.</p>
|
|
|
|
<li><p>Interpret the first component as a hexadecimal number; let
|
|
the red component of <var title="">result</var> be the resulting
|
|
number.</li>
|
|
|
|
<li><p>Interpret the second component as a hexadecimal number; let
|
|
the green component of <var title="">result</var> be the resulting
|
|
number.</li>
|
|
|
|
<li><p>Interpret the third component as a hexadecimal number; let
|
|
the blue component of <var title="">result</var> be the resulting
|
|
number.</li>
|
|
|
|
<li><p>Return <var title="">result</var>.</p>
|
|
|
|
</ol></div><hr><h4 id="space-separated-tokens"><span class="secno">2.5.7 </span>Space-separated tokens</h4><p>A <dfn id="set-of-space-separated-tokens">set of space-separated tokens</dfn> is a string containing
|
|
zero or more words (known as tokens) separated by one or more <a href="#space-character" title="space character">space characters</a>, where words consist
|
|
of any string of one or more characters, none of which are <a href="#space-character" title="space character">space characters</a>.<p>A string containing a <a href="#set-of-space-separated-tokens">set of space-separated tokens</a>
|
|
may have leading or trailing <a href="#space-character" title="space character">space
|
|
characters</a>.<p>An <dfn id="unordered-set-of-unique-space-separated-tokens">unordered set of unique space-separated tokens</dfn> is a
|
|
<a href="#set-of-space-separated-tokens">set of space-separated tokens</a> where none of the tokens
|
|
are duplicated.<p>An <dfn id="ordered-set-of-unique-space-separated-tokens">ordered set of unique space-separated tokens</dfn> is a
|
|
<a href="#set-of-space-separated-tokens">set of space-separated tokens</a> where none of the tokens
|
|
are duplicated but where the order of the tokens is meaningful.<p><a href="#set-of-space-separated-tokens" title="set of space-separated tokens">Sets of
|
|
space-separated tokens</a> 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.<p class="note">How tokens in a <a href="#set-of-space-separated-tokens">set of space-separated
|
|
tokens</a> are to be compared (e.g. case-sensitively or not) is
|
|
defined on a per-set basis.<div class="impl">
|
|
|
|
<p>When a user agent has to <dfn id="split-a-string-on-spaces">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.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>Let <var title="">tokens</var> be a list of tokens,
|
|
initially empty.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a></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-a-sequence-of-characters">Collect a sequence of characters</a> that are not
|
|
<a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
<li><p>Add the string collected in the previous step to <var title="">tokens</var>.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a></li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Return <var title="">tokens</var>.</li>
|
|
|
|
</ol><p>When a user agent has to <dfn id="remove-a-token-from-a-string">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.</li>
|
|
|
|
<li><p>Let <var title="">token</var> be the token being removed. It
|
|
will not contain any <a href="#space-character" title="space character">space
|
|
characters</a>.</li>
|
|
|
|
<li><p>Let <var title="">output</var> be the output string,
|
|
initially empty.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><i>Loop</i>: If <var title="">position</var> is beyond the
|
|
end of <var title="">input</var>, abort these steps.</li>
|
|
|
|
<li><p>If the character at <var title="">position</var> is a
|
|
<a href="#space-character">space character</a>:</p>
|
|
|
|
<ol><li><p>Append the character at <var title="">position</var> to
|
|
the end of <var title="">output</var>.</li>
|
|
|
|
<li><p>Advance <var title="">position</var> so it points at the
|
|
next character in <var title="">input</var>.</li>
|
|
|
|
<li><p>Return to the step labeled <i>loop</i>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Otherwise, the character at <var title="">position</var> is
|
|
the first character of a token. <a href="#collect-a-sequence-of-characters">Collect a sequence of
|
|
characters</a> that are not <a href="#space-character" title="space character">space
|
|
characters</a>, and let that be <var title="">s</var>.</li>
|
|
|
|
<li><p>If <var title="">s</var> is exactly equal to <var title="">token</var> (this is a <a href="#case-sensitive">case-sensitive</a>
|
|
comparison), then:</p>
|
|
|
|
<ol><li><p><a href="#skip-whitespace">Skip whitespace</a> (in <var title="">input</var>).</li>
|
|
|
|
<li><p>Remove any <a href="#space-character" title="space character">space
|
|
characters</a> currently at the end of <var title="">output</var>.</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>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Otherwise, append <var title="">s</var> to the end of <var title="">output</var>.</li>
|
|
|
|
<li><p>Return to the step labeled <i>loop</i>.</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>
|
|
|
|
</div><h4 id="comma-separated-tokens"><span class="secno">2.5.8 </span>Comma-separated tokens</h4><p>A <dfn id="set-of-comma-separated-tokens">set of comma-separated tokens</dfn> is a string containing
|
|
zero or more tokens each separated from the next by a single U+002C
|
|
COMMA character (,), where tokens consist of any string of zero or
|
|
more characters, neither beginning nor ending with <a href="#space-character" title="space character">space characters</a>, nor containing any
|
|
U+002C COMMA characters (,), and optionally surrounded by <a href="#space-character" title="space character">space characters</a>.<p class="example">For instance, the string "<code title=""> a ,b,,d d </code>" consists of four
|
|
tokens: "a", "b", the empty string, and "d d". Leading and
|
|
trailing whitespace around each token doesn't count as part of the
|
|
token, and the empty string can be a token.<p><a href="#set-of-comma-separated-tokens" title="set of comma-separated tokens">Sets of
|
|
comma-separated tokens</a> sometimes have further restrictions on
|
|
what consists a valid token. When such restrictions are defined, the
|
|
tokens must all fit within those restrictions; other values are
|
|
non-conforming. If no such restrictions are specified, then all
|
|
values are conforming.<div class="impl">
|
|
|
|
<p>When a user agent has to <dfn id="split-a-string-on-commas">split a string on commas</dfn>, it
|
|
must use the following algorithm:</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>Let <var title="">tokens</var> be a list of tokens,
|
|
initially empty.</li>
|
|
|
|
<li><p><i>Token</i>: If <var title="">position</var> is past the
|
|
end of <var title="">input</var>, jump to the last step.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> that are not
|
|
U+002C COMMA characters (,). Let <var title="">s</var> be the resulting sequence (which might be the
|
|
empty string).</li>
|
|
|
|
<li><p>Remove any leading or trailing sequence of <a href="#space-character" title="space character">space characters</a> from <var title="">s</var>.</li>
|
|
|
|
<li><p>Add <var title="">s</var> to <var title="">tokens</var>.</li>
|
|
|
|
<li><p>If <var title="">position</var> is not past the end of <var title="">input</var>, then the character at <var title="">position</var> is a U+002C COMMA character (,); advance
|
|
<var title="">position</var> past that character.</li>
|
|
|
|
<li><p>Jump back to the step labeled <i>token</i>.</li>
|
|
|
|
<li><p>Return <var title="">tokens</var>.</li>
|
|
|
|
</ol></div><h4 id="syntax-references"><span class="secno">2.5.9 </span>References</h4><p>A <dfn id="valid-hash-name-reference">valid hash-name reference</dfn> to an element of type <var title="">type</var> is a string consisting of a U+0023 NUMBER SIGN
|
|
character (#) followed by a string which exactly matches the value
|
|
of the <code title="">name</code> attribute of an element with type
|
|
<var title="">type</var> in the document.<div class="impl">
|
|
|
|
<p>The <dfn id="rules-for-parsing-a-hash-name-reference">rules for parsing a hash-name 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.</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.</li>
|
|
|
|
<li><p>Return the first element of type <var title="">type</var>
|
|
that has an <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute whose value
|
|
is a <a href="#case-sensitive">case-sensitive</a> match for <var title="">s</var> or
|
|
a <code title="">name</code> attribute whose value is a
|
|
<a href="#compatibility-caseless">compatibility caseless</a> match for <var title="">s</var>.</li>
|
|
|
|
|
|
</ol></div><h4 id="mq"><span class="secno">2.5.10 </span>Media queries</h4><p>A string is a <dfn id="valid-media-query">valid media query</dfn> if it matches the
|
|
<code title="">media_query_list</code> production of the Media
|
|
Queries specification. <a href="#refsMQ">[MQ]</a><p>A string <dfn id="matches-the-environment">matches the environment</dfn> of the user if it is
|
|
the empty string, a string consisting of only <a href="#space-character" title="space
|
|
character">space characters</a>, or is a media query that matches
|
|
the user's environment according to the definitions given in the
|
|
Media Queries specification. <a href="#refsMQ">[MQ]</a><h3 id="urls"><span class="secno">2.6 </span>URLs</h3><p>This specification defines the term <a href="#url">URL</a>, and defines
|
|
various algorithms for dealing with URLs, because for historical
|
|
reasons the rules defined by the URI and IRI specifications are not
|
|
a complete description of what HTML user agents need to implement to
|
|
be compatible with Web content.<p class="note">The term "URL" in this specification is used in a
|
|
manner distinct from the precise technical meaning it is given in
|
|
RFC 3986. Readers familiar with that RFC will find it easier to read
|
|
<em>this</em> specification if they pretend the term "URL" as used
|
|
herein is really called something else altogether. This is a
|
|
<a href="#willful-violation">willful violation</a> of RFC 3986. <a href="#refsRFC3986">[RFC3986]</a><h4 id="terminology-0"><span class="secno">2.6.1 </span>Terminology</h4><p>A <dfn id="url">URL</dfn> is a string used to identify a resource.<p>A <a href="#url">URL</a> is a <dfn id="valid-url">valid URL</dfn> if at least one of
|
|
the following conditions holds:<ul><li><p>The <a href="#url">URL</a> is a valid URI reference <a href="#refsRFC3986">[RFC3986]</a>.</li>
|
|
|
|
<li><p>The <a href="#url">URL</a> is a valid IRI reference and it has no
|
|
query component. <a href="#refsRFC3987">[RFC3987]</a></li>
|
|
|
|
<li><p>The <a href="#url">URL</a> is a valid IRI reference and its query
|
|
component contains no unescaped non-ASCII characters. <a href="#refsRFC3987">[RFC3987]</a></li>
|
|
|
|
<li><p>The <a href="#url">URL</a> is a valid IRI reference and the <a href="#document-s-character-encoding" title="document's character encoding">character encoding</a> of
|
|
the URL's <code><a href="#document">Document</a></code> is UTF-8 or UTF-16. <a href="#refsRFC3987">[RFC3987]</a></li>
|
|
|
|
</ul><p>A string is a <dfn id="valid-non-empty-url">valid non-empty URL</dfn> if it is a
|
|
<a href="#valid-url">valid URL</a> but it is not the empty string.<p>A string is a <dfn id="valid-url-potentially-surrounded-by-spaces">valid URL potentially surrounded by
|
|
spaces</dfn> if, after <a href="#strip-leading-and-trailing-whitespace" title="strip leading and trailing
|
|
whitespace">stripping leading and trailing whitespace</a> from
|
|
it, it is a <a href="#valid-url">valid URL</a>.<p>A string is a <dfn id="valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</dfn> if, after <a href="#strip-leading-and-trailing-whitespace" title="strip leading and trailing
|
|
whitespace">stripping leading and trailing whitespace</a> from
|
|
it, it is a <a href="#valid-non-empty-url">valid non-empty URL</a>.<p>This specification defines the URL
|
|
<dfn id="about:legacy-compat"><code>about:legacy-compat</code></dfn> as a reserved, though
|
|
unresolvable, <code title="">about:</code> URI, for use in <a href="#syntax-doctype" title="syntax-doctype">DOCTYPE</a>s in <a href="#html-documents">HTML
|
|
documents</a> when needed for compatibility with XML tools. <a href="#refsABOUT">[ABOUT]</a><p>This specification defines the URL
|
|
<dfn id="about:srcdoc"><code>about:srcdoc</code></dfn> as a reserved, though
|
|
unresolvable, <code title="">about:</code> URI, that is used as
|
|
<a href="#the-document-s-address">the document's address</a> of <a href="#an-iframe-srcdoc-document" title="an iframe srcdoc
|
|
document"><code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> documents</a>. <a href="#refsABOUT">[ABOUT]</a><div class="impl">
|
|
|
|
<h4 id="parsing-urls"><span class="secno">2.6.2 </span>Parsing URLs</h4>
|
|
|
|
<p>To <dfn id="parse-a-url">parse a URL</dfn> <var title="">url</var> into its
|
|
component parts, the user agent must use the following steps:</p>
|
|
|
|
<ol><li><p>Strip leading and trailing <a href="#space-character" title="space
|
|
character">space characters</a> from <var title="">url</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Parse <var title="">url</var> in the manner defined by RFC
|
|
3986, with the following exceptions:</p>
|
|
|
|
<ul><li>Add all characters with code points less than or equal to
|
|
U+0020 or greater than or equal to U+007F to the
|
|
<unreserved> production.</li>
|
|
|
|
<li>Add the characters U+0022, U+003C, U+003E, U+005B .. U+005E,
|
|
U+0060, and U+007B .. U+007D to the <unreserved>
|
|
production.
|
|
<!--
|
|
0022 QUOTATION MARK
|
|
003C LESS-THAN SIGN
|
|
003E GREATER-THAN SIGN
|
|
005B LEFT SQUARE BRACKET
|
|
005C REVERSE SOLIDUS
|
|
005D RIGHT SQUARE BRACKET
|
|
005E CIRCUMFLEX ACCENT
|
|
0060 GRAVE ACCENT
|
|
007B LEFT CURLY BRACKET
|
|
007C VERTICAL LINE
|
|
007D RIGHT CURLY BRACKET
|
|
-->
|
|
</li>
|
|
|
|
<li>Add a single U+0025 PERCENT SIGN character as a second
|
|
alternative way of matching the <pct-encoded> production,
|
|
except when the <pct-encoded> is used in the
|
|
<reg-name> production.</li>
|
|
|
|
<li>Add the U+0023 NUMBER SIGN character to the characters
|
|
allowed in the <fragment> production.</li>
|
|
|
|
|
|
</ul></li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">url</var> doesn't match the
|
|
<URI-reference> production, even after the above changes are
|
|
made to the ABNF definitions, then parsing the URL fails with an
|
|
error. <a href="#refsRFC3986">[RFC3986]</a></p>
|
|
|
|
<p>Otherwise, parsing <var title="">url</var> was successful; the
|
|
components of the URL are substrings of <var title="">url</var>
|
|
defined as follows:</p>
|
|
|
|
<dl><dt><dfn id="url-scheme" title="url-scheme"><scheme></dfn></dt>
|
|
|
|
<dd><p>The substring matched by the <scheme> production, if any.</dd>
|
|
|
|
|
|
<dt><dfn id="url-host" title="url-host"><host></dfn></dt>
|
|
|
|
<dd><p>The substring matched by the <host> production, if any.</dd>
|
|
|
|
|
|
<dt><dfn id="url-port" title="url-port"><port></dfn></dt>
|
|
|
|
<dd><p>The substring matched by the <port> production, if any.</dd>
|
|
|
|
|
|
<dt><dfn id="url-hostport" title="url-hostport"><hostport></dfn></dt>
|
|
|
|
<dd><p>If there is a <scheme> component and a <port>
|
|
component and the port given by the <port> component is
|
|
different than the default port defined for the protocol given by
|
|
the <scheme> component, then <hostport> is the
|
|
substring that starts with the substring matched by the
|
|
<host> production and ends with the substring matched by the
|
|
<port> production, and includes the colon in between the
|
|
two. Otherwise, it is the same as the <host> component.</p>
|
|
|
|
|
|
<dt><dfn id="url-path" title="url-path"><path></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The substring matched by one of the following productions, if
|
|
one of them was matched:</p>
|
|
|
|
<ul class="brief"><li><path-abempty></li>
|
|
<li><path-absolute></li>
|
|
<li><path-noscheme></li>
|
|
<li><path-rootless></li>
|
|
<li><path-empty></li>
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="url-query" title="url-query"><query></dfn></dt>
|
|
|
|
<dd><p>The substring matched by the <query> production, if any.</dd>
|
|
|
|
|
|
<dt><dfn id="url-fragment" title="url-fragment"><fragment></dfn></dt>
|
|
|
|
<dd><p>The substring matched by the <fragment> production, if any.</dd>
|
|
|
|
|
|
<dt><dfn id="url-host-specific" title="url-host-specific"><host-specific></dfn></dt>
|
|
|
|
<dd><p>The substring that <em>follows</em> the substring matched
|
|
by the <authority> production, or the whole string if the
|
|
<authority> production wasn't matched.</dd>
|
|
|
|
</dl></li>
|
|
|
|
</ol><p class="note">These parsing rules are a <a href="#willful-violation">willful
|
|
violation</a> of RFC 3986 and RFC 3987 (which do not define error
|
|
handling), motivated by a desire to handle legacy content. <a href="#refsRFC3986">[RFC3986]</a> <a href="#refsRFC3987">[RFC3987]</a></p>
|
|
|
|
</div><h4 id="resolving-urls"><span class="secno">2.6.3 </span>Resolving URLs</h4><p>Resolving a URL is the process of taking a relative URL and
|
|
obtaining the absolute URL that it implies.<div class="impl">
|
|
|
|
<p>To <dfn id="resolve-a-url">resolve a URL</dfn> to an <a href="#absolute-url">absolute URL</a>
|
|
relative to either another <a href="#absolute-url">absolute URL</a> or an element,
|
|
the user agent must use the following steps. Resolving a URL can
|
|
result in an error, in which case the URL is not resolvable.</p>
|
|
|
|
<ol><li><p>Let <var title="">url</var> be the <a href="#url">URL</a> being
|
|
resolved.</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">encoding</var> be determined as follows:</p>
|
|
|
|
<dl class="switch"><dt>If the URL had a character encoding defined when the URL was
|
|
created or defined</dt>
|
|
|
|
<dd>The URL character encoding is as defined.</dd>
|
|
|
|
<dt>If the URL came from a script (e.g. as an argument to a
|
|
method)</dt>
|
|
|
|
<dd>The URL character encoding is the <a href="#script-s-url-character-encoding">script's URL character
|
|
encoding</a>.</dd>
|
|
|
|
<dt>If the URL came from a DOM node (e.g. from an element)</dt>
|
|
|
|
<dd>The node has a <code><a href="#document">Document</a></code>, and the URL character
|
|
encoding is the <a href="#document-s-character-encoding">document's character encoding</a>.</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>If <var title="">encoding</var> is a UTF-16 encoding, then
|
|
change the value of <var title="">encoding</var> to UTF-8.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the algorithm was invoked with an <a href="#absolute-url">absolute URL</a>
|
|
to use as the base URL, let <var title="">base</var> be that
|
|
<a href="#absolute-url">absolute URL</a>.</p>
|
|
|
|
<p>Otherwise, let <var title="">base</var> be the <i>base URI of
|
|
the element</i>, as defined by the XML Base specification, with
|
|
<i>the base URI of the document entity</i> being defined as the
|
|
<a href="#document-base-url">document base URL</a> of the <code><a href="#document">Document</a></code> that
|
|
owns the element. <a href="#refsXMLBASE">[XMLBASE]</a></p>
|
|
|
|
<p>For the purposes of the XML Base specification, user agents
|
|
must act as if all <code><a href="#document">Document</a></code> objects represented XML
|
|
documents.</p>
|
|
|
|
<p class="note">It is possible for <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attributes to be present
|
|
even in HTML fragments, as such attributes can be added
|
|
dynamically using script. (Such scripts would not be conforming,
|
|
however, as <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attributes
|
|
are not allowed in <a href="#html-documents">HTML documents</a>.)</p>
|
|
|
|
<p>The <dfn id="document-base-url">document base URL</dfn> of a <code><a href="#document">Document</a></code>
|
|
object is the <a href="#absolute-url">absolute URL</a> obtained by running these
|
|
substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">fallback base url</var> be <a href="#the-document-s-address">the
|
|
document's address</a>.</li>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
|
|
<p>If <var title="">fallback base url</var> is
|
|
<code><a href="#about:blank">about:blank</a></code>, and the <code><a href="#document">Document</a></code>'s
|
|
<a href="#browsing-context">browsing context</a> has a <a href="#creator-browsing-context">creator browsing
|
|
context</a>, then let <var title="">fallback base url</var>
|
|
be the <a href="#document-base-url">document base URL</a> of the <a href="#creator-document">creator
|
|
<code>Document</code></a> instead.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the <code><a href="#document">Document</a></code> is <a href="#an-iframe-srcdoc-document">an
|
|
<code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a>, then
|
|
let <var title="">fallback base url</var> be the <a href="#document-base-url">document
|
|
base URL</a> of the <code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#browsing-context-container">browsing context container</a>'s
|
|
<code><a href="#document">Document</a></code> instead.</li>
|
|
|
|
<li><p>If there is no <code><a href="#the-base-element">base</a></code> element that has an <code title="attr-base-href"><a href="#attr-base-href">href</a></code> attribute, then the
|
|
<a href="#document-base-url">document base URL</a> is <var title="">fallback base
|
|
url</var>; abort these steps. Otherwise, let <var title="">url</var> be the value of the <code title="attr-base-href"><a href="#attr-base-href">href</a></code> attribute of the first such
|
|
element.</li>
|
|
|
|
<li><p><a href="#resolve-a-url" title="resolve a URL">Resolve</a> <var title="">url</var> relative to <var title="">fallback base
|
|
url</var> (thus, the <code><a href="#the-base-element">base</a></code> <code title="attr-base-href"><a href="#attr-base-href">href</a></code> attribute isn't affected by
|
|
<code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attributes).</li>
|
|
|
|
<li><p>The <a href="#document-base-url">document base URL</a> is the result of the
|
|
previous step if it was successful; otherwise it is <var title="">fallback base url</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p><a href="#parse-a-url" title="parse a URL">Parse</a> <var title="">url</var> into its component parts.</li>
|
|
|
|
<li>
|
|
|
|
<p>If parsing <var title="">url</var> resulted in a <a href="#url-host" title="url-host"><host></a> component, then replace the
|
|
matching substring of <var title="">url</var> with the string that
|
|
results from expanding any sequences of percent-encoded octets in
|
|
that component that are valid UTF-8 sequences into Unicode
|
|
characters as defined by UTF-8.</p>
|
|
|
|
<p>If any percent-encoded octets in that component are not valid
|
|
UTF-8 sequences, then return an error and abort these steps.</p>
|
|
|
|
<p>Apply the IDNA ToASCII algorithm to the matching substring,
|
|
with both the AllowUnassigned and UseSTD3ASCIIRules flags
|
|
set. Replace the matching substring with 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 return an error and abort these steps. <a href="#refsRFC3490">[RFC3490]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If parsing <var title="">url</var> resulted in a <a href="#url-path" title="url-path"><path></a> component, then replace the
|
|
matching substring of <var title="">url</var> with the string that
|
|
results from applying the following steps to each character other
|
|
than U+0025 PERCENT SIGN (%) that doesn't match the original
|
|
<path> production defined in RFC 3986:</p>
|
|
|
|
<ol><li>Encode the character into a sequence of octets as defined by
|
|
UTF-8.</li>
|
|
|
|
<li>Replace the character with the percent-encoded form of those
|
|
octets. <a href="#refsRFC3986">[RFC3986]</a></li>
|
|
|
|
</ol><div class="example">
|
|
|
|
<p>For instance if <var title="">url</var> was "<code title="">//example.com/a^b☺c%FFd%z/?e</code>", then the
|
|
<a href="#url-path" title="url-path"><path></a> component's substring
|
|
would be "<code title="">/a^b☺c%FFd%z/</code>" and the two
|
|
characters that would have to be escaped would be "<code title="">^</code>" and "<code title="">☺</code>". The
|
|
result after this step was applied would therefore be that <var title="">url</var> now had the value "<code title="">//example.com/a%5Eb%E2%98%BAc%FFd%z/?e</code>".</p>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If parsing <var title="">url</var> resulted in a <a href="#url-query" title="url-query"><query></a> component, then replace the
|
|
matching substring of <var title="">url</var> with the string that
|
|
results from applying the following steps to each character other
|
|
than U+0025 PERCENT SIGN (%) that doesn't match the original
|
|
<query> production defined in RFC 3986:</p>
|
|
|
|
<ol><li>If the character in question cannot be expressed in the
|
|
encoding <var title="">encoding</var>, then replace it with a
|
|
single 0x3F octet (an ASCII question mark) and skip the remaining
|
|
substeps for this character.</li>
|
|
|
|
<li>Encode the character into a sequence of octets as defined by
|
|
the encoding <var title="">encoding</var>.</li>
|
|
|
|
<li>Replace the character with the percent-encoded form of those
|
|
octets. <a href="#refsRFC3986">[RFC3986]</a></li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Apply the algorithm described in RFC 3986 section 5.2
|
|
Relative Resolution, using <var title="">url</var> as the
|
|
potentially relative URI reference (<var title="">R</var>), and
|
|
<var title="">base</var> as the base URI (<var title="">Base</var>). <a href="#refsRFC3986">[RFC3986]</a></li>
|
|
|
|
<li>
|
|
|
|
<p>Apply any relevant conformance criteria of RFC 3986 and RFC
|
|
3987, returning an error and aborting these steps if
|
|
appropriate. <a href="#refsRFC3986">[RFC3986]</a> <a href="#refsRFC3987">[RFC3987]</a></p>
|
|
|
|
<p class="example">For instance, if an absolute URI that would be
|
|
returned by the above algorithm violates the restrictions specific
|
|
to its scheme, e.g. a <code title="">data:</code> URI using the
|
|
"<code title="">//</code>" server-based naming authority syntax,
|
|
then user agents are to treat this as an error instead.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">result</var> be the target URI (<var title="">T</var>) returned by the Relative Resolution
|
|
algorithm.</li>
|
|
|
|
<li><p>If <var title="">result</var> uses a scheme with a
|
|
server-based naming authority, replace all U+005C REVERSE SOLIDUS
|
|
(\) characters in <var title="">result</var> with U+002F SOLIDUS
|
|
(/) characters.</li>
|
|
|
|
<li><p>Return <var title="">result</var>.</li>
|
|
|
|
</ol><p class="note">Some of the steps in these rules, for example the
|
|
processing of U+005C REVERSE SOLIDUS (\) characters, are a
|
|
<a href="#willful-violation">willful violation</a> of RFC 3986 and RFC 3987, motivated
|
|
by a desire to handle legacy content. <a href="#refsRFC3986">[RFC3986]</a> <a href="#refsRFC3987">[RFC3987]</a></p>
|
|
|
|
</div><p>A <a href="#url">URL</a> is an <dfn id="absolute-url">absolute URL</dfn> if <a href="#resolve-a-url" title="resolve a url">resolving</a> it results in the same output
|
|
regardless of what it is resolved relative to, and that output is
|
|
not a failure.<p>An <a href="#absolute-url">absolute URL</a> is a <dfn id="hierarchical-url">hierarchical URL</dfn> if,
|
|
when <a href="#resolve-a-url" title="resolve a url">resolved</a> and then <a href="#parse-a-url" title="parse a url">parsed</a>, there is a character immediately
|
|
after the <a href="#url-scheme" title="url-scheme"><scheme></a> component
|
|
and it is a U+002F SOLIDUS character (/).<p>An <a href="#absolute-url">absolute URL</a> is an <dfn id="authority-based-url">authority-based URL</dfn>
|
|
if, when <a href="#resolve-a-url" title="resolve a url">resolved</a> and then <a href="#parse-a-url" title="parse a url">parsed</a>, there are two characters
|
|
immediately after the <a href="#url-scheme" title="url-scheme"><scheme></a>
|
|
component and they are both U+002F SOLIDUS characters (//).<div class="impl">
|
|
|
|
<h4 id="url-manipulation-and-creation"><span class="secno">2.6.4 </span>URL manipulation and creation</h4>
|
|
|
|
<p>To <dfn id="fragment-escaped" title="fragment-escaped">fragment-escape</dfn> a string
|
|
<var title="">input</var>, a user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string to be
|
|
escaped.</li>
|
|
|
|
<li><p>Let <var title="">position</var> point at the first
|
|
character of <var title="">input</var>.</li>
|
|
|
|
<li><p>Let <var title="">output</var> be an empty string.</li>
|
|
|
|
<li><p><i>Loop</i>: If <var title="">position</var> is past the end
|
|
of <var title="">input</var>, then jump to the step labeled
|
|
<i>end</i>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the character in <var title="">input</var> pointed to by
|
|
<var title="">position</var> is in the range U+0000 to U+0020 or
|
|
is one of the following characters:</p>
|
|
|
|
<ul class="brief"><li>U+0022 QUOTATION MARK character (")
|
|
<li>U+0023 NUMBER SIGN character (#)
|
|
<li>U+0025 PERCENT SIGN character (%)
|
|
<li>U+003C LESS-THAN SIGN character (<)
|
|
<li>U+003E GREATER-THAN SIGN character (>)
|
|
<li>U+005B LEFT SQUARE BRACKET character ([)
|
|
<li>U+005C REVERSE SOLIDUS character (\)
|
|
<li>U+005D RIGHT SQUARE BRACKET character (])
|
|
<li>U+005E CIRCUMFLEX ACCENT character (^)
|
|
<li>U+007B LEFT CURLY BRACKET character ({)
|
|
<li>U+007C VERTICAL LINE character (|)
|
|
<li>U+007D RIGHT CURLY BRACKET character (})
|
|
</ul><p>...then append the percent-encoded form of the character to
|
|
<var title="">output</var>. <a href="#refsRFC3986">[RFC3986]</a></p>
|
|
<p>Otherwise, append the character itself to <var title="">output</var>.</p>
|
|
|
|
<p class="note">This escapes any ASCII characters that are not
|
|
valid in the URI <fragment> production without being
|
|
escaped.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Advance <var title="">position</var> to the next character
|
|
in <var title="">input</var>.</li>
|
|
|
|
<li><p>Return to the step labeled <i>loop</i>.</li>
|
|
|
|
<li><p><i>End</i>: Return <var title="">output</var>.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h4 id="dynamic-changes-to-base-urls"><span class="secno">2.6.5 </span>Dynamic changes to base URLs</h4>
|
|
|
|
<p>When an <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attribute
|
|
changes, the attribute's element, and all descendant elements, are
|
|
<a href="#affected-by-a-base-url-change">affected by a base URL change</a>.</p>
|
|
|
|
<p>When a document's <a href="#document-base-url">document base URL</a> changes, all
|
|
elements in that document are <a href="#affected-by-a-base-url-change">affected by a base URL
|
|
change</a>.</p>
|
|
|
|
<p>When an element is moved from one document to another, if the two
|
|
documents have different <a href="#document-base-url" title="document base URL">base
|
|
URLs</a>, then that element and all its descendants are
|
|
<a href="#affected-by-a-base-url-change">affected by a base URL change</a>.</p>
|
|
|
|
<p>When an element is <dfn id="affected-by-a-base-url-change">affected by a base URL change</dfn>, it
|
|
must act as described in the following list:</p>
|
|
|
|
<dl class="switch"><dt>If the element creates a <a href="#hyperlink">hyperlink</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <a href="#absolute-url">absolute URL</a> identified by the hyperlink is
|
|
being shown to the user, or if any data derived from that URL is
|
|
affecting the display, then the <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute should be <a href="#resolve-a-url" title="resolve a url">re-resolved</a> relative to the element
|
|
and the UI updated appropriately.</p>
|
|
|
|
<p class="example">For example, the CSS <code title="selector-link"><a href="#selector-link">:link</a></code>/<code title="selector-visited"><a href="#selector-visited">:visited</a></code> pseudo-classes might have
|
|
been affected.</p>
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>If the element is a <code><a href="#the-q-element">q</a></code>, <code><a href="#the-blockquote-element">blockquote</a></code>,
|
|
<code><a href="#the-section-element">section</a></code>, <code><a href="#the-article-element">article</a></code>, <code><a href="#the-ins-element">ins</a></code>, or
|
|
<code><a href="#the-del-element">del</a></code> element with a <code title="">cite</code>
|
|
attribute</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <a href="#absolute-url">absolute URL</a> identified by the <code title="">cite</code> attribute is being shown to the user, or if
|
|
any data derived from that URL is affecting the display, then the
|
|
<a href="#url">URL</a> should be <a href="#resolve-a-url" title="resolve a
|
|
url">re-resolved</a> relative to the element and the UI updated
|
|
appropriately.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The element is not directly affected.</p>
|
|
|
|
<p class="example">Changing the base URL doesn't affect the image
|
|
displayed by <code><a href="#the-img-element">img</a></code> elements, although subsequent
|
|
accesses of the <code title="dom-img-src"><a href="#dom-img-src">src</a></code> IDL attribute
|
|
from script will return a new <a href="#absolute-url">absolute URL</a> that might
|
|
no longer correspond to the image being shown.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></div><h4 id="interfaces-for-url-manipulation"><span class="secno">2.6.6 </span>Interfaces for URL manipulation</h4><p>An interface that has a complement of <dfn id="url-decomposition-idl-attributes">URL decomposition IDL
|
|
attributes</dfn> has seven attributes with the following
|
|
definitions:<pre class="idl extract"> attribute DOMString <a href="#dom-uda-protocol" title="dom-uda-protocol">protocol</a>;
|
|
attribute DOMString <a href="#dom-uda-host" title="dom-uda-host">host</a>;
|
|
attribute DOMString <a href="#dom-uda-hostname" title="dom-uda-hostname">hostname</a>;
|
|
attribute DOMString <a href="#dom-uda-port" title="dom-uda-port">port</a>;
|
|
attribute DOMString <a href="#dom-uda-pathname" title="dom-uda-pathname">pathname</a>;
|
|
attribute DOMString <a href="#dom-uda-search" title="dom-uda-search">search</a>;
|
|
attribute DOMString <a href="#dom-uda-hash" title="dom-uda-hash">hash</a>;</pre><dl class="domintro"><dt><var title="">o</var> . <code title="dom-uda-protocol"><a href="#dom-uda-protocol">protocol</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the current scheme of the underlying URL.</p>
|
|
<p>Can be set, to change the underlying URL's scheme.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">o</var> . <code title="dom-uda-host"><a href="#dom-uda-host">host</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the current host and port (if it's not the default port) in the underlying URL.</p>
|
|
<p>Can be set, to change the underlying URL's host and port.</p>
|
|
<p>The host and the port are separated by a colon. The port part,
|
|
if omitted, will be assumed to be the current scheme's default
|
|
port.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">o</var> . <code title="dom-uda-hostname"><a href="#dom-uda-hostname">hostname</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the current host in the underlying URL.</p>
|
|
<p>Can be set, to change the underlying URL's host.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">o</var> . <code title="dom-uda-port"><a href="#dom-uda-port">port</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the current port in the underlying URL.</p>
|
|
<p>Can be set, to change the underlying URL's port.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">o</var> . <code title="dom-uda-pathname"><a href="#dom-uda-pathname">pathname</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the current path in the underlying URL.</p>
|
|
<p>Can be set, to change the underlying URL's path.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">o</var> . <code title="dom-uda-search"><a href="#dom-uda-search">search</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the current query component in the underlying URL.</p>
|
|
<p>Can be set, to change the underlying URL's query component.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">o</var> . <code title="dom-uda-hash"><a href="#dom-uda-hash">hash</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the current fragment identifier in the underlying URL.</p>
|
|
<p>Can be set, to change the underlying URL's fragment identifier.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<hr><p>The attributes defined to be <a href="#url-decomposition-idl-attributes">URL decomposition IDL
|
|
attributes</a> 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 <a href="#url-decomposition-idl-attributes">URL
|
|
decomposition IDL attributes</a> defines an <dfn id="concept-uda-input" title="concept-uda-input">input</dfn>, which is a <a href="#url">URL</a>
|
|
that the attributes act on, and a <dfn id="concept-uda-setter" 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 <a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a> have
|
|
similar requirements.</p>
|
|
|
|
<p>On getting, if the <a href="#concept-uda-input" title="concept-uda-input">input</a>
|
|
is an <a href="#absolute-url">absolute URL</a> that 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="#concept-uda-input" title="concept-uda-input">input</a> URL 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 <a href="#concept-uda-input" title="concept-uda-input">input</a> is an <a href="#absolute-url">absolute
|
|
URL</a> and 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
|
|
URL given by the "component" column in the <a href="#concept-uda-input" title="concept-uda-input">input</a> URL with the new value;
|
|
otherwise, the user agent must let <var title="">output</var> be
|
|
equal to the <a href="#concept-uda-input" title="concept-uda-input">input</a>. Finally,
|
|
the user agent must invoke the <a href="#concept-uda-setter" title="concept-uda-setter">common setter action</a> with the
|
|
value of <var title="">output</var>.</p>
|
|
|
|
<p>When replacing a component in the URL, if the component is part
|
|
of an optional group in the URL 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.</p>
|
|
|
|
<p class="note">The previous paragraph applies in particular to the
|
|
"<code title="">:</code>" before a <port> component, the "<code title="">?</code>" before a <query> component, and the "<code title="">#</code>" before a <fragment> component.</p>
|
|
|
|
<p>For the purposes of the above definitions, URLs must be parsed
|
|
using the <a href="#parse-a-url" title="parse a URL">URL parsing rules</a> defined
|
|
in this specification.</p>
|
|
|
|
<table id="table-uda"><thead><tr><th>Attribute
|
|
<th>Component
|
|
<th>Getter Condition
|
|
<th>Prefix
|
|
<th>Suffix
|
|
<th>Setter Preprocessor
|
|
<th>Setter Condition
|
|
<tbody><tr><td><dfn id="dom-uda-protocol" title="dom-uda-protocol"><code>protocol</code></dfn>
|
|
<td><a href="#url-scheme" title="url-scheme"><scheme></a>
|
|
<td>—
|
|
<td>—
|
|
<td>U+003A COLON (:)
|
|
<td>Remove all trailing U+003A COLON characters (:)
|
|
<td>The new value is not the empty string
|
|
<tr><td><dfn id="dom-uda-host" title="dom-uda-host"><code>host</code></dfn>
|
|
<td><a href="#url-hostport" title="url-hostport"><hostport></a>
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> is an <a href="#authority-based-url">authority-based URL</a>
|
|
<td>—
|
|
<td>—
|
|
<td>—
|
|
<td>The new value is not the empty string and <a href="#concept-uda-input" title="concept-uda-input">input</a> is an <a href="#authority-based-url">authority-based URL</a>
|
|
<tr><td><dfn id="dom-uda-hostname" title="dom-uda-hostname"><code>hostname</code></dfn>
|
|
<td><a href="#url-host" title="url-host"><host></a>
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> is an <a href="#authority-based-url">authority-based URL</a>
|
|
<td>—
|
|
<td>—
|
|
<td>Remove all leading U+002F SOLIDUS characters (/)
|
|
<td>The new value is not the empty string and <a href="#concept-uda-input" title="concept-uda-input">input</a> is an <a href="#authority-based-url">authority-based URL</a>
|
|
<tr><td><dfn id="dom-uda-port" title="dom-uda-port"><code>port</code></dfn>
|
|
<td><a href="#url-port" title="url-port"><port></a>
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> is an <a href="#authority-based-url">authority-based URL</a>, and contained a <a href="#url-port" title="url-port"><port></a> component (possibly an empty one)
|
|
<td>—
|
|
<td>—
|
|
<td>Remove all characters in the new value from the first that is not in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), if any.
|
|
Remove any leading U+0030 DIGIT ZERO characters (0) in the new value.
|
|
If the resulting string is empty, set it to a single U+0030 DIGIT ZERO character (0).
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> is an <a href="#authority-based-url">authority-based URL</a>,
|
|
and the new value, when interpreted as a base-ten integer, is less than or equal to 65535
|
|
<tr><td><dfn id="dom-uda-pathname" title="dom-uda-pathname"><code>pathname</code></dfn>
|
|
<td><a href="#url-path" title="url-path"><path></a>
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> is a <a href="#hierarchical-url">hierarchical URL</a>
|
|
<td>—
|
|
<td>—
|
|
<td>If it has no leading U+002F SOLIDUS character (/), prepend a U+002F SOLIDUS character (/) to the new value
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> is hierarchical
|
|
<tr><td><dfn id="dom-uda-search" title="dom-uda-search"><code>search</code></dfn>
|
|
<td><a href="#url-query" title="url-query"><query></a>
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> is a <a href="#hierarchical-url">hierarchical URL</a>, and contained a <a href="#url-query" title="url-query"><query></a> component (possibly an empty one)
|
|
<td>U+003F QUESTION MARK (?)
|
|
<td>—
|
|
<td>Remove one leading U+003F QUESTION MARK character (?), if any
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> is a <a href="#hierarchical-url">hierarchical URL</a>
|
|
<tr><td><dfn id="dom-uda-hash" title="dom-uda-hash"><code>hash</code></dfn>
|
|
<td><a href="#url-fragment" title="url-fragment"><fragment></a>
|
|
<td><a href="#concept-uda-input" title="concept-uda-input">input</a> contained a non-empty <a href="#url-fragment" title="url-fragment"><fragment></a> component
|
|
<td>U+0023 NUMBER SIGN (#)
|
|
<td>—
|
|
<td>Remove one leading U+0023 NUMBER SIGN character (#), if any
|
|
<td>—
|
|
</table></div><div class="example">
|
|
|
|
<p>The table below demonstrates how the getter <span class="impl">condition</span> for <code title="dom-uda-search"><a href="#dom-uda-search">search</a></code> results in different results
|
|
depending on the exact original syntax of the URL:</p>
|
|
|
|
<table id="table-uda-examples"><thead><tr><th> Input URL
|
|
<th> <code title="dom-uda-search"><a href="#dom-uda-search">search</a></code> value
|
|
<th> Explanation
|
|
<tbody><tr><td> <code title="">http://example.com/</code>
|
|
<td> <i>empty string</i>
|
|
<td> No <a href="#url-query" title="url-query"><query></a> component in input URL.
|
|
<tr><td> <code title="">http://example.com/?</code>
|
|
<td> <code title="">?</code>
|
|
<td> There is a <a href="#url-query" title="url-query"><query></a> component, but it is empty.
|
|
<span class="impl">The question mark in the resulting value is the prefix.</span>
|
|
<tr><td> <code title="">http://example.com/?test</code>
|
|
<td> <code title="">?test</code>
|
|
<td> The <a href="#url-query" title="url-query"><query></a> component has the value "<code title="">test</code>".
|
|
<tr><td> <code title="">http://example.com/?test#</code>
|
|
<td> <code title="">?test</code>
|
|
<td> The (empty) <a href="#url-fragment" title="url-fragment"><fragment></a> component is not part of the <a href="#url-query" title="url-query"><query></a> component.
|
|
</table></div><div class="example">
|
|
|
|
<p>The following table is similar; it provides a list of what each
|
|
of the <a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a> returns for a
|
|
given <var title="">input</var> URL.</p>
|
|
|
|
<table><thead><tr><th>Input
|
|
<th><code title="dom-uda-protocol"><a href="#dom-uda-protocol">protocol</a></code>
|
|
<th><code title="dom-uda-host"><a href="#dom-uda-host">host</a></code>
|
|
<th><code title="dom-uda-hostname"><a href="#dom-uda-hostname">hostname</a></code>
|
|
<th><code title="dom-uda-port"><a href="#dom-uda-port">port</a></code>
|
|
<th><code title="dom-uda-pathname"><a href="#dom-uda-pathname">pathname</a></code>
|
|
<th><code title="dom-uda-search"><a href="#dom-uda-search">search</a></code>
|
|
<th><code title="dom-uda-hash"><a href="#dom-uda-hash">hash</a></code>
|
|
<tbody><tr><td><code title="">http://example.com/carrot#question%3f</code>
|
|
<td><code title="">http:</code>
|
|
<td><code title="">example.com</code>
|
|
<td><code title="">example.com</code>
|
|
<td>(empty string)
|
|
<td><code title="">/carrot</code>
|
|
<td>(empty string)
|
|
<td><code title="">#question%3f</code>
|
|
<tr><td><code title="">https://www.example.com:4443?</code>
|
|
<td><code title="">https:</code>
|
|
<td><code title="">www.example.com:4443</code>
|
|
<td><code title="">www.example.com</code>
|
|
<td><code title="">4443</code>
|
|
<td><code title="">/</code>
|
|
<td><code title="">?</code>
|
|
<td>(empty string)
|
|
</table></div><div class="impl">
|
|
|
|
<h3 id="fetching-resources"><span class="secno">2.7 </span>Fetching resources</h3>
|
|
|
|
<p>When a user agent is to <dfn id="fetch">fetch</dfn> a resource or
|
|
<a href="#url">URL</a>, optionally from an origin <i title="">origin</i>,
|
|
and optionally with a <i>synchronous flag</i>, a <i>manual redirect
|
|
flag</i>, a <i>force same-origin flag</i>, and/or a <i>block cookies
|
|
flag</i>, the following steps must be run. (When a <em>URL</em> is
|
|
to be fetched, the URL identifies a resource to be obtained.)</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">document</var> be the appropriate
|
|
<code><a href="#document">Document</a></code> as given by the following list:</p>
|
|
|
|
<dl class="switch"><dt>When <a href="#navigate" title="navigate">navigating</a></dt>
|
|
|
|
<dd>The <a href="#active-document">active document</a> of the <a href="#source-browsing-context">source browsing
|
|
context</a>.</dd>
|
|
|
|
<dt>When fetching resources for an element</dt>
|
|
|
|
<dd>The element's <code><a href="#document">Document</a></code>.</dd>
|
|
|
|
<dt>When fetching resources in response to a call to an API</dt>
|
|
|
|
<dd>The <a href="#entry-script">entry script</a>'s <a href="#script-s-document" title="script's
|
|
document">document</a>.</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>While <var title="">document</var> is <a href="#an-iframe-srcdoc-document">an
|
|
<code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code>
|
|
document</a>, let <var title="">document</var> be <var title="">document</var>'s <a href="#browsing-context">browsing context</a>'s
|
|
<a href="#browsing-context-container">browsing context container</a>'s <code><a href="#document">Document</a></code>
|
|
instead.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Generate the <i>address of the resource from which Request-URIs
|
|
are obtained</i> as required by HTTP for the <code title="http-referer">Referer</code> (sic) header from <a href="#the-document-s-current-address">the
|
|
document's current address</a> of <var title="">document</var>.
|
|
<a href="#refsHTTP">[HTTP]</a></p>
|
|
|
|
<p>Remove any <a href="#url-fragment" title="url-fragment"><fragment></a>
|
|
component from the generated <i>address of the resource from which
|
|
Request-URIs are obtained</i>.</p>
|
|
<p>If the <a href="#origin">origin</a> of the appropriate
|
|
<code><a href="#document">Document</a></code> is not a scheme/host/port tuple, then the
|
|
<code title="http-referer">Referer</code> (sic) header must be
|
|
omitted, regardless of its value.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the algorithm was not invoked with the <i>synchronous
|
|
flag</i>, perform the remaining steps asynchronously.</li>
|
|
|
|
<li>
|
|
|
|
<p>This is the <i>main step</i>.</p>
|
|
|
|
<p>If the resource is identified by an <a href="#absolute-url">absolute URL</a>,
|
|
and the resource is to be obtained using an idempotent action
|
|
(such as an HTTP GET <a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or
|
|
equivalent</a>), and it is already being downloaded for other
|
|
reasons (e.g. another invocation of this algorithm), and this
|
|
request would be identical to the previous one (e.g. same <code title="http-accept">Accept</code> and <code title="http-origin">Origin</code> headers), and the user agent is
|
|
configured such that it is to reuse the data from the existing
|
|
download instead of initiating a new one, then use the results of
|
|
the existing download instead of starting a new one.</p>
|
|
|
|
<p>Otherwise, if the resource is identified by an <a href="#absolute-url">absolute
|
|
URL</a> with a scheme that does not define a mechanism to
|
|
obtain the resource (e.g. it is a <code title="">mailto:</code>
|
|
URL) or that the user agent does not support, then act as if the
|
|
resource was an HTTP 204 No Content response with no other
|
|
metadata.</p>
|
|
|
|
<p>Otherwise, if the resource is identified by the
|
|
<a href="#url">URL</a> <dfn id="about:blank"><code>about:blank</code></dfn>, then the
|
|
resource is immediately available and consists of the empty
|
|
string, with no metadata.</p>
|
|
|
|
<p>Otherwise, at a time convenient to the user and the user agent,
|
|
download (or otherwise obtain) the resource, applying the
|
|
semantics of the relevant specifications (e.g. performing an HTTP
|
|
GET or POST operation, or reading the file from disk, <a href="#concept-js-deref" title="concept-js-deref">dereferencing <span title="javascript
|
|
protocol"><code title="">javascript:</code> URLs</span></a>,
|
|
etc).</p>
|
|
|
|
<p>For the purposes of the <code title="http-referer">Referer</code> (sic) header, use the
|
|
<i>address of the resource from which Request-URIs are
|
|
obtained</i> generated in the earlier step.</p>
|
|
|
|
<p>For the purposes of the <code title="http-origin">Origin</code>
|
|
header, if the <a href="#fetch" title="fetch">fetching algorithm</a> was
|
|
explicitly initiated from an <i title="">origin</i>, then <i title="">the origin that initiated the HTTP request</i> is <i title="">origin</i>. Otherwise, this is <i title="">a request from
|
|
a "privacy-sensitive" context</i>. <a href="#refsORIGIN">[ORIGIN]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the algorithm was not invoked with the <i>block cookies
|
|
flag</i>, and there are cookies to be set, then the user agent
|
|
must run the following substeps:</p>
|
|
|
|
<ol><li><p>Wait until ownership of the <a href="#storage-mutex">storage mutex</a> can
|
|
be taken by this instance of the <a href="#fetch" title="fetch">fetching</a> algorithm.</li>
|
|
|
|
<li><p>Take ownership of the <a href="#storage-mutex">storage mutex</a>.</li>
|
|
|
|
<li><p>Update the cookies. <a href="#refsCOOKIES">[COOKIES]</a></li>
|
|
|
|
<li><p>Release the <a href="#storage-mutex">storage mutex</a> so that it is once
|
|
again free.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>If the fetched resource is an HTTP redirect <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a>,
|
|
then:</p>
|
|
|
|
<dl class="switch"><dt>If the <i>force same-origin flag</i> is set and the
|
|
<a href="#url">URL</a> of the target of the redirect does not have the
|
|
<a href="#same-origin">same origin</a> as the <a href="#url">URL</a> for which the
|
|
<a href="#fetch">fetch</a> algorithm was invoked</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Abort these steps and return failure from this algorithm, as
|
|
if the remote host could not be contacted.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the <i>manual redirect flag</i> is set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Continue, using the fetched resource (the redirect) as the
|
|
result of the algorithm.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>First, apply any relevant requirements for redirects (such as
|
|
showing any appropriate prompts). Then, redo <i>main step</i>,
|
|
but using the target of the redirect as the resource to fetch,
|
|
rather than the original resource.</p>
|
|
|
|
<p class="note">The HTTP specification requires that 301, 302,
|
|
and 307 redirects, when applied to methods other than the safe
|
|
methods, not be followed without user confirmation. That would
|
|
be an appropriate prompt for the purposes of the requirement in
|
|
the paragraph above. <a href="#refsHTTP">[HTTP]</a></p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>If the algorithm was not invoked with the <i>synchronous
|
|
flag</i>: When the resource is available, or if there is an error
|
|
of some description, <a href="#queue-a-task">queue a task</a> that uses the
|
|
resource as appropriate. If the resource can be processed
|
|
incrementally, as, for instance, with a progressively interlaced
|
|
JPEG or an HTML file, additional tasks may be queued to process
|
|
the data as it is downloaded. The <a href="#task-source">task source</a> for
|
|
these <a href="#concept-task" title="concept-task">tasks</a> is the
|
|
<a href="#networking-task-source">networking task source</a>.</p>
|
|
|
|
<p>Otherwise, return the resource or error information to the
|
|
calling algorithm.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>If the user agent can determine the actual length of the resource
|
|
being <a href="#fetch" title="fetch">fetched</a> for an instance of this
|
|
algorithm, and if that length is finite, then that length is the
|
|
file's <dfn id="concept-fetch-total" title="concept-fetch-total">size</dfn>. Otherwise, the
|
|
subject of the algorithm (that is, the resource being fetched) has
|
|
no known <a href="#concept-fetch-total" title="concept-fetch-total">size</a>. (For
|
|
example, the HTTP <code title="http-content-length">Content-Length</code> header might
|
|
provide this information.)</p>
|
|
|
|
<p>The user agent must also keep track of the <dfn id="concept-fetch-loaded" title="concept-fetch-loaded">number of bytes downloaded</dfn> for
|
|
each instance of this algorithm. This number must exclude any
|
|
out-of-band metadata, such as HTTP headers.</p>
|
|
|
|
<p class="note">The <a href="#application-cache">application cache</a> processing model
|
|
introduces some <a href="#changesToNetworkingModel">changes to the
|
|
networking model</a> to handle the returning of cached
|
|
resources.</p>
|
|
|
|
<p class="note">The <a href="#navigate" title="navigate">navigation</a>
|
|
processing model handles redirects itself, overriding the
|
|
redirection handling that would be done by the fetching
|
|
algorithm.</p>
|
|
|
|
<p class="note">Whether the <a href="#content-type-sniffing">type
|
|
sniffing rules</a> apply to the fetched resource depends on the
|
|
algorithm that invokes the rules — they are not always
|
|
applicable.</p>
|
|
|
|
|
|
<h4 id="concept-http-equivalent"><span class="secno">2.7.1 </span>Protocol concepts</h4>
|
|
|
|
<p>User agents can implement a variety of transfer protocols, but
|
|
this specification mostly defines behavior in terms of HTTP. <a href="#refsHTTP">[HTTP]</a></p>
|
|
|
|
<p>The <dfn id="concept-http-equivalent-get" title="concept-http-equivalent-get">HTTP GET
|
|
method</dfn> is equivalent to the default retrieval action of the
|
|
protocol. For example, RETR in FTP. Such actions are idempotent and
|
|
safe, in HTTP terms.</p>
|
|
|
|
<p>The <dfn id="concept-http-equivalent-codes" title="concept-http-equivalent-codes">HTTP response
|
|
codes</dfn> are equivalent to statuses in other protocols that have
|
|
the same basic meanings. For example, a "file not found" error is
|
|
equivalent to a 404 code, a server error is equivalent to a 5xx
|
|
code, and so on.</p>
|
|
|
|
<p>The <dfn id="concept-http-equivalent-headers" title="concept-http-equivalent-headers">HTTP
|
|
headers</dfn> are equivalent to fields in other protocols that have
|
|
the same basic meaning. For example, the HTTP authentication
|
|
headers are equivalent to the authentication aspects of the FTP
|
|
protocol.</p>
|
|
|
|
|
|
<h4 id="encrypted-http-and-related-security-concerns"><span class="secno">2.7.2 </span>Encrypted HTTP and related security concerns</h4>
|
|
|
|
<p>Anything in this specification that refers to HTTP also applies
|
|
to HTTP-over-TLS, as represented by <a href="#url" title="url">URLs</a>
|
|
representing the <code title="">https</code> scheme.</p>
|
|
|
|
<p class="warning">User agents should report certificate errors to
|
|
the user and must either refuse to download resources sent with
|
|
erroneous certificates or must act as if such resources were in fact
|
|
served with no encryption.</p>
|
|
|
|
<p>User agents should warn the user that there is a potential
|
|
problem whenever the user visits a page that the user has previously
|
|
visited, if the page uses less secure encryption on the second
|
|
visit.</p>
|
|
|
|
<p>Not doing so can result in users not noticing man-in-the-middle
|
|
attacks.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>If a user connects to a server with a self-signed certificate,
|
|
the user agent could allow the connection but just act as if there
|
|
had been no encryption. If the user agent instead allowed the user
|
|
to override the problem and then displayed the page as if it was
|
|
fully and safely encrypted, the user could be easily tricked into
|
|
accepting man-in-the-middle connections.</p>
|
|
|
|
<p>If a user connects to a server with full encryption, but the
|
|
page then refers to an external resource that has an expired
|
|
certificate, then the user agent will act as if the resource was
|
|
unavailable, possibly also reporting the problem to the user. If
|
|
the user agent instead allowed the resource to be used, then an
|
|
attacker could just look for "secure" sites that used resources
|
|
from a different host and only apply man-in-the-middle attacks to
|
|
that host, for example taking over scripts in the page.</p>
|
|
|
|
<p>If a user bookmarks a site that uses a CA-signed certificate,
|
|
and then later revisits that site directly but the site has started
|
|
using a self-signed certificate, the user agent could warn the user
|
|
that a man-in-the-middle attack is likely underway, instead of
|
|
simply acting as if the page was not encrypted.</p>
|
|
|
|
</div>
|
|
|
|
|
|
<h4 id="content-type-sniffing"><span class="secno">2.7.3 </span>Determining the type of a resource</h4>
|
|
|
|
<p>The <dfn id="content-type" title="Content-Type">Content-Type metadata</dfn> of a
|
|
resource must be obtained and interpreted in a manner consistent
|
|
with the requirements of the Media Type Sniffing
|
|
specification. <a href="#refsMIMESNIFF">[MIMESNIFF]</a></p>
|
|
|
|
<p>The <dfn id="content-type-sniffing-0" title="Content-Type sniffing">sniffed type of a
|
|
resource</dfn> must be found in a manner consistent with the
|
|
requirements given in the Media Type Sniffing
|
|
specification for finding the <i>sniffed-type</i> of the relevant
|
|
sequence of octets. <a href="#refsMIMESNIFF">[MIMESNIFF]</a></p>
|
|
|
|
<p>The <dfn id="content-type-sniffing:-image" title="Content-Type sniffing: image">rules for sniffing
|
|
images specifically</dfn> and the <dfn id="content-type-sniffing:-text-or-binary" title="Content-Type sniffing:
|
|
text or binary">rules for distinguishing if a resource is text or
|
|
binary</dfn> are also defined in the Media Type Sniffing
|
|
specification. Both sets of rules return a <a href="#mime-type">MIME type</a> as
|
|
their result. <a href="#refsMIMESNIFF">[MIMESNIFF]</a></p>
|
|
|
|
<p class="warning">It is imperative that the rules in the
|
|
Media Type Sniffing specification be followed
|
|
exactly. When a user agent uses different heuristics for content
|
|
type detection than the server expects, security problems can
|
|
occur. For more details, see the Media Type Sniffing
|
|
specification. <a href="#refsMIMESNIFF">[MIMESNIFF]</a></p>
|
|
|
|
|
|
<h4 id="extracting-encodings-from-meta-elements"><span class="secno">2.7.4 </span>Extracting encodings from <code><a href="#the-meta-element">meta</a></code> elements</h4>
|
|
|
|
<p>The <dfn id="algorithm-for-extracting-an-encoding-from-a-meta-element">algorithm for extracting an encoding from a
|
|
<code>meta</code> element</dfn>, given a string <var title="">s</var>, is as follows. It either returns an encoding or
|
|
nothing.</p>
|
|
|
|
<ol><li><p>Let <var title="">position</var> be a pointer into <var title="">s</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><i>Loop</i>: Find the first seven characters in <var title="">s</var> after <var title="">position</var> that are an
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the word "<code title="">charset</code>". If no such match is found, return nothing
|
|
and abort these steps.</li>
|
|
|
|
<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
|
|
characters that immediately follow the word "<code title="">charset</code>" (there might not be any).</li>
|
|
|
|
<li><p>If the next character is not a U+003D EQUALS SIGN ('='),
|
|
then move <var title="">position</var> to point just before that
|
|
next character, and jump back to the step labeled
|
|
<i>loop</i>.</li>
|
|
|
|
<li><p>Skip any U+0009, U+000A, U+000C, U+000D, or U+0020
|
|
characters that immediately follow the equals sign (there might not
|
|
be any).</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></dt>
|
|
<dt>If it is a U+0027 APOSTROPHE ("'") and there is a later U+0027 APOSTROPHE ("'") in <var title="">s</var></dt>
|
|
<dd>Return the encoding corresponding to the string between this character and the next earliest occurrence of this character.</dd>
|
|
|
|
<dt>If it is an unmatched U+0022 QUOTATION MARK ('"')</dt>
|
|
<dt>If it is an unmatched U+0027 APOSTROPHE ("'")</dt>
|
|
<dt>If there is no next character</dt>
|
|
<dd>Return nothing.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
<dd>Return the encoding corresponding to the string from this
|
|
character to the first U+0009, U+000A, U+000C, U+000D, U+0020, or
|
|
U+003B character or the end of <var title="">s</var>, whichever
|
|
comes first.</dd>
|
|
|
|
</dl></li>
|
|
|
|
</ol><p class="note">This algorithm is distinct from those in the HTTP
|
|
specification (for example, HTTP doesn't allow the use of single
|
|
quotes and requires supporting a backslash-escape mechanism that is
|
|
not supported by this algorithm). While the algorithm is used in contexts
|
|
that, historically, were related to HTTP, the syntax as supported by
|
|
implementations diverged some time ago. <a href="#refsHTTP">[HTTP]</a></p>
|
|
|
|
</div><h3 id="common-dom-interfaces"><span class="secno">2.8 </span>Common DOM interfaces</h3><h4 id="reflecting-content-attributes-in-idl-attributes"><span class="secno">2.8.1 </span>Reflecting content attributes in IDL attributes</h4><p>Some IDL attributes are defined to <dfn id="reflect">reflect</dfn> a
|
|
particular content attribute. This means that on getting, the IDL
|
|
attribute returns the current value of the content attribute, and on
|
|
setting, the IDL attribute changes the value of the content
|
|
attribute to the given value.</p><div class="impl">
|
|
|
|
<p>In general, on getting, if the content attribute is not present,
|
|
the IDL attribute must act as if the content attribute's value is
|
|
the empty string; and on setting, if the content attribute is not
|
|
present, it must first be added.</p>
|
|
|
|
<p>If a reflecting IDL attribute is a <code>DOMString</code>
|
|
attribute whose content attribute is defined to contain a
|
|
<a href="#url">URL</a>, then on getting, the IDL attribute must <a href="#resolve-a-url" title="resolve a url">resolve</a> the value of the content
|
|
attribute relative to the element and return the resulting
|
|
<a href="#absolute-url">absolute URL</a> if that was successful, or the empty
|
|
string otherwise; and on setting, must set the content attribute to
|
|
the specified literal value. If the content attribute is absent, the
|
|
IDL attribute must return the default value, if the content
|
|
attribute has one, or else the empty string.</p>
|
|
|
|
<p>If a reflecting IDL attribute is a <code>DOMString</code>
|
|
attribute whose content attribute is defined to contain one or more
|
|
<a href="#url" title="URL">URLs</a>, then on getting, the IDL attribute
|
|
must <a href="#split-a-string-on-spaces" title="split a string on spaces">split the content
|
|
attribute on spaces</a> and return the concatenation of <a href="#resolve-a-url" title="resolve a URL">resolving</a> each token URL to an
|
|
<a href="#absolute-url">absolute URL</a> relative to the element, with a single
|
|
U+0020 SPACE character between each URL, ignoring any tokens that
|
|
did not resolve successfully. If the content attribute is absent,
|
|
the IDL attribute must return the default value, if the content
|
|
attribute has one, or else the empty string. On setting, the IDL
|
|
attribute must set the content attribute to the specified literal
|
|
value.</p>
|
|
|
|
<p>If a reflecting IDL attribute is a <code>DOMString</code>
|
|
attribute whose content attribute is an <a href="#enumerated-attribute">enumerated
|
|
attribute</a>, and the IDL attribute is <dfn id="limited-to-only-known-values">limited to only
|
|
known values</dfn>, then, on getting, the IDL attribute must return
|
|
the conforming 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, the
|
|
content attribute must be set to the specified new value.</p>
|
|
|
|
<p>If a reflecting IDL attribute is a <code>DOMString</code>
|
|
attribute 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 IDL attribute is a <code title="">boolean</code>
|
|
attribute, then on getting the IDL attribute must return true if the
|
|
content attribute is set, and false if it is absent. On setting, the
|
|
content attribute must be removed if the IDL attribute is set to
|
|
false, and must be set to the empty string if the IDL attribute is
|
|
set to true. (This corresponds to the rules for <a href="#boolean-attribute" title="boolean
|
|
attribute">boolean content attributes</a>.)</p>
|
|
|
|
<p>If a reflecting IDL attribute has a signed integer type
|
|
(<code>long</code>) then, on getting, the content attribute must be
|
|
parsed according to the <a href="#rules-for-parsing-integers" title="rules for parsing
|
|
integers">rules for parsing signed integers</a>, and if that is
|
|
successful, and the value is in the range of the IDL attribute's
|
|
type, the resulting value must be returned. If, on the other hand,
|
|
it fails or returns an out of range value, or if the attribute is
|
|
absent, then the default value must be returned instead, or 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 <a href="#valid-integer">valid integer</a> and then that string must be used as
|
|
the new content attribute value.</p>
|
|
|
|
<p>If a reflecting IDL attribute has a signed integer type
|
|
(<code>long</code>) that is <dfn id="limited-to-only-non-negative-numbers">limited to only non-negative
|
|
numbers</dfn> then, on getting, the content attribute must be parsed
|
|
according to the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative
|
|
integers</a>, and if that is successful, and the value is in the
|
|
range of the IDL attribute's type, the resulting value must be
|
|
returned. If, on the other hand, it fails or returns an out of range
|
|
value, 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 negative, the user agent must fire an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception. Otherwise, the given value
|
|
must be converted to the shortest possible string representing the
|
|
number as a <a href="#valid-non-negative-integer">valid non-negative integer</a> and then that
|
|
string must be used as the new content attribute value.</p>
|
|
|
|
<p>If a reflecting IDL attribute has an <em>unsigned</em> integer
|
|
type (<code>unsigned long</code>) then, on getting, the content
|
|
attribute must be parsed according to the <a href="#rules-for-parsing-non-negative-integers">rules for parsing
|
|
non-negative integers</a>, and if that is successful, and the
|
|
value is in the range 0 to 2147483647 inclusive, the resulting value
|
|
must be returned. If, on the other hand, it fails or returns an out
|
|
of range value, 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 the shortest possible
|
|
string representing the number as a <a href="#valid-non-negative-integer">valid non-negative
|
|
integer</a> and then that string must be used as the new content
|
|
attribute value.</p>
|
|
|
|
<p>If a reflecting IDL attribute has an unsigned integer type
|
|
(<code>unsigned long</code>) that is <dfn id="limited-to-only-non-negative-numbers-greater-than-zero">limited to only
|
|
non-negative numbers greater than zero</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 the
|
|
<a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</a>, and if that is
|
|
successful, and the value is in the range 1 to 2147483647 inclusive,
|
|
the resulting value must be returned. If, on the other hand, it
|
|
fails or returns an out of range value, 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><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception. Otherwise, the
|
|
given value must be converted to the shortest possible string
|
|
representing the number as a <a href="#valid-non-negative-integer">valid non-negative integer</a>
|
|
and then that string must be used as the new content attribute
|
|
value.</p>
|
|
|
|
<p>If a reflecting IDL attribute has a floating point number type
|
|
(<code>double</code>), then, on getting, the content attribute must
|
|
be parsed according to the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating point
|
|
number values</a>, and 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 <a href="#best-representation-of-the-number-as-a-floating-point-number">best representation of the number as a
|
|
floating point number</a> and then that string must be used as
|
|
the new content attribute value.</p>
|
|
|
|
<p class="note">The values Infinity and Not-a-Number (NaN) values
|
|
throw an exception on setting, as <a href="#float-nan">defined
|
|
earlier</a>.</p>
|
|
|
|
<p>If a reflecting IDL attribute has the type
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> or <code><a href="#domsettabletokenlist">DOMSettableTokenList</a></code>, then
|
|
on getting it must return a <code><a href="#domtokenlist">DOMTokenList</a></code> or
|
|
<code><a href="#domsettabletokenlist">DOMSettableTokenList</a></code> object (as appropriate) whose
|
|
underlying string is the element's corresponding content attribute.
|
|
When the object mutates its underlying string, the content attribute
|
|
must itself be immediately mutated. When the attribute is absent,
|
|
then the string represented by the object is the empty string; when
|
|
the object mutates this empty string, the user agent must add the
|
|
corresponding content attribute, with its value set to the value it
|
|
would have been set to after mutating the empty string. The same
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> or <code><a href="#domsettabletokenlist">DOMSettableTokenList</a></code>
|
|
object must be returned every time for each attribute.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>If an element with no attributes has its <code title="dom-tokenlist-remove"><a href="#dom-tokenlist-remove">element.classList.remove()</a></code>
|
|
method invoked, the underlying string won't be changed, since the
|
|
result of removing any token from the empty string is still the
|
|
empty string. However, if the <code title="dom-tokenlist-add"><a href="#dom-tokenlist-add">element.classList.add()</a></code> method is
|
|
then invoked, a <code title="attr-class"><a href="#classes">class</a></code> attribute
|
|
will be added to the element with the value of the token to be
|
|
added.</p>
|
|
|
|
</div>
|
|
|
|
<p>If a reflecting IDL 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
|
|
IDL attribute must return null.</li>
|
|
|
|
<li>Let <var title="">candidate</var> be the element that the <code title="dom-Document-getElementById"><a href="#dom-document-getelementbyid">document.getElementById()</a></code> method
|
|
would find when called on the content attribute's document 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 IDL attribute, then the IDL 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="#the-id-attribute">id</a></code> attribute, then the content attribute must
|
|
be set to the value of that <code title="attr-id"><a href="#the-id-attribute">id</a></code>
|
|
attribute. Otherwise, the IDL attribute must be set to the empty
|
|
string.</p>
|
|
|
|
</div><h4 id="collections-0"><span class="secno">2.8.2 </span>Collections</h4><p>The <code><a href="#htmlcollection">HTMLCollection</a></code>, <code><a href="#htmlallcollection">HTMLAllCollection</a></code>,
|
|
<code><a href="#htmlformcontrolscollection">HTMLFormControlsCollection</a></code>,
|
|
<code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code>,
|
|
interfaces represent various
|
|
lists of DOM nodes. Collectively, objects implementing these
|
|
interfaces are called <dfn id="collections">collections</dfn>.<p>When a <a href="#collections" title="collections">collection</a> is created, a
|
|
filter and a root are associated with the collection.<p class="example">For example, when the <code><a href="#htmlcollection">HTMLCollection</a></code>
|
|
object for the <code title="dom-document-images"><a href="#dom-document-images">document.images</a></code> attribute is
|
|
created, it is associated with a filter that selects only
|
|
<code><a href="#the-img-element">img</a></code> elements, and rooted at the root of the
|
|
document.<p>The <a href="#collections" title="collections">collection</a> then <dfn id="represented-by-the-collection" 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. <span class="impl">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>.</span><div class="impl">
|
|
|
|
<p class="note">The <code title="dom-table-rows"><a href="#dom-table-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>
|
|
|
|
</div><h5 id="htmlcollection-0"><span class="secno">2.8.2.1 </span>HTMLCollection</h5><p>The <code><a href="#htmlcollection">HTMLCollection</a></code> interface represents a generic
|
|
<a href="#collections" title="collections">collection</a> of elements.<pre class="idl">interface <dfn id="htmlcollection">HTMLCollection</dfn> {
|
|
readonly attribute unsigned long <a href="#dom-htmlcollection-length" title="dom-HTMLCollection-length">length</a>;
|
|
caller getter <a href="#element">Element</a> <a href="#dom-htmlcollection-item" title="dom-HTMLCollection-item">item</a>(in unsigned long index);
|
|
caller getter object <a href="#dom-htmlcollection-nameditem" title="dom-HTMLCollection-namedItem">namedItem</a>(in DOMString name); // only returns Element
|
|
};</pre><dl class="domintro"><dt><var title="">collection</var> . <code title="dom-HTMLCollection-length"><a href="#dom-htmlcollection-length">length</a></code></dt>
|
|
<dd>
|
|
<p>Returns the number of elements in the collection.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLCollection-item"><a href="#dom-htmlcollection-item">item</a></code>(<var title="">index</var>)</dt>
|
|
<dt><var title="">collection</var>[<var title="">index</var>]</dt>
|
|
<dt><var title="">collection</var>(<var title="">index</var>)</dt>
|
|
<dd>
|
|
<p>Returns the item with index <var title="">index</var> from the collection. The items are sorted in <a href="#tree-order">tree order</a>.</p>
|
|
<p>Returns null if <var title="">index</var> is out of range.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLCollection-namedItem"><a href="#dom-htmlcollection-nameditem">namedItem</a></code>(<var title="">name</var>)</dt>
|
|
<dt><var title="">collection</var>[<var title="">name</var>]</dt>
|
|
<dt><var title="">collection</var>(<var title="">name</var>)</dt>
|
|
<dd>
|
|
<p>Returns the first item with <a href="#concept-id" title="concept-id">ID</a> or name <var title="">name</var>
|
|
from the collection.</p>
|
|
<p>Returns null if no element with that <a href="#concept-id" title="concept-id">ID</a> or name could be found.</p>
|
|
<p>Only <code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-area-element">area</a></code>,
|
|
<code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-form-element">form</a></code>, <code><a href="#frame">frame</a></code>,
|
|
<code><a href="#frameset">frameset</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, and
|
|
<code><a href="#the-object-element">object</a></code> elements can have a name for the purpose of
|
|
this method; their name is given by the value of their <code title="">name</code> attribute.</p>
|
|
</dd>
|
|
</dl><div class="impl">
|
|
|
|
<p>The object's <a href="#supported-property-indices">supported property indices</a> are the
|
|
numbers in the range zero to one less than the number of nodes
|
|
<a href="#represented-by-the-collection">represented by the collection</a>. If there are no such
|
|
elements, then there are no <a href="#supported-property-indices">supported property
|
|
indices</a>.</p>
|
|
|
|
<p>The <dfn id="dom-htmlcollection-length" title="dom-HTMLCollection-length"><code>length</code></dfn>
|
|
attribute must return the number of nodes <a href="#represented-by-the-collection">represented by the
|
|
collection</a>.</p>
|
|
|
|
<p>The <dfn id="dom-htmlcollection-item" 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 <a href="#supported-property-names">supported property names</a> consist
|
|
of the values of the <code title="">name</code> attributes of each
|
|
<code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-area-element">area</a></code>,
|
|
<code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-form-element">form</a></code>, <code><a href="#frame">frame</a></code>,
|
|
<code><a href="#frameset">frameset</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, and
|
|
<code><a href="#the-object-element">object</a></code> element <a href="#represented-by-the-collection">represented by the
|
|
collection</a> with a <code title="">name</code> attribute, plus
|
|
the list of IDs that the elements <a href="#represented-by-the-collection">represented by the
|
|
collection</a> have.</p>
|
|
|
|
<p>The <dfn id="dom-htmlcollection-nameditem" title="dom-HTMLCollection-namedItem"><code>namedItem(<var title="">key</var>)</code></dfn> method must return the first node
|
|
in the collection that matches either of the following
|
|
requirements:</p>
|
|
|
|
<ul><li>It is an <code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>,
|
|
<code><a href="#the-area-element">area</a></code>, <code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-form-element">form</a></code>,
|
|
<code><a href="#frame">frame</a></code>, <code><a href="#frameset">frameset</a></code>, <code><a href="#the-iframe-element">iframe</a></code>,
|
|
<code><a href="#the-img-element">img</a></code>, or <code><a href="#the-object-element">object</a></code> element with a <code title="">name</code> attribute equal to <var title="">key</var>,
|
|
or,</li>
|
|
|
|
<li>It is an element with an <a href="#concept-id" title="concept-id">ID</a>
|
|
equal to <var title="">key</var>.</li>
|
|
|
|
</ul><p>If no such elements are found, then the method must return
|
|
null.</p>
|
|
|
|
</div><h5 id="htmlallcollection-0"><span class="secno">2.8.2.2 </span>HTMLAllCollection</h5><p>The <code><a href="#htmlallcollection">HTMLAllCollection</a></code> interface represents a generic
|
|
<a href="#collections" title="collections">collection</a> of elements just like
|
|
<code><a href="#htmlcollection">HTMLCollection</a></code>, with the exception that its <code title="dom-HTMLAllCollection-namedItem"><a href="#dom-htmlallcollection-nameditem">namedItem()</a></code> method
|
|
returns an <code><a href="#htmlallcollection">HTMLAllCollection</a></code> object when there are
|
|
multiple matching elements.<pre class="idl">interface <dfn id="htmlallcollection">HTMLAllCollection</dfn> : <a href="#htmlcollection">HTMLCollection</a> {
|
|
// inherits <a href="#dom-htmlcollection-length" title="dom-HTMLCollection-length">length</a> and <a href="#dom-htmlcollection-item" title="dom-HTMLCollection-item">item</a>()
|
|
caller getter object <a href="#dom-htmlallcollection-nameditem" title="dom-HTMLAllCollection-namedItem">namedItem</a>(in DOMString name); // overrides inherited namedItem()
|
|
<a href="#htmlallcollection">HTMLAllCollection</a> <a href="#dom-htmlallcollection-tags" title="dom-HTMLAllCollection-tags">tags</a>(in DOMString tagName);
|
|
};</pre><dl class="domintro"><dt><var title="">collection</var> . <code title="dom-HTMLCollection-length"><a href="#dom-htmlcollection-length">length</a></code></dt>
|
|
<dd>
|
|
<p>Returns the number of elements in the collection.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLCollection-item"><a href="#dom-htmlcollection-item">item</a></code>(<var title="">index</var>)</dt>
|
|
<dt><var title="">collection</var>[<var title="">index</var>]</dt>
|
|
<dt><var title="">collection</var>(<var title="">index</var>)</dt>
|
|
<dd>
|
|
<p>Returns the item with index <var title="">index</var> from the collection. The items are sorted in <a href="#tree-order">tree order</a>.</p>
|
|
<p>Returns null if <var title="">index</var> is out of range.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLAllCollection-namedItem"><a href="#dom-htmlallcollection-nameditem">namedItem</a></code>(<var title="">name</var>)</dt>
|
|
<dt><var title="">collection</var> = <var title="">collection</var> . <code title="dom-HTMLAllCollection-namedItem"><a href="#dom-htmlallcollection-nameditem">namedItem</a></code>(<var title="">name</var>)</dt>
|
|
<dt><var title="">collection</var>[<var title="">name</var>]</dt>
|
|
<dt><var title="">collection</var>(<var title="">name</var>)</dt>
|
|
<dd>
|
|
<p>Returns the item with <a href="#concept-id" title="concept-id">ID</a> or name <var title="">name</var> from the collection.</p>
|
|
<p>If there are multiple matching items, then an <code><a href="#htmlallcollection">HTMLAllCollection</a></code> object containing all those elements is returned.</p>
|
|
<p>Returns null if no element with that <a href="#concept-id" title="concept-id">ID</a> or name could be found.</p>
|
|
<p>Only <code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-area-element">area</a></code>,
|
|
<code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-form-element">form</a></code>, <code><a href="#frame">frame</a></code>,
|
|
<code><a href="#frameset">frameset</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, and
|
|
<code><a href="#the-object-element">object</a></code> elements can have a name for the purpose of
|
|
this method; their name is given by the value of their <code title="">name</code> attribute.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">collection</var> = <var title="">collection</var> . <code title="dom-HTMLAllCollection-tags"><a href="#dom-htmlallcollection-tags">tags</a></code>(<var title="">tagName</var>)</dt>
|
|
<dd>
|
|
<p>Returns a collection that is a filtered view of the current collection, containing only elements with the given tag name.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The object's <a href="#supported-property-indices">supported property indices</a> and
|
|
<a href="#supported-property-names">supported property names</a> are as defined for
|
|
<code><a href="#htmlcollection">HTMLCollection</a></code> objects.</p>
|
|
|
|
<p>The <dfn id="dom-htmlallcollection-nameditem" title="dom-HTMLAllCollection-namedItem"><code>namedItem(<var title="">key</var>)</code></dfn> method must act according to the
|
|
following algorithm:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">collection</var> be an
|
|
<code><a href="#htmlallcollection">HTMLAllCollection</a></code> object rooted at the same node as
|
|
the <code><a href="#htmlallcollection">HTMLAllCollection</a></code> object on which the method was
|
|
invoked, whose filter matches only elements that already
|
|
match the filter of the <code><a href="#htmlallcollection">HTMLAllCollection</a></code> object on
|
|
which the method was invoked and that are either:</p>
|
|
|
|
<ul><li><code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-area-element">area</a></code>,
|
|
<code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-form-element">form</a></code>, <code><a href="#frame">frame</a></code>,
|
|
<code><a href="#frameset">frameset</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, or
|
|
<code><a href="#the-object-element">object</a></code> elements with a <code title="">name</code>
|
|
attribute equal to <var title="">key</var>, or,</li>
|
|
|
|
<li>elements with an <a href="#concept-id" title="concept-id">ID</a> equal to
|
|
<var title="">key</var>.</li>
|
|
|
|
</ul></li>
|
|
|
|
<li>If, at the time the method is called, there is exactly one node
|
|
in <var title="">collection</var>, then return that node and stop
|
|
the algorithm.</li>
|
|
|
|
<li>Otherwise, if, at the time the method is called, <var title="">collection</var> is empty, return null and stop the
|
|
algorithm.</li>
|
|
|
|
<li>Otherwise, return <var title="">collection</var>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-htmlallcollection-tags" title="dom-HTMLAllCollection-tags"><code>tags(<var title="">tagName</var>)</code></dfn> method must return an
|
|
<code><a href="#htmlallcollection">HTMLAllCollection</a></code> rooted at the same node as the
|
|
<code><a href="#htmlallcollection">HTMLAllCollection</a></code> object on which the method was
|
|
invoked, whose filter matches only <a href="#html-elements">HTML elements</a> whose
|
|
local name is the <var title="">tagName</var> argument and that
|
|
already match the filter of the <code><a href="#htmlallcollection">HTMLAllCollection</a></code>
|
|
object on which the method was invoked. In <a href="#html-documents">HTML
|
|
documents</a>, the argument must first be <a href="#converted-to-ascii-lowercase">converted to
|
|
ASCII lowercase</a>.</p>
|
|
|
|
</div><h5 id="htmlformcontrolscollection-0"><span class="secno">2.8.2.3 </span>HTMLFormControlsCollection</h5><p>The <code><a href="#htmlformcontrolscollection">HTMLFormControlsCollection</a></code> interface represents
|
|
a <a href="#collections" title="collections">collection</a> of <a href="#category-listed" title="category-listed">listed elements</a> in <code><a href="#the-form-element">form</a></code>
|
|
and <code><a href="#the-fieldset-element">fieldset</a></code> elements.<pre class="idl">interface <dfn id="htmlformcontrolscollection">HTMLFormControlsCollection</dfn> : <a href="#htmlcollection">HTMLCollection</a> {
|
|
// inherits <a href="#dom-htmlcollection-length" title="dom-HTMLCollection-length">length</a> and <a href="#dom-htmlcollection-item" title="dom-HTMLCollection-item">item</a>()
|
|
caller getter object <a href="#dom-htmlformcontrolscollection-nameditem" title="dom-HTMLFormControlsCollection-namedItem">namedItem</a>(in DOMString name); // overrides inherited namedItem()
|
|
};
|
|
|
|
interface <dfn id="radionodelist">RadioNodeList</dfn> : <a href="#nodelist">NodeList</a> {
|
|
attribute DOMString <a href="#dom-radionodelist-value" title="dom-RadioNodeList-value">value</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">collection</var> . <code title="dom-HTMLCollection-length"><a href="#dom-htmlcollection-length">length</a></code></dt>
|
|
<dd>
|
|
<p>Returns the number of elements in the collection.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLCollection-item"><a href="#dom-htmlcollection-item">item</a></code>(<var title="">index</var>)</dt>
|
|
<dt><var title="">collection</var>[<var title="">index</var>]</dt>
|
|
<dt><var title="">collection</var>(<var title="">index</var>)</dt>
|
|
<dd>
|
|
<p>Returns the item with index <var title="">index</var> from the collection. The items are sorted in <a href="#tree-order">tree order</a>.</p>
|
|
<p>Returns null if <var title="">index</var> is out of range.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLFormControlsCollection-namedItem"><a href="#dom-htmlformcontrolscollection-nameditem">namedItem</a></code>(<var title="">name</var>)</dt>
|
|
<dt><var title="">radioNodeList</var> = <var title="">collection</var> . <code title="dom-HTMLFormControlsCollection-namedItem"><a href="#dom-htmlformcontrolscollection-nameditem">namedItem</a></code>(<var title="">name</var>)</dt>
|
|
<dt><var title="">collection</var>[<var title="">name</var>]</dt>
|
|
<dt><var title="">collection</var>(<var title="">name</var>)</dt>
|
|
<dd>
|
|
<p>Returns the item with <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> <var title="">name</var> from the collection.</p>
|
|
<p>If there are multiple matching items, then a <code><a href="#radionodelist">RadioNodeList</a></code> object containing all those elements is returned.</p>
|
|
<p>Returns null if no element with that <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> could be found.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">radioNodeList</var> . <var title="">value</var> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the value of the first checked radio button represented by the object.</p>
|
|
<p>Can be set, to check the first radio button with the given value represented by the object.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The object's <a href="#supported-property-indices">supported property indices</a> are as
|
|
defined for <code><a href="#htmlcollection">HTMLCollection</a></code> objects.</p>
|
|
|
|
<p>The <a href="#supported-property-names">supported property names</a> consist of the values
|
|
of all the <code title="attr-id"><a href="#the-id-attribute">id</a></code> and <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attributes of all the elements
|
|
<a href="#represented-by-the-collection">represented by the collection</a>.</p>
|
|
|
|
<p>The <dfn id="dom-htmlformcontrolscollection-nameditem" title="dom-HTMLFormControlsCollection-namedItem"><code>namedItem(<var title="">name</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="#the-id-attribute">id</a></code> attribute or a <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute equal to <var title="">name</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="#the-id-attribute">id</a></code> attribute or a <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute equal to <var title="">name</var>, then return null and stop the algorithm.</li>
|
|
|
|
<li>Otherwise, create a new <code><a href="#radionodelist">RadioNodeList</a></code> object
|
|
representing a <a href="#live">live</a> view of the
|
|
<code><a href="#htmlformcontrolscollection">HTMLFormControlsCollection</a></code> object, further filtered so
|
|
that the only nodes in the <code><a href="#radionodelist">RadioNodeList</a></code> object are
|
|
those that have either an <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute
|
|
or a <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute equal to <var title="">name</var>. The nodes in the <code><a href="#radionodelist">RadioNodeList</a></code>
|
|
object must be sorted in <a href="#tree-order">tree order</a>.</li>
|
|
|
|
<li>Return that <code><a href="#radionodelist">RadioNodeList</a></code> object.</li>
|
|
|
|
</ol><hr><p>Members of the <code><a href="#radionodelist">RadioNodeList</a></code> interface inherited
|
|
from the <code><a href="#nodelist">NodeList</a></code> interface must behave as they would
|
|
on a <code><a href="#nodelist">NodeList</a></code> object.</p>
|
|
|
|
<p>The <dfn id="dom-radionodelist-value" title="dom-RadioNodeList-value"><code>value</code></dfn>
|
|
IDL attribute on the <code><a href="#radionodelist">RadioNodeList</a></code> object, on getting,
|
|
must return the value returned by running the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">element</var> be the first element in
|
|
<a href="#tree-order">tree order</a> represented by the
|
|
<code><a href="#radionodelist">RadioNodeList</a></code> object that is an <code><a href="#the-input-element">input</a></code>
|
|
element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute
|
|
is in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a>
|
|
state and whose <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a>
|
|
is true. Otherwise, let it be null.</li>
|
|
|
|
<li><p>If <var title="">element</var> is null, or if it is an
|
|
element with no <code title="attr-input-value"><a href="#attr-input-value">value</a></code>
|
|
attribute, return the empty string.</li>
|
|
|
|
<li><p>Otherwise, return the value of <var title="">element</var>'s
|
|
<code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute.</li>
|
|
|
|
</ol><p>On setting, the <code title="dom-RadioNodeList-value"><a href="#dom-radionodelist-value">value</a></code> IDL attribute must run
|
|
the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">element</var> be the first element in
|
|
<a href="#tree-order">tree order</a> represented by the
|
|
<code><a href="#radionodelist">RadioNodeList</a></code> object that is an <code><a href="#the-input-element">input</a></code>
|
|
element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute
|
|
is in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a>
|
|
state and whose <code title="attr-input-value"><a href="#attr-input-value">value</a></code> content
|
|
attribute is present and equal to the new value, if any. Otherwise,
|
|
let it be null.</li>
|
|
|
|
<li><p>If <var title="">element</var> is not null, then set its
|
|
<a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> to true.</p>
|
|
|
|
</ol></div><h5 id="htmloptionscollection-0"><span class="secno">2.8.2.4 </span>HTMLOptionsCollection</h5><p>The <code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> interface represents a
|
|
list of <code><a href="#the-option-element">option</a></code> elements. It is always rooted on a
|
|
<code><a href="#the-select-element">select</a></code> element and has attributes and methods that
|
|
manipulate that element's descendants.<pre class="idl">interface <dfn id="htmloptionscollection">HTMLOptionsCollection</dfn> : <a href="#htmlcollection">HTMLCollection</a> {
|
|
// inherits <a href="#dom-htmlcollection-item" title="dom-HTMLCollection-item">item</a>()
|
|
attribute unsigned long <a href="#dom-htmloptionscollection-length" title="dom-HTMLOptionsCollection-length">length</a>; // overrides inherited length
|
|
caller getter object <a href="#dom-htmloptionscollection-nameditem" title="dom-HTMLOptionsCollection-namedItem">namedItem</a>(in DOMString name); // overrides inherited namedItem()
|
|
void <a href="#dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add">add</a>(in <a href="#htmlelement">HTMLElement</a> element, in optional <a href="#htmlelement">HTMLElement</a> before);
|
|
void <a href="#dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add">add</a>(in <a href="#htmlelement">HTMLElement</a> element, in long before);
|
|
void <a href="#dom-htmloptionscollection-remove" title="dom-HTMLOptionsCollection-remove">remove</a>(in long index);
|
|
attribute long <a href="#dom-htmloptionscollection-selectedindex" title="dom-HTMLOptionsCollection-selectedIndex">selectedIndex</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">collection</var> . <code title="dom-HTMLOptionsCollection-length"><a href="#dom-htmloptionscollection-length">length</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the number of elements in the collection.</p>
|
|
<p>When set to a smaller number, truncates the number of <code><a href="#the-option-element">option</a></code> elements in the corresponding container.</p>
|
|
<p>When set to a greater number, adds new blank <code><a href="#the-option-element">option</a></code> elements to that container.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLCollection-item"><a href="#dom-htmlcollection-item">item</a></code>(<var title="">index</var>)</dt>
|
|
<dt><var title="">collection</var>[<var title="">index</var>]</dt>
|
|
<dt><var title="">collection</var>(<var title="">index</var>)</dt>
|
|
<dd>
|
|
<p>Returns the item with index <var title="">index</var> from the collection. The items are sorted in <a href="#tree-order">tree order</a>.</p>
|
|
<p>Returns null if <var title="">index</var> is out of range.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLOptionsCollection-namedItem"><a href="#dom-htmloptionscollection-nameditem">namedItem</a></code>(<var title="">name</var>)</dt>
|
|
<dt><var title="">nodeList</var> = <var title="">collection</var> . <code title="dom-HTMLOptionsCollection-namedItem"><a href="#dom-htmloptionscollection-nameditem">namedItem</a></code>(<var title="">name</var>)</dt>
|
|
<dt><var title="">collection</var>[<var title="">name</var>]</dt>
|
|
<dt><var title="">collection</var>(<var title="">name</var>)</dt>
|
|
<dd>
|
|
<p>Returns the item with <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-option-name"><a href="#attr-option-name">name</a></code> <var title="">name</var> from the collection.</p>
|
|
<p>If there are multiple matching items, then a <code><a href="#nodelist">NodeList</a></code> object containing all those elements is returned.</p>
|
|
<p>Returns null if no element with that <a href="#concept-id" title="concept-id">ID</a> could be found.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">collection</var> . <code title="dom-HTMLOptionsCollection-add"><a href="#dom-htmloptionscollection-add">add</a></code>(<var title="">element</var> [, <var title="">before</var> ] )</dt>
|
|
<dd>
|
|
<p>Inserts <var title="">element</var> before the node given by <var title="">before</var>.</p>
|
|
<p>The <var title="">before</var> argument can be a number, in
|
|
which case <var title="">element</var> is inserted before the item
|
|
with that number, or an element from the collection, in which case
|
|
<var title="">element</var> is inserted before that element.</p>
|
|
<p>If <var title="">before</var> is omitted, null, or a number out
|
|
of range, then <var title="">element</var> will be added at the
|
|
end of the list.</p>
|
|
<p>This method will throw a <code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code>
|
|
exception if <var title="">element</var> is an ancestor of the
|
|
element into which it is to be inserted. If <var title="">element</var> is not an <code><a href="#the-option-element">option</a></code> or
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element, then the method does nothing.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">collection</var> . <code title="dom-HTMLOptionsCollection-selectedIndex"><a href="#dom-htmloptionscollection-selectedindex">selectedIndex</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the index of the first selected item, if any, or
|
|
−1 if there is no selected item.</p>
|
|
|
|
<p>Can be set, to change the selection.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The object's <a href="#supported-property-indices">supported property indices</a> are as
|
|
defined for <code><a href="#htmlcollection">HTMLCollection</a></code> objects.</p>
|
|
|
|
<p>On getting, the <dfn id="dom-htmloptionscollection-length" title="dom-HTMLOptionsCollection-length"><code>length</code></dfn>
|
|
attribute must return the number of nodes <a href="#represented-by-the-collection">represented by the
|
|
collection</a>.</p>
|
|
|
|
<p>On setting, the behavior depends on whether the new value is
|
|
equal to, greater than, or less than the number of nodes
|
|
<a href="#represented-by-the-collection">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><a href="#the-option-element">option</a></code> elements with no attributes and no child nodes
|
|
must be appended to the <code><a href="#the-select-element">select</a></code> element on which the
|
|
<code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> is rooted, where <var title="">n</var> is the difference between the two numbers (new
|
|
value minus old value). Mutation events must be fired as if a
|
|
<code><a href="#documentfragment">DocumentFragment</a></code> containing the new <code><a href="#the-option-element">option</a></code>
|
|
elements had been inserted. 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="#dom-htmloptionscollection-length">length</a></code> never removes
|
|
or adds any <code><a href="#the-optgroup-element">optgroup</a></code> elements, and never adds new
|
|
children to existing <code><a href="#the-optgroup-element">optgroup</a></code> elements (though it can
|
|
remove children from them).</p>
|
|
|
|
<p>The <a href="#supported-property-names">supported property names</a> consist of the values
|
|
of all the <code title="attr-id"><a href="#the-id-attribute">id</a></code> and <code title="attr-option-name"><a href="#attr-option-name">name</a></code> attributes of all the elements
|
|
<a href="#represented-by-the-collection">represented by the collection</a>.</p>
|
|
|
|
<p>The <dfn id="dom-htmloptionscollection-nameditem" title="dom-HTMLOptionsCollection-namedItem"><code>namedItem(<var title="">name</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="#the-id-attribute">id</a></code> attribute or a <code title="attr-option-name"><a href="#attr-option-name">name</a></code> attribute equal to <var title="">name</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="#the-id-attribute">id</a></code> attribute or a <code title="attr-option-name"><a href="#attr-option-name">name</a></code> attribute equal to <var title="">name</var>, then return null and stop the algorithm.</li>
|
|
|
|
|
|
<li>Otherwise, create a new <code><a href="#nodelist">NodeList</a></code> object
|
|
representing a <a href="#live">live</a> view of the
|
|
<code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> object, further filtered so that
|
|
the only nodes in the <code><a href="#nodelist">NodeList</a></code> object are those that
|
|
have either an <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute or a <code title="attr-option-name"><a href="#attr-option-name">name</a></code> attribute equal to <var title="">name</var>. The nodes in the <code><a href="#nodelist">NodeList</a></code> object
|
|
must be sorted in <a href="#tree-order">tree order</a>.</li>
|
|
|
|
<li>Return that <code><a href="#nodelist">NodeList</a></code> object.</li>
|
|
|
|
</ol><p>The <dfn id="dom-htmloptionscollection-add" title="dom-HTMLOptionsCollection-add"><code>add(<var title="">element</var>, <var title="">before</var>)</code></dfn>
|
|
method must act according to the following algorithm:</p>
|
|
|
|
<ol><li><p>If <var title="">element</var> is not an <code><a href="#the-option-element">option</a></code>
|
|
or <code><a href="#the-optgroup-element">optgroup</a></code> element, then return and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If <var title="">element</var> is an ancestor of the
|
|
<code><a href="#the-select-element">select</a></code> element on which the
|
|
<code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> is rooted, then throw a
|
|
<code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> exception.</li>
|
|
|
|
<li><p>If <var title="">before</var> is an element, but that
|
|
element isn't a descendant of the <code><a href="#the-select-element">select</a></code> element on
|
|
which the <code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> is rooted, then throw
|
|
a <code><a href="#not_found_err">NOT_FOUND_ERR</a></code> exception.</li>
|
|
|
|
<li><p>If <var title="">element</var> and <var title="">before</var> are the same element, then return and abort
|
|
these steps.</li>
|
|
|
|
<li><p>If <var title="">before</var> is a node, then let <var title="">reference</var> be that node. Otherwise, if <var title="">before</var> is an integer, and there is a <var title="">before</var>th node in the collection, let <var title="">reference</var> be that node. Otherwise, let <var title="">reference</var> be null.</li>
|
|
|
|
<li><p>If <var title="">reference</var> is not null, let <var title="">parent</var> be the parent node of <var title="">reference</var>. Otherwise, let <var title="">parent</var>
|
|
be the <code><a href="#the-select-element">select</a></code> element on which the
|
|
<code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> is rooted.</li>
|
|
|
|
<li><p>Act as if the DOM Core <code title="dom-Node-insertBefore"><a href="#dom-node-insertbefore">insertBefore()</a></code> method was
|
|
invoked on the <var title="">parent</var> node, with <var title="">element</var> as the first argument and <var title="">reference</var> as the second argument.</p>
|
|
|
|
</ol><p>The <dfn id="dom-htmloptionscollection-remove" title="dom-HTMLOptionsCollection-remove"><code>remove(<var title="">index</var>)</code></dfn> method must act according to
|
|
the following algorithm:</p>
|
|
|
|
<ol><li><p>If the number of nodes <a href="#represented-by-the-collection">represented by the
|
|
collection</a> is zero, abort these steps.</li>
|
|
|
|
<li><p>If <var title="">index</var> is not a number greater than or
|
|
equal to 0 and less than the number of nodes <a href="#represented-by-the-collection">represented by
|
|
the collection</a>, let <var title="">element</var> be the first
|
|
element in the collection. Otherwise, let <var title="">element</var> be the <var title="">index</var>th element
|
|
in the collection.</li>
|
|
|
|
<li><p>Remove <var title="">element</var> from its parent
|
|
node.</li>
|
|
|
|
</ol><p>The <dfn id="dom-htmloptionscollection-selectedindex" title="dom-HTMLOptionsCollection-selectedIndex"><code>selectedIndex</code></dfn>
|
|
IDL attribute must act like the identically named attribute on the
|
|
<code><a href="#the-select-element">select</a></code> element on which the
|
|
<code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> is rooted</p>
|
|
|
|
|
|
|
|
</div><h4 id="domtokenlist-0"><span class="secno">2.8.3 </span>DOMTokenList</h4><p>The <code><a href="#domtokenlist">DOMTokenList</a></code> interface represents an interface
|
|
to an underlying string that consists of a <a href="#set-of-space-separated-tokens">set of
|
|
space-separated tokens</a>.<p class="note"><code><a href="#domtokenlist">DOMTokenList</a></code> objects are always
|
|
<a href="#case-sensitive">case-sensitive</a>, even when the underlying string might
|
|
ordinarily be treated in a case-insensitive manner.<pre class="idl">interface <dfn id="domtokenlist">DOMTokenList</dfn> {
|
|
readonly attribute unsigned long <a href="#dom-tokenlist-length" title="dom-tokenlist-length">length</a>;
|
|
getter DOMString <a href="#dom-tokenlist-item" title="dom-tokenlist-item">item</a>(in unsigned long index);
|
|
boolean <a href="#dom-tokenlist-contains" title="dom-tokenlist-contains">contains</a>(in DOMString token);
|
|
void <a href="#dom-tokenlist-add" title="dom-tokenlist-add">add</a>(in DOMString token);
|
|
void <a href="#dom-tokenlist-remove" title="dom-tokenlist-remove">remove</a>(in DOMString token);
|
|
boolean <a href="#dom-tokenlist-toggle" title="dom-tokenlist-toggle">toggle</a>(in DOMString token);
|
|
<a href="#dom-tokenlist-tostring" title="dom-tokenlist-toString">stringifier</a> DOMString ();
|
|
};</pre><dl class="domintro"><dt><var title="">tokenlist</var> . <code title="dom-tokenlist-length"><a href="#dom-tokenlist-length">length</a></code></dt>
|
|
<dd>
|
|
<p>Returns the number of tokens in the string.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">tokenlist</var> . <code title="dom-tokenlist-item"><a href="#dom-tokenlist-item">item</a></code>(<var title="">index</var>)</dt>
|
|
<dt><var title="">tokenlist</var>[<var title="">index</var>]</dt>
|
|
<dd>
|
|
<p>Returns the token with index <var title="">index</var>. The tokens are returned in the order they are found in the underlying string.</p>
|
|
<p>Returns null if <var title="">index</var> is out of range.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">hastoken</var> = <var title="">tokenlist</var> . <code title="dom-tokenlist-contains"><a href="#dom-tokenlist-contains">contains</a></code>(<var title="">token</var>)</dt>
|
|
<dd>
|
|
<p>Returns true if the <var title="">token</var> is present; false otherwise.</p>
|
|
<p>Throws a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception if <var title="">token</var> is empty.</p>
|
|
<p>Throws an <code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception if <var title="">token</var> contains any spaces.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">tokenlist</var> . <code title="dom-tokenlist-add"><a href="#dom-tokenlist-add">add</a></code>(<var title="">token</var>)</dt>
|
|
<dd>
|
|
<p>Adds <var title="">token</var>, unless it is already present.</p>
|
|
<p>Throws a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception if <var title="">token</var> is empty.</p>
|
|
<p>Throws an <code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception if <var title="">token</var> contains any spaces.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">tokenlist</var> . <code title="dom-tokenlist-remove"><a href="#dom-tokenlist-remove">remove</a></code>(<var title="">token</var>)</dt>
|
|
<dd>
|
|
<p>Removes <var title="">token</var> if it is present.</p>
|
|
<p>Throws a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception if <var title="">token</var> is empty.</p>
|
|
<p>Throws an <code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception if <var title="">token</var> contains any spaces.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">hastoken</var> = <var title="">tokenlist</var> . <code title="dom-tokenlist-toggle"><a href="#dom-tokenlist-toggle">toggle</a></code>(<var title="">token</var>)</dt>
|
|
<dd>
|
|
<p>Adds <var title="">token</var> if it is not present, or removes
|
|
it if it is. Returns true if <var title="">token</var> is now
|
|
present (it was added); returns false if it is not (it was
|
|
removed).</p>
|
|
<p>Throws a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception if <var title="">token</var> is empty.</p>
|
|
<p>Throws an <code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception if <var title="">token</var> contains any spaces.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-tokenlist-length" title="dom-tokenlist-length"><code>length</code></dfn>
|
|
attribute must return the number of tokens that result from <a href="#split-a-string-on-spaces" title="split a string on spaces">splitting the underlying string on
|
|
spaces</a>. This is the <var title="dom-tokenlist-length"><a href="#dom-tokenlist-length">length</a></var>.</p>
|
|
|
|
<p>The object's <a href="#supported-property-indices">supported property indices</a> are the
|
|
numbers in the range zero to <span title=""><var title="dom-tokenlist-length"><a href="#dom-tokenlist-length">length</a></var>-1</span>, unless the <var title="dom-tokenlist-length"><a href="#dom-tokenlist-length">length</a></var> is zero, in which case
|
|
there are no <a href="#supported-property-indices">supported property indices</a>.</p>
|
|
|
|
<p>The <dfn id="dom-tokenlist-item" title="dom-tokenlist-item"><code>item(<var title="">index</var>)</code></dfn> method must <a href="#split-a-string-on-spaces" title="split a
|
|
string on spaces">split the underlying string on spaces</a>,
|
|
preserving the order of the tokens as found in the underlying
|
|
string, 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 class="example">For example, if the string is "<code title="">a b
|
|
a c</code>" then there are four tokens: the token with index 0 is
|
|
"<code title="">a</code>", the token with index 1 is "<code title="">b</code>", the token with index 2 is "<code title="">a</code>", and the token with index 3 is "<code title="">c</code>".</p>
|
|
|
|
<p>The <dfn id="dom-tokenlist-contains" title="dom-tokenlist-contains"><code>contains(<var title="">token</var>)</code></dfn> method must run the following
|
|
algorithm:</p>
|
|
|
|
<ol><li>If the <var title="">token</var> argument is the empty string,
|
|
then raise a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception and stop the
|
|
algorithm.</li>
|
|
|
|
<li>If the <var title="">token</var> argument contains any <a href="#space-character" title="space character">space characters</a>, then raise an
|
|
<code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception and stop the
|
|
algorithm.</li>
|
|
|
|
<li>Otherwise, <a href="#split-a-string-on-spaces" title="split a string on spaces">split the
|
|
underlying string on spaces</a> to get the list of tokens in the
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying string.</li>
|
|
|
|
<li>If the token indicated by <var title="">token</var> is a
|
|
<a href="#case-sensitive">case-sensitive</a> match for one of the tokens in the
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying string then return
|
|
true and stop this algorithm.</li>
|
|
|
|
<li>Otherwise, return false.</li>
|
|
|
|
</ol><p>The <dfn id="dom-tokenlist-add" 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 is the empty string,
|
|
then raise a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception and stop the
|
|
algorithm.</li>
|
|
|
|
<li>If the <var title="">token</var> argument contains any <a href="#space-character" title="space character">space characters</a>, then raise an
|
|
<code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception and stop the
|
|
algorithm.</li>
|
|
|
|
<li>Otherwise, <a href="#split-a-string-on-spaces" title="split a string on spaces">split the
|
|
underlying string on spaces</a> to get the list of tokens in the
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying string.</li>
|
|
|
|
<li>If the given <var title="">token</var> is a
|
|
<a href="#case-sensitive">case-sensitive</a> match for one of the tokens in the
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying string then stop the
|
|
algorithm.</li>
|
|
|
|
<li>Otherwise, if the <code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying
|
|
string is not the empty string and the last character of that
|
|
string is not a <a href="#space-character">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="#domtokenlist">DOMTokenList</a></code> object's underlying string.</li>
|
|
|
|
</ol><p>The <dfn id="dom-tokenlist-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 is the empty string,
|
|
then raise a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception and stop the
|
|
algorithm.</li>
|
|
|
|
<li>If the <var title="">token</var> argument contains any <a href="#space-character" title="space character">space characters</a>, then raise an
|
|
<code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception and stop the
|
|
algorithm.</li>
|
|
|
|
<li>Otherwise, <a href="#remove-a-token-from-a-string" 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="dom-tokenlist-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 is the empty string,
|
|
then raise a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception and stop the
|
|
algorithm.</li>
|
|
|
|
<li>If the <var title="">token</var> argument contains any <a href="#space-character" title="space character">space characters</a>, then raise an
|
|
<code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception and stop the
|
|
algorithm.</li>
|
|
|
|
<li>Otherwise, <a href="#split-a-string-on-spaces" title="split a string on spaces">split the
|
|
underlying string on spaces</a> to get the list of tokens in the
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying string.</li>
|
|
|
|
<li>If the given <var title="">token</var> is a
|
|
<a href="#case-sensitive">case-sensitive</a> match for one of the tokens in the
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying string then <a href="#remove-a-token-from-a-string" 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 <code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying
|
|
string is not the empty string and the last character of that
|
|
string is not a <a href="#space-character">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="#domtokenlist">DOMTokenList</a></code> object's underlying string.</li>
|
|
|
|
<li>Return true.</li>
|
|
|
|
</ol><p>A <code><a href="#domtokenlist">DOMTokenList</a></code> object must <dfn id="dom-tokenlist-tostring" title="dom-tokenlist-toString">stringify</dfn> to the value of the
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> object's underlying string.</p>
|
|
|
|
</div><h4 id="domsettabletokenlist-0"><span class="secno">2.8.4 </span>DOMSettableTokenList</h4><p>The <code><a href="#domsettabletokenlist">DOMSettableTokenList</a></code> interface is the same as the
|
|
<code><a href="#domtokenlist">DOMTokenList</a></code> interface, except that it allows the
|
|
underlying string to be directly changed.<pre class="idl">interface <dfn id="domsettabletokenlist">DOMSettableTokenList</dfn> : <a href="#domtokenlist">DOMTokenList</a> {
|
|
attribute DOMString <a href="#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">tokenlist</var> . <code title="dom-DOMSettableTokenList-value"><a href="#dom-domsettabletokenlist-value">value</a></code></dt>
|
|
<dd>
|
|
<p>Returns the underlying string.</p>
|
|
<p>Can be set, to change the underlying string.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>An object implementing the <code><a href="#domsettabletokenlist">DOMSettableTokenList</a></code>
|
|
interface must act as defined for the <code><a href="#domtokenlist">DOMTokenList</a></code>
|
|
interface, except for the <code title="dom-DOMSettableTokenList-value"><a href="#dom-domsettabletokenlist-value">value</a></code> attribute defined
|
|
here.</p>
|
|
|
|
<p>The <dfn id="dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value"><code>value</code></dfn>
|
|
attribute must return the underlying string on getting, and must
|
|
replace the underlying string with the new value on setting.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="safe-passing-of-structured-data"><span class="secno">2.8.5 </span>Safe passing of structured data</h4>
|
|
|
|
<p>When a user agent is required to obtain a <dfn id="structured-clone">structured
|
|
clone</dfn> of a value, it must run the following algorithm, which
|
|
either returns a separate value, or throws an exception.</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the value being
|
|
cloned.</li>
|
|
|
|
<li><p>Let <var title="">memory</var> be an association list of
|
|
pairs of objects, initially empty. This is used to handle duplicate
|
|
references. In each pair of objects, one is called the
|
|
<em>source</em> object and the other the <em>destination</em>
|
|
object.</li>
|
|
|
|
<li><p>Let <var title="">output</var> be the value resulting from
|
|
calling the <a href="#internal-structured-cloning-algorithm">internal structured cloning algorithm</a> with
|
|
<var title="">input</var> and <var title="">memory</var>.</li>
|
|
|
|
<li><p>Return <var title="">output</var>.</li>
|
|
|
|
</ol><p>The <dfn id="internal-structured-cloning-algorithm">internal structured cloning algorithm</dfn> is always
|
|
called with two arguments, <var title="">input</var> and <var title="">memory</var>, and its behavior is as follows:</p>
|
|
|
|
<ol><li><p>If <var title="">input</var> is the source object of a pair
|
|
of objects in <var title="">memory</var>, then return the
|
|
destination object in that pair of objects and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If <var title="">input</var> is a primitive value, then
|
|
return that value and abort these steps.</li>
|
|
|
|
<li>
|
|
|
|
<p>The <var title="">input</var> value is an object. Jump to the
|
|
appropriate step below:</p>
|
|
|
|
<dl class="switch"><dt>If <var title="">input</var> is a Boolean object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed Boolean object with the same value as <var title="">input</var>.</dd>
|
|
|
|
<dt>If <var title="">input</var> is a Number object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed Number object with the same value as <var title="">input</var>.</dd>
|
|
|
|
<dt>If <var title="">input</var> is a String object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed String object with the same value as <var title="">input</var>.</dd>
|
|
|
|
<dt>If <var title="">input</var> is a <code>Date</code> object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed <code>Date</code> object with the same value as <var title="">input</var>.</dd>
|
|
|
|
<dt>If <var title="">input</var> is a <code>RegExp</code> object</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Let <var title="">output</var> be a newly constructed <code>RegExp</code> object with the same pattern and flags as <var title="">input</var>.</p>
|
|
|
|
<p class="note">The value of the <code title="">lastIndex</code> property is not copied.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">input</var> is a <code>ImageData</code> object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed <code>ImageData</code> object
|
|
with the same <code title="dom-imagedata-width">width</code> and
|
|
<code title="dom-imagedata-height">height</code> as <var title="">input</var>, and with a newly constructed
|
|
<code>CanvasPixelArray</code> for its <code title="dom-imagedata-data">data</code> attribute, with the same
|
|
<code title="dom-canvaspixelarray-length">length</code> and pixel
|
|
values as the <var title="">input</var>'s.</dd>
|
|
|
|
<dt>If <var title="">input</var> is a <code><a href="#file">File</a></code> object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed <code><a href="#file">File</a></code> object corresponding to the same underlying data.</dd>
|
|
|
|
<dt>If <var title="">input</var> is a <code><a href="#blob">Blob</a></code> object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed <code><a href="#blob">Blob</a></code> object corresponding to the same underlying data.</dd>
|
|
|
|
<dt>If <var title="">input</var> is a <code><a href="#filelist">FileList</a></code> object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed <code><a href="#filelist">FileList</a></code> object containing a list of newly constructed <code><a href="#file">File</a></code> objects corresponding to the same underlying data as those in <var title="">input</var>, maintaining their relative order.</dd>
|
|
|
|
<dt>If <var title="">input</var> is an Array object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed empty <code>Array</code> object.</dd>
|
|
|
|
<dt>If <var title="">input</var> is an Object object</dt>
|
|
|
|
<dd><p>Let <var title="">output</var> be a newly constructed empty <code title="">Object</code> object.</dd>
|
|
|
|
<dt>If <var title="">input</var> is another native object type (e.g. <code>Error</code>, <code><a href="#function">Function</a></code>)</dt>
|
|
<dt>If <var title="">input</var> is a host object (e.g. a DOM node)</dt>
|
|
|
|
<dd><p>Throw a <code><a href="#data_clone_err">DATA_CLONE_ERR</a></code> exception and abort
|
|
the overall <a href="#structured-clone">structured clone</a> algorithm.</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>Add a mapping from <var title="">input</var> (the source
|
|
object) to <var title="">output</var> (the destination object) to
|
|
<var title="">memory</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">input</var> is an Array object or an Object
|
|
object, then, for each enumerable property in <var title="">input</var>, add a new property to <var title="">output</var> having the same name, and having a value
|
|
created from invoking the <a href="#internal-structured-cloning-algorithm">internal structured cloning
|
|
algorithm</a> recursively with the value of the property as the
|
|
"<var title="">input</var>" argument and <var title="">memory</var> as the "<var title="">memory</var>"
|
|
argument. The order of the properties in the <var title="">input</var> and <var title="">output</var> objects must
|
|
be the same.</p>
|
|
|
|
<p class="note">This does not walk the prototype chain.</p>
|
|
|
|
<p class="note">Property descriptors, setters, getters, and
|
|
analogous features are not copied in this process. For example,
|
|
the property in the input could be marked as read-only, but in the
|
|
output it would just have the default state (typically read-write,
|
|
though that could depend on the scripting environment).</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Return <var title="">output</var>.</li>
|
|
|
|
</ol><p class="note">This algorithm preserves cycles and preserves the
|
|
identity of duplicate objects in graphs.</p>
|
|
|
|
</div><h4 id="domstringmap-0"><span class="secno">2.8.6 </span>DOMStringMap</h4><p>The <code><a href="#domstringmap">DOMStringMap</a></code> interface represents a set of
|
|
name-value pairs. It exposes these using the scripting language's
|
|
native mechanisms for property access.<div class="impl">
|
|
|
|
<p>When a <code><a href="#domstringmap">DOMStringMap</a></code> object is instantiated, it is
|
|
associated with three algorithms, one for getting the list of
|
|
name-value pairs, one for setting names to certain values, and one
|
|
for deleting names.</p>
|
|
|
|
<pre class="idl">interface <dfn id="domstringmap">DOMStringMap</dfn> {
|
|
<a href="#dom-domstringmap-nameditem" title="dom-DOMStringMap-namedItem">getter</a> DOMString (in DOMString name);
|
|
<a href="#dom-domstringmap-setitem" title="dom-DOMStringMap-setItem">setter</a> void (in DOMString name, in DOMString value);
|
|
<a href="#dom-domstringmap-additem" title="dom-DOMStringMap-addItem">creator</a> void (in DOMString name, in DOMString value);
|
|
<a href="#dom-domstringmap-removeitem" title="dom-DOMStringMap-removeItem">deleter</a> void (in DOMString name);
|
|
};</pre>
|
|
|
|
<p>The <a href="#supported-property-names">supported property names</a> on a
|
|
<code><a href="#domstringmap">DOMStringMap</a></code> object at any instant are the names of
|
|
each pair returned from the algorithm for getting the list of
|
|
name-value pairs at that instant.</p>
|
|
|
|
<p>To <dfn id="dom-domstringmap-nameditem" title="dom-DOMStringMap-namedItem">determine the value of
|
|
a named property</dfn> <var title="">name</var> in a
|
|
<code><a href="#domstringmap">DOMStringMap</a></code>, the user agent must return the value
|
|
component of the name-value pair whose name component is <var title="">name</var> in the list returned by the algorithm for
|
|
getting the list of name-value pairs.</p>
|
|
|
|
<p>To set the value of a <dfn id="dom-domstringmap-additem" title="dom-DOMStringMap-addItem">new</dfn> or <dfn id="dom-domstringmap-setitem" title="dom-DOMStringMap-setItem">existing</dfn> named property <var title="">name</var> to value <var title="">value</var>, the
|
|
algorithm for setting names to certain values must be run, passing
|
|
<var title="">name</var> as the name and the result of converting
|
|
<var title="">value</var> to a <code>DOMString</code> as the
|
|
value.</p>
|
|
|
|
<p>To <dfn id="dom-domstringmap-removeitem" title="dom-DOMStringMap-removeItem">delete an existing
|
|
named property</dfn> <var title="">name</var>, the algorithm for
|
|
deleting names must be run, passing <var title="">name</var> as the
|
|
name.</p>
|
|
|
|
<p class="note">The <code><a href="#domstringmap">DOMStringMap</a></code> interface definition
|
|
here is only intended for JavaScript environments. Other language
|
|
bindings will need to define how <code><a href="#domstringmap">DOMStringMap</a></code> is to be
|
|
implemented for those languages.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The <code title="dom-dataset"><a href="#dom-dataset">dataset</a></code> attribute on
|
|
elements exposes the <code title="attr-data-*"><a href="#attr-data">data-*</a></code>
|
|
attributes on the element.</p>
|
|
|
|
<p>Given the following fragment and elements with similar
|
|
constructions:</p>
|
|
|
|
<pre><img class="tower" id="tower5" data-x="12" data-y="5"
|
|
data-ai="robotarget" data-hp="46" data-ability="flames"
|
|
src="towers/rocket.png alt="Rocket Tower"></pre>
|
|
|
|
<p>...one could imagine a function <code title="">splashDamage()</code> that takes some arguments, the first
|
|
of which is the element to process:</p>
|
|
|
|
<pre>function splashDamage(node, x, y, damage) {
|
|
if (node.classList.contains('tower') && // checking the 'class' attribute
|
|
node.dataset.x == x && // reading the 'data-x' attribute
|
|
node.dataset.y == y) { // reading the 'data-y' attribute
|
|
var hp = parseInt(node.dataset.hp); // reading the 'data-hp' attribute
|
|
hp = hp - damage;
|
|
if (hp < 0) {
|
|
hp = 0;
|
|
node.dataset.ai = 'dead'; // setting the 'data-ai' attribute
|
|
delete node.dataset.ability; // removing the 'data-ability' attribute
|
|
}
|
|
node.dataset.hp = hp; // setting the 'data-hp' attribute
|
|
}
|
|
}</pre>
|
|
|
|
</div><h4 id="dom-feature-strings"><span class="secno">2.8.7 </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="#refsDOMCORE">[DOMCORE]</a><p>Authors are strongly discouraged from using these, as they are
|
|
notoriously unreliable and imprecise. Authors are encouraged to rely
|
|
on explicit feature testing or the graceful degradation behavior
|
|
intrinsic to some of the features in this specification.<div class="impl">
|
|
|
|
<p>For historical reasons, user agents should return the true value
|
|
when the <dfn id="hasfeature" title="hasFeature"><code>hasFeature(<var title="">feature</var>, <var title="">version</var>)</code></dfn>
|
|
method of the <code><a href="#domimplementation">DOMImplementation</a></code> interface is invoked
|
|
with <var title="">feature</var> set to either "<code title="">HTML</code>" or "<code title="">XHTML</code>" and <var title="">version</var> set to either "<code>1.0</code>" or
|
|
"<code>2.0</code>".</p>
|
|
|
|
</div><h4 id="exceptions"><span class="secno">2.8.8 </span>Exceptions</h4><p>The following are <code><a href="#domexception">DOMException</a></code> codes. <a href="#refsDOMCORE">[DOMCORE]</a><ol class="brief"><li value="1"><dfn id="index_size_err"><code>INDEX_SIZE_ERR</code></dfn></li>
|
|
<li value="2"><dfn id="domstring_size_err"><code>DOMSTRING_SIZE_ERR</code></dfn></li>
|
|
<li value="3"><dfn id="hierarchy_request_err"><code>HIERARCHY_REQUEST_ERR</code></dfn></li>
|
|
<li value="4"><dfn id="wrong_document_err"><code>WRONG_DOCUMENT_ERR</code></dfn></li>
|
|
<li value="5"><dfn id="invalid_character_err"><code>INVALID_CHARACTER_ERR</code></dfn></li>
|
|
<li value="6"><dfn id="no_data_allowed_err"><code>NO_DATA_ALLOWED_ERR</code></dfn></li>
|
|
<li value="7"><dfn id="no_modification_allowed_err"><code>NO_MODIFICATION_ALLOWED_ERR</code></dfn></li>
|
|
<li value="8"><dfn id="not_found_err"><code>NOT_FOUND_ERR</code></dfn></li>
|
|
<li value="9"><dfn id="not_supported_err"><code>NOT_SUPPORTED_ERR</code></dfn></li>
|
|
<li value="10"><dfn id="inuse_attribute_err"><code>INUSE_ATTRIBUTE_ERR</code></dfn></li>
|
|
<li value="11"><dfn id="invalid_state_err"><code>INVALID_STATE_ERR</code></dfn></li>
|
|
<li value="12"><dfn id="syntax_err"><code>SYNTAX_ERR</code></dfn></li>
|
|
<li value="13"><dfn id="invalid_modification_err"><code>INVALID_MODIFICATION_ERR</code></dfn></li>
|
|
<li value="14"><dfn id="namespace_err"><code>NAMESPACE_ERR</code></dfn></li>
|
|
<li value="15"><dfn id="invalid_access_err"><code>INVALID_ACCESS_ERR</code></dfn></li>
|
|
<li value="16"><dfn id="validation_err"><code>VALIDATION_ERR</code></dfn></li>
|
|
<li value="17"><dfn id="type_mismatch_err"><code>TYPE_MISMATCH_ERR</code></dfn></li>
|
|
<li value="18"><dfn id="security_err"><code>SECURITY_ERR</code></dfn></li>
|
|
<li value="19"><dfn id="network_err"><code>NETWORK_ERR</code></dfn></li>
|
|
<li value="20"><dfn id="abort_err"><code>ABORT_ERR</code></dfn></li>
|
|
<li value="21"><dfn id="url_mismatch_err"><code>URL_MISMATCH_ERR</code></dfn></li>
|
|
<li value="22"><dfn id="quota_exceeded_err"><code>QUOTA_EXCEEDED_ERR</code></dfn></li>
|
|
<li value="23"><dfn id="timeout_err"><code>TIMEOUT_ERR</code></dfn></li>
|
|
<li value="25"><dfn id="data_clone_err"><code>DATA_CLONE_ERR</code></dfn></li>
|
|
</ol><div class="impl">
|
|
|
|
<pre class="idl">[Supplemental] exception DOMException {
|
|
const unsigned short <a href="#url_mismatch_err">URL_MISMATCH_ERR</a> = 21;
|
|
const unsigned short <a href="#quota_exceeded_err">QUOTA_EXCEEDED_ERR</a> = 22;
|
|
const unsigned short <a href="#data_clone_err">DATA_CLONE_ERR</a> = 25;
|
|
};</pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="garbage-collection"><span class="secno">2.8.9 </span>Garbage collection</h4>
|
|
|
|
<p>There is an <dfn id="implied-strong-reference">implied strong reference</dfn> from any IDL
|
|
attribute that returns a pre-existing object to that object.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, the <code>document.location</code> attribute means
|
|
that there is a strong reference from a <code><a href="#document">Document</a></code>
|
|
object to its <code><a href="#location">Location</a></code> object. Similarly, there is
|
|
always a strong reference from a <code><a href="#document">Document</a></code> to any
|
|
descendant nodes, and from any node to its owner
|
|
<code><a href="#document">Document</a></code>.</p>
|
|
|
|
</div>
|
|
|
|
</div><h3 id="namespaces"><span class="secno">2.9 </span>Namespaces</h3><p>The <dfn id="html-namespace-0">HTML namespace</dfn> is: <code>http://www.w3.org/1999/xhtml</code><p>The <dfn id="mathml-namespace">MathML namespace</dfn> is: <code>http://www.w3.org/1998/Math/MathML</code><p>The <dfn id="svg-namespace">SVG namespace</dfn> is: <code>http://www.w3.org/2000/svg</code><p>The <dfn id="xlink-namespace">XLink namespace</dfn> is: <code>http://www.w3.org/1999/xlink</code><p>The <dfn id="xml-namespace">XML namespace</dfn> is: <code>http://www.w3.org/XML/1998/namespace</code><p>The <dfn id="xmlns-namespace">XMLNS namespace</dfn> is: <code>http://www.w3.org/2000/xmlns/</code><hr><p>Data mining tools and other user agents that perform operations
|
|
on content without running scripts, evaluating CSS or XPath
|
|
expressions, or otherwise exposing the resulting DOM to arbitrary
|
|
content, may "support namespaces" by just asserting that their DOM
|
|
node analogues are in certain namespaces, without actually exposing
|
|
the above strings.<hr><p class="note">In <a href="#syntax">the HTML syntax</a>, namespace prefixes
|
|
and namespace declarations do not have the same effect as in XML.
|
|
For instance, the colon has no special meaning in HTML element
|
|
names.<h2 id="dom"><span class="secno">3 </span>Semantics, structure, and APIs of HTML documents</h2><h3 id="documents"><span class="secno">3.1 </span>Documents</h3><p>Every XML and HTML document in an HTML UA is represented by a
|
|
<code><a href="#document">Document</a></code> object. <a href="#refsDOMCORE">[DOMCORE]</a><p><dfn id="the-document-s-address">The document's address</dfn> is an <a href="#absolute-url">absolute URL</a>
|
|
that is set when the <code><a href="#document">Document</a></code> is created. <dfn id="the-document-s-current-address">The
|
|
document's current address</dfn> is an <a href="#absolute-url">absolute URL</a>
|
|
that can change during the lifetime of the <code><a href="#document">Document</a></code>,
|
|
for example when the user <a href="#navigate" title="navigate">navigates</a> to
|
|
a <a href="#scroll-to-fragid" title="navigate-fragid">fragment identifier</a> on the
|
|
page or when the <code title="dom-history-pushState"><a href="#dom-history-pushstate">pushState()</a></code> method is called
|
|
with a new <a href="#url">URL</a>. <span class="impl"><a href="#the-document-s-current-address">The document's
|
|
current address</a> must be set to <a href="#the-document-s-address">the document's
|
|
address</a> when the <code><a href="#document">Document</a></code> is created.</span><p class="note">Interactive user agents typically expose <a href="#the-document-s-current-address">the
|
|
document's current address</a> in their user interface.<p>When a <code><a href="#document">Document</a></code> is created by a <a href="#concept-script" title="concept-script">script</a> using the <code title="dom-DOMImplementation-createDocument"><a href="#dom-domimplementation-createdocument">createDocument()</a></code>
|
|
or <code title="dom-DOMHTMLImplementation-createHTMLDocument"><a href="#dom-domhtmlimplementation-createhtmldocument">createHTMLDocument()</a></code>
|
|
APIs, <a href="#the-document-s-address">the document's address</a> is the same as <a href="#the-document-s-address">the
|
|
document's address</a> of the <a href="#script-s-document">script's document</a>.<p><code><a href="#document">Document</a></code> objects are assumed to be <dfn id="xml-documents">XML
|
|
documents</dfn> unless they are flagged as being <dfn id="html-documents">HTML
|
|
documents</dfn> when they are created. Whether a document is an
|
|
<a href="#html-documents" title="HTML documents">HTML document</a> or an <a href="#xml-documents" title="XML documents">XML document</a> affects the behavior of
|
|
certain APIs and the case-sensitivity of some selectors.<p>Each <code><a href="#document">Document</a></code> object has a <dfn id="reload-override-flag">reload override
|
|
flag</dfn> that is originally unset. The flag is set by the <code title="dom-document-open"><a href="#dom-document-open">document.open()</a></code> and <code title="dom-document-open"><a href="#dom-document-open">document.write()</a></code> methods in certain
|
|
situations. When the flag is set, the <code><a href="#document">Document</a></code> also has
|
|
a <dfn id="reload-override-buffer">reload override buffer</dfn> which is a Unicode string that
|
|
is used as the source of the document when it is reloaded.<p>When the user agent is to perform <dfn id="an-overridden-reload">an overridden
|
|
reload</dfn>, it must act as follows:<ol><li><p>Let <var title="">source</var> be the value of the
|
|
<a href="#browsing-context">browsing context</a>'s <a href="#active-document">active document</a>'s
|
|
<a href="#reload-override-buffer">reload override buffer</a>.</li>
|
|
|
|
<li><p><a href="#navigate">Navigate</a> the
|
|
<a href="#browsing-context">browsing context</a> to a resource whose source is <var title="">source</var>, with <a href="#replacement-enabled">replacement enabled</a>. When
|
|
the <a href="#navigate">navigate</a> algorithm creates a <code><a href="#document">Document</a></code>
|
|
object for this purpose, set that <code><a href="#document">Document</a></code>'s
|
|
<a href="#reload-override-flag">reload override flag</a> and set its <a href="#reload-override-buffer">reload override
|
|
buffer</a> to <var title="">source</var>.</li>
|
|
|
|
</ol><h4 id="documents-in-the-dom"><span class="secno">3.1.1 </span>Documents in the DOM</h4><p>All <code><a href="#document">Document</a></code> objects (in user agents implementing
|
|
this specification) <span class="impl">must</span> 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-documents" title="HTML documents">HTML
|
|
document</a> or indeed whether it contains any <a href="#html-elements">HTML
|
|
elements</a> at all.) <code><a href="#document">Document</a></code> objects <span class="impl">must</span> also implement the document-level interface
|
|
of any other namespaces that the UA supports.<p class="example">For example, if an HTML implementation also
|
|
supports SVG, then the <code><a href="#document">Document</a></code> object implements both
|
|
<code><a href="#htmldocument">HTMLDocument</a></code> and <code>SVGDocument</code>.<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><a href="#document">Document</a></code>.<pre class="idl">[OverrideBuiltins]
|
|
interface <dfn id="htmldocument">HTMLDocument</dfn> {
|
|
// <a href="#resource-metadata-management">resource metadata management</a>
|
|
[PutForwards=<a href="#dom-location-href" title="dom-location-href">href</a>] readonly attribute <a href="#location">Location</a> <a href="#dom-document-location" title="dom-document-location">location</a>;
|
|
readonly attribute DOMString <a href="#dom-document-url" title="dom-document-URL">URL</a>;
|
|
attribute DOMString <a href="#dom-document-domain" title="dom-document-domain">domain</a>;
|
|
readonly attribute DOMString <a href="#dom-document-referrer" title="dom-document-referrer">referrer</a>;
|
|
attribute DOMString <a href="#dom-document-cookie" title="dom-document-cookie">cookie</a>;
|
|
readonly attribute DOMString <a href="#dom-document-lastmodified" title="dom-document-lastModified">lastModified</a>;
|
|
readonly attribute DOMString <a href="#dom-document-compatmode" title="dom-document-compatMode">compatMode</a>;
|
|
attribute DOMString <a href="#dom-document-charset" title="dom-document-charset">charset</a>;
|
|
readonly attribute DOMString <a href="#dom-document-characterset" title="dom-document-characterSet">characterSet</a>;
|
|
readonly attribute DOMString <a href="#dom-document-defaultcharset" title="dom-document-defaultCharset">defaultCharset</a>;
|
|
readonly attribute DOMString <a href="#dom-document-readystate" title="dom-document-readyState">readyState</a>;
|
|
|
|
// <a href="#dom-tree-accessors">DOM tree accessors</a>
|
|
<a href="#dom-document-nameditem" title="dom-document-namedItem">getter</a> any (in DOMString name);
|
|
attribute DOMString <a href="#document.title" title="dom-document-title">title</a>;
|
|
attribute DOMString <a href="#dom-document-dir" title="dom-document-dir">dir</a>;
|
|
attribute <a href="#htmlelement">HTMLElement</a> <a href="#dom-document-body" title="dom-document-body">body</a>;
|
|
readonly attribute <a href="#htmlheadelement">HTMLHeadElement</a> <a href="#dom-document-head" title="dom-document-head">head</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-images" title="dom-document-images">images</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-embeds" title="dom-document-embeds">embeds</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-plugins" title="dom-document-plugins">plugins</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-links" title="dom-document-links">links</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-forms" title="dom-document-forms">forms</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-scripts" title="dom-document-scripts">scripts</a>;
|
|
NodeList <a href="#dom-document-getelementsbyname" title="dom-document-getElementsByName">getElementsByName</a>(in DOMString elementName);
|
|
NodeList <a href="#dom-document-getelementsbyclassname" title="dom-document-getElementsByClassName">getElementsByClassName</a>(in DOMString classNames);
|
|
|
|
// <a href="#dynamic-markup-insertion">dynamic markup insertion</a>
|
|
attribute DOMString <a href="#dom-innerhtml" title="dom-innerHTML">innerHTML</a>;
|
|
<a href="#htmldocument">HTMLDocument</a> <a href="#dom-document-open" title="dom-document-open">open</a>(in optional DOMString type, in optional DOMString replace);
|
|
<a href="#windowproxy">WindowProxy</a> <a href="#dom-document-open" title="dom-document-open">open</a>(in DOMString url, in DOMString name, in DOMString features, in optional boolean replace);
|
|
void <a href="#dom-document-close" title="dom-document-close">close</a>();
|
|
void <a href="#dom-document-write" title="dom-document-write">write</a>(in DOMString... text);
|
|
void <a href="#dom-document-writeln" title="dom-document-writeln">writeln</a>(in DOMString... text);
|
|
|
|
// <a href="#editing">user interaction</a>
|
|
readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-document-defaultview" title="dom-document-defaultView">defaultView</a>;
|
|
readonly attribute <a href="#element">Element</a> <a href="#dom-document-activeelement" title="dom-document-activeElement">activeElement</a>;
|
|
boolean <a href="#dom-document-hasfocus" title="dom-document-hasFocus">hasFocus</a>();
|
|
attribute DOMString <a href="#designMode" title="dom-document-designMode">designMode</a>;
|
|
boolean <a href="#execCommand" title="dom-document-execCommand">execCommand</a>(in DOMString commandId);
|
|
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="#dom-document-querycommandenabled" title="dom-document-queryCommandEnabled">queryCommandEnabled</a>(in DOMString commandId);
|
|
boolean <a href="#dom-document-querycommandindeterm" title="dom-document-queryCommandIndeterm">queryCommandIndeterm</a>(in DOMString commandId);
|
|
boolean <a href="#dom-document-querycommandstate" title="dom-document-queryCommandState">queryCommandState</a>(in DOMString commandId);
|
|
boolean <a href="#dom-document-querycommandsupported" title="dom-document-queryCommandSupported">queryCommandSupported</a>(in DOMString commandId);
|
|
DOMString <a href="#dom-document-querycommandvalue" title="dom-document-queryCommandValue">queryCommandValue</a>(in DOMString commandId);
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-commands" title="dom-document-commands">commands</a>;
|
|
|
|
// <a href="#event-handler-idl-attributes">event handler IDL attributes</a>
|
|
attribute <a href="#function">Function</a> <a href="#handler-onabort" title="handler-onabort">onabort</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onblur" title="handler-onblur">onblur</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncanplay" title="handler-oncanplay">oncanplay</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncanplaythrough" title="handler-oncanplaythrough">oncanplaythrough</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onchange" title="handler-onchange">onchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onclick" title="handler-onclick">onclick</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncontextmenu" title="handler-oncontextmenu">oncontextmenu</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncuechange" title="handler-oncuechange">oncuechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondblclick" title="handler-ondblclick">ondblclick</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondrag" title="handler-ondrag">ondrag</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragend" title="handler-ondragend">ondragend</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragenter" title="handler-ondragenter">ondragenter</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragleave" title="handler-ondragleave">ondragleave</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragover" title="handler-ondragover">ondragover</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragstart" title="handler-ondragstart">ondragstart</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondrop" title="handler-ondrop">ondrop</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondurationchange" title="handler-ondurationchange">ondurationchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onemptied" title="handler-onemptied">onemptied</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onended" title="handler-onended">onended</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onerror" title="handler-onerror">onerror</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onfocus" title="handler-onfocus">onfocus</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oninput" title="handler-oninput">oninput</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oninvalid" title="handler-oninvalid">oninvalid</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeydown" title="handler-onkeydown">onkeydown</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeypress" title="handler-onkeypress">onkeypress</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeyup" title="handler-onkeyup">onkeyup</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onload" title="handler-onload">onload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadeddata" title="handler-onloadeddata">onloadeddata</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadedmetadata" title="handler-onloadedmetadata">onloadedmetadata</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadstart" title="handler-onloadstart">onloadstart</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousedown" title="handler-onmousedown">onmousedown</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousemove" title="handler-onmousemove">onmousemove</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseout" title="handler-onmouseout">onmouseout</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseover" title="handler-onmouseover">onmouseover</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseup" title="handler-onmouseup">onmouseup</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousewheel" title="handler-onmousewheel">onmousewheel</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onpause" title="handler-onpause">onpause</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onplay" title="handler-onplay">onplay</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onplaying" title="handler-onplaying">onplaying</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onprogress" title="handler-onprogress">onprogress</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onratechange" title="handler-onratechange">onratechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onreadystatechange" title="handler-onreadystatechange">onreadystatechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onreset" title="handler-onreset">onreset</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onscroll" title="handler-onscroll">onscroll</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onseeked" title="handler-onseeked">onseeked</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onseeking" title="handler-onseeking">onseeking</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onselect" title="handler-onselect">onselect</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onshow" title="handler-onshow">onshow</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onstalled" title="handler-onstalled">onstalled</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onsubmit" title="handler-onsubmit">onsubmit</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onsuspend" title="handler-onsuspend">onsuspend</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ontimeupdate" title="handler-ontimeupdate">ontimeupdate</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onvolumechange" title="handler-onvolumechange">onvolumechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onwaiting" title="handler-onwaiting">onwaiting</a>;
|
|
};
|
|
<a href="#document">Document</a> implements <a href="#htmldocument">HTMLDocument</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.<h4 id="security-document"><span class="secno">3.1.2 </span>Security</h4><p id="security">User agents <span class="impl">must</span> raise a
|
|
<code><a href="#security_err">SECURITY_ERR</a></code> exception whenever any of the members of
|
|
an <code><a href="#htmldocument">HTMLDocument</a></code> object are accessed by scripts whose
|
|
<a href="#effective-script-origin">effective script origin</a> is not the <a href="#same-origin" title="same
|
|
origin">same</a> as the <code><a href="#document">Document</a></code>'s <a href="#effective-script-origin">effective
|
|
script origin</a>.<h4 id="resource-metadata-management"><span class="secno">3.1.3 </span><dfn>Resource metadata management</dfn></h4><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-URL"><a href="#dom-document-url">URL</a></code></dt>
|
|
<dd>
|
|
<p>Returns <a href="#the-document-s-address">the document's address</a>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-referrer"><a href="#dom-document-referrer">referrer</a></code></dt>
|
|
<dd>
|
|
<p>Returns <a href="#the-document-s-current-address" title="the document's current address">the
|
|
address</a> of the <code><a href="#document">Document</a></code> from which the user
|
|
navigated to this one, unless it was blocked or there was no such
|
|
document, in which case it returns the empty string.</p>
|
|
<p>The <code title="rel-noreferrer"><a href="#link-type-noreferrer">noreferrer</a></code> link
|
|
type can be used to block the referrer.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-url" title="dom-document-URL"><code>URL</code></dfn>
|
|
attribute must return <a href="#the-document-s-address">the document's address</a>.</p>
|
|
|
|
<p>The <dfn id="dom-document-referrer" title="dom-document-referrer"><code>referrer</code></dfn> attribute
|
|
must return either the <a href="#the-document-s-current-address" title="the document's current
|
|
address">current address</a> of the <a href="#active-document">active document</a>
|
|
of the <a href="#source-browsing-context">source browsing context</a> <em>at the time the
|
|
navigation was started</em> (that is, the page which <a href="#navigate" title="navigate">navigated</a> the <a href="#browsing-context">browsing context</a>
|
|
to the current document), with any <a href="#url-fragment" title="url-fragment"><fragment></a> component removed; or
|
|
the empty string if there is no such originating page, or if the UA
|
|
has been configured not to report referrers in this case, or if the
|
|
navigation was initiated for a <a href="#hyperlink">hyperlink</a> with a <code title="rel-noreferrer"><a href="#link-type-noreferrer">noreferrer</a></code> keyword.</p>
|
|
|
|
</div><p class="note">In the case of HTTP, the <code title="dom-document-referrer"><a href="#dom-document-referrer">referrer</a></code> IDL attribute will
|
|
match the <code title="http-referer">Referer</code> (sic) header
|
|
that was sent when <a href="#fetch" title="fetch">fetching</a> the current
|
|
page.<p class="note">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 <code title="">https:</code> page to an <code title="">http:</code>
|
|
page).<hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-cookie"><a href="#dom-document-cookie">cookie</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the HTTP cookies that apply to the
|
|
<code><a href="#document">Document</a></code>. If there are no cookies or cookies can't be
|
|
applied to this resource, the empty string will be returned.</p>
|
|
<p>Can be set, to add a new cookie to the element's set of HTTP
|
|
cookies.</p>
|
|
<p>If the contents are <a href="#sandboxed-origin-browsing-context-flag" title="sandboxed origin browsing
|
|
context flag">sandboxed into a unique origin</a> (in an
|
|
<code><a href="#the-iframe-element">iframe</a></code> with the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute) or the
|
|
resource was labeled as <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code>, a
|
|
<code><a href="#security_err">SECURITY_ERR</a></code> exception will be thrown on getting and
|
|
setting.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-cookie" title="dom-document-cookie"><code>cookie</code></dfn>
|
|
attribute represents the cookies of the resource from which the
|
|
<code><a href="#document">Document</a></code> was created.</p>
|
|
|
|
<p>A <code><a href="#document">Document</a></code> object that falls into one of the
|
|
following conditions is a <dfn id="cookie-free-document-object">cookie-free <code>Document</code>
|
|
object</dfn>:</p>
|
|
|
|
<ul><li>A <code><a href="#document">Document</a></code> that has no <a href="#browsing-context">browsing
|
|
context</a>.</li>
|
|
|
|
<li>A <code><a href="#document">Document</a></code> whose <a href="#the-document-s-address" title="the document's
|
|
address">address</a> does not use a server-based naming
|
|
authority.</li>
|
|
|
|
</ul><p id="sandboxCookies">On getting, if the document is a
|
|
<a href="#cookie-free-document-object">cookie-free <code>Document</code> object</a>, then the user
|
|
agent must return the empty string. Otherwise, if the
|
|
<code><a href="#document">Document</a></code>'s <a href="#origin">origin</a> is not a
|
|
scheme/host/port tuple, the user agent must raise a
|
|
<code><a href="#security_err">SECURITY_ERR</a></code> exception. Otherwise, the user agent must
|
|
first <a href="#obtain-the-storage-mutex">obtain the storage mutex</a> and then return the
|
|
cookie-string for <a href="#the-document-s-address">the document's address</a> for a
|
|
"non-HTTP" API, <a href="#decoded-as-utf-8-with-error-handling">decoded as UTF-8, with error handling</a>.
|
|
<a href="#refsCOOKIES">[COOKIES]</a></p>
|
|
|
|
<p>On setting, if the document is a <a href="#cookie-free-document-object">cookie-free
|
|
<code>Document</code> object</a>, then the user agent must do
|
|
nothing. Otherwise, if the <code><a href="#document">Document</a></code>'s
|
|
<a href="#origin">origin</a> is not a scheme/host/port tuple, the user agent
|
|
must raise a <code><a href="#security_err">SECURITY_ERR</a></code> exception. Otherwise, the
|
|
user agent must <a href="#obtain-the-storage-mutex">obtain the storage mutex</a> and then act
|
|
as it would when <span title="receives a
|
|
set-cookie-string">receiving a set-cookie-string</span> for
|
|
<a href="#the-document-s-address">the document's address</a> via a "non-HTTP" API, consisting
|
|
of the new value encoded as UTF-8. <a href="#refsCOOKIES">[COOKIES]</a> <a href="#refsRFC3629">[RFC3629]</a></p>
|
|
|
|
<p class="note">Since the <code title="dom-document-cookie"><a href="#dom-document-cookie">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>
|
|
|
|
<hr></div><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-lastmodified"><a href="#dom-document-lastmodified">lastModified</a></code></dt>
|
|
<dd>
|
|
<p>Returns the date of the last modification to the document, as
|
|
reported by the server, in the form "<code title="">MM/DD/YYYY hh:mm:ss</code>", in the user's local
|
|
time zone.</p>
|
|
<p>If the last modification date is not known, the current time is
|
|
returned instead.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-lastmodified" title="dom-document-lastModified"><code>lastModified</code></dfn>
|
|
attribute, on getting, must return the date and time of the
|
|
<code><a href="#document">Document</a></code>'s source file's last modification, in the
|
|
user's local time zone, 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 (0) to U+0039
|
|
DIGIT NINE (9) representing the number in base ten, zero-padded if
|
|
necessary. The year must be given as the shortest possible string of
|
|
four or more digits in the range U+0030 DIGIT ZERO (0) to U+0039
|
|
DIGIT NINE (9) representing the number in base ten, zero-padded if
|
|
necessary.</p>
|
|
|
|
<p>The <code><a href="#document">Document</a></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="http-last-modified">Last-Modified</code> header of the
|
|
document, or from metadata in the file system for local files. If
|
|
the last modification date and time are not known, the attribute
|
|
must return the current date and time in the above format.</p>
|
|
|
|
<hr></div><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-compatmode"><a href="#dom-document-compatmode">compatMode</a></code></dt>
|
|
<dd>
|
|
<p>In a conforming document, returns the string "<code title="">CSS1Compat</code>". (In <a href="#quirks-mode">quirks mode</a>
|
|
documents, returns the string "<code title="">BackCompat</code>",
|
|
but a conforming document can never trigger <a href="#quirks-mode">quirks
|
|
mode</a>.)</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>A <code><a href="#document">Document</a></code> is always set to one of three modes:
|
|
<dfn id="no-quirks-mode">no-quirks mode</dfn>, the default; <dfn id="quirks-mode">quirks mode</dfn>, used
|
|
typically for legacy documents; and <dfn id="limited-quirks-mode">limited-quirks mode</dfn>,
|
|
also known as "almost standards" mode. The mode is only ever changed
|
|
from the default by the <a href="#html-parser">HTML parser</a>, based on the
|
|
presence, absence, or value of the DOCTYPE string.</p>
|
|
|
|
<p>The <dfn id="dom-document-compatmode" title="dom-document-compatMode"><code>compatMode</code></dfn> IDL
|
|
attribute must return the literal string "<code title="">CSS1Compat</code>" unless the document has been set to
|
|
<a href="#quirks-mode">quirks mode</a> by the <a href="#html-parser">HTML parser</a>, in which
|
|
case it must instead return the literal string "<code title="">BackCompat</code>".</p>
|
|
|
|
<hr></div><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-charset"><a href="#dom-document-charset">charset</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the <a href="#document-s-character-encoding">document's character encoding</a>.</p>
|
|
<p>Can be set, to dynamically change the <a href="#document-s-character-encoding">document's
|
|
character encoding</a>.</p>
|
|
<p>New values that are not IANA-registered aliases supported by the user agent are ignored.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-characterSet"><a href="#dom-document-characterset">characterSet</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#document-s-character-encoding">document's character encoding</a>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-defaultCharset"><a href="#dom-document-defaultcharset">defaultCharset</a></code></dt>
|
|
<dd>
|
|
<p>Returns what might be the user agent's default character
|
|
encoding. (The user agent might return another character encoding
|
|
altogether, e.g. to protect the user's privacy, or if the user
|
|
agent doesn't use a single default encoding.)</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>Documents have an associated <dfn id="document-s-character-encoding" title="document's character
|
|
encoding">character encoding</dfn>. When a <code><a href="#document">Document</a></code>
|
|
object is created, the <a href="#document-s-character-encoding">document's character encoding</a>
|
|
must be initialized to UTF-16. Various algorithms during page
|
|
loading affect this value, as does the <code title="dom-document-charset"><a href="#dom-document-charset">charset</a></code> setter. <a href="#refsIANACHARSET">[IANACHARSET]</a></p>
|
|
|
|
<p>The <dfn id="dom-document-charset" title="dom-document-charset"><code>charset</code></dfn>
|
|
IDL attribute must, on getting, return the <a href="#preferred-mime-name">preferred MIME
|
|
name</a> of the <a href="#document-s-character-encoding">document's character encoding</a>. On
|
|
setting, if the new value is an IANA-registered alias for a
|
|
character encoding supported by the user agent, the <a href="#document-s-character-encoding">document's
|
|
character encoding</a> must be set to that character
|
|
encoding. (Otherwise, nothing happens.)</p>
|
|
|
|
<p>The <dfn id="dom-document-characterset" title="dom-document-characterSet"><code>characterSet</code></dfn>
|
|
IDL attribute must, on getting, return the <a href="#preferred-mime-name">preferred MIME
|
|
name</a> of the <a href="#document-s-character-encoding">document's character encoding</a>.</p>
|
|
|
|
<p>The <dfn id="dom-document-defaultcharset" title="dom-document-defaultCharset"><code>defaultCharset</code></dfn>
|
|
IDL attribute must, on getting, return the <a href="#preferred-mime-name">preferred MIME
|
|
name</a> 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.</p>
|
|
|
|
<hr></div><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-readyState"><a href="#dom-document-readystate">readyState</a></code></dt>
|
|
<dd>
|
|
<p>Returns "loading" while the <code><a href="#document">Document</a></code> is loading, "interactive" once it is finished parsing but still loading sub-resources, and "complete" once it has loaded.</p>
|
|
<p>The <code title="event-readystatechange"><a href="#event-readystatechange">readystatechange</a></code> event fires on the <code><a href="#document">Document</a></code> object when this value changes.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>Each document has a <dfn id="current-document-readiness">current document readiness</dfn>. When a
|
|
<code><a href="#document">Document</a></code> object is created, it must have its
|
|
<a href="#current-document-readiness">current document readiness</a> set to the string "loading"
|
|
if the document is associated with an <a href="#html-parser">HTML parser</a> or an
|
|
<a href="#xml-parser">XML parser</a>, or to the string "complete" otherwise.
|
|
Various algorithms during page loading affect this value. When the
|
|
value is set, the user agent must <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <dfn id="event-readystatechange" title="event-readystatechange"><code>readystatechange</code></dfn>
|
|
at the <code><a href="#document">Document</a></code> object.</p>
|
|
|
|
<p>A <code><a href="#document">Document</a></code> is said to have an <dfn id="active-parser">active
|
|
parser</dfn> if it is associated with an <a href="#html-parser">HTML parser</a> or
|
|
an <a href="#xml-parser">XML parser</a> that has not yet been <a href="#stop-parsing" title="stop
|
|
parsing">stopped</a> or <a href="#abort-a-parser" title="abort a
|
|
parser">aborted</a>.</p>
|
|
|
|
<p>The <dfn id="dom-document-readystate" title="dom-document-readyState"><code>readyState</code></dfn> IDL
|
|
attribute must, on getting, return the <a href="#current-document-readiness">current document
|
|
readiness</a>.</p>
|
|
|
|
</div><h4 id="dom-tree-accessors"><span class="secno">3.1.4 </span><dfn>DOM tree accessors</dfn></h4><p><dfn id="the-html-element-0">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="#the-html-element">html</a></code> element, or null otherwise.<hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-head"><a href="#dom-document-head">head</a></code></dt>
|
|
<dd>
|
|
<p>Returns <a href="#the-head-element-0">the <code>head</code> element</a>.</p>
|
|
</dd>
|
|
|
|
</dl><p><dfn id="the-head-element-0">The <code>head</code> element</dfn> of a document is the
|
|
first <code><a href="#the-head-element">head</a></code> element that is a child of <a href="#the-html-element-0">the
|
|
<code>html</code> element</a>, if there is one, or null
|
|
otherwise.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-head" title="dom-document-head"><code>head</code></dfn>
|
|
attribute, on getting, must return <a href="#the-head-element-0">the <code>head</code>
|
|
element</a> of the document (a <code><a href="#the-head-element">head</a></code> element or
|
|
null).</p>
|
|
|
|
</div><hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-title"><a href="#document.title">title</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the document's title, as given by <a href="#the-title-element-0">the
|
|
<code>title</code> element</a>.</p>
|
|
<p>Can be set, to update the document's title. If there is no
|
|
<a href="#the-head-element-0" title="the head element"><code>head</code> element</a>,
|
|
the new value is ignored.</p>
|
|
<p>In SVG documents, the <code>SVGDocument</code> interface's
|
|
<code title="dom-svg-title">title</code> attribute takes
|
|
precedence.</p>
|
|
</dd>
|
|
|
|
</dl><p><dfn id="the-title-element-0">The <code>title</code> element</dfn> of a document is the
|
|
first <code><a href="#the-title-element">title</a></code> element in the document (in tree order), if
|
|
there is one, or null otherwise.<div class="impl">
|
|
|
|
<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><a href="#svg">svg</a></code>
|
|
element in the "<code title="">http://www.w3.org/2000/svg</code>"
|
|
namespace, and the user agent supports SVG, then return the value
|
|
that would have been returned by the IDL attribute of the same name
|
|
on the <code>SVGDocument</code> interface. <a href="#refsSVG">[SVG]</a></li>
|
|
|
|
<li><p>Otherwise, let <var title="">value</var> be a concatenation
|
|
of the data of all the child <a href="#text-node" title="text node">text
|
|
nodes</a> of <a href="#the-title-element-0">the <code>title</code> element</a>, in
|
|
<a href="#tree-order">tree order</a>, or the empty string if <a href="#the-title-element-0">the
|
|
<code>title</code> element</a> is null.</li>
|
|
|
|
<li><p>Replace any sequence of one or more consecutive <a href="#space-character" title="space character">space characters</a> in <var title="">value</var> with a single U+0020 SPACE character.</li>
|
|
|
|
<li><p>Remove any leading or trailing <a href="#space-character" title="space
|
|
character">space characters</a> in <var title="">value</var>.</li>
|
|
|
|
<li><p>Return <var title="">value</var>.</li>
|
|
|
|
</ol><p>On setting, the following algorithm must be run. Mutation events
|
|
must be fired as appropriate.</p>
|
|
|
|
<ol><li><p>If the <a href="#root-element">root element</a> is an <code><a href="#svg">svg</a></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 IDL attribute of the same name on the
|
|
<code>SVGDocument</code> interface (if it is readonly, then this
|
|
will raise an exception). Stop the algorithm here. <a href="#refsSVG">[SVG]</a></li>
|
|
|
|
<li>If <a href="#the-title-element-0">the <code>title</code> element</a> is null and
|
|
<a href="#the-head-element-0">the <code>head</code> element</a> is null, then the
|
|
attribute must do nothing. Stop the algorithm here.</li>
|
|
|
|
<li>If <a href="#the-title-element-0">the <code>title</code> element</a> is null, then a
|
|
new <code><a href="#the-title-element">title</a></code> element must be created and appended to
|
|
<a href="#the-head-element-0">the <code>head</code> element</a>. Let <var title="">element</var> be that element. Otherwise, let <var title="">element</var> be <a href="#the-title-element-0">the <code>title</code>
|
|
element</a>.</li>
|
|
|
|
<li>The children of <var title="">element</var> (if any) must all
|
|
be removed.</li>
|
|
|
|
<li>A single <code><a href="#text">Text</a></code> node whose data is the new value
|
|
being assigned must be appended to <var title="">element</var>.</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. <a href="#refsSVG">[SVG]</a></p>
|
|
|
|
</div><hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-body"><a href="#dom-document-body">body</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns <a href="#the-body-element-0">the body element</a>.</p>
|
|
<p>Can be set, to replace <a href="#the-body-element-0">the body element</a>.</p>
|
|
<p>If the new value is not a <code><a href="#the-body-element">body</a></code> or <code><a href="#frameset">frameset</a></code> element, this will throw a <code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> exception.</p>
|
|
</dd>
|
|
|
|
</dl><p><dfn id="the-body-element-0">The body element</dfn> of a document is the first child of
|
|
<a href="#the-html-element-0">the <code>html</code> element</a> that is either a
|
|
<code><a href="#the-body-element">body</a></code> element or a <code><a href="#frameset">frameset</a></code> element. If
|
|
there is no such element, it is null. <span class="impl">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><a href="#document">Document</a></code> object.</span><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-body" title="dom-document-body"><code>body</code></dfn>
|
|
attribute, on getting, must return <a href="#the-body-element-0">the body element</a> of
|
|
the document (either a <code><a href="#the-body-element">body</a></code> element, a
|
|
<code><a href="#frameset">frameset</a></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="#the-body-element">body</a></code> or
|
|
<code><a href="#frameset">frameset</a></code> element, then raise a
|
|
<code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li>Otherwise, if the new value is the same as <a href="#the-body-element-0">the body
|
|
element</a>, do nothing. Abort these steps.</li>
|
|
|
|
<li>Otherwise, if <a href="#the-body-element-0">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-body-element-0" title="the body element">the
|
|
incumbent body element</a> as its two arguments respectively,
|
|
then abort these steps.</li>
|
|
|
|
<li>Otherwise, <a href="#the-body-element-0">the body element</a> is null. Append
|
|
the new value to the root element.</li>
|
|
|
|
</ol></div><hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-images"><a href="#dom-document-images">images</a></code></dt>
|
|
<dd>
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-img-element">img</a></code> elements in the <code><a href="#document">Document</a></code>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-embeds"><a href="#dom-document-embeds">embeds</a></code></dt>
|
|
<dt><var title="">document</var> . <code title="dom-document-plugins"><a href="#dom-document-plugins">plugins</a></code></dt>
|
|
<dd>
|
|
<p>Return an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-embed-element">embed</a></code> elements in the <code><a href="#document">Document</a></code>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-links"><a href="#dom-document-links">links</a></code></dt>
|
|
<dd>
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements in the <code><a href="#document">Document</a></code> that have <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attributes.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-forms"><a href="#dom-document-forms">forms</a></code></dt>
|
|
<dd>
|
|
<p>Return an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-form-element">form</a></code> elements in the <code><a href="#document">Document</a></code>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-scripts"><a href="#dom-document-scripts">scripts</a></code></dt>
|
|
<dd>
|
|
<p>Return an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-script-element">script</a></code> elements in the <code><a href="#document">Document</a></code>.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
|
|
<p>The <dfn id="dom-document-images" title="dom-document-images"><code>images</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only
|
|
<code><a href="#the-img-element">img</a></code> elements.</p>
|
|
|
|
<p>The <dfn id="dom-document-embeds" title="dom-document-embeds"><code>embeds</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only
|
|
<code><a href="#the-embed-element">embed</a></code> elements.</p>
|
|
|
|
<p>The <dfn id="dom-document-plugins" title="dom-document-plugins"><code>plugins</code></dfn>
|
|
attribute must return the same object as that returned by the <code title="dom-document-embeds"><a href="#dom-document-embeds">embeds</a></code> attribute.</p>
|
|
|
|
<p>The <dfn id="dom-document-links" title="dom-document-links"><code>links</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only <code><a href="#the-a-element">a</a></code>
|
|
elements with <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>
|
|
attributes and <code><a href="#the-area-element">area</a></code> elements with <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attributes.</p>
|
|
|
|
<p>The <dfn id="dom-document-forms" title="dom-document-forms"><code>forms</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only
|
|
<code><a href="#the-form-element">form</a></code> elements.</p>
|
|
|
|
<p>The <dfn id="dom-document-scripts" title="dom-document-scripts"><code>scripts</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only
|
|
<code><a href="#the-script-element">script</a></code> elements.</p>
|
|
|
|
<hr></div><dl class="domintro"><dt><var title="">collection</var> = <var title="">document</var> . <code title="dom-document-getElementsByName"><a href="#dom-document-getelementsbyname">getElementsByName</a></code>(<var title="">name</var>)</dt>
|
|
<dd>
|
|
<p>Returns a <code><a href="#nodelist">NodeList</a></code> of elements in the
|
|
<code><a href="#document">Document</a></code> that have a <code title="">name</code>
|
|
attribute with the value <var title="">name</var>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">collection</var> = <var title="">document</var> . <code title="dom-document-getElementsByClassName"><a href="#dom-document-getelementsbyclassname">getElementsByClassName(<var title="">classes</var>)</a></code></dt>
|
|
<dt><var title="">collection</var> = <var title="">element</var> . <code title="dom-getElementsByClassName"><a href="#dom-getelementsbyclassname">getElementsByClassName(<var title="">classes</var>)</a></code></dt>
|
|
<dd>
|
|
<p>Returns a <code><a href="#nodelist">NodeList</a></code> of the elements in the object
|
|
on which the method was invoked (a <code><a href="#document">Document</a></code> or an
|
|
<code><a href="#element">Element</a></code>) that have all the classes given by <var title="">classes</var>.</p>
|
|
<p>The <var title="">classes</var> argument is interpreted as a
|
|
space-separated list of classes.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-getelementsbyname" title="dom-document-getElementsByName"><code>getElementsByName(<var title="">name</var>)</code></dfn> method takes a string <var title="">name</var>, and must return a <a href="#live">live</a>
|
|
<code><a href="#nodelist">NodeList</a></code> containing all the <a href="#html-elements">HTML elements</a>
|
|
in that document that have a <code title="">name</code> attribute
|
|
whose value is equal to the <var title="">name</var> argument (in a
|
|
<a href="#case-sensitive">case-sensitive</a> manner), in <a href="#tree-order">tree order</a>.
|
|
When the method is invoked on a <code><a href="#document">Document</a></code> object again
|
|
with the same argument, the user agent may return the same as the
|
|
object returned by the earlier call. In other cases, a new
|
|
<code><a href="#nodelist">NodeList</a></code> object must be returned.</p>
|
|
|
|
<p>The <dfn id="dom-document-getelementsbyclassname" title="dom-document-getElementsByClassName"><code>getElementsByClassName(<var title="">classNames</var>)</code></dfn> method takes a string that
|
|
contains a <a href="#set-of-space-separated-tokens">set of space-separated tokens</a> representing
|
|
classes. When called, the method must return a <a href="#live">live</a>
|
|
<code><a href="#nodelist">NodeList</a></code> object containing all the elements in the
|
|
document, in <a href="#tree-order">tree order</a>, that have all the classes
|
|
specified in that argument, having obtained the classes by <a href="#split-a-string-on-spaces" title="split a string on spaces">splitting a string on
|
|
spaces</a>. (Duplicates are ignored.) If there are no tokens
|
|
specified in the argument, then the method must return an empty
|
|
<code><a href="#nodelist">NodeList</a></code>. If the document is in <a href="#quirks-mode">quirks
|
|
mode</a>, then the comparisons for the classes must be done in an
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a> manner, otherwise, the
|
|
comparisons must be done in a <a href="#case-sensitive">case-sensitive</a> manner.
|
|
When the method is invoked on a <code><a href="#document">Document</a></code> object again
|
|
with the same argument, the user agent may return the same object as
|
|
the object returned by the earlier call. In other cases, a new
|
|
<code><a href="#nodelist">NodeList</a></code> object must be returned.</p>
|
|
|
|
<p>The <dfn id="dom-getelementsbyclassname" title="dom-getElementsByClassName"><code>getElementsByClassName(<var title="">classNames</var>)</code></dfn> method on the
|
|
<code><a href="#htmlelement">HTMLElement</a></code> interface must return a <a href="#live">live</a>
|
|
<code><a href="#nodelist">NodeList</a></code> with the nodes that the
|
|
<code><a href="#htmldocument">HTMLDocument</a></code> <code title="dom-document-getElementsByClassName"><a href="#dom-document-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.
|
|
When the method is invoked on an <code><a href="#htmlelement">HTMLElement</a></code> object
|
|
again with the same argument, the user agent may return the same
|
|
object as the object returned by the earlier call. In other cases, a
|
|
new <code><a href="#nodelist">NodeList</a></code> object must be returned.</p>
|
|
|
|
</div><p>HTML, SVG, and MathML elements define which classes they are in
|
|
by having an attribute with no namespace 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 labeled as being in specific
|
|
classes.<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 title="">document.getElementById('example').getElementsByClassName('aaa')</code>
|
|
would return a <code><a href="#nodelist">NodeList</a></code> with the two paragraphs <code title="">p1</code> and <code title="">p2</code> in it.</p>
|
|
|
|
<p>A call to <code title="">getElementsByClassName('ccc bbb')</code> would only
|
|
return one node, however, namely <code title="">p3</code>. A call
|
|
to <code title="">document.getElementById('example').getElementsByClassName('bbb ccc ')</code>
|
|
would return the same thing.</p>
|
|
|
|
<p>A call to <code title="">getElementsByClassName('aaa,bbb')</code> would return no
|
|
nodes; none of the elements above are in the "aaa,bbb" class.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<hr><p>The <code><a href="#htmldocument">HTMLDocument</a></code> interface <span title="support
|
|
named properties">supports named properties</span>. The
|
|
<a href="#supported-property-names">supported property names</a> at any moment consist of the
|
|
values of the <code title="attr-name">name</code> content attributes
|
|
of all the
|
|
<code><a href="#the-applet-element">applet</a></code>,
|
|
<a href="#exposed">exposed</a> <code><a href="#the-embed-element">embed</a></code>,
|
|
<code><a href="#the-form-element">form</a></code>,
|
|
<code><a href="#the-iframe-element">iframe</a></code>,
|
|
<code><a href="#the-img-element">img</a></code>, and
|
|
<a href="#exposed">exposed</a> <code><a href="#the-object-element">object</a></code>
|
|
elements in the <code><a href="#document">Document</a></code> that have <code title="attr-name">name</code> content attributes, and the values of
|
|
the <code title="attr-id"><a href="#the-id-attribute">id</a></code> content attributes of all the
|
|
<code><a href="#the-applet-element">applet</a></code> and
|
|
<a href="#exposed">exposed</a> <code><a href="#the-object-element">object</a></code>
|
|
elements in the <code><a href="#document">Document</a></code> that have <code title="attr-id"><a href="#the-id-attribute">id</a></code> content attributes, and the values of the
|
|
<code title="attr-id"><a href="#the-id-attribute">id</a></code> content attributes of all the
|
|
<code><a href="#the-img-element">img</a></code>
|
|
elements in the <code><a href="#document">Document</a></code> that have both <code title="attr-name">name</code> content attributes and <code title="attr-id"><a href="#the-id-attribute">id</a></code> content attributes.</p>
|
|
|
|
<p>When <dfn id="dom-document-nameditem" title="dom-document-namedItem">the
|
|
<code>HTMLDocument</code> object is indexed for property
|
|
retrieval</dfn> using a name <var title="">name</var>, then the user
|
|
agent must return the value obtained using the following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">elements</var> be the list of <a href="#dom-document-nameditem-filter" title="dom-document-namedItem-filter">named elements</a> with
|
|
the name <var title="">name</var> in the <code><a href="#document">Document</a></code>.
|
|
|
|
<p class="note">There will be at least one such element, by
|
|
definition.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">elements</var> has only one element, and that
|
|
element is an <code><a href="#the-iframe-element">iframe</a></code> element, then return the
|
|
<code><a href="#windowproxy">WindowProxy</a></code> object of the <a href="#nested-browsing-context">nested browsing
|
|
context</a> represented by that <code><a href="#the-iframe-element">iframe</a></code> element,
|
|
and abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, if <var title="">elements</var> has only one
|
|
element, return that element and abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only <a href="#dom-document-nameditem-filter" title="dom-document-namedItem-filter">named elements</a> with
|
|
the name <var title="">name</var>.</p>
|
|
</li>
|
|
|
|
|
|
</ol><p><dfn id="dom-document-nameditem-filter" title="dom-document-nameditem-filter">Named elements</dfn>
|
|
with the name <var title="">name</var>, for the purposes of the
|
|
above algorithm, are those that are either:</p>
|
|
|
|
<ul><li><code><a href="#the-applet-element">applet</a></code>, <a href="#exposed">exposed</a> <code><a href="#the-embed-element">embed</a></code>,
|
|
<code><a href="#the-form-element">form</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, or
|
|
<a href="#exposed">exposed</a> <code><a href="#the-object-element">object</a></code> elements that have a <code title="attr-name">name</code> content attribute whose value is <var title="">name</var>, or</li>
|
|
|
|
<li><code><a href="#the-applet-element">applet</a></code> or <a href="#exposed">exposed</a> <code><a href="#the-object-element">object</a></code>
|
|
elements that have an <code title="attr-id"><a href="#the-id-attribute">id</a></code> content
|
|
attribute whose value is <var title="">name</var>, or</li>
|
|
|
|
<li><code><a href="#the-img-element">img</a></code> elements that have an <code title="attr-id"><a href="#the-id-attribute">id</a></code> content attribute whose value is <var title="">name</var>, and that have a <code title="attr-name">name</code> content attribute present also.</li>
|
|
|
|
</ul><p>An <code><a href="#the-embed-element">embed</a></code> or <code><a href="#the-object-element">object</a></code> element is said to
|
|
be <dfn id="exposed">exposed</dfn> if it has no <a href="#exposed">exposed</a>
|
|
<code><a href="#the-object-element">object</a></code> ancestor, and, for <code><a href="#the-object-element">object</a></code> elements,
|
|
is additionally either not showing its <a href="#fallback-content">fallback content</a>
|
|
or has no <code><a href="#the-object-element">object</a></code> or <code><a href="#the-embed-element">embed</a></code> descendants.</p>
|
|
|
|
</div><hr><p class="note">The <code title="dom-document-dir"><a href="#dom-document-dir">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="#the-dir-attribute">dir</a></code> content
|
|
attribute.<h4 id="creating-documents"><span class="secno">3.1.5 </span>Creating documents</h4><p><a href="#xml-documents">XML documents</a> can be created from script using the
|
|
<code title="dom-DOMImplementation-createDocument"><a href="#dom-domimplementation-createdocument">createDocument()</a></code>
|
|
method on the <code><a href="#domimplementation">DOMImplementation</a></code> interface.<p><a href="#html-documents">HTML documents</a> can be created using the <code title="dom-DOMHTMLImplementation-createHTMLDocument"><a href="#dom-domhtmlimplementation-createhtmldocument">createHTMLDocument()</a></code>
|
|
method:<pre class="idl">[Supplemental, NoInterfaceObject]
|
|
interface <dfn id="domhtmlimplementation">DOMHTMLImplementation</dfn> {
|
|
<a href="#document">Document</a> <a href="#dom-domhtmlimplementation-createhtmldocument" title="dom-DOMHTMLImplementation-createHTMLDocument">createHTMLDocument</a>(in DOMString title);
|
|
};
|
|
<a href="#domimplementation">DOMImplementation</a> implements <a href="#domhtmlimplementation">DOMHTMLImplementation</a>;</pre><dl class="domintro"><dt><var title="">document</var> = <var title="">document</var> . <code title="dom-document-implementation">implementation</code> . <code title="dom-DOMHTMLImplementation-createHTMLDocument"><a href="#dom-domhtmlimplementation-createhtmldocument">createHTMLDocument</a></code>( <var title="">title</var> )</dt>
|
|
<dd>
|
|
|
|
<p>Returns a new <code><a href="#document">Document</a></code>, with a basic DOM already
|
|
constructed with an appropriate <code><a href="#the-title-element">title</a></code> element.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-domhtmlimplementation-createhtmldocument" title="dom-DOMHTMLImplementation-createHTMLDocument"><code>createHTMLDocument(<var title="">title</var>)</code></dfn> method, when invoked, must run the
|
|
following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">doc</var> be a newly created
|
|
<code><a href="#document">Document</a></code> object.</li>
|
|
|
|
<li><p>Mark <var title="">doc</var> as being an <a href="#html-documents" title="HTML
|
|
documents">HTML document</a>.</li>
|
|
|
|
<li><p>Create a <code><a href="#documenttype">DocumentType</a></code> node with the <code title="">name</code> attribute set to the string "<code title="">html</code>", and the other attributes specific to
|
|
<code><a href="#documenttype">DocumentType</a></code> objects set to the empty string, null,
|
|
and empty lists, as appropriate. Append the newly created node to
|
|
<var title="">doc</var>.</li>
|
|
|
|
<li><p>Create an <code><a href="#the-html-element">html</a></code> element, and append it to <var title="">doc</var>.</li>
|
|
|
|
<li><p>Create a <code><a href="#the-head-element">head</a></code> element, and append it to the
|
|
<code><a href="#the-html-element">html</a></code> element created in the previous step.</p>
|
|
|
|
<li><p>Create a <code><a href="#the-title-element">title</a></code> element, and append it to the
|
|
<code><a href="#the-head-element">head</a></code> element created in the previous step.</p>
|
|
|
|
<li><p>Create a <code><a href="#text">Text</a></code> node, and set its <code title="">data</code> attribute to the string given by the method's
|
|
argument (which could be the empty string). Append it to the
|
|
<code><a href="#the-title-element">title</a></code> element created in the previous step.</p>
|
|
|
|
<li><p>Create a <code><a href="#the-body-element">body</a></code> element, and append it to the
|
|
<code><a href="#the-html-element">html</a></code> element created in the earlier step.</p>
|
|
|
|
<li><p>Return <var title="">doc</var>.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h4 id="loading-xml-documents"><span class="secno">3.1.6 </span>Loading XML documents</h4>
|
|
|
|
<p>A <code><a href="#document">Document</a></code> object that is an <a href="#xml-documents" title="XML
|
|
documents">XML document</a> that was created by the <code title="dom-DOMImplementation-createDocument"><a href="#dom-domimplementation-createdocument">DOMImplementation.createDocument()</a></code>
|
|
factory method must also implement the
|
|
<code><a href="#xmldocumentloader">XMLDocumentLoader</a></code> interface:</p>
|
|
|
|
<pre class="idl">[Supplemental, NoInterfaceObject]
|
|
interface <dfn id="xmldocumentloader">XMLDocumentLoader</dfn> {
|
|
boolean <a href="#dom-xmldocumentloader-load" title="dom-XMLDocumentLoader-load">load</a>(in DOMString url);
|
|
};</pre>
|
|
|
|
|
|
|
|
|
|
|
|
<p>The <dfn id="dom-xmldocumentloader-load" title="dom-XMLDocumentLoader-load"><code>load(<var title="">url</var>)</code></dfn> method must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">document</var> be the <code><a href="#document">Document</a></code>
|
|
object on which the method was invoked.</li>
|
|
|
|
<li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the method's
|
|
first argument, relative to the <a href="#entry-script">entry script</a>'s <a href="#script-s-base-url" title="script's base URL">base URL</a>. If this is not
|
|
successful, throw a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception and abort
|
|
these steps. Otherwise, let <var title="">url</var> be the
|
|
resulting <a href="#absolute-url">absolute URL</a>.</li>
|
|
|
|
<li><p>If the <a href="#origin">origin</a> of <var title="">url</var> is not
|
|
the same as the <a href="#origin">origin</a> of <var title="">document</var>, throw a <code><a href="#security_err">SECURITY_ERR</a></code>
|
|
exception and abort these steps.</li>
|
|
<li><p>Remove all child nodes of <var title="">document</var>,
|
|
without firing any mutation events.</li>
|
|
<li><p>Set the <a href="#current-document-readiness">current document readiness</a> of <var title="">document</var> to "loading".</li>
|
|
|
|
<li><p> Run the remainder of these steps asynchronously,
|
|
and return true from the method.</li>
|
|
|
|
<li><p>Let <var title="">result</var> be an <code><a href="#document">Document</a></code>
|
|
object.</li>
|
|
|
|
<li><p>Let <var title="">success</var> be false.</li>
|
|
|
|
<li><p><a href="#fetch">Fetch</a> <var title="">url</var> from the
|
|
<a href="#origin">origin</a> of <var title="">document</var>, with the <i title="">synchronous flag</i> set and the <i title="">force
|
|
same-origin flag</i> set.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the fetch attempt was successful, and the resource's <a href="#content-type" title="Content-Type">Content-Type metadata</a> is an <a href="#xml-mime-type">XML
|
|
MIME type</a>, then run these substeps:</p>
|
|
|
|
<ol><li><p>Create a new <a href="#xml-parser">XML parser</a> associated with the
|
|
<var title="">result</var> document.</li>
|
|
|
|
<li><p>Pass this parser the fetched document.</li>
|
|
<li><p>If there is an XML well-formedness or XML namespace
|
|
well-formedness error, then remove all child nodes from <var title="">result</var>. Otherwise let <var title="">success</var>
|
|
be true.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p> <a href="#queue-a-task">Queue a task</a> to run the following
|
|
steps. </p>
|
|
|
|
<ol><li><p>Set the <a href="#current-document-readiness">current document readiness</a> of <var title="">document</var> to "complete".</li>
|
|
|
|
<li><p>Replace all the children of <var title="">document</var>
|
|
by the children of <var title="">result</var> (even if it has no
|
|
children), firing mutation events as if a
|
|
<code><a href="#documentfragment">DocumentFragment</a></code> containing the new children had
|
|
been inserted.</li>
|
|
|
|
<li><p><a href="#fire-a-simple-event">Fire a simple event</a> named <code title="event-load">load</code> at <var title="">document</var>.</li>
|
|
|
|
</ol></li>
|
|
</ol></div><h3 id="elements"><span class="secno">3.2 </span>Elements</h3><h4 id="semantics-0"><span class="secno">3.2.1 </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="#the-ol-element">ol</a></code> element represents an ordered list, and
|
|
the <code title="attr-lang"><a href="#attr-lang">lang</a></code> attribute represents the
|
|
language of the content.<p>Authors must not use elements, attributes, or attribute values
|
|
for purposes other than their appropriate intended semantic
|
|
purpose. Authors must not use elements, attributes, or attribute
|
|
values that are not permitted by this specification or <a href="#other-applicable-specifications">other
|
|
applicable specifications</a>.<div class="example">
|
|
<p>For example, the following document is non-conforming, despite
|
|
being syntactically correct:</p>
|
|
|
|
<pre class="bad"><!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
|
|
data (and the <code><a href="#the-cite-element">cite</a></code> element mis-used). 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>
|
|
—<a href="http://example.org/~ernest/">Ernest</a>,
|
|
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 class="bad"><body>
|
|
<h1>ABC Company</h1>
|
|
<h2>Leading the way in widget design since 1432</h2>
|
|
...</pre>
|
|
|
|
<p>The <code><a href="#the-hgroup-element">hgroup</a></code> element is intended for these kinds of
|
|
situations:</p>
|
|
|
|
<pre><body>
|
|
<hgroup>
|
|
<h1>ABC Company</h1>
|
|
<h2>Leading the way in widget design since 1432</h2>
|
|
</hgroup>
|
|
...</pre>
|
|
|
|
<p>In the next example, there is a non-conforming attribute value
|
|
("carpet") and a non-conforming attribute ("texture"), which
|
|
is not permitted by this specification:</p>
|
|
|
|
<pre class="bad"><label>Carpet: <input type="carpet" name="c" texture="deep pile"></label></pre>
|
|
|
|
<p>Here would be an alternative and correct way to mark this up:</p>
|
|
|
|
<pre><label>Carpet: <input type="text" class="carpet" name="c" data-texture="deep pile"></label></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
|
|
<span class="impl">must</span> update their presentation of the
|
|
document as this occurs.<p class="example">HTML has a <code><a href="#the-progress-element">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.<h4 id="elements-in-the-dom"><span class="secno">3.2.2 </span>Elements in the DOM</h4><p>The nodes representing <a href="#html-elements">HTML elements</a> in the DOM
|
|
<span class="impl">must</span> implement, and expose to scripts, the
|
|
interfaces listed for them in the relevant sections of this
|
|
specification. This includes <a href="#html-elements">HTML elements</a> in <a href="#xml-documents">XML
|
|
documents</a>, even when those documents are in another context
|
|
(e.g. inside an XSLT transform).<p>Elements in the DOM <a href="#represents" title="represents">represent</a>
|
|
things; that is, they have intrinsic <em>meaning</em>, also known as
|
|
semantics.<p class="example">For example, an <code><a href="#the-ol-element">ol</a></code> element
|
|
represents an ordered list.<p>The basic interface, from which all the <a href="#html-elements">HTML
|
|
elements</a>' interfaces inherit, <span class="impl">and which
|
|
must be used by elements that have no additional
|
|
requirements,</span> is the <code><a href="#htmlelement">HTMLElement</a></code> interface.<pre class="idl">interface <dfn id="htmlelement">HTMLElement</dfn> : <a href="#element">Element</a> {
|
|
// <a href="#dom-tree-accessors">DOM tree accessors</a>
|
|
NodeList <a href="#dom-getelementsbyclassname" title="dom-getElementsByClassName">getElementsByClassName</a>(in DOMString classNames);
|
|
|
|
// <a href="#dynamic-markup-insertion">dynamic markup insertion</a>
|
|
attribute DOMString <a href="#dom-innerhtml" title="dom-innerHTML">innerHTML</a>;
|
|
attribute DOMString <a href="#dom-outerhtml" title="dom-outerHTML">outerHTML</a>;
|
|
void <a href="#dom-insertadjacenthtml" title="dom-insertAdjacentHTML">insertAdjacentHTML</a>(in DOMString position, in DOMString text);
|
|
|
|
// <span>metadata attributes</span>
|
|
attribute DOMString <a href="#dom-id" title="dom-id">id</a>;
|
|
attribute DOMString <a href="#dom-title" title="dom-title">title</a>;
|
|
attribute DOMString <a href="#dom-lang" title="dom-lang">lang</a>;
|
|
attribute DOMString <a href="#dom-dir" title="dom-dir">dir</a>;
|
|
attribute <span>DOMString</span> <a href="#dom-classname" title="dom-className">className</a>;
|
|
readonly attribute <a href="#domtokenlist">DOMTokenList</a> <a href="#dom-classlist" title="dom-classList">classList</a>;
|
|
readonly attribute <a href="#domstringmap">DOMStringMap</a> <a href="#dom-dataset" title="dom-dataset">dataset</a>;
|
|
|
|
// <a href="#editing">user interaction</a>
|
|
attribute boolean <a href="#dom-hidden" title="dom-hidden">hidden</a>;
|
|
void <a href="#dom-click" title="dom-click">click</a>();
|
|
attribute long <a href="#dom-tabindex" title="dom-tabindex">tabIndex</a>;
|
|
void <a href="#dom-focus" title="dom-focus">focus</a>();
|
|
void <a href="#dom-blur" title="dom-blur">blur</a>();
|
|
attribute DOMString <a href="#dom-accesskey" title="dom-accessKey">accessKey</a>;
|
|
readonly attribute DOMString <a href="#dom-accesskeylabel" title="dom-accessKeyLabel">accessKeyLabel</a>;
|
|
attribute boolean <a href="#dom-draggable" title="dom-draggable">draggable</a>;
|
|
[PutForwards=<a href="#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</a>] attribute <a href="#domsettabletokenlist">DOMSettableTokenList</a> <a href="#dom-dropzone" title="dom-dropzone">dropzone</a>;
|
|
attribute DOMString <a href="#dom-contenteditable" title="dom-contentEditable">contentEditable</a>;
|
|
readonly attribute boolean <a href="#dom-iscontenteditable" title="dom-isContentEditable">isContentEditable</a>;
|
|
attribute <a href="#htmlmenuelement">HTMLMenuElement</a> <a href="#dom-contextmenu" title="dom-contextMenu">contextMenu</a>;
|
|
attribute boolean <a href="#dom-spellcheck" title="dom-spellcheck">spellcheck</a>;
|
|
|
|
// <a href="#command-api">command API</a>
|
|
readonly attribute DOMString <a href="#dom-command-ro-commandtype" title="dom-command-ro-commandType">commandType</a>;
|
|
readonly attribute DOMString <a href="#dom-command-ro-label" title="dom-command-ro-label">label</a>;
|
|
readonly attribute DOMString <a href="#dom-command-ro-icon" title="dom-command-ro-icon">icon</a>;
|
|
readonly attribute boolean <a href="#dom-command-ro-disabled" title="dom-command-ro-disabled">disabled</a>;
|
|
readonly attribute boolean <a href="#dom-command-ro-checked" title="dom-command-ro-checked">checked</a>;
|
|
// <span>styling</span>
|
|
readonly attribute <span>CSSStyleDeclaration</span> <a href="#dom-style" title="dom-style">style</a>;
|
|
|
|
// <a href="#event-handler-idl-attributes">event handler IDL attributes</a>
|
|
attribute <a href="#function">Function</a> <a href="#handler-onabort" title="handler-onabort">onabort</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onblur" title="handler-onblur">onblur</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncanplay" title="handler-oncanplay">oncanplay</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncanplaythrough" title="handler-oncanplaythrough">oncanplaythrough</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onchange" title="handler-onchange">onchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onclick" title="handler-onclick">onclick</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncontextmenu" title="handler-oncontextmenu">oncontextmenu</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncuechange" title="handler-oncuechange">oncuechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondblclick" title="handler-ondblclick">ondblclick</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondrag" title="handler-ondrag">ondrag</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragend" title="handler-ondragend">ondragend</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragenter" title="handler-ondragenter">ondragenter</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragleave" title="handler-ondragleave">ondragleave</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragover" title="handler-ondragover">ondragover</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragstart" title="handler-ondragstart">ondragstart</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondrop" title="handler-ondrop">ondrop</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondurationchange" title="handler-ondurationchange">ondurationchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onemptied" title="handler-onemptied">onemptied</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onended" title="handler-onended">onended</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onerror" title="handler-onerror">onerror</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onfocus" title="handler-onfocus">onfocus</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oninput" title="handler-oninput">oninput</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oninvalid" title="handler-oninvalid">oninvalid</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeydown" title="handler-onkeydown">onkeydown</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeypress" title="handler-onkeypress">onkeypress</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeyup" title="handler-onkeyup">onkeyup</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onload" title="handler-onload">onload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadeddata" title="handler-onloadeddata">onloadeddata</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadedmetadata" title="handler-onloadedmetadata">onloadedmetadata</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadstart" title="handler-onloadstart">onloadstart</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousedown" title="handler-onmousedown">onmousedown</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousemove" title="handler-onmousemove">onmousemove</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseout" title="handler-onmouseout">onmouseout</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseover" title="handler-onmouseover">onmouseover</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseup" title="handler-onmouseup">onmouseup</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousewheel" title="handler-onmousewheel">onmousewheel</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onpause" title="handler-onpause">onpause</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onplay" title="handler-onplay">onplay</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onplaying" title="handler-onplaying">onplaying</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onprogress" title="handler-onprogress">onprogress</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onratechange" title="handler-onratechange">onratechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onreadystatechange" title="handler-onreadystatechange">onreadystatechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onreset" title="handler-onreset">onreset</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onscroll" title="handler-onscroll">onscroll</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onseeked" title="handler-onseeked">onseeked</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onseeking" title="handler-onseeking">onseeking</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onselect" title="handler-onselect">onselect</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onshow" title="handler-onshow">onshow</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onstalled" title="handler-onstalled">onstalled</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onsubmit" title="handler-onsubmit">onsubmit</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onsuspend" title="handler-onsuspend">onsuspend</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ontimeupdate" title="handler-ontimeupdate">ontimeupdate</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onvolumechange" title="handler-onvolumechange">onvolumechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onwaiting" title="handler-onwaiting">onwaiting</a>;
|
|
};
|
|
|
|
interface <dfn id="htmlunknownelement">HTMLUnknownElement</dfn> : <a href="#htmlelement">HTMLElement</a> { };</pre><p>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.<div class="impl">
|
|
|
|
<p>The <code><a href="#htmlunknownelement">HTMLUnknownElement</a></code> interface must be used for
|
|
<a href="#html-elements">HTML elements</a> that are not defined by this
|
|
specification (or <a href="#other-applicable-specifications">other applicable specifications</a>).</p>
|
|
|
|
</div><h4 id="global-attributes"><span class="secno">3.2.3 </span><dfn>Global attributes</dfn></h4><p>The following attributes are common to and may be specified on
|
|
all <a href="#html-elements">HTML elements</a><span class="impl"> (even those not
|
|
defined in this specification)</span>:<ul class="brief"><li><code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code></li>
|
|
<li><code title="attr-class"><a href="#classes">class</a></code></li>
|
|
<li><code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code></li>
|
|
<li><code title="attr-contextmenu"><a href="#attr-contextmenu">contextmenu</a></code></li>
|
|
<li><code title="attr-dir"><a href="#the-dir-attribute">dir</a></code></li>
|
|
<li><code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code></li>
|
|
<li><code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code></li>
|
|
<li><code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code></li>
|
|
<li><code title="attr-id"><a href="#the-id-attribute">id</a></code></li>
|
|
<li><code title="attr-lang"><a href="#attr-lang">lang</a></code></li>
|
|
<li><code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code></li>
|
|
<li><code title="attr-style"><a href="#the-style-attribute">style</a></code></li>
|
|
<li><code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code></li>
|
|
<li><code title="attr-title"><a href="#the-title-attribute">title</a></code></li>
|
|
</ul><hr><p>The following <a href="#event-handler-content-attributes">event handler content attributes</a> may
|
|
be specified on any <a href="#html-elements" title="HTML elements">HTML
|
|
element</a>:<ul class="brief"><li><code title="handler-onabort"><a href="#handler-onabort">onabort</a></code></li>
|
|
<li><code title="handler-onblur"><a href="#handler-onblur">onblur</a></code>*</li>
|
|
<li><code title="handler-oncanplay"><a href="#handler-oncanplay">oncanplay</a></code></li>
|
|
<li><code title="handler-oncanplaythrough"><a href="#handler-oncanplaythrough">oncanplaythrough</a></code></li>
|
|
<li><code title="handler-onchange"><a href="#handler-onchange">onchange</a></code></li>
|
|
<li><code title="handler-onclick"><a href="#handler-onclick">onclick</a></code></li>
|
|
<li><code title="handler-oncontextmenu"><a href="#handler-oncontextmenu">oncontextmenu</a></code></li>
|
|
<li><code title="handler-oncuechange"><a href="#handler-oncuechange">oncuechange</a></code></li>
|
|
<li><code title="handler-ondblclick"><a href="#handler-ondblclick">ondblclick</a></code></li>
|
|
<li><code title="handler-ondrag"><a href="#handler-ondrag">ondrag</a></code></li>
|
|
<li><code title="handler-ondragend"><a href="#handler-ondragend">ondragend</a></code></li>
|
|
<li><code title="handler-ondragenter"><a href="#handler-ondragenter">ondragenter</a></code></li>
|
|
<li><code title="handler-ondragleave"><a href="#handler-ondragleave">ondragleave</a></code></li>
|
|
<li><code title="handler-ondragover"><a href="#handler-ondragover">ondragover</a></code></li>
|
|
<li><code title="handler-ondragstart"><a href="#handler-ondragstart">ondragstart</a></code></li>
|
|
<li><code title="handler-ondrop"><a href="#handler-ondrop">ondrop</a></code></li>
|
|
<li><code title="handler-ondurationchange"><a href="#handler-ondurationchange">ondurationchange</a></code></li>
|
|
<li><code title="handler-onemptied"><a href="#handler-onemptied">onemptied</a></code></li>
|
|
<li><code title="handler-onended"><a href="#handler-onended">onended</a></code></li>
|
|
<li><code title="handler-onerror"><a href="#handler-onerror">onerror</a></code>*</li>
|
|
<li><code title="handler-onfocus"><a href="#handler-onfocus">onfocus</a></code>*</li>
|
|
<li><code title="handler-oninput"><a href="#handler-oninput">oninput</a></code></li>
|
|
<li><code title="handler-oninvalid"><a href="#handler-oninvalid">oninvalid</a></code></li>
|
|
<li><code title="handler-onkeydown"><a href="#handler-onkeydown">onkeydown</a></code></li>
|
|
<li><code title="handler-onkeypress"><a href="#handler-onkeypress">onkeypress</a></code></li>
|
|
<li><code title="handler-onkeyup"><a href="#handler-onkeyup">onkeyup</a></code></li>
|
|
<li><code title="handler-onload"><a href="#handler-onload">onload</a></code>*</li>
|
|
<li><code title="handler-onloadeddata"><a href="#handler-onloadeddata">onloadeddata</a></code></li>
|
|
<li><code title="handler-onloadedmetadata"><a href="#handler-onloadedmetadata">onloadedmetadata</a></code></li>
|
|
<li><code title="handler-onloadstart"><a href="#handler-onloadstart">onloadstart</a></code></li>
|
|
<li><code title="handler-onmousedown"><a href="#handler-onmousedown">onmousedown</a></code></li>
|
|
<li><code title="handler-onmousemove"><a href="#handler-onmousemove">onmousemove</a></code></li>
|
|
<li><code title="handler-onmouseout"><a href="#handler-onmouseout">onmouseout</a></code></li>
|
|
<li><code title="handler-onmouseover"><a href="#handler-onmouseover">onmouseover</a></code></li>
|
|
<li><code title="handler-onmouseup"><a href="#handler-onmouseup">onmouseup</a></code></li>
|
|
<li><code title="handler-onmousewheel"><a href="#handler-onmousewheel">onmousewheel</a></code></li>
|
|
<li><code title="handler-onpause"><a href="#handler-onpause">onpause</a></code></li>
|
|
<li><code title="handler-onplay"><a href="#handler-onplay">onplay</a></code></li>
|
|
<li><code title="handler-onplaying"><a href="#handler-onplaying">onplaying</a></code></li>
|
|
<li><code title="handler-onprogress"><a href="#handler-onprogress">onprogress</a></code></li>
|
|
<li><code title="handler-onratechange"><a href="#handler-onratechange">onratechange</a></code></li>
|
|
<li><code title="handler-onreadystatechange"><a href="#handler-onreadystatechange">onreadystatechange</a></code></li>
|
|
<li><code title="handler-onreset"><a href="#handler-onreset">onreset</a></code></li>
|
|
<li><code title="handler-onscroll"><a href="#handler-onscroll">onscroll</a></code>*</li>
|
|
<li><code title="handler-onseeked"><a href="#handler-onseeked">onseeked</a></code></li>
|
|
<li><code title="handler-onseeking"><a href="#handler-onseeking">onseeking</a></code></li>
|
|
<li><code title="handler-onselect"><a href="#handler-onselect">onselect</a></code></li>
|
|
<li><code title="handler-onshow"><a href="#handler-onshow">onshow</a></code></li>
|
|
<li><code title="handler-onstalled"><a href="#handler-onstalled">onstalled</a></code></li>
|
|
<li><code title="handler-onsubmit"><a href="#handler-onsubmit">onsubmit</a></code></li>
|
|
<li><code title="handler-onsuspend"><a href="#handler-onsuspend">onsuspend</a></code></li>
|
|
<li><code title="handler-ontimeupdate"><a href="#handler-ontimeupdate">ontimeupdate</a></code></li>
|
|
<li><code title="handler-onvolumechange"><a href="#handler-onvolumechange">onvolumechange</a></code></li>
|
|
<li><code title="handler-onwaiting"><a href="#handler-onwaiting">onwaiting</a></code></li>
|
|
</ul><p class="note">The attributes marked with an asterisk have a
|
|
different meaning when specified on <code><a href="#the-body-element">body</a></code> elements as
|
|
those elements expose <a href="#event-handlers">event handlers</a> of the
|
|
<code><a href="#window">Window</a></code> object with the same names.<p class="note">While these attributes apply to all elements, they
|
|
are not useful on all elements. For example, only <a href="#media-element" title="media
|
|
element">media elements</a> will ever receive a <code title="event-media-volumechange"><a href="#event-media-volumechange">volumechange</a></code> event fired by
|
|
the user agent.<hr><p><a href="#custom-data-attribute" title="custom data attribute">Custom data attributes</a>
|
|
(e.g. <code title="">data-foldername</code> or <code title="">data-msgid</code>) can be specified on any <a href="#html-elements" title="HTML elements">HTML element</a>, to store custom data
|
|
specific to the page.<hr><p>In <a href="#html-documents">HTML documents</a>, elements in the <a href="#html-namespace-0">HTML
|
|
namespace</a> may have an <code title="">xmlns</code> attribute
|
|
specified, if, and only if, it has the exact value
|
|
"<code>http://www.w3.org/1999/xhtml</code>". This does not apply to
|
|
<a href="#xml-documents">XML documents</a>.<p class="note">In HTML, the <code title="">xmlns</code> 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 <a href="#html-parser">HTML parser</a>, the attribute ends up in no
|
|
namespace, not the "<code>http://www.w3.org/2000/xmlns/</code>"
|
|
namespace like namespace declaration attributes in XML do.<p class="note">In XML, an <code title="">xmlns</code> attribute is
|
|
part of the namespace declaration mechanism, and an element cannot
|
|
actually have an <code title="">xmlns</code> attribute in no
|
|
namespace specified.<hr><p>The XML specification also allows the use of the <code title="attr-xml-space">xml:space</code> attribute in the <a href="#xml-namespace">XML
|
|
namespace</a> on any element in an <a href="#xml-documents" title="XML
|
|
documents">XML document</a>. This attribute has no effect on
|
|
<a href="#html-elements">HTML elements</a>, as the default behavior in HTML is to
|
|
preserve whitespace. <a href="#refsXML">[XML]</a><p class="note">There is no way to serialize the <code title="attr-xml-space">xml:space</code> attribute on <a href="#html-elements">HTML
|
|
elements</a> in the <code><a href="#text-html">text/html</a></code> syntax.<hr><p>To enable assistive technology products to expose a more
|
|
fine-grained interface than is otherwise possible with HTML elements
|
|
and attributes, a set of <a href="#wai-aria" title="WAI-ARIA">annotations for
|
|
assistive technology products</a> can be specified (the ARIA
|
|
<code title="attr-aria-role">role</code> and <code title="attr-aria-*">aria-*</code> attributes).<h5 id="the-id-attribute"><span class="secno">3.2.3.1 </span>The <dfn title="attr-id"><code>id</code></dfn> attribute</h5><p>The <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute specifies its
|
|
element's <dfn id="concept-id" title="concept-id">unique identifier (ID)</dfn>. The
|
|
value must be unique amongst all the IDs in the element's <a href="#home-subtree">home
|
|
subtree</a> and must contain at least one character. The value
|
|
must not contain any <a href="#space-character" title="space character">space
|
|
characters</a>.</p><p class="note">An element's <a href="#concept-id" title="concept-id">unique
|
|
identifier</a> can be used for a variety of purposes, most
|
|
notably as a way to link to specific parts of a document using
|
|
fragment identifiers, as a way to target an element when scripting,
|
|
and as a way to style a specific element from CSS.<div class="impl">
|
|
|
|
<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 <a href="#concept-id" title="concept-id">ID</a> matching within the element's
|
|
<a href="#home-subtree">home subtree</a> (e.g. for selectors in CSS or for the
|
|
<code title="dom-Document-getElementById"><a href="#dom-document-getelementbyid">getElementById()</a></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="#the-id-attribute">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 <a href="#concept-id" title="concept-id">ID</a> in a way that doesn't conflict with the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute.</p>
|
|
|
|
<p>The <dfn id="dom-id" title="dom-id"><code>id</code></dfn> IDL attribute must
|
|
<a href="#reflect">reflect</a> the <code title="attr-id"><a href="#the-id-attribute">id</a></code> content
|
|
attribute.</p>
|
|
|
|
</div><h5 id="the-title-attribute"><span class="secno">3.2.3.2 </span>The <dfn title="attr-title"><code>title</code></dfn> attribute</h5><p>The <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute
|
|
<a href="#represents">represents</a> 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>If this attribute is omitted from an element, then it implies
|
|
that the <code title="attr-title"><a href="#the-title-attribute">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="#the-title-attribute">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>If the <code title="attr-title"><a href="#the-title-attribute">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.<div class="example">
|
|
|
|
<p>Caution is advised with respect to the use of newlines in <code title="attr-title"><a href="#the-title-attribute">title</a></code> attributes.</p>
|
|
|
|
<p>For instance, the following snippet actually defines an
|
|
abbreviation's expansion <em>with a line break in it</em>:</p>
|
|
|
|
<pre class="bad"><p>My logs show that there was some interest in <abbr title="Hypertext
|
|
Transport Protocol">HTTP</abbr> today.</p></pre>
|
|
|
|
</div><p>Some elements, such as <code><a href="#the-link-element">link</a></code>, <code><a href="#the-abbr-element">abbr</a></code>, and
|
|
<code><a href="#the-input-element">input</a></code>, define additional semantics for the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute beyond the semantics
|
|
described above.<div class="impl">
|
|
|
|
<hr><p>The <dfn id="dom-title" title="dom-title"><code>title</code></dfn> IDL attribute
|
|
must <a href="#reflect">reflect</a> the <code title="attr-title"><a href="#the-title-attribute">title</a></code>
|
|
content attribute.</p>
|
|
|
|
</div><h5 id="the-lang-and-xml:lang-attributes"><span class="secno">3.2.3.3 </span>The <code title="attr-lang"><a href="#attr-lang">lang</a></code> and <code title="attr-xml-lang"><a href="#attr-xml-lang">xml:lang</a></code> attributes</h5><p>The <dfn id="attr-lang" title="attr-lang"><code>lang</code></dfn> attribute (in
|
|
no namespace) specifies the primary language for the element's
|
|
contents and for any of the element's attributes that contain
|
|
text. Its value must be a valid BCP 47 language tag, or the empty
|
|
string. Setting the attribute to the empty string indicates that the
|
|
primary language is unknown. <a href="#refsBCP47">[BCP47]</a><p>The <dfn id="attr-xml-lang" title="attr-xml-lang"><code title="">lang</code></dfn>
|
|
attribute in the <a href="#xml-namespace">XML namespace</a> is defined in XML. <a href="#refsXML">[XML]</a><p>If these attributes are omitted from an element, then the
|
|
language of this element is the same as the language of its parent
|
|
element, if any.<p>The <code title="attr-lang"><a href="#attr-lang">lang</a></code> attribute in no namespace
|
|
may be used on any <a href="#html-elements" title="HTML elements">HTML
|
|
element</a>.<p>The <a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code>
|
|
attribute in the <span>XML namespace</span></a> may be used on
|
|
<a href="#html-elements">HTML elements</a> in <a href="#xml-documents">XML documents</a>, as well as
|
|
elements in other namespaces if the relevant specifications allow it
|
|
(in particular, MathML and SVG allow <a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code> attributes in the
|
|
<span>XML namespace</span></a> to be specified on their
|
|
elements). If both the <code title="attr-lang"><a href="#attr-lang">lang</a></code> attribute
|
|
in no namespace and the <a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code> attribute in the <span>XML
|
|
namespace</span></a> are specified on the same element, they must
|
|
have exactly the same value when compared in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner.<p>Authors must not use the <a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code> attribute in the <span>XML
|
|
namespace</span></a> on <a href="#html-elements">HTML elements</a> in <a href="#html-documents">HTML
|
|
documents</a>. To ease migration to and from XHTML, authors may
|
|
specify an attribute in no namespace with no prefix and with the
|
|
literal localname "<code title="">xml:lang</code>" on <a href="#html-elements">HTML
|
|
elements</a> in <a href="#html-documents">HTML documents</a>, but such attributes
|
|
must only be specified if a <code title="attr-lang"><a href="#attr-lang">lang</a></code>
|
|
attribute in no namespace is also specified, and both attributes
|
|
must have the same value when compared in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner.<p class="note">The attribute in no namespace with no prefix and
|
|
with the literal localname "<code title="">xml:lang</code>" has no
|
|
effect on language processing.<div class="impl">
|
|
|
|
<hr><p>To determine the <dfn id="language">language</dfn> of a node, user agents must
|
|
look at the nearest ancestor element (including the element itself
|
|
if the node is an element) that has a <a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code> attribute in the
|
|
<span>XML namespace</span></a> set or is an <a href="#html-elements" title="HTML
|
|
elements">HTML element</a> and has a <code title="attr-lang"><a href="#attr-lang">lang</a></code> in no namespace attribute set. That
|
|
attribute specifies the language of the node (regardless of its
|
|
value).</p>
|
|
|
|
<p>If both the <code title="attr-lang"><a href="#attr-lang">lang</a></code> attribute in no
|
|
namespace and the <a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code> attribute in the <span>XML
|
|
namespace</span></a> are set on an element, user agents must use
|
|
the <a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code> attribute
|
|
in the <span>XML namespace</span></a>, and the <code title="attr-lang"><a href="#attr-lang">lang</a></code> attribute in no namespace must be
|
|
<a href="#ignore" title="ignore">ignored</a> for the purposes of determining
|
|
the element's language.</p>
|
|
|
|
<p>If none of the node's ancestors, including the <a href="#root-element">root
|
|
element</a>, have either attribute set, but there is a
|
|
<a href="#pragma-set-default-language">pragma-set default language</a> set, then that is the
|
|
language of the node. If there is no <a href="#pragma-set-default-language">pragma-set default
|
|
language</a> set, then language information from a higher-level
|
|
protocol (such as HTTP), if any, must be used as the final fallback
|
|
language instead. In the absence of any such language information,
|
|
and in cases where the higher-level protocol reports multiple
|
|
languages, the language of the node is unknown, and the
|
|
corresponding language tag is the empty string.</p>
|
|
|
|
<p>If the resulting value is not a recognized language tag, then it
|
|
must be treated as an unknown language having the given language
|
|
tag, distinct from all other languages. For the purposes of
|
|
round-tripping or communicating with other services that expect
|
|
language tags, user agents should pass unknown language tags
|
|
through unmodified.</p>
|
|
|
|
<p class="example">Thus, for instance, an element with <code title="">lang="xyzzy"</code> would be matched by the selector <code title="">:lang(xyzzy)</code> (e.g. in CSS), but it would not be
|
|
matched by <code title="">:lang(abcde)</code>, even though both are
|
|
equally invalid. Similarly, if a Web browser and screen reader
|
|
working in unison communicated about the language of the element,
|
|
the browser would tell the screen reader that the language was
|
|
"xyzzy", even if it knew it was invalid, just in case the screen
|
|
reader actually supported a language with that tag after all.</p>
|
|
|
|
<p>If the resulting value is the empty string, then it must be
|
|
interpreted as meaning that the language of the node is explicitly
|
|
unknown.</p>
|
|
|
|
<hr><p>User agents may use the element's language to determine proper
|
|
processing or rendering (e.g. in the selection of appropriate
|
|
fonts or pronunciations, or for dictionary selection). </p>
|
|
|
|
<hr><p>The <dfn id="dom-lang" title="dom-lang"><code>lang</code></dfn> IDL attribute
|
|
must <a href="#reflect">reflect</a> the <code title="attr-lang"><a href="#attr-lang">lang</a></code>
|
|
content attribute in no namespace.</p>
|
|
|
|
</div><h5 id="the-xml:base-attribute-xml-only"><span class="secno">3.2.3.4 </span>The <dfn title="attr-xml-base"><code>xml:base</code></dfn>
|
|
attribute (XML only)</h5><p>The <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attribute is
|
|
defined in XML Base. <a href="#refsXMLBASE">[XMLBASE]</a><p>The <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attribute may be
|
|
used on elements of <a href="#xml-documents">XML documents</a>. Authors must not
|
|
use the <code title="attr-xml-base"><a href="#the-xml:base-attribute-xml-only">xml:base</a></code> attribute in
|
|
<a href="#html-documents">HTML documents</a>.<h5 id="the-dir-attribute"><span class="secno">3.2.3.5 </span>The <dfn title="attr-dir"><code>dir</code></dfn> attribute</h5><p>The <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute specifies the
|
|
element's text directionality. The attribute is an <a href="#enumerated-attribute">enumerated
|
|
attribute</a> with the following keywords and states:<dl><dt>The <dfn id="attr-dir-ltr" title="attr-dir-ltr"><code>ltr</code></dfn> keyword, which maps to the <dfn id="attr-dir-ltr-state" title="attr-dir-ltr-state">ltr</dfn> state</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the contents of the element are explicitly
|
|
directionally embedded left-to-right text.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="attr-dir-rtl" title="attr-dir-rtl"><code>rtl</code></dfn> keyword, which maps to the <dfn id="attr-dir-rtl-state" title="attr-dir-rtl-state">rtl</dfn> state</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the contents of the element are explicitly
|
|
directionally embedded right-to-left text.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="attr-dir-auto" title="attr-dir-auto"><code>auto</code></dfn> keyword, which maps to the <dfn id="attr-dir-auto-state" title="attr-dir-auto-state">auto</dfn> state</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the contents of the element are explicitly
|
|
embedded text, but that the direction is to be determined
|
|
programmatically using the contents of the element (as described
|
|
below).</p>
|
|
|
|
<p class="note">The heuristic used by this state is very crude (it
|
|
just looks at the first character with a strong directionality, in
|
|
a manner analogous to the Paragraph Level determination in the
|
|
bidirectional algorithm). Authors are urged to only use this value
|
|
as a last resort when the direction of the text is truly unknown
|
|
and no better server-side heuristic can be applied.</p>
|
|
|
|
<p class="note">For <code><a href="#the-textarea-element">textarea</a></code> and <code><a href="#the-pre-element">pre</a></code>
|
|
elements, the heuristic is applied on a per-paragraph level.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The attribute has no <i>invalid value default</i> and no
|
|
<i>missing value default</i>.<p><dfn id="the-directionality">The directionality</dfn> of an element is either '<dfn id="concept-ltr" title="concept-ltr">ltr</dfn>' or '<dfn id="concept-rtl" title="concept-rtl">rtl</dfn>', and is determined as per the first
|
|
appropriate set of steps from the following list:<dl class="switch"><dt>If the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is
|
|
in the <a href="#attr-dir-ltr-state" title="attr-dir-ltr-state">ltr</a> state</dt>
|
|
|
|
<dd><p><a href="#the-directionality">The directionality</a> of the element is '<a href="#concept-ltr" title="concept-ltr">ltr</a>'.</dd>
|
|
|
|
|
|
<dt>If the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is
|
|
in the <a href="#attr-dir-rtl-state" title="attr-dir-rtl-state">rtl</a> state</dt>
|
|
|
|
<dd><p><a href="#the-directionality">The directionality</a> of the element is '<a href="#concept-rtl" title="concept-rtl">rtl</a>'.</dd>
|
|
|
|
|
|
<dt>If the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is
|
|
in the <a href="#attr-dir-auto-state" title="attr-dir-auto-state">auto</a> state</dt>
|
|
|
|
<dt>If the element is a <code><a href="#the-bdi-element">bdi</a></code> element and the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is not in a defined state
|
|
(i.e. it is not present or has an invalid value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Find the first character in <a href="#tree-order">tree order</a> that
|
|
matches the following criteria:</p>
|
|
|
|
<ul><li><p>The character is from a <a href="#text-node">text node</a> that is a
|
|
descendant of the element whose <a href="#the-directionality" title="the
|
|
directionality">directionality</a> is being
|
|
determined.</li>
|
|
|
|
<li><p>The character is of bidirectional character type L, AL,
|
|
or R. <a href="#refsBIDI">[BIDI]</a></li>
|
|
|
|
<li>
|
|
|
|
<p>The character is not in a text node that has an ancestor
|
|
element that is a descendant of the element whose <a href="#the-directionality" title="the directionality">directionality</a> is being
|
|
determined and that is either:</p>
|
|
|
|
<ul class="brief"><li>A <code><a href="#the-bdi-element">bdi</a></code> element.
|
|
<li>A <code><a href="#the-script-element">script</a></code> element.
|
|
<li>A <code><a href="#the-style-element">style</a></code> element.
|
|
<li>An element with a <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute in a defined state.
|
|
</ul></li>
|
|
|
|
</ul><p>If such a character is found and it is of bidirectional
|
|
character type AL or R, <a href="#the-directionality">the directionality</a> of the
|
|
element is '<a href="#concept-rtl" title="concept-rtl">rtl</a>'.</p>
|
|
|
|
<p>Otherwise, <a href="#the-directionality">the directionality</a> of the element is
|
|
'<a href="#concept-ltr" title="concept-ltr">ltr</a>'.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the element is a <a href="#root-element">root element</a> and the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is not in a defined state
|
|
(i.e. it is not present or has an invalid value)</dt>
|
|
|
|
<dd><p><a href="#the-directionality">The directionality</a> of the element is '<a href="#concept-ltr" title="concept-ltr">ltr</a>'.</dd>
|
|
|
|
|
|
<dt>If the element has a parent element and the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is not in a defined state
|
|
(i.e. it is not present or has an invalid value)</dt>
|
|
|
|
<dd><p><a href="#the-directionality">The directionality</a> of the element is the same
|
|
as the element's parent element's <a href="#the-directionality" title="the
|
|
directionality">directionality</a>.</dd>
|
|
|
|
|
|
</dl><p>The effect of this attribute is primarily on the presentation
|
|
layer. For example, the rendering section in this specification
|
|
defines a mapping from this attribute to the CSS 'direction' and
|
|
'unicode-bidi' properties, and CSS defines rendering in terms of
|
|
those properties.<hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-dir"><a href="#dom-dir">dir</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns <a href="#the-html-element-0">the <code>html</code> element</a>'s <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute's value, if any.</p>
|
|
<p>Can be set, to either "<code title="">ltr</code>", "<code title="">rtl</code>", or "<code title="">auto</code>" to replace <a href="#the-html-element-0">the <code>html</code> element</a>'s <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute's value.</p>
|
|
<p>If there is no <a href="#the-html-element-0" title="the html element"><code>html</code> element</a>, returns the empty string and ignores new values.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-dir" title="dom-dir"><code>dir</code></dfn> IDL attribute on
|
|
an element must <a href="#reflect">reflect</a> the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> content attribute of that element,
|
|
<a href="#limited-to-only-known-values">limited to only known values</a>.</p>
|
|
|
|
<p>The <dfn id="dom-document-dir" title="dom-document-dir"><code>dir</code></dfn> IDL
|
|
attribute on <code><a href="#htmldocument">HTMLDocument</a></code> objects must
|
|
<a href="#reflect">reflect</a> the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> content
|
|
attribute of <a href="#the-html-element-0">the <code>html</code> element</a>, if any,
|
|
<a href="#limited-to-only-known-values">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>
|
|
|
|
</div><p class="note">Authors are strongly encouraged to use the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute to indicate text direction
|
|
rather than using CSS, since that way their documents will continue
|
|
to render correctly even in the absence of CSS (e.g. as interpreted
|
|
by search engines).<div class="example">
|
|
|
|
<p>This markup fragment is of an IM conversation.</p>
|
|
|
|
<pre><p dir=auto class="u1"><b><bdi>Student</bdi>:</b> How do you write "What's your name?" in Arabic?</p>
|
|
<p dir=auto class="u2"><b><bdi>Teacher</bdi>:</b> ما اسمك؟</p>
|
|
<p dir=auto class="u1"><b><bdi>Student</bdi>:</b> Thanks.</p>
|
|
<p dir=auto class="u2"><b><bdi>Teacher</bdi>:</b> That's written "شكرًا".</p>
|
|
<p dir=auto class="u2"><b><bdi>Teacher</bdi>:</b> Do you know how to write "Please"?</p>
|
|
<p dir=auto class="u1"><b><bdi>Student</bdi>:</b> "من فضلك", right?</p></pre>
|
|
|
|
|
|
<p>Given a suitable style sheet and the default alignment styles
|
|
for the <code><a href="#the-p-element">p</a></code> element, namely to align the text to the
|
|
<i>start edge</i> of the paragraph, the resulting rendering could
|
|
be as follows:</p>
|
|
|
|
<p><img alt="Each paragraph rendered as a separate block, with the paragraphs left-aligned except the second paragraph and the last one, which would be right aligned, with the usernames ('Student' and 'Teacher' in this example) flush right, with a colon to their left, and the text first to the left of that." src="im.png"></p>
|
|
|
|
<p>As noted earlier, the <code title="attr-dir-auto"><a href="#attr-dir-auto">auto</a></code>
|
|
value is not a panacea. The final paragraph in this example is
|
|
misinterpreted as being right-to-left text, since it begins with an
|
|
Arabic character, which causes the "right?" to be to the left of
|
|
the Arabic text.</p>
|
|
|
|
</div><h5 id="classes"><span class="secno">3.2.3.6 </span>The <dfn title="attr-class"><code>class</code></dfn> attribute</h5><p>Every <a href="#html-elements" title="HTML elements">HTML element</a> may have a
|
|
<code title="attr-class"><a href="#classes">class</a></code> attribute specified.<p>The attribute, if specified, must have a value that is a
|
|
<a href="#set-of-space-separated-tokens">set of space-separated tokens</a> representing the various
|
|
classes that the element belongs to.<div class="impl">
|
|
|
|
<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="#classes">class</a></code>
|
|
attribute is <a href="#split-a-string-on-spaces" title="split a string on spaces">split on
|
|
spaces</a>. (Duplicates are ignored.)</p>
|
|
|
|
</div><p class="note">Assigning classes to an element affects class
|
|
matching in selectors in CSS, the <code title="dom-document-getElementsByClassName"><a href="#dom-document-getelementsbyclassname">getElementsByClassName()</a></code>
|
|
method in the DOM, and other such features.<p>There are no additional restrictions on the tokens authors can
|
|
use in the <code title="attr-class"><a href="#classes">class</a></code> attribute, but
|
|
authors are encouraged to use values that describe the nature of the
|
|
content, rather than values that describe the desired presentation
|
|
of the content.<div class="impl">
|
|
|
|
<hr><p>The <dfn id="dom-classname" title="dom-className"><code>className</code></dfn> and
|
|
<dfn id="dom-classlist" title="dom-classList"><code>classList</code></dfn> IDL
|
|
attributes must both <a href="#reflect">reflect</a> the <code title="attr-class"><a href="#classes">class</a></code> content attribute.</p>
|
|
|
|
</div><h5 id="the-style-attribute"><span class="secno">3.2.3.7 </span>The <dfn title="attr-style"><code>style</code></dfn> attribute</h5><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-style"><a href="#the-style-attribute">style</a></code> content attribute set. This is a
|
|
<span>CSS styling attribute</span> as defined by the CSS Styling
|
|
Attribute Syntax specification. <a href="#refsCSSATTR">[CSSATTR]</a><div class="impl">
|
|
|
|
<p>In user agents that support CSS, the attribute's value must be
|
|
parsed when the attribute is added or has its value changed, according
|
|
to the rules given for <span>CSS styling attributes</span>. <a href="#refsCSSATTR">[CSSATTR]</a></p>
|
|
|
|
</div><p>Documents that use <code title="attr-style"><a href="#the-style-attribute">style</a></code>
|
|
attributes on any of their elements must still be comprehensible and
|
|
usable if those attributes were removed.<p class="note">In particular, using the <code title="attr-style"><a href="#the-style-attribute">style</a></code> attribute to hide and show content,
|
|
or to convey meaning that is otherwise not included in the document,
|
|
is non-conforming. (To hide and show content, use the <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute.)<hr><dl class="domintro"><dt><var title="">element</var> . <code title="dom-style"><a href="#dom-style">style</a></code></dt>
|
|
<dd>
|
|
<p>Returns a <code>CSSStyleDeclaration</code> object for the element's <code title="attr-style"><a href="#the-style-attribute">style</a></code> attribute.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-style" title="dom-style"><code>style</code></dfn> IDL attribute
|
|
must return a <code>CSSStyleDeclaration</code> whose value
|
|
represents the declarations specified in the attribute, if
|
|
present. Mutating the <code>CSSStyleDeclaration</code> object must
|
|
create a <code title="attr-style"><a href="#the-style-attribute">style</a></code> 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
|
|
<code>CSSStyleDeclaration</code> object. The same object must be
|
|
returned each time. <a href="#refsCSSOM">[CSSOM]</a></p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, the words that refer to colors are
|
|
marked up using the <code><a href="#the-span-element">span</a></code> element and the <code title="attr-style"><a href="#the-style-attribute">style</a></code> attribute to make those words show
|
|
up in the relevant colors in visual media.</p>
|
|
|
|
<pre><p>My sweat suit is <span style="color: green; background:
|
|
transparent">green</span> and my eyes are <span style="color: blue;
|
|
background: transparent">blue</span>.</p></pre>
|
|
|
|
</div><h5 id="embedding-custom-non-visible-data-with-the-data-attributes"><span class="secno">3.2.3.8 </span><dfn>Embedding custom non-visible data</dfn> with the <code title="attr-data-*"><a href="#attr-data">data-*</a></code> attributes</h5><p>A <dfn id="custom-data-attribute">custom data attribute</dfn> is an attribute in no
|
|
namespace whose name starts with the string "<dfn id="attr-data" title="attr-data-*"><code>data-</code></dfn>", has at least one
|
|
character after the hyphen, is <a href="#xml-compatible">XML-compatible</a>, and
|
|
contains no characters in the range U+0041 to U+005A (LATIN CAPITAL
|
|
LETTER A to LATIN CAPITAL LETTER Z).<p class="note">All attributes on <a href="#html-elements">HTML elements</a> in
|
|
<a href="#html-documents">HTML documents</a> get ASCII-lowercased automatically, so
|
|
the restriction on ASCII uppercase letters doesn't affect such
|
|
documents.<p><a href="#custom-data-attribute" title="custom data attribute">Custom data attributes</a>
|
|
are intended to store custom data private to the page or
|
|
application, for which there are no more appropriate attributes or
|
|
elements.<p>These attributes are not intended for use by software that is
|
|
independent of the site that uses the attributes.<div class="example">
|
|
|
|
<p>For instance, a site about music could annotate list items
|
|
representing tracks in an album with custom data attributes
|
|
containing the length of each track. This information could then be
|
|
used by the site itself to allow the user to sort the list by track
|
|
length, or to filter the list for tracks of certain lengths.</p>
|
|
|
|
<pre><ol>
|
|
<li data-length="2m11s">Beyond The Sea</li>
|
|
...
|
|
</ol></pre>
|
|
|
|
<p>It would be inappropriate, however, for the user to use generic
|
|
software not associated with that music site to search for tracks
|
|
of a certain length by looking at this data.</p>
|
|
|
|
<p>This is because these attributes are intended for use by the
|
|
site's own scripts, and are not a generic extension mechanism for
|
|
publicly-usable metadata.</p>
|
|
|
|
</div><p>Every <a href="#html-elements" title="HTML elements">HTML element</a> may have
|
|
any number of <a href="#custom-data-attribute" title="custom data attribute">custom data
|
|
attributes</a> specified, with any value.<hr><dl class="domintro"><dt><var title="">element</var> . <code title="dom-dataset"><a href="#dom-dataset">dataset</a></code></dt>
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#domstringmap">DOMStringMap</a></code> object for the element's <code title="attr-data-*"><a href="#attr-data">data-*</a></code> attributes.</p>
|
|
|
|
<p>Hyphenated names become camel-cased. For example, <code title="">data-foo-bar=""</code> becomes <code title="">element.dataset.fooBar</code>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-dataset" title="dom-dataset"><code>dataset</code></dfn> IDL
|
|
attribute provides convenient accessors for all the <code title="attr-data-*"><a href="#attr-data">data-*</a></code> attributes on an element. On
|
|
getting, the <code title="dom-dataset"><a href="#dom-dataset">dataset</a></code> IDL attribute
|
|
must return a <code><a href="#domstringmap">DOMStringMap</a></code> object, associated with the
|
|
following algorithms, which expose these attributes on their
|
|
element:</p>
|
|
|
|
<dl><dt>The algorithm for getting the list of name-value pairs</dt>
|
|
|
|
<dd>
|
|
<ol><li>Let <var title="">list</var> be an empty list of name-value
|
|
pairs.</li>
|
|
|
|
<li>For each content attribute on the element whose first five
|
|
characters are the string "<code title="">data-</code>" and whose
|
|
remaining characters (if any) do not include any characters in
|
|
the range U+0041 to U+005A (LATIN CAPITAL LETTER A to LATIN
|
|
CAPITAL LETTER Z), add a name-value pair to <var title="">list</var> whose name is the attribute's name with the
|
|
first five characters removed and whose value is the attribute's
|
|
value.</li>
|
|
|
|
<li>For each name on the list, for each U+002D HYPHEN-MINUS
|
|
character (-) in the name that is followed by a character in the
|
|
range U+0061 to U+007A (U+0061 LATIN SMALL LETTER A to U+007A
|
|
LATIN SMALL LETTER Z), remove the U+002D HYPHEN-MINUS character
|
|
(-) and replace the character that followed it by the same
|
|
character <a href="#converted-to-ascii-uppercase">converted to ASCII uppercase</a>.</li>
|
|
|
|
<li>Return <var title="">list</var>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>The algorithm for setting names to certain values</dt>
|
|
|
|
<dd>
|
|
<ol><li>Let <var title="">name</var> be the name passed to the
|
|
algorithm.</li>
|
|
|
|
<li>Let <var title="">value</var> be the value passed to the
|
|
algorithm.</li>
|
|
|
|
<li>If <var title="">name</var> contains a U+002D HYPHEN-MINUS
|
|
character (-) followed by a character in the range U+0061 to
|
|
U+007A (U+0061 LATIN SMALL LETTER A to U+007A LATIN SMALL LETTER
|
|
Z), throw a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li>For each character in the range U+0041 to U+005A (U+0041
|
|
LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z) in <var title="">name</var>, insert a U+002D HYPHEN-MINUS character (-)
|
|
before the character and replace the character with the same
|
|
character <a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
|
|
|
|
<li>Insert the string <code title="">data-</code> at the front of
|
|
<var title="">name</var>.</li>
|
|
|
|
<li>Set the value of the attribute with the name <var title="">name</var>, to the value <var title="">value</var>,
|
|
replacing any previous value if the attribute already existed. If
|
|
<code title="">setAttribute()</code> would have raised an
|
|
exception when setting an attribute with the name <var title="">name</var>, then this must raise the same
|
|
exception.</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>The algorithm for deleting names</dt>
|
|
|
|
<dd>
|
|
<ol><li>Let <var title="">name</var> be the name passed to the
|
|
algorithm.</li>
|
|
<li>For each character in the range U+0041 to U+005A (U+0041
|
|
LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z) in <var title="">name</var>, insert a U+002D HYPHEN-MINUS character (-)
|
|
before the character and replace the character with the same
|
|
character <a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
|
|
|
|
<li>Insert the string <code title="">data-</code> at the front of
|
|
<var title="">name</var>.</li>
|
|
|
|
<li>Remove the attribute with the name <var title="">name</var>,
|
|
if such an attribute exists. Do nothing otherwise.</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl><p>The same object must be returned each time.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>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 <code title="attr-class"><a href="#classes">class</a></code> attribute along with <code title="attr-data-*"><a href="#attr-data">data-*</a></code> attributes:</p>
|
|
|
|
<pre><div class="spaceship" data-ship-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.shipId].fire()">
|
|
Fire
|
|
</button>
|
|
</div></pre>
|
|
|
|
<p>Notice how the hyphenated attribute name becomes camel-cased in
|
|
the API.</p>
|
|
|
|
</div><p>Authors should carefully design such extensions so that when the
|
|
attributes are ignored and any associated CSS dropped, the page is
|
|
still usable.<div class="impl">
|
|
|
|
<p>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.</p>
|
|
|
|
</div><p>JavaScript libraries may use the <a href="#custom-data-attribute" title="custom data
|
|
attribute">custom data attributes</a>, as they are considered to
|
|
be part of the page on which they are used. Authors of libraries
|
|
that are reused by many authors are encouraged to include their name
|
|
in the attribute names, to reduce the risk of clashes. Where it
|
|
makes sense, library authors are also encouraged to make the exact
|
|
name used in the attribute names customizable, so that libraries
|
|
whose authors unknowingly picked the same name can be used on the
|
|
same page, and so that multiple versions of a particular library can
|
|
be used on the same page even when those versions are not mutually
|
|
compatible.<div class="example">
|
|
|
|
<p>For example, a library called "DoQuery" could use attribute
|
|
names like <code title="">data-doquery-range</code>, and a library
|
|
called "jJo" could use attributes names like <code title="">data-jjo-range</code>. The jJo library could also provide
|
|
an API to set which prefix to use (e.g. <code title="">J.setDataPrefix('j2')</code>, making the attributes have
|
|
names like <code title="">data-j2-range</code>).</p>
|
|
|
|
</div><h4 id="element-definitions"><span class="secno">3.2.4 </span>Element definitions</h4><p>Each element in this specification has a definition that includes
|
|
the following information:<dl><dt>Categories</dt>
|
|
|
|
<dd><p>A list of <a href="#content-categories" title="content categories">categories</a>
|
|
to which the element belongs. These are used when defining the
|
|
<a href="#content-models">content models</a> for each element.</dd>
|
|
|
|
|
|
<dt>Contexts in which this element can be used</dt>
|
|
|
|
<dd>
|
|
|
|
<p>A <em>non-normative</em> description of where the element can
|
|
be used. This information is redundant with the content models of
|
|
elements that allow this one as a child, and is provided only as a
|
|
convenience.</p>
|
|
|
|
<p class="note">For simplicity, only the most specific
|
|
expectations are listed. For example, an element that is both
|
|
<a href="#flow-content">flow content</a> and <a href="#phrasing-content">phrasing content</a> can be
|
|
used anywhere that either <a href="#flow-content">flow content</a> or
|
|
<a href="#phrasing-content">phrasing content</a> is expected, but since anywhere that
|
|
<a href="#flow-content">flow content</a> is expected, <a href="#phrasing-content">phrasing
|
|
content</a> is also expected (since all <a href="#phrasing-content">phrasing
|
|
content</a> is <a href="#flow-content">flow content</a>), only "where
|
|
<a href="#phrasing-content">phrasing content</a> is expected" will be listed.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Content model</dt>
|
|
|
|
<dd><p>A normative description of what content must be included as
|
|
children and descendants of the element.</dd>
|
|
|
|
|
|
<dt>Content attributes</dt>
|
|
|
|
<dd><p>A normative list of attributes that may be specified on the
|
|
element (except where otherwise disallowed).</dd>
|
|
|
|
|
|
<dt>DOM interface</dt>
|
|
|
|
<dd><p>A normative definition of a DOM interface that such elements
|
|
must implement.</dd>
|
|
|
|
</dl><p>This is then followed by a description of what the element
|
|
<a href="#represents">represents</a>, along with any additional normative
|
|
conformance criteria that may apply to authors<span class="impl" title=""> and implementations</span>. Examples are sometimes
|
|
also included.<h5 id="attributes"><span class="secno">3.2.4.1 </span>Attributes</h5><p id="attribute-text">Except where otherwise specified, attributes
|
|
on <a href="#html-elements">HTML elements</a> may have any string value, including
|
|
the empty string. Except where explicitly stated, there is no
|
|
restriction on what text can be specified in such attributes.<h4 id="content-models"><span class="secno">3.2.5 </span><dfn>Content models</dfn></h4><p>Each element defined in this specification has a content model: a
|
|
description of the element's expected contents. An <a href="#html-elements" title="HTML
|
|
elements">HTML element</a> must have contents that match the
|
|
requirements described in the element's content model.<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>The <a href="#space-character" 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-whitespace">inter-element
|
|
whitespace</dfn>.<p><a href="#inter-element-whitespace">Inter-element whitespace</a>, comment nodes, and
|
|
processing instruction nodes must be ignored when establishing
|
|
whether an element's contents match the element's content model or
|
|
not, and must be ignored when following algorithms that define
|
|
document and element semantics.<p class="note">Thus, an element <var title="">A</var> is said to be
|
|
<i>preceded or followed</i> 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-whitespace">inter-element whitespace</a>)
|
|
between them. Similarly, a node is the <i>only child</i> of an
|
|
element if that element contains no other nodes other than
|
|
<a href="#inter-element-whitespace">inter-element whitespace</a>, comment nodes, and processing
|
|
instruction nodes.<p>Authors must not use <a href="#html-elements">HTML elements</a> anywhere except
|
|
where they are explicitly allowed, as defined for each element, or
|
|
as explicitly required by other specifications. For XML compound
|
|
documents, these contexts could be inside elements from other
|
|
namespaces, if those elements are defined as providing the relevant
|
|
contexts.<div class="example">
|
|
<p>For example, the Atom specification defines a <code title="">content</code> element. When its <code title="">type</code> attribute has the value <code title="">xhtml</code>, the Atom specification requires that it
|
|
contain a single HTML <code><a href="#the-div-element">div</a></code> element. Thus, a
|
|
<code><a href="#the-div-element">div</a></code> element is allowed in that context, even though
|
|
this is not explicitly normatively stated by this specification. <a href="#refsATOM">[ATOM]</a></p>
|
|
</div><p>In addition, <a href="#html-elements">HTML elements</a> may be orphan nodes
|
|
(i.e. without a parent node).<div class="example">
|
|
|
|
<p>For example, creating a <code><a href="#the-td-element">td</a></code> element and storing it
|
|
in a global variable in a script is conforming, even though
|
|
<code><a href="#the-td-element">td</a></code> elements are otherwise only supposed to be used
|
|
inside <code><a href="#the-tr-element">tr</a></code> elements.</p>
|
|
|
|
<pre>var data = {
|
|
name: "Banana",
|
|
cell: document.createElement('td'),
|
|
};</pre>
|
|
|
|
</div><h5 id="kinds-of-content"><span class="secno">3.2.5.1 </span>Kinds of content</h5><p>Each element in HTML falls into zero or more <dfn id="content-categories" title="content
|
|
categories">categories</dfn> that group elements with similar
|
|
characteristics together. The following broad categories are used in
|
|
this specification:<ul class="brief"><li><a href="#metadata-content">Metadata content</a></li>
|
|
<li><a href="#flow-content">Flow content</a></li>
|
|
<li><a href="#sectioning-content">Sectioning content</a></li>
|
|
<li><a href="#heading-content">Heading content</a></li>
|
|
<li><a href="#phrasing-content">Phrasing content</a></li>
|
|
<li><a href="#embedded-content">Embedded content</a></li>
|
|
<li><a href="#interactive-content">Interactive content</a></li>
|
|
</ul><p class="note">Some elements also fall into other categories, which
|
|
are defined in other parts of this specification.<p>These categories are related as follows:<p><object data="images/content-venn.svg" height="288" width="1000"><img alt="Sectioning content, heading content, phrasing content, and
|
|
embedded content are all types of flow content. Embedded content is
|
|
also a type of phrasing content." src="content-venn.png"></object><p>In addition, certain elements are categorized as <a href="#form-associated-element" title="form-associated element">form-associated elements</a> and
|
|
further subcategorized to define their role in various form-related
|
|
processing models.<p>Some elements have unique requirements and do not fit into any
|
|
particular category.<h6 id="metadata-content-0"><span class="secno">3.2.5.1.1 </span>Metadata content</h6><p><dfn id="metadata-content">Metadata content</dfn> is content that sets up the
|
|
presentation or behavior 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><ul class="brief category-list"><li><code><a href="#the-base-element">base</a></code></li>
|
|
<li><code><a href="#the-command-element">command</a></code></li>
|
|
<li><code><a href="#the-link-element">link</a></code></li>
|
|
<li><code><a href="#the-meta-element">meta</a></code></li>
|
|
<li><code><a href="#the-noscript-element">noscript</a></code></li>
|
|
<li><code><a href="#the-script-element">script</a></code></li>
|
|
<li><code><a href="#the-style-element">style</a></code></li>
|
|
<li><code><a href="#the-title-element">title</a></code></li>
|
|
</ul><p>Elements from other namespaces whose semantics are primarily
|
|
metadata-related (e.g. RDF) are also <a href="#metadata-content">metadata
|
|
content</a>.<div class="example">
|
|
|
|
<p>Thus, in the XML serialization, one can use RDF, like this:</p>
|
|
|
|
<pre><html xmlns="http://www.w3.org/1999/xhtml"
|
|
xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
|
<head>
|
|
<title>Hedral's Home Page</title>
|
|
<r:RDF>
|
|
<Person xmlns="http://www.w3.org/2000/10/swap/pim/contact#"
|
|
r:about="http://hedral.example.com/#">
|
|
<fullName>Cat Hedral</fullName>
|
|
<mailbox r:resource="mailto:hedral@damowmow.com"/>
|
|
<personalTitle>Sir</personalTitle>
|
|
</Person>
|
|
</r:RDF>
|
|
</head>
|
|
<body>
|
|
<h1>My home page</h1>
|
|
<p>I like playing with string, I guess. Sister says squirrels are fun
|
|
too so sometimes I follow her to play with them.</p>
|
|
</body>
|
|
</html></pre>
|
|
|
|
<p>This isn't possible in the HTML serialization, however.</p>
|
|
|
|
</div><h6 id="flow-content-0"><span class="secno">3.2.5.1.2 </span>Flow content</h6><p>Most elements that are used in the body of documents and
|
|
applications are categorized as <dfn id="flow-content">flow content</dfn>.</p><ul class="brief category-list"><li><code><a href="#the-a-element">a</a></code></li>
|
|
<li><code><a href="#the-abbr-element">abbr</a></code></li>
|
|
<li><code><a href="#the-address-element">address</a></code></li>
|
|
<li><code><a href="#the-area-element">area</a></code> (if it is a descendant of a <code><a href="#the-map-element">map</a></code> element)</li>
|
|
<li><code><a href="#the-article-element">article</a></code></li>
|
|
<li><code><a href="#the-aside-element">aside</a></code></li>
|
|
<li><code><a href="#the-audio-element">audio</a></code></li>
|
|
<li><code><a href="#the-b-element">b</a></code></li>
|
|
<li><code><a href="#the-bdi-element">bdi</a></code></li>
|
|
<li><code><a href="#the-bdo-element">bdo</a></code></li>
|
|
<li><code><a href="#the-blockquote-element">blockquote</a></code></li>
|
|
<li><code><a href="#the-br-element">br</a></code></li>
|
|
<li><code><a href="#the-button-element">button</a></code></li>
|
|
<li><code><a href="#the-canvas-element">canvas</a></code></li>
|
|
<li><code><a href="#the-cite-element">cite</a></code></li>
|
|
<li><code><a href="#the-code-element">code</a></code></li>
|
|
<li><code><a href="#the-command-element">command</a></code></li>
|
|
<li><code><a href="#the-datalist-element">datalist</a></code></li>
|
|
<li><code><a href="#the-del-element">del</a></code></li>
|
|
<li><code><a href="#the-details-element">details</a></code></li>
|
|
<li><code><a href="#the-dfn-element">dfn</a></code></li>
|
|
<li><code><a href="#the-div-element">div</a></code></li>
|
|
<li><code><a href="#the-dl-element">dl</a></code></li>
|
|
<li><code><a href="#the-em-element">em</a></code></li>
|
|
<li><code><a href="#the-embed-element">embed</a></code></li>
|
|
<li><code><a href="#the-fieldset-element">fieldset</a></code></li>
|
|
<li><code><a href="#the-figure-element">figure</a></code></li>
|
|
<li><code><a href="#the-footer-element">footer</a></code></li>
|
|
<li><code><a href="#the-form-element">form</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code></li>
|
|
<li><code><a href="#the-header-element">header</a></code></li>
|
|
<li><code><a href="#the-hgroup-element">hgroup</a></code></li>
|
|
<li><code><a href="#the-hr-element">hr</a></code></li>
|
|
<li><code><a href="#the-i-element">i</a></code></li>
|
|
<li><code><a href="#the-iframe-element">iframe</a></code></li>
|
|
<li><code><a href="#the-img-element">img</a></code></li>
|
|
<li><code><a href="#the-input-element">input</a></code></li>
|
|
<li><code><a href="#the-ins-element">ins</a></code></li>
|
|
<li><code><a href="#the-kbd-element">kbd</a></code></li>
|
|
<li><code><a href="#the-keygen-element">keygen</a></code></li>
|
|
<li><code><a href="#the-label-element">label</a></code></li>
|
|
<li><code><a href="#the-map-element">map</a></code></li>
|
|
<li><code><a href="#the-mark-element">mark</a></code></li>
|
|
<li><code><a href="#math">math</a></code></li>
|
|
<li><code><a href="#the-menu-element">menu</a></code></li>
|
|
<li><code><a href="#the-meter-element">meter</a></code></li>
|
|
<li><code><a href="#the-nav-element">nav</a></code></li>
|
|
<li><code><a href="#the-noscript-element">noscript</a></code></li>
|
|
<li><code><a href="#the-object-element">object</a></code></li>
|
|
<li><code><a href="#the-ol-element">ol</a></code></li>
|
|
<li><code><a href="#the-output-element">output</a></code></li>
|
|
<li><code><a href="#the-p-element">p</a></code></li>
|
|
<li><code><a href="#the-pre-element">pre</a></code></li>
|
|
<li><code><a href="#the-progress-element">progress</a></code></li>
|
|
<li><code><a href="#the-q-element">q</a></code></li>
|
|
<li><code><a href="#the-ruby-element">ruby</a></code></li>
|
|
<li><code><a href="#the-s-element">s</a></code></li>
|
|
<li><code><a href="#the-samp-element">samp</a></code></li>
|
|
<li><code><a href="#the-script-element">script</a></code></li>
|
|
<li><code><a href="#the-section-element">section</a></code></li>
|
|
<li><code><a href="#the-select-element">select</a></code></li>
|
|
<li><code><a href="#the-small-element">small</a></code></li>
|
|
<li><code><a href="#the-span-element">span</a></code></li>
|
|
<li><code><a href="#the-strong-element">strong</a></code></li>
|
|
<li><code><a href="#the-style-element">style</a></code> (if the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is present)</li>
|
|
<li><code><a href="#the-sub-and-sup-elements">sub</a></code></li>
|
|
<li><code><a href="#the-sub-and-sup-elements">sup</a></code></li>
|
|
<li><code><a href="#svg">svg</a></code></li>
|
|
<li><code><a href="#the-table-element">table</a></code></li>
|
|
<li><code><a href="#the-textarea-element">textarea</a></code></li>
|
|
<li><code><a href="#the-time-element">time</a></code></li>
|
|
<li><code><a href="#the-u-element">u</a></code></li>
|
|
<li><code><a href="#the-ul-element">ul</a></code></li>
|
|
<li><code><a href="#the-var-element">var</a></code></li>
|
|
<li><code><a href="#the-video-element">video</a></code></li>
|
|
<li><code><a href="#the-wbr-element">wbr</a></code></li>
|
|
<li><a href="#text-content" title="text content">Text</a></li>
|
|
</ul><p>As a general rule, elements whose content model allows any
|
|
<a href="#flow-content">flow content</a> should have either at least one descendant
|
|
<a href="#text-node">text node</a> that is not <a href="#inter-element-whitespace">inter-element
|
|
whitespace</a>, or at least one descendant element node that is
|
|
<a href="#embedded-content">embedded content</a>. For the purposes of this requirement,
|
|
<code><a href="#the-del-element">del</a></code> elements and their descendants must not be counted
|
|
as contributing to the ancestors of the <code><a href="#the-del-element">del</a></code>
|
|
element.<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.<h6 id="sectioning-content-0"><span class="secno">3.2.5.1.3 </span>Sectioning content</h6><p><dfn id="sectioning-content">Sectioning content</dfn> is content that defines the scope
|
|
of <a href="#heading-content" title="heading content">headings</a> and <a href="#the-footer-element" title="footer">footers</a>.</p><ul class="brief category-list"><li><code><a href="#the-article-element">article</a></code></li>
|
|
<li><code><a href="#the-aside-element">aside</a></code></li>
|
|
<li><code><a href="#the-nav-element">nav</a></code></li>
|
|
<li><code><a href="#the-section-element">section</a></code></li>
|
|
</ul><p>Each <a href="#sectioning-content">sectioning content</a> element potentially has a
|
|
heading and an <a href="#outline">outline</a>. See the section on
|
|
<a href="#headings-and-sections">headings and sections</a> for further details.<p class="note">There are also certain elements that are <a href="#sectioning-root" title="sectioning root">sectioning roots</a>. These are distinct
|
|
from <a href="#sectioning-content">sectioning content</a>, but they can also have an
|
|
<a href="#outline">outline</a>.<h6 id="heading-content-0"><span class="secno">3.2.5.1.4 </span>Heading content</h6><p><dfn id="heading-content">Heading content</dfn> defines the header of a section
|
|
(whether explicitly marked up using <a href="#sectioning-content">sectioning content</a>
|
|
elements, or implied by the heading content itself).</p><ul class="brief category-list"><li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code></li>
|
|
<li><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code></li>
|
|
<li><code><a href="#the-hgroup-element">hgroup</a></code></li>
|
|
</ul><h6 id="phrasing-content-0"><span class="secno">3.2.5.1.5 </span>Phrasing content</h6><p><dfn id="phrasing-content">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="#phrasing-content">phrasing content</a> form <a href="#paragraph" title="paragraph">paragraphs</a>.</p><ul class="brief category-list"><li><code><a href="#the-a-element">a</a></code> (if it contains only <a href="#phrasing-content">phrasing content</a>)</li>
|
|
<li><code><a href="#the-abbr-element">abbr</a></code></li>
|
|
<li><code><a href="#the-area-element">area</a></code> (if it is a descendant of a <code><a href="#the-map-element">map</a></code> element)</li>
|
|
<li><code><a href="#the-audio-element">audio</a></code></li>
|
|
<li><code><a href="#the-b-element">b</a></code></li>
|
|
<li><code><a href="#the-bdi-element">bdi</a></code></li>
|
|
<li><code><a href="#the-bdo-element">bdo</a></code></li>
|
|
<li><code><a href="#the-br-element">br</a></code></li>
|
|
<li><code><a href="#the-button-element">button</a></code></li>
|
|
<li><code><a href="#the-canvas-element">canvas</a></code></li>
|
|
<li><code><a href="#the-cite-element">cite</a></code></li>
|
|
<li><code><a href="#the-code-element">code</a></code></li>
|
|
<li><code><a href="#the-command-element">command</a></code></li>
|
|
<li><code><a href="#the-datalist-element">datalist</a></code></li>
|
|
<li><code><a href="#the-del-element">del</a></code> (if it contains only <a href="#phrasing-content">phrasing content</a>)</li>
|
|
<li><code><a href="#the-dfn-element">dfn</a></code></li>
|
|
<li><code><a href="#the-em-element">em</a></code></li>
|
|
<li><code><a href="#the-embed-element">embed</a></code></li>
|
|
<li><code><a href="#the-i-element">i</a></code></li>
|
|
<li><code><a href="#the-iframe-element">iframe</a></code></li>
|
|
<li><code><a href="#the-img-element">img</a></code></li>
|
|
<li><code><a href="#the-input-element">input</a></code></li>
|
|
<li><code><a href="#the-ins-element">ins</a></code> (if it contains only <a href="#phrasing-content">phrasing content</a>)</li>
|
|
<li><code><a href="#the-kbd-element">kbd</a></code></li>
|
|
<li><code><a href="#the-keygen-element">keygen</a></code></li>
|
|
<li><code><a href="#the-label-element">label</a></code></li>
|
|
<li><code><a href="#the-map-element">map</a></code> (if it contains only <a href="#phrasing-content">phrasing content</a>)</li>
|
|
<li><code><a href="#the-mark-element">mark</a></code></li>
|
|
<li><code><a href="#math">math</a></code></li>
|
|
<li><code><a href="#the-meter-element">meter</a></code></li>
|
|
<li><code><a href="#the-noscript-element">noscript</a></code></li>
|
|
<li><code><a href="#the-object-element">object</a></code></li>
|
|
<li><code><a href="#the-output-element">output</a></code></li>
|
|
<li><code><a href="#the-progress-element">progress</a></code></li>
|
|
<li><code><a href="#the-q-element">q</a></code></li>
|
|
<li><code><a href="#the-ruby-element">ruby</a></code></li>
|
|
<li><code><a href="#the-s-element">s</a></code></li>
|
|
<li><code><a href="#the-samp-element">samp</a></code></li>
|
|
<li><code><a href="#the-script-element">script</a></code></li>
|
|
<li><code><a href="#the-select-element">select</a></code></li>
|
|
<li><code><a href="#the-small-element">small</a></code></li>
|
|
<li><code><a href="#the-span-element">span</a></code></li>
|
|
<li><code><a href="#the-strong-element">strong</a></code></li>
|
|
<li><code><a href="#the-sub-and-sup-elements">sub</a></code></li>
|
|
<li><code><a href="#the-sub-and-sup-elements">sup</a></code></li>
|
|
<li><code><a href="#svg">svg</a></code></li>
|
|
<li><code><a href="#the-textarea-element">textarea</a></code></li>
|
|
<li><code><a href="#the-time-element">time</a></code></li>
|
|
<li><code><a href="#the-u-element">u</a></code></li>
|
|
<li><code><a href="#the-var-element">var</a></code></li>
|
|
<li><code><a href="#the-video-element">video</a></code></li>
|
|
<li><code><a href="#the-wbr-element">wbr</a></code></li>
|
|
<li><a href="#text-content" title="text content">Text</a></li>
|
|
</ul><p>As a general rule, elements whose content model allows any
|
|
<a href="#phrasing-content">phrasing content</a> should have either at least one
|
|
descendant <a href="#text-node">text node</a> that is not <a href="#inter-element-whitespace">inter-element
|
|
whitespace</a>, or at least one descendant element node that is
|
|
<a href="#embedded-content">embedded content</a>. For the purposes of this requirement,
|
|
nodes that are descendants of <code><a href="#the-del-element">del</a></code> elements must not be
|
|
counted as contributing to the ancestors of the <code><a href="#the-del-element">del</a></code>
|
|
element.<p class="note">Most elements that are categorized as phrasing
|
|
content can only contain elements that are themselves categorized as
|
|
phrasing content, not any flow content.<p><dfn id="text-content" title="text content">Text</dfn>, in the context of content
|
|
models, means <a href="#text-node" title="text node">text nodes</a>. <a href="#text-content" title="text content">Text</a> is sometimes used as a content
|
|
model on its own, but is also <a href="#phrasing-content">phrasing content</a>, and can
|
|
be <a href="#inter-element-whitespace">inter-element whitespace</a> (if the <a href="#text-node" title="text
|
|
node">text nodes</a> are empty or contain just <a href="#space-character" title="space
|
|
character">space characters</a>).<h6 id="embedded-content-0"><span class="secno">3.2.5.1.6 </span>Embedded content</h6><p><dfn id="embedded-content">Embedded content</dfn> is content that imports another
|
|
resource into the document, or content from another vocabulary that
|
|
is inserted into the document.</p><ul class="brief category-list"><li><code><a href="#the-audio-element">audio</a></code></li>
|
|
<li><code><a href="#the-canvas-element">canvas</a></code></li>
|
|
<li><code><a href="#the-embed-element">embed</a></code></li>
|
|
<li><code><a href="#the-iframe-element">iframe</a></code></li>
|
|
<li><code><a href="#the-img-element">img</a></code></li>
|
|
<li><code><a href="#math">math</a></code></li>
|
|
<li><code><a href="#the-object-element">object</a></code></li>
|
|
<li><code><a href="#svg">svg</a></code></li>
|
|
<li><code><a href="#the-video-element">video</a></code></li>
|
|
</ul><p>Elements that are from namespaces other than the <a href="#html-namespace-0">HTML
|
|
namespace</a> and that convey content but not metadata, are
|
|
<a href="#embedded-content">embedded content</a> for the purposes of the content models
|
|
defined in this specification. (For example, MathML, or SVG.)<p>Some embedded content elements can have <dfn id="fallback-content">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><h6 id="interactive-content-0"><span class="secno">3.2.5.1.7 </span>Interactive content</h6><p><dfn id="interactive-content">Interactive content</dfn> is content that is specifically
|
|
intended for user interaction.</p><ul class="brief category-list"><li><code><a href="#the-a-element">a</a></code></li>
|
|
<li><code><a href="#the-audio-element">audio</a></code> (if the <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code> attribute is present)</li>
|
|
<li><code><a href="#the-button-element">button</a></code></li>
|
|
<li><code><a href="#the-details-element">details</a></code></li>
|
|
<li><code><a href="#the-embed-element">embed</a></code></li>
|
|
<li><code><a href="#the-iframe-element">iframe</a></code></li>
|
|
<li><code><a href="#the-img-element">img</a></code> (if the <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute is present)</li>
|
|
<li><code><a href="#the-input-element">input</a></code> (if the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is <em>not</em> in the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state)</li>
|
|
<li><code><a href="#the-keygen-element">keygen</a></code></li>
|
|
<li><code><a href="#the-label-element">label</a></code></li>
|
|
<li><code><a href="#the-menu-element">menu</a></code> (if the <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute is in the <a href="#toolbar-state" title="toolbar state">toolbar</a> state)</li>
|
|
<li><code><a href="#the-object-element">object</a></code> (if the <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute is present)</li>
|
|
<li><code><a href="#the-select-element">select</a></code></li>
|
|
<li><code><a href="#the-textarea-element">textarea</a></code></li>
|
|
<li><code><a href="#the-video-element">video</a></code> (if the <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code> attribute is present)</li>
|
|
</ul><p>Certain elements in HTML have an <a href="#activation-behavior">activation
|
|
behavior</a>, which means that the user can activate them. This
|
|
triggers a sequence of events dependent on the activation mechanism,
|
|
and normally culminating in a <code title="event-click"><a href="#event-click">click</a></code>
|
|
event<span class="impl">, as described below</span>.<div class="impl">
|
|
|
|
<p>The user agent should allow the user to manually trigger elements
|
|
that have an <a href="#activation-behavior">activation behavior</a>, for instance using
|
|
keyboard or voice input, or through mouse clicks. When the user
|
|
triggers an element with a defined <a href="#activation-behavior">activation behavior</a>
|
|
in a manner other than clicking it, the default action of the
|
|
interaction event must be to <a href="#run-synthetic-click-activation-steps">run synthetic click activation
|
|
steps</a> on the element.</p>
|
|
|
|
<p>When a user agent is to <dfn id="run-synthetic-click-activation-steps">run synthetic click activation
|
|
steps</dfn> on an element, the user agent must <a href="#run-pre-click-activation-steps">run pre-click
|
|
activation steps</a> on the element, then <a href="#fire-a-click-event">fire a <code title="event-click">click</code> event</a> at the element. The
|
|
default action of this <code title="event-click"><a href="#event-click">click</a></code> event
|
|
must be to <a href="#run-post-click-activation-steps">run post-click activation steps</a> on the
|
|
element. If the event is canceled, the user agent must <a href="#run-canceled-activation-steps">run
|
|
canceled activation steps</a> on the element instead.</p>
|
|
|
|
<p>When a pointing device is clicked, the user agent must run these
|
|
steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">e</var> be the <a href="#nearest-activatable-element">nearest activatable
|
|
element</a> of the element designated by the user (defined
|
|
below), if any.</li>
|
|
|
|
<li><p>If there is an element <var title="">e</var>, <a href="#run-pre-click-activation-steps">run
|
|
pre-click activation steps</a> on it.</li>
|
|
|
|
<li>
|
|
|
|
<p>Dispatch the required <code title="event-click"><a href="#event-click">click</a></code>
|
|
event.</p>
|
|
|
|
<p>If there is an element <var title="">e</var>, then the default
|
|
action of the <code title="event-click"><a href="#event-click">click</a></code> event must be
|
|
to <a href="#run-post-click-activation-steps">run post-click activation steps</a> on element <var title="">e</var>.</p>
|
|
|
|
<p>If there is an element <var title="">e</var> but the event is
|
|
canceled, the user agent must <a href="#run-canceled-activation-steps">run canceled activation
|
|
steps</a> on element <var title="">e</var>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p class="note">The above doesn't happen for arbitrary synthetic
|
|
events dispatched by author script. However, the <code title="dom-click"><a href="#dom-click">click()</a></code> method can be used to make it
|
|
happen programmatically.</p>
|
|
|
|
<p>Given an element <var title="">target</var>, the <dfn id="nearest-activatable-element">nearest
|
|
activatable element</dfn> is the element returned by the following
|
|
algorithm:</p>
|
|
|
|
<ol><li><p>If <var title="">target</var> has a defined <a href="#activation-behavior">activation
|
|
behavior</a>, then return <var title="">target</var> and abort
|
|
these steps.</li>
|
|
|
|
<li><p>If <var title="">target</var> has a parent element, then set
|
|
<var title="">target</var> to that parent element and return to the
|
|
first step.</li>
|
|
|
|
<li><p>Otherwise, there is no <a href="#nearest-activatable-element">nearest activatable
|
|
element</a>.</li>
|
|
|
|
</ol><p>When a user agent is to <dfn id="run-pre-click-activation-steps">run pre-click activation steps</dfn>
|
|
on an element, it must run the <dfn id="pre-click-activation-steps">pre-click activation steps</dfn>
|
|
defined for that element, if any.</p>
|
|
|
|
<p>When a user agent is to <dfn id="run-canceled-activation-steps">run canceled activation steps</dfn>
|
|
on an element, it must run the <dfn id="canceled-activation-steps">canceled activation steps</dfn>
|
|
defined for that element, if any.</p>
|
|
|
|
<p>When a user agent is to <dfn id="run-post-click-activation-steps">run post-click activation
|
|
steps</dfn> on an element, it must run the <dfn id="activation-behavior">activation
|
|
behavior</dfn> defined for that element. Activation behaviors can
|
|
refer to the <code title="event-click"><a href="#event-click">click</a></code> event that was
|
|
fired by the steps above leading up to this point.</p>
|
|
|
|
</div><h5 id="transparent-content-models"><span class="secno">3.2.5.2 </span>Transparent content models</h5><p>Some elements are described as <dfn id="transparent">transparent</dfn>; they have
|
|
"transparent" in the description of their content model. The content
|
|
model of a <a href="#transparent">transparent</a> element is derived from the
|
|
content model of its parent element: the elements required in the
|
|
part of the content model that is "transparent" are the same
|
|
elements as required in the part of the content model of the parent
|
|
of the transparent element in which the transparent element finds
|
|
itself.<div class="example">
|
|
|
|
<p>For instance, an <code><a href="#the-ins-element">ins</a></code> element inside a
|
|
<code><a href="#the-ruby-element">ruby</a></code> element cannot contain an <code><a href="#the-rt-element">rt</a></code>
|
|
element, because the part of the <code><a href="#the-ruby-element">ruby</a></code> element's
|
|
content model that allows <code><a href="#the-ins-element">ins</a></code> elements is the part
|
|
that allows <a href="#phrasing-content">phrasing content</a>, and the <code><a href="#the-rt-element">rt</a></code>
|
|
element is not <a href="#phrasing-content">phrasing content</a>.</p>
|
|
|
|
</div><p class="note">In some cases, where transparent elements are nested
|
|
in each other, the process has to be applied iteratively.<div class="example">
|
|
|
|
<p>Consider the following markup fragment:</p>
|
|
|
|
<pre><p><object><param><ins><map><a href="/">Apples</a></map></ins></object></p></pre>
|
|
|
|
<p>To check whether "Apples" is allowed inside the <code><a href="#the-a-element">a</a></code>
|
|
element, the content models are examined. The <code><a href="#the-a-element">a</a></code>
|
|
element's content model is transparent, as is the <code><a href="#the-map-element">map</a></code>
|
|
element's, as is the <code><a href="#the-ins-element">ins</a></code> element's, as is the part of
|
|
the <code><a href="#the-object-element">object</a></code> element's in which the <code><a href="#the-ins-element">ins</a></code>
|
|
element is found. The <code><a href="#the-object-element">object</a></code> element is found in the
|
|
<code><a href="#the-p-element">p</a></code> element, whose content model is <a href="#phrasing-content">phrasing
|
|
content</a>. Thus, "Apples" is allowed, as text is phrasing
|
|
content.</p>
|
|
|
|
</div><p>When a transparent element has no parent, then the part of its
|
|
content model that is "transparent" must instead be treated as
|
|
accepting any <a href="#flow-content">flow content</a>.<h5 id="paragraphs"><span class="secno">3.2.5.3 </span>Paragraphs</h5><p class="note">The term <a href="#paragraph">paragraph</a> as defined in this
|
|
section is distinct from (though related to) the <code><a href="#the-p-element">p</a></code>
|
|
element defined later. The <a href="#paragraph">paragraph</a> concept defined
|
|
here is used to describe how to interpret documents.<p>A <dfn id="paragraph">paragraph</dfn> is typically a run of <a href="#phrasing-content">phrasing
|
|
content</a> that forms 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.<div class="example">
|
|
|
|
<p>In the following example, there are two paragraphs in a
|
|
section. There is also a heading, which contains phrasing content
|
|
that is not a paragraph. Note how the comments and
|
|
<a href="#inter-element-whitespace">inter-element whitespace</a> 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>
|
|
|
|
</div><p>Paragraphs in <a href="#flow-content">flow content</a> are defined relative to
|
|
what the document looks like without the <code><a href="#the-a-element">a</a></code>,
|
|
<code><a href="#the-ins-element">ins</a></code>, <code><a href="#the-del-element">del</a></code>, and <code><a href="#the-map-element">map</a></code> elements
|
|
complicating matters, since those elements, with their hybrid
|
|
content models, can straddle paragraph boundaries, as shown in the
|
|
first two examples below.<p class="note">Generally, having elements straddle paragraph
|
|
boundaries is best avoided. Maintaining such markup can be
|
|
difficult.<div class="example">
|
|
|
|
<p>The following example takes the markup from the earlier example
|
|
and puts <code><a href="#the-ins-element">ins</a></code> and <code><a href="#the-del-element">del</a></code> elements around some
|
|
of the markup to show that the text was changed (though in this
|
|
case, the changes admittedly don't make much sense). Notice how
|
|
this example has exactly the same paragraphs as the previous one,
|
|
despite the <code><a href="#the-ins-element">ins</a></code> and <code><a href="#the-del-element">del</a></code> elements —
|
|
the <code><a href="#the-ins-element">ins</a></code> element straddles the heading and the first
|
|
paragraph, and the <code><a href="#the-del-element">del</a></code> element straddles the boundary
|
|
between the two paragraphs.</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><div class="impl">
|
|
|
|
<p>Let <var title="">view</var> be a view of the DOM that replaces
|
|
all <code><a href="#the-a-element">a</a></code>, <code><a href="#the-ins-element">ins</a></code>, <code><a href="#the-del-element">del</a></code>, and
|
|
<code><a href="#the-map-element">map</a></code> elements in the document with their contents. Then,
|
|
in <var title="">view</var>, for each run of sibling <a href="#phrasing-content">phrasing
|
|
content</a> nodes uninterrupted by other types of content, in an
|
|
element that accepts content other than <a href="#phrasing-content">phrasing
|
|
content</a> as well as <a href="#phrasing-content">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 such run
|
|
that consists of at least one node that is neither <a href="#embedded-content">embedded
|
|
content</a> nor <a href="#inter-element-whitespace">inter-element whitespace</a>, 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="#the-a-element">a</a></code>, <code><a href="#the-ins-element">ins</a></code>, <code><a href="#the-del-element">del</a></code>, and
|
|
<code><a href="#the-map-element">map</a></code> elements.)</p>
|
|
|
|
<p>Conformance checkers may warn authors of cases where they have
|
|
paragraphs that overlap each other (this can happen with
|
|
<code><a href="#the-object-element">object</a></code>, <code><a href="#the-video-element">video</a></code>, <code><a href="#the-audio-element">audio</a></code>, and
|
|
<code><a href="#the-canvas-element">canvas</a></code> elements, and indirectly through elements in
|
|
other namespaces that allow HTML to be further embedded therein,
|
|
like <code><a href="#svg">svg</a></code> or <code><a href="#math">math</a></code>).</p>
|
|
</div><p>A <a href="#paragraph">paragraph</a> is also formed explicitly by
|
|
<code><a href="#the-p-element">p</a></code> elements.<p class="note">The <code><a href="#the-p-element">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.<div class="example">
|
|
|
|
<p>In the following example, the link spans half of the first
|
|
paragraph, all of the heading separating the two paragraphs, and
|
|
half of the second paragraph. It straddles the paragraphs and the
|
|
heading.</p>
|
|
|
|
<pre><aside>
|
|
Welcome!
|
|
<a href="about.html">
|
|
This is home of...
|
|
<h1>The Falcons!</h1>
|
|
The Lockheed Martin multirole jet fighter aircraft!
|
|
</a>
|
|
This page discusses the F-16 Fighting Falcon's innermost secrets.
|
|
</aside></pre>
|
|
|
|
<p>Here is another way of marking this up, this time showing the
|
|
paragraphs explicitly, and splitting the one link element into
|
|
three:</p>
|
|
|
|
<pre><aside>
|
|
<p>Welcome! <a href="about.html">This is home of...</a></p>
|
|
<h1><a href="about.html">The Falcons!</a></h1>
|
|
<p><a href="about.html">The Lockheed Martin multirole jet
|
|
fighter aircraft!</a> This page discusses the F-16 Fighting
|
|
Falcon's innermost secrets.</p>
|
|
</aside></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
|
|
<p>It is possible for paragraphs to overlap when using certain
|
|
elements that define fallback content. For example, in the
|
|
following section:</p>
|
|
|
|
<pre><section>
|
|
<h1>My Cats</h1>
|
|
You can play with my cat simulator.
|
|
<object data="cats.sim">
|
|
To see the cat simulator, use one of the following links:
|
|
<ul>
|
|
<li><a href="cats.sim">Download simulator file</a>
|
|
<li><a href="http://sims.example.com/watch?v=LYds5xY4INU">Use online simulator</a>
|
|
</ul>
|
|
Alternatively, upgrade to the Mellblom Browser.
|
|
</object>
|
|
I'm quite proud of it.
|
|
</section></pre>
|
|
|
|
<p>There are five paragraphs:</p>
|
|
|
|
<ol class="brief"><li>The paragraph that says "You can play with my cat
|
|
simulator. <i title="">object</i> I'm quite proud of it.", where
|
|
<i title="">object</i> is the <code><a href="#the-object-element">object</a></code> element.</li>
|
|
|
|
<li>The paragraph that says "To see the cat simulator, use one of
|
|
the following links:".</li>
|
|
|
|
<li>The paragraph that says "Download simulator file".</li>
|
|
|
|
<li>The paragraph that says "Use online simulator".</li>
|
|
|
|
<li>The paragraph that says "Alternatively, upgrade to the Mellblom Browser.".</li>
|
|
|
|
</ol><p>The first paragraph is overlapped by the other four. A user
|
|
agent that supports the "cats.sim" resource will only show the
|
|
first one, but a user agent that shows the fallback will
|
|
confusingly show the first sentence of the first paragraph as
|
|
if it was in the same paragraph as the second one, and will show
|
|
the last paragraph as if it was at the start of the second sentence
|
|
of the first paragraph.</p>
|
|
|
|
<p>To avoid this confusion, explicit <code><a href="#the-p-element">p</a></code> elements can be
|
|
used.</p>
|
|
|
|
</div><h4 id="requirements-relating-to-bidirectional-algorithm-formatting-characters"><span class="secno">3.2.6 </span>Requirements relating to bidirectional-algorithm formatting
|
|
characters</h4><p><a href="#text-content">Text content</a> in <a href="#html-elements">HTML elements</a> with
|
|
child <a href="#text-node" title="text node">text nodes</a>, and text in
|
|
attributes of <a href="#html-elements">HTML elements</a> that allow free-form text,
|
|
may contain characters in the range U+202A to U+202E (the
|
|
bidirectional-algorithm formatting characters). However, the use of
|
|
these characters is restricted so that any embedding or overrides
|
|
generated by these characters do not start and end with different
|
|
parent elements, and so that all such embeddings and overrides are
|
|
explicitly terminated by a U+202C POP DIRECTIONAL FORMATTING
|
|
character. This helps reduce incidences of text being reused in a
|
|
manner that has unforeseen effects on the bidirectional
|
|
algorithm.<p>The aforementioned restrictions are defined by specifying that
|
|
certain parts of documents form <a href="#bidirectional-algorithm-formatting-character-ranges">bidirectional-algorithm
|
|
formatting character ranges</a>, and then imposing a requirement
|
|
on such ranges.<p>The string resulting from the concatenation of the data of all of
|
|
an <a href="#html-elements" title="HTML elements">HTML element</a>'s <a href="#text-node" title="text node">text nodes</a>, if any, is a <a href="#bidirectional-algorithm-formatting-character-ranges" title="bidirectional-algorithm formatting character
|
|
ranges">bidirectional-algorithm formatting character
|
|
range</a>.<p>The value of a namespace-less attribute of an <a href="#html-elements" title="HTML
|
|
elements">HTML element</a> is a <a href="#bidirectional-algorithm-formatting-character-ranges" title="bidirectional-algorithm formatting character
|
|
ranges">bidirectional-algorithm formatting character
|
|
range</a>.<p>Any strings that, as described above, are
|
|
<dfn id="bidirectional-algorithm-formatting-character-ranges">bidirectional-algorithm formatting character ranges</dfn> must
|
|
match the <code title="">string</code> production in the following
|
|
ABNF, the character set for which is Unicode. <a href="#refsABNF">[ABNF]</a><pre>string = *( plaintext ( embedding / override ) ) plaintext
|
|
embedding = ( lre / rle ) string pdf
|
|
override = ( lro / rlo ) string pdf
|
|
lre = %x202A ; U+202A LEFT-TO-RIGHT EMBEDDING
|
|
rle = %x202B ; U+202B RIGHT-TO-LEFT EMBEDDING
|
|
lro = %x202D ; U+202D LEFT-TO-RIGHT OVERRIDE
|
|
rlo = %x202E ; U+202E RIGHT-TO-LEFT OVERRIDE
|
|
pdf = %x202C ; U+202C POP DIRECTIONAL FORMATTING
|
|
plaintext = *( %x0000-2029 / %x202F-10FFFF )
|
|
; any string with no bidirectional-algorithm formatting characters</pre><p class="note">For convenience, where possible authors will likely
|
|
prefer to use the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute, the
|
|
<code><a href="#the-bdo-element">bdo</a></code> element, and the <code><a href="#the-bdi-element">bdi</a></code> element, rather
|
|
than maintaining the bidirectional-algorithm formatting characters
|
|
manually.<h4 id="wai-aria"><span class="secno">3.2.7 </span><dfn>WAI-ARIA</dfn></h4><p>Authors may use the ARIA <code title="attr-aria-role">role</code>
|
|
and <code title="attr-aria-*">aria-*</code> attributes on <a href="#html-elements">HTML
|
|
elements</a>, in accordance with the requirements described in
|
|
the ARIA specifications, except where these conflict with the
|
|
<span>strong native semantics</span>
|
|
described below. These exceptions are intended to prevent authors
|
|
from making assistive technology products report nonsensical states
|
|
that do not represent the actual state of the document. <a href="#refsARIA">[ARIA]</a><div class="impl">
|
|
|
|
<p>User agents are required to implement ARIA semantics on all
|
|
<a href="#html-elements">HTML elements</a>, as defined in the ARIA
|
|
specifications. The <span>implicit ARIA semantics</span> defined
|
|
below must be recognized by implementations. <a href="#refsARIAIMPL">[ARIAIMPL]</a></p>
|
|
|
|
</div><p>The following table defines the <span>strong native
|
|
semantics</span> and corresponding <span>default implicit ARIA
|
|
semantics</span> that apply to <a href="#html-elements">HTML elements</a>. Each
|
|
language feature (element or attribute) in a cell in the first
|
|
column implies the ARIA semantics (role, states, and/or properties)
|
|
given in the cell in the second column of the same row. <span class="impl">When multiple rows apply to an element, the role from
|
|
the last row to define a role must be applied, and the states and
|
|
properties from all the rows must be combined.</span><table id="table-aria-strong"><thead><tr><th>Language feature
|
|
<th><span>Strong native semantics</span> and <span>default implied ARIA semantics</span>
|
|
|
|
<tbody><tr><td><code><a href="#the-area-element">area</a></code> element that creates a <a href="#hyperlink">hyperlink</a>
|
|
<td><code title="attr-aria-role-link">link</code> role
|
|
|
|
|
|
<tr><td><code><a href="#the-base-element">base</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-datalist-element">datalist</a></code> element
|
|
<td><code title="attr-aria-role-listbox">listbox</code> role, with the <code title="attr-aria-multiselectable">aria-multiselectable</code> property set to "false"
|
|
|
|
<tr><td><code><a href="#the-details-element">details</a></code> element
|
|
<td><code title="attr-aria-expanded">aria-expanded</code> state set to "true" if the element's <code title="attr-details-open"><a href="#attr-details-open">open</a></code> attribute is present, and set to "false" otherwise
|
|
|
|
|
|
<tr><td><code><a href="#the-head-element">head</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-hgroup-element">hgroup</a></code> element
|
|
<td><code title="attr-aria-role-heading">heading</code> role, with the <code title="attr-aria-level">aria-level</code> property set to the element's <a href="#outline-depth">outline depth</a>
|
|
|
|
<tr><td><code><a href="#the-hr-element">hr</a></code> element
|
|
<td><code title="attr-aria-role-separator">separator</code> role
|
|
|
|
<tr><td><code><a href="#the-html-element">html</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-img-element">img</a></code> element whose <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute's value is empty
|
|
<td><code title="attr-aria-role-presentation">presentation</code> role
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state
|
|
<td><code title="attr-aria-checked">aria-checked</code> state set to "mixed" if the element's <code title="dom-input-indeterminate"><a href="#dom-input-indeterminate">indeterminate</a></code> IDL attribute is true, or "true" if the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> is true, or "false" otherwise
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#color-state" title="attr-input-type-color">Color</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#date-state" title="attr-input-type-date">Date</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#date-and-time-state" title="attr-input-type-datetime">Date and Time</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#local-date-and-time-state" title="attr-input-type-datetime-local">Local Date and Time</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#e-mail-state" title="attr-input-type-email">E-mail</a> state with no <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>
|
|
<td><code title="attr-aria-role-textbox">textbox</code> role, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#file-upload-state" title="attr-input-type-file">File Upload</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#month-state" title="attr-input-type-month">Month</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#number-state" title="attr-input-type-number">Number</a> state
|
|
<td><code title="attr-aria-role-spinbutton">spinbutton</code> role, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute, the <code title="attr-aria-valuemax">aria-valuemax</code> property set to the element's <a href="#concept-input-max" title="concept-input-max">maximum</a>, the <code title="attr-aria-valuemin">aria-valuemin</code> property set to the element's <a href="#concept-input-min" title="concept-input-min">minimum</a>, and, if the result of applying the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating point number values</a> to the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is a number, with the <code title="attr-aria-valuenow">aria-valuenow</code> property set to that number
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#password-state" title="attr-input-type-password">Password</a> state
|
|
<td><code title="attr-aria-role-textbox">textbox</code> role, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a> state
|
|
<td><code title="attr-aria-checked">aria-checked</code> state set to "true" if the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> is true, or "false" otherwise
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#range-state" title="attr-input-type-range">Range</a> state
|
|
<td><code title="attr-aria-role-slider">slider</code> role, with the <code title="attr-aria-valuemax">aria-valuemax</code> property set to the element's <a href="#concept-input-max" title="concept-input-max">maximum</a>, the <code title="attr-aria-valuemin">aria-valuemin</code> property set to the element's <a href="#concept-input-min" title="concept-input-min">minimum</a>, and the <code title="attr-aria-valuenow">aria-valuenow</code> property set to the result of applying the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating point number values</a> to the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>, if that results in a number, or the <a href="#concept-input-value-default-range" title="concept-input-value-default-range">default value</a> otherwise
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#reset-button-state" title="attr-input-type-reset">Reset Button</a> state
|
|
<td><code title="attr-aria-role-button">button</code> role
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a> state with no <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>
|
|
<td><code title="attr-aria-role-textbox">textbox</code> role, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a> state
|
|
<td><code title="attr-aria-role-button">button</code> role
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#telephone-state" title="attr-input-type-tel">Telephone</a> state with no <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>
|
|
<td><code title="attr-aria-role-textbox">textbox</code> role, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state with no <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>
|
|
<td><code title="attr-aria-role-textbox">textbox</code> role, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a>, <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a>, <a href="#telephone-state" title="attr-input-type-tel">Telephone</a>, <a href="#url-state" title="attr-input-type-url">URL</a>, or <a href="#e-mail-state" title="attr-input-type-email">E-mail</a> states with a <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>
|
|
<td><code title="attr-aria-role-combobox">combobox</code> role, with the <code title="attr-aria-owns">aria-owns</code> property set to the same value as the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute, and the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#time-state" title="attr-input-type-time">Time</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#url-state" title="attr-input-type-url">URL</a> state with no <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>
|
|
<td><code title="attr-aria-role-textbox">textbox</code> role, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#week-state" title="attr-input-type-week">Week</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>, with the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element that is <a href="#concept-input-required" title="concept-input-required">required</a>
|
|
<td>The <code title="title-aria-required">aria-required</code> state set to "true"
|
|
|
|
<tr><td><code><a href="#the-keygen-element">keygen</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-label-element">label</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-link-element">link</a></code> element that creates a <a href="#hyperlink">hyperlink</a>
|
|
<td><code title="attr-aria-role-link">link</code> role
|
|
|
|
<tr><td><code><a href="#the-menu-element">menu</a></code> element with a <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute in the <a href="#context-menu-state" title="context menu state">context menu</a> state
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-menu-element">menu</a></code> element with a <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute in the <a href="#list-state" title="list state">list</a> state
|
|
<td><code title="attr-aria-role-menu">menu</code> role
|
|
|
|
<tr><td><code><a href="#the-menu-element">menu</a></code> element with a <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute in the <a href="#toolbar-state" title="toolbar state">toolbar</a> state
|
|
<td><code title="attr-aria-role-toolbar">toolbar</code> role
|
|
|
|
<tr><td><code><a href="#the-meta-element">meta</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-meter-element">meter</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-nav-element">nav</a></code> element
|
|
<td><code title="attr-aria-role-navigation">navigation</code> role
|
|
|
|
<tr><td><code><a href="#the-noscript-element">noscript</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-optgroup-element">optgroup</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-option-element">option</a></code> element that is in a <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> or that represents a suggestion in a <code><a href="#the-datalist-element">datalist</a></code> element
|
|
<td><code title="attr-aria-role-option">option</code> role, with the <code title="attr-aria-selected">aria-selected</code> state set to "true" if the element's <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> is true, or "false" otherwise.
|
|
|
|
<tr><td><code><a href="#the-param-element">param</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-progress-element">progress</a></code> element
|
|
<td><code title="attr-aria-role-progressbar">progressbar</code> role, with, if the progress bar is determinate, the <code title="attr-aria-valuemax">aria-valuemax</code> property set to the maximum value of the progress bar, the <code title="attr-aria-valuemin">aria-valuemin</code> property set to zero, and the <code title="attr-aria-valuenow">aria-valuenow</code> property set to the current value of the progress bar
|
|
|
|
<tr><td><code><a href="#the-script-element">script</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-select-element">select</a></code> element with a <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute
|
|
<td><code title="attr-aria-role-listbox">listbox</code> role, with the <code title="attr-aria-multiselectable">aria-multiselectable</code> property set to "true"
|
|
|
|
<tr><td><code><a href="#the-select-element">select</a></code> element with no <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute
|
|
<td><code title="attr-aria-role-listbox">listbox</code> role, with the <code title="attr-aria-multiselectable">aria-multiselectable</code> property set to "false"
|
|
|
|
<tr><td><code><a href="#the-select-element">select</a></code> element with a <code title="attr-select-required"><a href="#attr-select-required">required</a></code> attribute
|
|
<td>The <code title="title-aria-required">aria-required</code> state set to "true"
|
|
|
|
<tr><td><code><a href="#the-source-element">source</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-style-element">style</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-summary-element">summary</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td><code><a href="#the-textarea-element">textarea</a></code> element
|
|
<td><code title="attr-aria-role-textbox">textbox</code> role, with the <code title="attr-aria-multiline">aria-multiline</code> property set to "true", and the <code title="title-aria-readonly">aria-readonly</code> state set to "true" if the element has a <code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">readonly</a></code> attribute
|
|
|
|
<tr><td><code><a href="#the-textarea-element">textarea</a></code> element with a <code title="attr-textarea-required"><a href="#attr-textarea-required">required</a></code> attribute
|
|
<td>The <code title="title-aria-required">aria-required</code> state set to "true"
|
|
|
|
<tr><td><code><a href="#the-title-element">title</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
|
|
<tr><td>An element that <a href="#concept-command" title="concept-command">defines a command</a>, whose <a href="#command-facet-type" title="command-facet-type">Type</a> facet is "checkbox", and that is a descendant of a <code><a href="#the-menu-element">menu</a></code> element whose <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute in the <a href="#list-state" title="list state">list</a> state
|
|
<td><code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code> role, with the <code title="attr-aria-checked">aria-checked</code> state set to "true" if the command's <a href="#command-facet-checkedstate" title="command-facet-checkedstate">Checked State</a> facet is true, and "false" otherwise
|
|
|
|
<tr><td>An element that <a href="#concept-command" title="concept-command">defines a command</a>, whose <a href="#command-facet-type" title="command-facet-type">Type</a> facet is "command", and that is a descendant of a <code><a href="#the-menu-element">menu</a></code> element whose <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute in the <a href="#list-state" title="list state">list</a> state
|
|
<td><code title="attr-aria-role-menuitem">menuitem</code> role
|
|
|
|
<tr><td>An element that <a href="#concept-command" title="concept-command">defines a command</a>, whose <a href="#command-facet-type" title="command-facet-type">Type</a> facet is "radio", and that is a descendant of a <code><a href="#the-menu-element">menu</a></code> element whose <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute in the <a href="#list-state" title="list state">list</a> state
|
|
<td><code title="attr-aria-role-menuitemradio">menuitemradio</code> role, with the <code title="attr-aria-checked">aria-checked</code> state set to "true" if the command's <a href="#command-facet-checkedstate" title="command-facet-checkedstate">Checked State</a> facet is true, and "false" otherwise
|
|
|
|
<tr><td>Element that is <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>
|
|
<td>The <code title="title-aria-disabled">aria-disabled</code> state set to "true"
|
|
|
|
<tr><td>Element with a <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute
|
|
<td>The <code title="title-aria-hidden">aria-hidden</code> state set to "true"
|
|
|
|
<tr><td>Element that is a <a href="#candidate-for-constraint-validation">candidate for constraint validation</a> but that does not <a href="#concept-fv-valid" title="concept-fv-valid">satisfy its constraints</a>
|
|
<td>The <code title="title-aria-invalid">aria-invalid</code> state set to "true"
|
|
|
|
</table><p>Some <a href="#html-elements">HTML elements</a> have native semantics that can be
|
|
overridden. The following table lists these elements and their
|
|
<span>default implicit ARIA semantics</span>, along with the
|
|
restrictions that apply to those elements. Each language feature
|
|
(element or attribute) in a cell in the first column implies, unless
|
|
otherwise overridden, the ARIA semantic (role, state, or property)
|
|
given in the cell in the second column of the same row, but this
|
|
semantic may be overridden under the conditions listed in the cell
|
|
in the third column of that row. In addition, any element may be
|
|
given the <code title="attr-aria-role-presentation">presentation</code> role,
|
|
regardless of the restrictions below.<table id="table-aria-weak"><thead><tr><th>Language feature
|
|
<th>Default implied ARIA semantic
|
|
<th>Restrictions
|
|
|
|
<tbody><tr><td><code><a href="#the-a-element">a</a></code> element that creates a <a href="#hyperlink">hyperlink</a>
|
|
<td><code title="attr-aria-role-link">link</code> role
|
|
<td>Role must be either <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-button">button</code>, <code title="attr-aria-role-checkbox">checkbox</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-tab">tab</code>, or <code title="attr-aria-role-treeitem">treeitem</code>
|
|
|
|
<tr><td><code><a href="#the-address-element">address</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
<td>If specified, role must be <code title="attr-aria-role-contentinfo">contentinfo</code>
|
|
|
|
<tr><td><code><a href="#the-article-element">article</a></code> element
|
|
<td><code title="attr-aria-role-article">article</code> role
|
|
<td>Role must be either <code title="attr-aria-role-article">article</code>, <code title="attr-aria-role-document">document</code>, <code title="attr-aria-role-application">application</code>, or <code title="attr-aria-role-main">main</code>
|
|
|
|
<tr><td><code><a href="#the-aside-element">aside</a></code> element
|
|
<td><code title="attr-aria-role-note">note</code> role
|
|
<td>Role must be either <code title="attr-aria-role-note">note</code>, <code title="attr-aria-role-complementary">complementary</code>, or <code title="attr-aria-role-search">search</code>
|
|
|
|
<tr><td><code><a href="#the-audio-element">audio</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
<td>If specified, role must be <code title="attr-aria-role-application">application</code>
|
|
|
|
<tr><td><code><a href="#the-button-element">button</a></code> element
|
|
<td><code title="attr-aria-role-button">button</code> role
|
|
<td>Role must be either <code title="attr-aria-role-button">button</code>, <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-radio">radio</code>
|
|
|
|
<tr><td><code><a href="#the-details-element">details</a></code> element
|
|
<td><code title="attr-aria-role-group">group</code> role
|
|
<td>Role must be a role that supports <code title="attr-aria-expanded">aria-expanded</code>
|
|
|
|
<tr><td><code><a href="#the-embed-element">embed</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
<td>If specified, role must be either <code title="attr-aria-role-application">application</code>, <code title="attr-aria-role-document">document</code>, or <code title="attr-aria-role-img">img</code>
|
|
|
|
<tr><td><code><a href="#the-footer-element">footer</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
<td>If specified, role must be <code title="attr-aria-role-contentinfo">contentinfo</code>
|
|
|
|
<tr><td><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> element that does not have an <code><a href="#the-hgroup-element">hgroup</a></code> ancestor
|
|
<td><code title="attr-aria-role-heading">heading</code> role, with the <code title="attr-aria-level">aria-level</code> property set to the element's <a href="#outline-depth">outline depth</a>
|
|
<td>Role must be either <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-tab">tab</code>, or <code title="attr-aria-role-treeitem">treeitem</code>
|
|
|
|
<tr><td><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> element that does not have an <code><a href="#the-hgroup-element">hgroup</a></code> ancestor
|
|
<td><code title="attr-aria-role-heading">heading</code> role, with the <code title="attr-aria-level">aria-level</code> property set to the element's <a href="#outline-depth">outline depth</a>
|
|
<td>Role must be either <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-tab">tab</code>, or <code title="attr-aria-role-treeitem">treeitem</code>
|
|
|
|
<tr><td><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code> element that does not have an <code><a href="#the-hgroup-element">hgroup</a></code> ancestor
|
|
<td><code title="attr-aria-role-heading">heading</code> role, with the <code title="attr-aria-level">aria-level</code> property set to the element's <a href="#outline-depth">outline depth</a>
|
|
<td>Role must be either <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-tab">tab</code>, or <code title="attr-aria-role-treeitem">treeitem</code>
|
|
|
|
<tr><td><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code> element that does not have an <code><a href="#the-hgroup-element">hgroup</a></code> ancestor
|
|
<td><code title="attr-aria-role-heading">heading</code> role, with the <code title="attr-aria-level">aria-level</code> property set to the element's <a href="#outline-depth">outline depth</a>
|
|
<td>Role must be either <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-tab">tab</code>, or <code title="attr-aria-role-treeitem">treeitem</code>
|
|
|
|
<tr><td><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code> element that does not have an <code><a href="#the-hgroup-element">hgroup</a></code> ancestor
|
|
<td><code title="attr-aria-role-heading">heading</code> role, with the <code title="attr-aria-level">aria-level</code> property set to the element's <a href="#outline-depth">outline depth</a>
|
|
<td>Role must be either <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-tab">tab</code>, or <code title="attr-aria-role-treeitem">treeitem</code>
|
|
|
|
<tr><td><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> element that does not have an <code><a href="#the-hgroup-element">hgroup</a></code> ancestor
|
|
<td><code title="attr-aria-role-heading">heading</code> role, with the <code title="attr-aria-level">aria-level</code> property set to the element's <a href="#outline-depth">outline depth</a>
|
|
<td>Role must be either <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-tab">tab</code>, or <code title="attr-aria-role-treeitem">treeitem</code>
|
|
|
|
<tr><td><code><a href="#the-header-element">header</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
<td>If specified, role must be <code title="attr-aria-role-banner">banner</code>
|
|
|
|
<tr><td><code><a href="#the-iframe-element">iframe</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
<td>If specified, role must be either <code title="attr-aria-role-application">application</code>, <code title="attr-aria-role-document">document</code>, or <code title="attr-aria-role-img">img</code>
|
|
|
|
<tr><td><code><a href="#the-img-element">img</a></code> element whose <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute's value is absent
|
|
<td><code title="attr-aria-role-img">img</code> role
|
|
<td>No restrictions
|
|
|
|
<tr><td><code><a href="#the-img-element">img</a></code> element whose <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute's value is present and not empty
|
|
<td><code title="attr-aria-role-img">img</code> role
|
|
<td>No restrictions
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#button-state" title="attr-input-type-button">Button</a> state
|
|
<td><code title="attr-aria-role-button">button</code> role
|
|
<td>Role must be either <code title="attr-aria-role-button">button</code>, <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-radio">radio</code>
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state
|
|
<td><code title="attr-aria-role-checkbox">checkbox</code> role
|
|
<td>Role must be either <code title="attr-aria-role-checkbox">checkbox</code> or <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state
|
|
<td><code title="attr-aria-role-button">button</code> role
|
|
<td>Role must be either <code title="attr-aria-role-button">button</code>, <code title="attr-aria-role-link">link</code>, <code title="attr-aria-role-menuitem">menuitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-radio">radio</code>
|
|
|
|
<tr><td><code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a> state
|
|
<td><code title="attr-aria-role-radio">radio</code> role
|
|
<td>Role must be either <code title="attr-aria-role-radio">radio</code> or <code title="attr-aria-role-menuitemradio">menuitemradio</code>
|
|
|
|
<tr><td><code><a href="#the-li-element">li</a></code> element whose parent is an <code><a href="#the-ol-element">ol</a></code> or <code><a href="#the-ul-element">ul</a></code> element
|
|
<td><code title="attr-aria-role-listitem">listitem</code> role
|
|
<td>Role must be either <code title="attr-aria-role-listitem">listitem</code>, <code title="attr-aria-role-menuitemcheckbox">menuitemcheckbox</code>, <code title="attr-aria-role-menuitemradio">menuitemradio</code>, <code title="attr-aria-role-option">option</code>, <code title="attr-aria-role-tab">tab</code>, or <code title="attr-aria-role-treeitem">treeitem</code>
|
|
|
|
<tr><td><code><a href="#the-object-element">object</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
<td>If specified, role must be either <code title="attr-aria-role-application">application</code>, <code title="attr-aria-role-document">document</code>, or <code title="attr-aria-role-img">img</code>
|
|
|
|
<tr><td><code><a href="#the-ol-element">ol</a></code> element
|
|
<td><code title="attr-aria-role-list">list</code> role
|
|
<td>Role must be either <code title="attr-aria-role-directory">directory</code>, <code title="attr-aria-role-list">list</code>, <code title="attr-aria-role-listbox">listbox</code>, <code title="attr-aria-role-menu">menu</code>, <code title="attr-aria-role-menubar">menubar</code>, <code title="attr-aria-role-tablist">tablist</code>, <code title="attr-aria-role-toolbar ">toolbar</code>, <code title="attr-aria-role-tree">tree</code>
|
|
|
|
<tr><td><code><a href="#the-output-element">output</a></code> element
|
|
<td><code title="attr-aria-role-status">status</code> role
|
|
<td>No restrictions
|
|
|
|
<tr><td><code><a href="#the-section-element">section</a></code> element
|
|
<td><code title="attr-aria-role-region">region</code> role
|
|
<td>Role must be either
|
|
<code title="attr-aria-role-alert">alert</code>,
|
|
<code title="attr-aria-role-alertdialog">alertdialog</code>,
|
|
<code title="attr-aria-role-application">application</code>,
|
|
<code title="attr-aria-role-contentinfo">contentinfo</code>,
|
|
<code title="attr-aria-role-dialog">dialog</code>,
|
|
<code title="attr-aria-role-document">document</code>,
|
|
<code title="attr-aria-role-log">log</code>,
|
|
<code title="attr-aria-role-main">main</code>,
|
|
<code title="attr-aria-role-marquee">marquee</code>,
|
|
<code title="attr-aria-role-region">region</code>,
|
|
<code title="attr-aria-role-search">search</code>, or
|
|
<code title="attr-aria-role-status">status</code>
|
|
|
|
<tr><td><code><a href="#the-ul-element">ul</a></code> element
|
|
<td><code title="attr-aria-role-list">list</code> role
|
|
<td>Role must be either <code title="attr-aria-role-directory">directory</code>, <code title="attr-aria-role-list">list</code>, <code title="attr-aria-role-listbox">listbox</code>, <code title="attr-aria-role-menu">menu</code>, <code title="attr-aria-role-menubar">menubar</code>, <code title="attr-aria-role-tablist">tablist</code>, <code title="attr-aria-role-toolbar ">toolbar</code>, <code title="attr-aria-role-tree">tree</code>
|
|
|
|
<tr><td><code><a href="#the-video-element">video</a></code> element
|
|
<td><a href="#concept-role-none" title="concept-role-none">No role</a>
|
|
<td>If specified, role must be <code title="attr-aria-role-application">application</code>
|
|
|
|
<tr><td><a href="#the-body-element-0">The body element</a>
|
|
<td><code title="attr-aria-role-document">document</code> role
|
|
<td>Role must be either <code title="attr-aria-role-document">document</code> or <code title="attr-aria-role-application">application</code>
|
|
|
|
</table><p>The entry "<dfn id="concept-role-none" title="concept-role-none">no role</dfn>", when
|
|
used as a <span title="strong native semantics">strong native
|
|
semantic</span>, means that no role other than <code title="attr-aria-role-presentation">presentation</code> can be used.
|
|
When used as a <span title="default implied ARIA semantics">default
|
|
implied ARIA semantic</span>, it means the user agent has no default
|
|
mapping to ARIA roles. (However, it probably will have its own
|
|
mappings to the accessibility layer.)<div class="impl">
|
|
|
|
<p>The WAI-ARIA specification neither requires or forbids user
|
|
agents from enhancing native presentation and interaction behaviors
|
|
on the basis of WAI- ARIA markup. Even mainstream user agents might
|
|
choose to expose metadata or navigational features directly or via
|
|
user-installed extensions; for example, exposing required form
|
|
fields or landmark navigation. User agents are encouraged to
|
|
maximize their usefulness to users, including users without
|
|
disabilities.</p>
|
|
<!-- EDITORIAL -->
|
|
|
|
<p>Conformance checkers are encouraged to phrase errors such that
|
|
authors are encouraged to use more appropriate elements rather than
|
|
remove accessibility annotations. For example, if an <code><a href="#the-a-element">a</a></code>
|
|
element is marked as having the <code title="attr-aria-role-button">button</code> role, a conformance
|
|
checker could say "Use a more appropriate element to represent a
|
|
button, for example a <code><a href="#the-button-element">button</a></code> element or an
|
|
<code><a href="#the-input-element">input</a></code> element" rather than "The <code title="attr-aria-role-button">button</code> role cannot be used with
|
|
<code><a href="#the-a-element">a</a></code> elements".</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>These features can be used to make accessibility tools render
|
|
content to their users in more useful ways. For example, ASCII art,
|
|
which is really an image, appears to be text, and in the absence of
|
|
appropriate annotations would end up being rendered by screen
|
|
readers as a very painful reading of lots of punctuation. Using the
|
|
features described in this section, one can instead make the ATs
|
|
skip the ASCII art and just read the caption:</p>
|
|
|
|
<pre><figure <strong>role="img" aria-labelledby="fish-caption"</strong>>
|
|
<pre>
|
|
o .'`/
|
|
' / (
|
|
O .-'` ` `'-._ .')
|
|
_/ (o) '. .' /
|
|
) ))) >< <
|
|
`\ |_\ _.' '. \
|
|
'-._ _ .-' '.)
|
|
jgs `\__\
|
|
</pre>
|
|
<figcaption <strong>id="fish-caption"</strong>>
|
|
Joan G. Stark, "<cite>fish</cite>".
|
|
October 1997. ASCII on electrons. 28×8.
|
|
</figcaption>
|
|
</figure>
|
|
</pre>
|
|
|
|
|
|
|
|
</div><h3 id="apis-in-html-documents"><span class="secno">3.3 </span>APIs in HTML documents</h3><p>For <a href="#html-documents">HTML documents</a>, and for <a href="#html-elements">HTML
|
|
elements</a> in <a href="#html-documents">HTML documents</a>, certain APIs defined
|
|
in DOM Core become case-insensitive or case-changing, as sometimes
|
|
defined in DOM Core, and as summarized <span class="impl">or
|
|
required</span> below. <a href="#refsDOMCORE">[DOMCORE]</a><p>This does not apply to <a href="#xml-documents">XML documents</a> or to elements
|
|
that are not in the <a href="#html-namespace-0">HTML namespace</a> despite being in
|
|
<a href="#html-documents">HTML documents</a>.<dl><dt><code title="dom-Element-tagName"><a href="#dom-element-tagname">Element.tagName</a></code> and <code title="dom-Node-nodeName">Node.nodeName</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>These attributes <span class="impl">must</span> return element
|
|
names <a href="#converted-to-ascii-uppercase">converted to ASCII uppercase</a>, regardless of the case
|
|
with which they were created.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><code title="dom-Document-createElement"><a href="#dom-document-createelement">Document.createElement()</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The canonical form of HTML markup is all-lowercase; thus, this
|
|
method will <a href="#converted-to-ascii-lowercase" title="converted to ASCII lowercase">lowercase</a>
|
|
the argument before creating the requisite element. <span class="impl">Also, the element created must be in the <a href="#html-namespace-0">HTML
|
|
namespace</a></span>.</p>
|
|
|
|
<p class="note">This doesn't apply to <code title="dom-Document-createElementNS"><a href="#dom-document-createelementns">Document.createElementNS()</a></code>.
|
|
Thus, it is possible, by passing this last method a tag name in
|
|
the wrong case, to create an element that appears to have the same
|
|
tag name as that of an element defined in this specification when
|
|
its <code title="dom-Element-tagName"><a href="#dom-element-tagname">tagName</a></code> attribute is
|
|
examined, but that doesn't support the corresponding interfaces.
|
|
The "real" element name (unaffected by case conversions) can be
|
|
obtained from the <code title="dom-Node-localName"><a href="#dom-node-localname">localName</a></code> attribute.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><code title="dom-Element-setAttribute">Element.setAttribute()</code></dt>
|
|
<dt><code title="dom-Element-setAttributeNode">Element.setAttributeNode()</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Attribute names are <a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p>Specifically: when an attribute is set on an <a href="#html-elements" title="HTML
|
|
elements">HTML element</a> using <code title="">Element.setAttribute()</code>, the name argument must be
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a> before the element is
|
|
affected; and when an <code><a href="#attr">Attr</a></code> node is set on an <a href="#html-elements" title="HTML elements">HTML element</a> using <code title="">Element.setAttributeNode()</code>, it must have its name
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a> before the element is
|
|
affected.</p>
|
|
|
|
</div>
|
|
|
|
<p class="note">This doesn't apply to <code title="">Element.setAttributeNS()</code> and <code title="">Element.setAttributeNodeNS()</code>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><code title="dom-Element-getAttribute">Element.getAttribute()</code></dt>
|
|
<dt><code title="dom-Element-getAttributeNode">Element.getAttributeNode()</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Attribute names are <a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p>Specifically: When the <code title="">Element.getAttribute()</code> method or the <code title="">Element.getAttributeNode()</code> method is invoked on
|
|
an <a href="#html-elements" title="HTML elements">HTML element</a>, the name
|
|
argument must be <a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a> before the
|
|
element's attributes are examined.</p>
|
|
|
|
</div>
|
|
|
|
<p class="note">This doesn't apply to <code title="">Element.getAttributeNS()</code> and <code title="">Element.getAttributeNodeNS()</code>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><code title="dom-Document-getElementsByTagName">Document.getElementsByTagName()</code></dt>
|
|
<dt><code title="dom-Element-getElementsByTagName">Element.getElementsByTagName()</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>HTML elements match by lower-casing the argument before
|
|
comparison, elements from other namespaces are treated as in XML
|
|
(case-sensitively).</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p>Specifically, these methods (but not their namespaced
|
|
counterparts) must compare the given argument in a
|
|
<a href="#case-sensitive">case-sensitive</a> manner, but when looking at <a href="#html-elements" title="HTML elements">HTML elements</a>, the argument must
|
|
first be <a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</p>
|
|
|
|
</div>
|
|
|
|
<p class="note">Thus, in an <a href="#html-documents" title="HTML documents">HTML
|
|
document</a> with nodes in multiple namespaces, these methods
|
|
will effectively be both case-sensitive and case-insensitive at
|
|
the same time.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
</dl><div class="impl">
|
|
|
|
<h3 id="interactions-with-xpath-and-xslt"><span class="secno">3.4 </span>Interactions with XPath and XSLT</h3>
|
|
|
|
<p id="xpath-1.0-processors">Implementations of XPath 1.0 that
|
|
operate on <a href="#html-documents">HTML documents</a> parsed or created in the
|
|
manners described in this specification (e.g. as part of the <code title="">document.evaluate()</code> API) must act as if the
|
|
following edit was applied to the XPath 1.0 specification.</p>
|
|
|
|
<p>First, remove this paragraph:</p>
|
|
|
|
<blockquote cite="http://www.w3.org/TR/1999/REC-xpath-19991116#node-tests">
|
|
|
|
<p>A <a href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</a> in the
|
|
node test is expanded into an <a href="http://www.w3.org/TR/1999/REC-xpath-19991116#dt-expanded-name">expanded-name</a>
|
|
using the namespace declarations from the expression context. This
|
|
is the same way expansion is done for element type names in start
|
|
and end-tags except that the default namespace declared with <code title="">xmlns</code> is not used: if the <a href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</a> does
|
|
not have a prefix, then the namespace URI is null (this is the same
|
|
way attribute names are expanded). It is an error if the <a href="http://www.w3.org/TR/REC-xml-names#NT-QName">QName</a> has a
|
|
prefix for which there is no namespace declaration in the
|
|
expression context.</p>
|
|
|
|
</blockquote>
|
|
|
|
<p>Then, insert in its place the following:</p>
|
|
|
|
<blockquote cite="http://www.w3.org/Bugs/Public/show_bug.cgi?id=7059#c37">
|
|
|
|
<p>A QName in the node test is expanded into an expanded-name using
|
|
the namespace declarations from the expression context. If the
|
|
QName has a prefix, then there must be a namespace
|
|
declaration for this prefix in the expression context, and the
|
|
corresponding namespace
|
|
URI is the one that is associated with this prefix. It is an error
|
|
if the QName has a prefix for which there is no namespace
|
|
declaration in the expression context. </p>
|
|
|
|
<p>If the QName has no prefix and the principal node type of the
|
|
axis is element, then the default element namespace is
|
|
used. Otherwise if the QName has no prefix, the namespace URI is
|
|
null. The default element namespace is a member of the context for
|
|
the XPath expression. The value of the default element namespace
|
|
when executing an XPath expression through the DOM3 XPath API is
|
|
determined in the following way:</p>
|
|
|
|
<ol><li>If the context node is from an HTML DOM, the default element
|
|
namespace is "http://www.w3.org/1999/xhtml".</li>
|
|
|
|
<li>Otherwise, the default element namespace URI is null.</li>
|
|
|
|
</ol><p class="note">This is equivalent to adding the default element
|
|
namespace feature of XPath 2.0 to XPath 1.0, and using the HTML
|
|
namespace as the default element namespace for HTML documents. It
|
|
is motivated by the desire to have implementations be compatible
|
|
with legacy HTML content while still supporting the changes that
|
|
this specification introduces to HTML regarding the namespace used
|
|
for HTML elements, and by the desire to use XPath 1.0 rather than
|
|
XPath 2.0.</p>
|
|
|
|
</blockquote>
|
|
|
|
<p class="note">This change is a <a href="#willful-violation">willful violation</a> of
|
|
the XPath 1.0 specification, motivated by desire to have
|
|
implementations be compatible with legacy content while still
|
|
supporting the changes that this specification introduces to HTML
|
|
regarding which namespace is used for HTML elements. <a href="#refsXPATH10">[XPATH10]</a></p>
|
|
<hr><p id="dom-based-xslt-1.0-processors">XSLT 1.0 processors outputting
|
|
to a DOM when the output method is "html" (either explicitly or via
|
|
the defaulting rule in XSLT 1.0) are affected as follows:</p>
|
|
|
|
<p>If the transformation program outputs an element in no namespace,
|
|
the processor must, prior to constructing the corresponding DOM
|
|
element node, change the namespace of the element to the <a href="#html-namespace-0">HTML
|
|
namespace</a>, <a href="#converted-to-ascii-lowercase" title="converted to ASCII
|
|
lowercase">ASCII-lowercase</a> the element's local name, and
|
|
<a href="#converted-to-ascii-lowercase" title="converted to ASCII lowercase">ASCII-lowercase</a>
|
|
the names of any non-namespaced attributes on the element.</p>
|
|
|
|
<p class="note">This requirement is a <a href="#willful-violation">willful violation</a>
|
|
of the XSLT 1.0 specification, required because this specification
|
|
changes the namespaces and case-sensitivity rules of HTML in a
|
|
manner that would otherwise be incompatible with DOM-based XSLT
|
|
transformations. (Processors that serialize the output are
|
|
unaffected.) <a href="#refsXSLT10">[XSLT10]</a></p>
|
|
<p class="note">There are also additional comments regarding the
|
|
interaction of XSLT and HTML <a href="#scriptTagXSLT">in the
|
|
<code>script</code> element section</a>.</p>
|
|
|
|
</div><h3 id="dynamic-markup-insertion"><span class="secno">3.5 </span><dfn>Dynamic markup insertion</dfn></h3><p class="note">APIs for dynamically inserting markup into the
|
|
document interact with the parser, and thus their behavior varies
|
|
depending on whether they are used with <a href="#html-documents">HTML documents</a>
|
|
(and the <a href="#html-parser">HTML parser</a>) or XHTML in <a href="#xml-documents">XML
|
|
documents</a> (and the <a href="#xml-parser">XML parser</a>).<h4 id="opening-the-input-stream"><span class="secno">3.5.1 </span>Opening the input stream</h4><p>The <dfn id="dom-document-open" title="dom-document-open"><code>open()</code></dfn>
|
|
method comes in several variants with different numbers of
|
|
arguments.<dl class="domintro"><dt><var title="">document</var> = <var title="">document</var> . <code title="dom-document-open"><a href="#dom-document-open">open</a></code>( [ <var title="">type</var> [, <var title="">replace</var> ] ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Causes the <code><a href="#document">Document</a></code> to be replaced in-place, as if
|
|
it was a new <code><a href="#document">Document</a></code> object, but reusing the
|
|
previous object, which is then returned.</p>
|
|
|
|
<p>If the <var title="">type</var> argument is omitted or has the
|
|
value "<code><a href="#text-html">text/html</a></code>", then the resulting
|
|
<code><a href="#document">Document</a></code> has an HTML parser associated with it, which
|
|
can be given data to parse using <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code>. Otherwise, all
|
|
content passed to <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code> will be parsed
|
|
as plain text.</p>
|
|
|
|
<p>If the <var title="">replace</var> argument is present and has
|
|
the value "<code title="">replace</code>", the existing entries in
|
|
the session history for the <code><a href="#document">Document</a></code> object are
|
|
removed.</p>
|
|
|
|
<p>The method has no effect if the <code><a href="#document">Document</a></code> is still
|
|
being parsed.</p>
|
|
|
|
<p>Throws an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception if the
|
|
<code><a href="#document">Document</a></code> is an <a href="#xml-documents" title="XML documents">XML
|
|
document</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> = <var title="">document</var> . <code title="dom-document-open"><a href="#dom-document-open">open</a></code>( <var title="">url</var>, <var title="">name</var>, <var title="">features</var> [, <var title="">replace</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Works like the <code title="dom-open"><a href="#dom-open">window.open()</a></code>
|
|
method.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>When called with two or fewer arguments, the method must act as
|
|
follows:</p>
|
|
|
|
<ol><li>If the <code><a href="#document">Document</a></code> object is not flagged as an <a href="#html-documents" title="HTML documents">HTML document</a>, throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li><p>Let <var title="">type</var> be the value of the first
|
|
argument, if there is one, or "<code><a href="#text-html">text/html</a></code>"
|
|
otherwise.</li>
|
|
|
|
<li><p>Let <var title="">replace</var> be true if there is a second
|
|
argument and it is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for
|
|
the value "replace", and false otherwise.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the document has an <a href="#active-parser">active parser</a> that isn't a
|
|
<a href="#script-created-parser">script-created parser</a>, and the <a href="#insertion-point">insertion
|
|
point</a> associated with that parser's <a href="#the-input-stream">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><a href="#document">Document</a></code>
|
|
object on which the method was invoked.</p>
|
|
|
|
<p class="note">This basically causes <code title="dom-document-open"><a href="#dom-document-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>Release the <a href="#storage-mutex">storage mutex</a>.</li>
|
|
|
|
<li><p><a href="#prompt-to-unload-a-document" title="prompt to unload a document">Prompt to
|
|
unload</a> the <code><a href="#document">Document</a></code> object. If the user
|
|
<a href="#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</a>, then
|
|
these steps must be aborted.</li>
|
|
|
|
<li><p><a href="#unload-a-document" title="unload a document">Unload</a> the
|
|
<code><a href="#document">Document</a></code> object, with the <var title="">recycle</var>
|
|
parameter set to true.</li>
|
|
|
|
<li><p><a href="#abort-a-document" title="abort a document">Abort</a> the
|
|
<code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li><p>Unregister all event listeners registered on the
|
|
<code><a href="#document">Document</a></code> node and its descendants.</p>
|
|
|
|
<li><p>Remove any <a href="#concept-task" title="concept-task">tasks</a>
|
|
associated with the <code><a href="#document">Document</a></code> in any <a href="#task-source">task
|
|
source</a>.</li>
|
|
<li><p>Remove all child nodes of the document, without firing any
|
|
mutation events.</li>
|
|
<li><p>Replace the <code><a href="#document">Document</a></code>'s singleton objects with
|
|
new instances of those objects. (This includes in particular the
|
|
<code><a href="#window">Window</a></code>, <code><a href="#location">Location</a></code>, <code><a href="#history-0">History</a></code>,
|
|
<code><a href="#applicationcache">ApplicationCache</a></code>,
|
|
and <code><a href="#navigator">Navigator</a></code>, objects, the various
|
|
<code><a href="#barprop">BarProp</a></code> objects, the two <code>Storage</code> objects,
|
|
the various <code><a href="#htmlcollection">HTMLCollection</a></code> objects, and objects
|
|
defined by other specifications, like <code>Selection</code>. It
|
|
also includes all the Web IDL prototypes in the JavaScript binding,
|
|
including the <code><a href="#document">Document</a></code> object's prototype.)</li>
|
|
|
|
|
|
|
|
|
|
<li><p>Change the <a href="#document-s-character-encoding">document's character encoding</a> to
|
|
UTF-8.</li>
|
|
|
|
<li><p>Set the <code><a href="#document">Document</a></code> object's <a href="#reload-override-flag">reload override
|
|
flag</a> and set the <code><a href="#document">Document</a></code>'s <a href="#reload-override-buffer">reload
|
|
override buffer</a> to the empty string.</li>
|
|
|
|
<li><p>Change <a href="#the-document-s-address">the document's address</a> to the
|
|
<a href="#entry-script">entry script</a>'s <a href="#script-s-document" title="script's
|
|
document">document</a>'s <a href="#the-document-s-address" title="the document's
|
|
address">address</a>.</li>
|
|
|
|
<li><p>Create a new <a href="#html-parser">HTML parser</a> and associate it with
|
|
the document. This is a <dfn id="script-created-parser">script-created parser</dfn> (meaning
|
|
that it can be closed by the <code title="dom-document-open"><a href="#dom-document-open">document.open()</a></code> and <code title="dom-document-close"><a href="#dom-document-close">document.close()</a></code> methods, and
|
|
that the tokenizer will wait for an explicit call to <code title="dom-document-close"><a href="#dom-document-close">document.close()</a></code> before emitting
|
|
an end-of-file token). The encoding <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> is
|
|
<i>irrelevant</i>.</li>
|
|
|
|
<li><p>Set the <a href="#current-document-readiness">current document readiness</a> of the
|
|
document to "loading".</li>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<p>If the <var title="">type</var> string contains a U+003B
|
|
SEMICOLON character (;), remove the first such character and all
|
|
characters from it up to the end of the string.</p>
|
|
|
|
<p>Strip all leading and trailing <a href="#space-character" title="space
|
|
character">space characters</a> from <var title="">type</var>.</p>
|
|
|
|
<p>If <var title="">type</var> is <em>not</em> now an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string
|
|
"<code><a href="#text-html">text/html</a></code>", then act as if the tokenizer had emitted
|
|
a start tag token with the tag name "pre" followed by a single
|
|
U+000A LINE FEED (LF) character, then
|
|
switch the <a href="#html-parser">HTML parser</a>'s tokenizer to the
|
|
<a href="#plaintext-state">PLAINTEXT state</a>.</p>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Remove all the entries in the <a href="#browsing-context">browsing context</a>'s
|
|
<a href="#session-history">session history</a> after the <a href="#current-entry">current
|
|
entry</a>. If the <a href="#current-entry">current entry</a> is the last entry
|
|
in the session history, then no entries are removed.</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>Remove any <a href="#concept-task" title="concept-task">tasks</a> queued by
|
|
the <a href="#history-traversal-task-source">history traversal task source</a>.</li>
|
|
|
|
<li>Remove any earlier entries that share the same
|
|
<code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li><p>If <var title="">replace</var> is false, then add a new
|
|
entry, just before the last entry, and associate with the new entry
|
|
the text that was parsed by the previous parser associated with the
|
|
<code><a href="#document">Document</a></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="#dom-document-open">document.open()</a></code> call.
|
|
This new entry does not have a <code><a href="#document">Document</a></code> object, so a
|
|
new one will be created if the session history is traversed to that
|
|
entry.</li>
|
|
|
|
<li><p>Finally, set the <a href="#insertion-point">insertion point</a> to point at
|
|
just before the end of the <a href="#the-input-stream">input stream</a> (which at this
|
|
point will be empty).</li>
|
|
|
|
<li><p>Return the <code><a href="#document">Document</a></code> on which the method was
|
|
invoked.</li>
|
|
|
|
</ol><p>When called with three or more arguments, the <code title="dom-document-open"><a href="#dom-document-open">open()</a></code> method on the
|
|
<code><a href="#htmldocument">HTMLDocument</a></code> object must call the <code title="dom-open"><a href="#dom-open">open()</a></code> method on the <code><a href="#window">Window</a></code>
|
|
object 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="#dom-document-open">open()</a></code> method, and return whatever
|
|
that method returned. If the <code><a href="#htmldocument">HTMLDocument</a></code> object has no
|
|
<code><a href="#window">Window</a></code> object, then the method must raise an
|
|
<code><a href="#invalid_access_err">INVALID_ACCESS_ERR</a></code> exception.</p>
|
|
|
|
</div><h4 id="closing-the-input-stream"><span class="secno">3.5.2 </span>Closing the input stream</h4><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-close"><a href="#dom-document-close">close</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Closes the input stream that was opened by the <code title="dom-document-open"><a href="#dom-document-open">document.open()</a></code> method.</p>
|
|
|
|
<p>Throws an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception if the
|
|
<code><a href="#document">Document</a></code> is an <a href="#xml-documents" title="XML documents">XML
|
|
document</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-close" title="dom-document-close"><code>close()</code></dfn>
|
|
method must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#document">Document</a></code> object is not flagged as an
|
|
<a href="#html-documents" title="HTML documents">HTML document</a>, throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If there is no <a href="#script-created-parser">script-created parser</a> associated
|
|
with the document, then abort these steps.</li>
|
|
|
|
<li><p>Insert an <a href="#explicit-eof-character">explicit "EOF" character</a> at the end
|
|
of the parser's <a href="#the-input-stream">input stream</a>.</li>
|
|
|
|
<li><p>If there is a <a href="#pending-parsing-blocking-script">pending parsing-blocking script</a>,
|
|
then abort these steps.</li>
|
|
|
|
<li><p>Run the tokenizer, processing resulting tokens as they are
|
|
emitted, and stopping when the tokenizer reaches the <a href="#explicit-eof-character">explicit
|
|
"EOF" character</a> or <a href="#spin-the-event-loop" title="spin the event loop">spins
|
|
the event loop</a>.</li>
|
|
|
|
</ol></div><h4 id="document.write"><span class="secno">3.5.3 </span><code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code></h4><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-write"><a href="#dom-document-write">write</a></code>(<var title="">text</var>...)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>In general, adds the given string(s) to the
|
|
<code><a href="#document">Document</a></code>'s input stream.</p>
|
|
|
|
<p class="warning">This method has very idiosyncratic behavior. In
|
|
some cases, this method can affect the state of the <a href="#html-parser">HTML
|
|
parser</a> while the parser is running, resulting in a DOM that
|
|
does not correspond to the source of the document. In other cases,
|
|
the call can clear the current page first, as if <code title="dom-document-open"><a href="#dom-document-open">document.open()</a></code> had been called.
|
|
In yet more cases, the method is simply ignored, or throws an
|
|
exception. To make matters worse, the exact behavior of this
|
|
method can in some cases be dependent on network latency, which
|
|
can lead to failures that are very hard to debug. <strong>For all
|
|
these reasons, use of this method is strongly
|
|
discouraged.</strong></p>
|
|
|
|
<p>This method throws an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception
|
|
when invoked on <a href="#xml-documents">XML documents</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p><code><a href="#document">Document</a></code> objects have an
|
|
<dfn id="ignore-destructive-writes-counter">ignore-destructive-writes counter</dfn>, which is used in
|
|
conjunction with the processing of <code><a href="#the-script-element">script</a></code> elements to
|
|
prevent external scripts from being able to use <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code> to blow away the
|
|
document by implicitly calling <code title="dom-document-open"><a href="#dom-document-open">document.open()</a></code>. Initially, the
|
|
counter must be set to zero.</p>
|
|
|
|
<p>The <dfn id="dom-document-write" title="dom-document-write"><code>document.write(...)</code></dfn>
|
|
method must act as follows:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the method was invoked on an <a href="#xml-documents" title="XML documents">XML
|
|
document</a>, throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code>
|
|
exception and abort these steps.</p>
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#insertion-point">insertion point</a> is undefined and the
|
|
<code><a href="#document">Document</a></code>'s <a href="#ignore-destructive-writes-counter">ignore-destructive-writes
|
|
counter</a> is greater than zero, then abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#insertion-point">insertion point</a> is undefined, call the
|
|
<code title="dom-document-open"><a href="#dom-document-open">open()</a></code> method on the <code title="Document"><a href="#document">document</a></code> object (with no arguments). If
|
|
the user <a href="#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be
|
|
unloaded</a>, then abort these steps. Otherwise, the
|
|
<a href="#insertion-point">insertion point</a> will point at just before the end of
|
|
the (empty) <a href="#the-input-stream">input stream</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Insert the string consisting of the concatenation of all the
|
|
arguments to the method into the <a href="#the-input-stream">input stream</a> just
|
|
before the <a href="#insertion-point">insertion point</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <code><a href="#document">Document</a></code> object's <a href="#reload-override-flag">reload override
|
|
flag</a> is set, then append the string consisting of the
|
|
concatenation of all the arguments to the method to the
|
|
<code><a href="#document">Document</a></code>'s <a href="#reload-override-buffer">reload override buffer</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is no <a href="#pending-parsing-blocking-script">pending parsing-blocking script</a>,
|
|
have the tokenizer process the characters that were inserted, one
|
|
at a time, processing resulting tokens as they are emitted, and
|
|
stopping when the tokenizer reaches the insertion point or when
|
|
the processing of the tokenizer is aborted by the tree
|
|
construction stage (this can happen if a <code><a href="#the-script-element">script</a></code> end
|
|
tag token is emitted by the tokenizer).
|
|
|
|
<p class="note">If the <code title="dom-document-write"><a href="#dom-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="#the-script-element">script</a></code> tags), then this is a
|
|
<a href="#nestedParsing">reentrant invocation of the
|
|
parser</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Finally, return from the method.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><h4 id="document.writeln"><span class="secno">3.5.4 </span><code title="dom-document-writeln"><a href="#dom-document-writeln">document.writeln()</a></code></h4><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-writeln"><a href="#dom-document-writeln">writeln</a></code>(<var title="">text</var>...)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Adds the given string(s) to the <code><a href="#document">Document</a></code>'s input
|
|
stream, followed by a newline character. If necessary, calls the
|
|
<code title="dom-document-open"><a href="#dom-document-open">open()</a></code> method implicitly
|
|
first.</p>
|
|
|
|
<p>This method throws an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception
|
|
when invoked on <a href="#xml-documents">XML documents</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-writeln" title="dom-document-writeln"><code>document.writeln(...)</code></dfn>
|
|
method, when invoked, must act as if the <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code> method had been
|
|
invoked with the same argument(s), plus an extra argument consisting
|
|
of a string containing a single line feed character (U+000A).</p>
|
|
|
|
</div><h4 id="innerhtml"><span class="secno">3.5.5 </span><code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code></h4><p>The <dfn id="dom-innerhtml" title="dom-innerHTML"><code>innerHTML</code></dfn> IDL
|
|
attribute represents the markup of the node's contents.<dl class="domintro"><dt><var title="">document</var> . <code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a fragment of HTML or XML that represents the
|
|
<code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p>Can be set, to replace the <code><a href="#document">Document</a></code>'s contents
|
|
with the result of parsing the given string.</p>
|
|
|
|
<p>In the case of <a href="#xml-documents">XML documents</a>, will throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> if the <code><a href="#document">Document</a></code> cannot
|
|
be serialized to XML, and a <code><a href="#syntax_err">SYNTAX_ERR</a></code> if the given
|
|
string is not well-formed.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a fragment of HTML or XML that represents the element's
|
|
contents.</p>
|
|
|
|
<p>Can be set, to replace the contents of the element with nodes
|
|
parsed from the given string.</p>
|
|
|
|
<p>In the case of <a href="#xml-documents">XML documents</a>, will throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> if the element cannot be serialized
|
|
to XML, and a <code><a href="#syntax_err">SYNTAX_ERR</a></code> if the given string is not
|
|
well-formed.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>On getting, if the node's document is an <a href="#html-documents" title="HTML
|
|
documents">HTML document</a>, then the attribute must return the
|
|
result of running the <a href="#html-fragment-serialization-algorithm">HTML fragment serialization
|
|
algorithm</a> on the node; otherwise, the node's document is an
|
|
<a href="#xml-documents" title="XML documents">XML document</a>, and the attribute
|
|
must return the result of running the <a href="#xml-fragment-serialization-algorithm">XML fragment
|
|
serialization algorithm</a> on the node instead (this might raise
|
|
an exception instead of returning a string).</p>
|
|
|
|
<p>On setting, the following steps must be run:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the node's document is an <a href="#html-documents" title="HTML documents">HTML
|
|
document</a>: Invoke the <a href="#html-fragment-parsing-algorithm">HTML fragment parsing
|
|
algorithm</a>.</p>
|
|
|
|
<p>If the node's document is an <a href="#xml-documents" title="XML documents">XML
|
|
document</a>: Invoke the <a href="#xml-fragment-parsing-algorithm">XML fragment parsing
|
|
algorithm</a>.</p>
|
|
|
|
<p>In either case, the algorithm must be invoked with the string
|
|
being assigned into the <code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code> attribute as the <var title="">input</var>. If the node is an <code><a href="#element">Element</a></code>
|
|
node, then, in addition, that element must be passed as the <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element.</p>
|
|
|
|
<p>If this raises an exception, then abort these steps.</p>
|
|
|
|
<p>Otherwise, let <var title="">new children</var> be the nodes
|
|
returned.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the attribute is being set on a <code><a href="#document">Document</a></code> node,
|
|
and that document has an <a href="#active-parser">active parser</a>, then abort
|
|
that parser.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Remove the child nodes of the node whose <code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code> attribute is being set,
|
|
firing appropriate mutation events.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the attribute is being set on a <code><a href="#document">Document</a></code> node,
|
|
let <var title="">target document</var> be that
|
|
<code><a href="#document">Document</a></code> node. Otherwise, the attribute is being set
|
|
on an <code><a href="#element">Element</a></code> node; let <var title="">target
|
|
document</var> be the <code title="dom-Node-ownerDocument"><a href="#dom-node-ownerdocument">ownerDocument</a></code> of that
|
|
<code><a href="#element">Element</a></code>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the <code title="dom-Node-ownerDocument"><a href="#dom-node-ownerdocument">ownerDocument</a></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"><a href="#dom-innerhtml">innerHTML</a></code> attribute
|
|
is being set, preserving their order, and firing mutation events
|
|
as if a <code><a href="#documentfragment">DocumentFragment</a></code> containing the <var title="">new children</var> had been inserted.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><h4 id="outerhtml"><span class="secno">3.5.6 </span><code title="dom-outerHTML"><a href="#dom-outerhtml">outerHTML</a></code></h4><p>The <dfn id="dom-outerhtml" title="dom-outerHTML"><code>outerHTML</code></dfn> IDL
|
|
attribute represents the markup of the element and its contents.<dl class="domintro"><dt><var title="">element</var> . <code title="dom-outerHTML"><a href="#dom-outerhtml">outerHTML</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a fragment of HTML or XML that represents the element
|
|
and its contents.</p>
|
|
|
|
<p>Can be set, to replace the element with nodes parsed from the
|
|
given string.</p>
|
|
|
|
<p>In the case of <a href="#xml-documents">XML documents</a>, will throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> if the element cannot be serialized
|
|
to XML, and a <code><a href="#syntax_err">SYNTAX_ERR</a></code> if the given string is not
|
|
well-formed.</p>
|
|
|
|
<p>Throws a <code><a href="#no_modification_allowed_err">NO_MODIFICATION_ALLOWED_ERR</a></code> exception if
|
|
the parent of the element is the <code><a href="#document">Document</a></code>
|
|
node.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>On getting, if the node's document is an <a href="#html-documents" title="HTML
|
|
documents">HTML document</a>, then the attribute must return the
|
|
result of running the <a href="#html-fragment-serialization-algorithm">HTML fragment serialization
|
|
algorithm</a> on a fictional node whose only child is the node on
|
|
which the attribute was invoked; otherwise, the node's document is
|
|
an <a href="#xml-documents" title="XML documents">XML document</a>, and the
|
|
attribute must return the result of running the <a href="#xml-fragment-serialization-algorithm">XML fragment
|
|
serialization algorithm</a> on that fictional node instead (this
|
|
might raise an exception instead of returning a string).</p>
|
|
|
|
<p>On setting, the following steps must be run:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">target</var> be the element whose <code title="dom-outerHTML"><a href="#dom-outerhtml">outerHTML</a></code> attribute is being
|
|
set.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">target</var> has no parent node, then abort
|
|
these steps. There would be no way to obtain a reference to the
|
|
nodes created even if the remaining steps were run.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">target</var>'s parent node is a
|
|
<code><a href="#document">Document</a></code> object, throw a
|
|
<code><a href="#no_modification_allowed_err">NO_MODIFICATION_ALLOWED_ERR</a></code> exception and abort these
|
|
steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">parent</var> be <var title="">target</var>'s
|
|
parent node, unless that is a <code><a href="#documentfragment">DocumentFragment</a></code> node,
|
|
in which case let <var title="">parent</var> be an arbitrary
|
|
<code><a href="#the-body-element">body</a></code> element.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">target</var>'s document is an <a href="#html-documents" title="HTML documents">HTML document</a>: Invoke the <a href="#html-fragment-parsing-algorithm">HTML
|
|
fragment parsing algorithm</a>.</p>
|
|
|
|
<p>If <var title="">target</var>'s document is an <a href="#xml-documents" title="XML
|
|
documents">XML document</a>: Invoke the <a href="#xml-fragment-parsing-algorithm">XML fragment
|
|
parsing algorithm</a>.</p>
|
|
|
|
<p>In either case, the algorithm must be invoked with the string
|
|
being assigned into the <code title="dom-outerHTML"><a href="#dom-outerhtml">outerHTML</a></code> attribute as the <var title="">input</var>, and <var title="">parent</var> as the <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element.</p>
|
|
|
|
<p>If this raises an exception, then abort these steps.</p>
|
|
|
|
<p>Otherwise, let <var title="">new children</var> be the nodes
|
|
returned.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the <code title="dom-Node-ownerDocument"><a href="#dom-node-ownerdocument">ownerDocument</a></code> of all the
|
|
nodes in <var title="">new children</var> to <var title="">target</var>'s document.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Remove <var title="">target</var> from its parent node, firing
|
|
mutation events as appropriate, and then insert in its place all
|
|
the <var title="">new children</var> nodes, preserving their
|
|
order, and again firing mutation events as if a
|
|
<code><a href="#documentfragment">DocumentFragment</a></code> containing the <var title="">new
|
|
children</var> had been inserted.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><h4 id="insertadjacenthtml"><span class="secno">3.5.7 </span><code title="dom-insertAdjacentHTML"><a href="#dom-insertadjacenthtml">insertAdjacentHTML()</a></code></h4><dl class="domintro"><dt><var title="">element</var> . <code title="dom-insertAdjacentHTML"><a href="#dom-insertadjacenthtml">insertAdjacentHTML</a></code>(<var title="">position</var>, <var title="">text</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Parses the given string <var title="">text</var> as HTML or XML
|
|
and inserts the resulting nodes into the tree in the position
|
|
given by the <var title="">position</var> argument, as
|
|
follows:</p>
|
|
|
|
<dl><dt>"beforebegin"</dt>
|
|
<dd>Before the element itself.</dd>
|
|
<dt>"afterbegin"</dt>
|
|
<dd>Just inside the element, before its first child.</dd>
|
|
<dt>"beforeend"</dt>
|
|
<dd>Just inside the element, after its last child.</dd>
|
|
<dt>"afterend"</dt>
|
|
<dd>After the element itself.</dd>
|
|
</dl><p>Throws a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception if the arguments
|
|
have invalid values (e.g., in the case of <a href="#xml-documents">XML
|
|
documents</a>, if the given string is not well-formed).</p>
|
|
|
|
<p>Throws a <code><a href="#no_modification_allowed_err">NO_MODIFICATION_ALLOWED_ERR</a></code> exception if
|
|
the given position isn't possible (e.g. inserting elements after
|
|
the root element of a <code><a href="#document">Document</a></code>).</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-insertadjacenthtml" title="dom-insertAdjacentHTML"><code>insertAdjacentHTML(<var title="">position</var>, <var title="">text</var>)</code></dfn>
|
|
method, when invoked, must run the following algorithm:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">position</var> and <var title="">text</var>
|
|
be the method's first and second arguments, respectively.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">target</var> be the element on which the
|
|
method was invoked.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Use the first matching item from this list:</p>
|
|
|
|
<dl><dt>If <var title="">position</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "beforebegin"</dt>
|
|
<dt>If <var title="">position</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "afterend"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If <var title="">target</var> has no parent node, then abort
|
|
these steps.</p>
|
|
|
|
<p>If <var title="">target</var>'s parent node is a
|
|
<code><a href="#document">Document</a></code> object, then throw a
|
|
<code><a href="#no_modification_allowed_err">NO_MODIFICATION_ALLOWED_ERR</a></code> exception and abort
|
|
these steps.
|
|
|
|
<p>Otherwise, let <var title="">destination</var> be the parent node
|
|
of <var title="">target</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">position</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "afterbegin"</dt>
|
|
<dt>If <var title="">position</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "beforeend"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Let <var title="">destination</var> be the same as <var title="">target</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Throw a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">target</var>'s document is an <a href="#html-documents" title="HTML documents">HTML document</a>: Invoke the <a href="#html-fragment-parsing-algorithm">HTML
|
|
fragment parsing algorithm</a>.</p>
|
|
|
|
<p>If <var title="">target</var>'s document is an <a href="#xml-documents" title="XML
|
|
documents">XML document</a>: Invoke the <a href="#xml-fragment-parsing-algorithm">XML fragment
|
|
parsing algorithm</a>.</p>
|
|
|
|
<p>In either case, the algorithm must be invoked with <var title="">text</var> as the <var title="">input</var>, and <var title="">destination</var> as the <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element.</p>
|
|
|
|
<p>If this raises an exception, then abort these steps.</p>
|
|
|
|
<p>Otherwise, let <var title="">new children</var> be the nodes
|
|
returned.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the <code title="dom-Node-ownerDocument"><a href="#dom-node-ownerdocument">ownerDocument</a></code> of all the
|
|
nodes in <var title="">new children</var> to <var title="">target</var>'s document.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Use the first matching item from this list:</p>
|
|
|
|
<dl><dt>If <var title="">position</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "beforebegin"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Insert all the <var title="">new children</var> nodes
|
|
immediately before <var title="">target</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">position</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "afterbegin"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Insert all the <var title="">new children</var> nodes before
|
|
the first child of <var title="">target</var>, if there is
|
|
one. If there is no such child, append them all to <var title="">target</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">position</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "beforeend"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Append all the <var title="">new children</var> nodes to <var title="">target</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">position</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "afterend"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Insert all the <var title="">new children</var> nodes
|
|
immediately after <var title="">target</var>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The <var title="">new children</var> nodes must be inserted in
|
|
a manner that preserves their order and fires mutation events as
|
|
if a <code><a href="#documentfragment">DocumentFragment</a></code> containing the <var title="">new children</var> had been inserted.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><h2 id="semantics"><span class="secno">4 </span>The elements of HTML</h2><h3 id="the-root-element"><span class="secno">4.1 </span>The root element</h3><h4 id="the-html-element"><span class="secno">4.1.1 </span>The <dfn><code>html</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can 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="#the-head-element">head</a></code> element followed by a <code><a href="#the-body-element">body</a></code> element.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlhtmlelement">HTMLHtmlElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-html-element">html</a></code> element <a href="#represents">represents</a> the root of
|
|
an HTML document.<p>The <dfn id="attr-html-manifest" title="attr-html-manifest"><code>manifest</code></dfn>
|
|
attribute gives the address of the document's <a href="#application-cache">application
|
|
cache</a> <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a>, if there is
|
|
one. If the attribute is present, the attribute's value must be a
|
|
<a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</a>.<p>The <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attribute
|
|
only <a href="#concept-appcache-init" title="concept-appcache-init">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).<p class="note">For the purposes of <a href="#concept-appcache-init" title="concept-appcache-init">application cache selection</a>,
|
|
later <code><a href="#the-base-element">base</a></code> elements cannot affect the <a href="#resolve-a-url" title="resolve a url">resolving of relative URLs</a> in <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attributes, as the
|
|
attributes are processed before those elements are seen.<p class="note">The <code title="dom-applicationCache"><a href="#dom-applicationcache">window.applicationCache</a></code> IDL
|
|
attribute provides scripted access to the offline <a href="#application-cache">application
|
|
cache</a> mechanism.<div class="example">
|
|
|
|
<p>The <code><a href="#the-html-element">html</a></code> element in the following example declares
|
|
that the document's language is English.</p>
|
|
|
|
<pre><!DOCTYPE html>
|
|
<strong><html lang="en"></strong>
|
|
<head>
|
|
<title>Swapping Songs</title>
|
|
</head>
|
|
<body>
|
|
<h1>Swapping Songs</h1>
|
|
<p>Tonight I swapped some of the songs I wrote with some friends, who
|
|
gave me some of the songs they wrote. I love sharing my music.</p>
|
|
</body>
|
|
<strong></html></strong></pre>
|
|
|
|
</div><h3 id="document-metadata"><span class="secno">4.2 </span>Document metadata</h3><h4 id="the-head-element"><span class="secno">4.2.1 </span>The <dfn><code>head</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As the first element in an <code><a href="#the-html-element">html</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>If the document is <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a> or if title information is available from a higher-level protocol: Zero or more elements of <a href="#metadata-content">metadata content</a>.</dd>
|
|
<dd>Otherwise: One or more elements of <a href="#metadata-content">metadata content</a>, of which exactly one is a <code><a href="#the-title-element">title</a></code> element.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlheadelement">HTMLHeadElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-head-element">head</a></code> element <a href="#represents">represents</a> a
|
|
collection of metadata for the <code><a href="#document">Document</a></code>.<div class="example">
|
|
|
|
<p>The collection of metadata in a <code><a href="#the-head-element">head</a></code> element can be
|
|
large or small. Here is an example of a very short one:</p>
|
|
|
|
<pre><!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>A document with a short head</title>
|
|
</head>
|
|
<body>
|
|
...</pre>
|
|
|
|
<p>Here is an example of a longer one:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<HTML>
|
|
<HEAD>
|
|
<META CHARSET="UTF-8">
|
|
<BASE HREF="http://www.example.com/">
|
|
<TITLE>An application with a long head</TITLE>
|
|
<LINK REL="STYLESHEET" HREF="default.css">
|
|
<LINK REL="STYLESHEET ALTERNATE" HREF="big.css" TITLE="Big Text">
|
|
<SCRIPT SRC="support.js"></SCRIPT>
|
|
<META NAME="APPLICATION-NAME" CONTENT="Long headed application">
|
|
</HEAD>
|
|
<BODY>
|
|
...</pre>
|
|
|
|
</div><p class="note">The <code><a href="#the-title-element">title</a></code> element is a required child
|
|
in most situations, but when a higher-level protocol provides title
|
|
information, e.g. in the Subject line of an e-mail when HTML is used
|
|
as an e-mail authoring format, the <code><a href="#the-title-element">title</a></code> element can be
|
|
omitted.<h4 id="the-title-element"><span class="secno">4.2.2 </span>The <dfn><code>title</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#metadata-content">Metadata content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>In a <code><a href="#the-head-element">head</a></code> element containing no other <code><a href="#the-title-element">title</a></code> elements.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#text-content" title="text content">Text</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmltitleelement">HTMLTitleElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-title-text" title="dom-title-text">text</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-title-element">title</a></code> element <a href="#represents">represents</a> 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 heading, since the
|
|
first heading does not have to stand alone when taken out of
|
|
context.<p>There must be no more than one <code><a href="#the-title-element">title</a></code> element per
|
|
document.<dl class="domintro"><dt><var title="">title</var> . <code title="dom-title-text"><a href="#dom-title-text">text</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the contents of the element, ignoring child nodes that
|
|
aren't <a href="#text-node" title="text node">text nodes</a>.</p>
|
|
|
|
<p>Can be set, to replace the element's children with the given
|
|
value.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The IDL attribute <dfn id="dom-title-text" title="dom-title-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="#the-title-element">title</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> IDL attribute.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here are some examples of appropriate titles, contrasted with
|
|
the top-level headings 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
|
|
heading assumes the reader knows 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> IDL attribute.<div class="impl">
|
|
|
|
<p>User agents should use the document's title when referring to the
|
|
document in their user interface. When the contents of a
|
|
<code><a href="#the-title-element">title</a></code> element are used in this way, <a href="#the-directionality">the
|
|
directionality</a> of that <code><a href="#the-title-element">title</a></code> element should be
|
|
used to set the directionality of the document's title in the user
|
|
interface.</p>
|
|
|
|
</div><h4 id="the-base-element"><span class="secno">4.2.3 </span>The <dfn><code>base</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#metadata-content">Metadata content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>In a <code><a href="#the-head-element">head</a></code> element containing no other <code><a href="#the-base-element">base</a></code> elements.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-base-href"><a href="#attr-base-href">href</a></code></dd>
|
|
<dd><code title="attr-base-target"><a href="#attr-base-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="#dom-base-href" title="dom-base-href">href</a>;
|
|
attribute DOMString <a href="#dom-base-target" title="dom-base-target">target</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-base-element">base</a></code> element allows authors to specify the
|
|
<a href="#document-base-url">document base URL</a> for the purposes of <a href="#resolve-a-url" title="resolve a url">resolving relative URLs</a>, and the name
|
|
of the default <a href="#browsing-context">browsing context</a> for the purposes of
|
|
<a href="#following-hyperlinks">following hyperlinks</a>. The element does not <a href="#represents" title="represents">represent</a> any content beyond this
|
|
information.<p>There must be no more than one <code><a href="#the-base-element">base</a></code> element per
|
|
document.<p>A <code><a href="#the-base-element">base</a></code> element must have either an <code title="attr-base-href"><a href="#attr-base-href">href</a></code> attribute, a <code title="attr-base-target"><a href="#attr-base-target">target</a></code> attribute, or both.<p>The <dfn id="attr-base-href" title="attr-base-href"><code>href</code></dfn> content
|
|
attribute, if specified, must contain a <a href="#valid-url-potentially-surrounded-by-spaces">valid URL potentially
|
|
surrounded by spaces</a>.<p>A <code><a href="#the-base-element">base</a></code> element, if it has an <code title="attr-base-href"><a href="#attr-base-href">href</a></code> attribute, must come before any
|
|
other elements in the tree that have attributes defined as taking
|
|
<a href="#url" title="URL">URLs</a>, except the <code><a href="#the-html-element">html</a></code> element
|
|
(its <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attribute
|
|
isn't affected by <code><a href="#the-base-element">base</a></code> elements).<div class="impl">
|
|
|
|
<p class="note">If there are multiple <code><a href="#the-base-element">base</a></code> elements
|
|
with <code title="attr-base-href"><a href="#attr-base-href">href</a></code> attributes, all but the
|
|
first are ignored.</p>
|
|
|
|
</div><p>The <dfn id="attr-base-target" title="attr-base-target"><code>target</code></dfn>
|
|
attribute, if specified, must contain a <a href="#valid-browsing-context-name-or-keyword">valid browsing context
|
|
name or keyword</a>, which specifies which <a href="#browsing-context">browsing
|
|
context</a> is to be used as the default when <a href="#hyperlink" title="hyperlink">hyperlinks</a> and <a href="#the-form-element" title="form">forms</a> in the <code><a href="#document">Document</a></code> cause <a href="#navigate" title="navigate">navigation</a>.<p>A <code><a href="#the-base-element">base</a></code> element, if it has a <code title="attr-base-target"><a href="#attr-base-target">target</a></code> attribute, must come before
|
|
any elements in the tree that represent <a href="#hyperlink" title="hyperlink">hyperlinks</a>.<div class="impl">
|
|
|
|
<p class="note">If there are multiple <code><a href="#the-base-element">base</a></code> elements
|
|
with <code title="attr-base-target"><a href="#attr-base-target">target</a></code> attributes, all but
|
|
the first are ignored.</p>
|
|
|
|
<p>The <dfn id="dom-base-href" title="dom-base-href"><code>href</code></dfn> IDL
|
|
attribute, on getting, must return the page's <a href="#document-base-url">document base
|
|
URL</a>, and on setting, it must set the <code title="attr-base-href"><a href="#attr-base-href">href</a></code> content attribute to the given
|
|
new value.</p>
|
|
|
|
<p>The <dfn id="dom-base-target" title="dom-base-target"><code>target</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this example, a <code><a href="#the-base-element">base</a></code> element is used to set the
|
|
<a href="#document-base-url">document base URL</a>:</p>
|
|
|
|
<pre><!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>This is an example for the &lt;base&gt; element</title>
|
|
<base href="http://www.example.com/news/index.html">
|
|
</head>
|
|
<body>
|
|
<p>Visit the <a href="archives.html">archives</a>.</p>
|
|
</body>
|
|
</html></pre>
|
|
|
|
<p>The link in the above example would be a link to "<code title="">http://www.example.com/news/archives.html</code>".</p>
|
|
|
|
</div><h4 id="the-link-element"><span class="secno">4.2.4 </span>The <dfn><code>link</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#metadata-content">Metadata content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#metadata-content">metadata content</a> is expected.</dd>
|
|
<dd>In a <code><a href="#the-noscript-element">noscript</a></code> element that is a child of a <code><a href="#the-head-element">head</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-link-href"><a href="#attr-link-href">href</a></code></dd>
|
|
<dd><code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code></dd>
|
|
<dd><code title="attr-link-media"><a href="#attr-link-media">media</a></code></dd>
|
|
<dd><code title="attr-link-hreflang"><a href="#attr-link-hreflang">hreflang</a></code></dd>
|
|
<dd><code title="attr-link-type"><a href="#attr-link-type">type</a></code></dd>
|
|
<dd><code title="attr-link-sizes"><a href="#attr-link-sizes">sizes</a></code></dd>
|
|
<dd>Also, the <code title="attr-link-title"><a href="#attr-link-title">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="#dom-link-disabled" title="dom-link-disabled">disabled</a>;
|
|
attribute DOMString <a href="#dom-link-href" title="dom-link-href">href</a>;
|
|
attribute DOMString <a href="#dom-link-rel" title="dom-link-rel">rel</a>;
|
|
readonly attribute <a href="#domtokenlist">DOMTokenList</a> <a href="#dom-link-rellist" title="dom-link-relList">relList</a>;
|
|
attribute DOMString <a href="#dom-link-media" title="dom-link-media">media</a>;
|
|
attribute DOMString <a href="#dom-link-hreflang" title="dom-link-hreflang">hreflang</a>;
|
|
attribute DOMString <a href="#dom-link-type" title="dom-link-type">type</a>;
|
|
[PutForwards=<a href="#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</a>] readonly attribute <a href="#domsettabletokenlist">DOMSettableTokenList</a> <a href="#dom-link-sizes" title="dom-link-sizes">sizes</a>;
|
|
};
|
|
<a href="#htmllinkelement">HTMLLinkElement</a> implements <span>LinkStyle</span>;</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-link-element">link</a></code> element allows authors to link their
|
|
document to other resources.<p>The destination of the link(s) is given by the <dfn id="attr-link-href" title="attr-link-href"><code>href</code></dfn> attribute, which must
|
|
be present and must contain a <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially
|
|
surrounded by spaces</a>. <span class="impl">If the <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute is absent, then the
|
|
element does not define a link.</span><p>A <code><a href="#the-link-element">link</a></code> element must have <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute.</p><p>The types of link indicated (the relationships) are given by the
|
|
value of the <dfn id="attr-link-rel" title="attr-link-rel"><code>rel</code></dfn>
|
|
attribute, which, if present, must have a value that is a <a href="#set-of-space-separated-tokens">set
|
|
of space-separated tokens</a>. The <a href="#linkTypes">allowed
|
|
keywords and their meanings</a> are defined in a later
|
|
section. <span class="impl">If the <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute is absent, has no
|
|
keywords, or if none of the keywords used are allowed according to
|
|
the definitions in this specification, then the element does not
|
|
create any links.</span><p>Two categories of links can be created using the
|
|
<code><a href="#the-link-element">link</a></code> element: <a href="#external-resource-link" title="external resource
|
|
link">Links to external resources</a> and <a href="#hyperlink" title="hyperlink">hyperlinks</a>. The <a href="#linkTypes">link
|
|
types section</a> defines whether a particular link type is an
|
|
external resource or a hyperlink. One <code><a href="#the-link-element">link</a></code> element can
|
|
create multiple links (of which some might be external resource
|
|
links and some might be hyperlinks); exactly which and how many
|
|
links are created depends on the keywords given in the <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute. User agents must process
|
|
the links on a per-link basis, not a per-element basis.<p class="note">Each link created for a <code><a href="#the-link-element">link</a></code> element is
|
|
handled separately. For instance, if there are two <code><a href="#the-link-element">link</a></code>
|
|
elements with <code title="">rel="stylesheet"</code>, they each
|
|
count as a separate external resource, and each is affected by its
|
|
own attributes independently. Similarly, if a single
|
|
<code><a href="#the-link-element">link</a></code> element has a <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute with the value <code title="">next stylesheet</code>, it creates both a
|
|
<a href="#hyperlink">hyperlink</a> (for the <code title="rel-next"><a href="#link-type-next">next</a></code>
|
|
keyword) and an <a href="#external-resource-link">external resource link</a> (for the <code title="rel-stylesheet"><a href="#link-type-stylesheet">stylesheet</a></code> keyword), and they are
|
|
affected by other attributes (such as <code title="attr-link-media"><a href="#attr-link-media">media</a></code> or <code title="attr-link-title"><a href="#attr-link-title">title</a></code>) differently.<p>The exact behavior 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).<div class="impl">
|
|
|
|
<p>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. To <dfn id="concept-link-obtain" title="concept-link-obtain">obtain the resource</dfn>, the user
|
|
agent must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute's
|
|
value is the empty string, then abort these steps.</li>
|
|
|
|
<li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the
|
|
<a href="#url">URL</a> given by the <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute, relative to the
|
|
element.</li>
|
|
|
|
<li><p>If the previous step fails, then abort these steps.</li>
|
|
|
|
<li><p><a href="#fetch">Fetch</a> the resulting <a href="#absolute-url">absolute
|
|
URL</a>.</li>
|
|
|
|
</ol><p>User agents may opt to only try to obtain such resources when
|
|
they are needed, instead of pro-actively <a href="#fetch" title="fetch">fetching</a> all the external resources that are
|
|
not applied.</p>
|
|
|
|
<p>The semantics of the protocol used (e.g. HTTP) must be followed
|
|
when fetching external resources. (For example, redirects will be
|
|
followed and 404 responses will cause the external resource to not
|
|
be applied.)</p>
|
|
|
|
|
|
<p>Once the attempts to obtain the resource and its <a href="#critical-subresources">critical
|
|
subresources</a> are complete, the user agent must, if the loads
|
|
were successful, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-load">load</code> at the
|
|
<code><a href="#the-link-element">link</a></code> element, or, if the resource or one of its
|
|
<a href="#critical-subresources">critical subresources</a> failed to completely load for any
|
|
reason (e.g. DNS error, HTTP 404 response, a connection being
|
|
prematurely closed, unsupported Content-Type), <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-error">error</code> at the <code><a href="#the-link-element">link</a></code>
|
|
element. Non-network errors in processing the resource or its
|
|
subresources (e.g. CSS parse errors, PNG decoding errors) are not
|
|
failures for the purposes of this paragraph.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <a href="#dom-manipulation-task-source">DOM manipulation task
|
|
source</a>.</p>
|
|
|
|
<p>The element must <a href="#delay-the-load-event">delay the load event</a> of the
|
|
element's document until all the attempts to obtain the resource and
|
|
its <a href="#critical-subresources">critical subresources</a> are complete. (Resources that
|
|
the user agent has not yet attempted to obtain, e.g. because it is
|
|
waiting for the resource to be needed, do not <a href="#delay-the-load-event">delay the load
|
|
event</a>.)</p>
|
|
|
|
<hr><p id="linkui">Interactive user agents may provide users with a
|
|
means to <a href="#following-hyperlinks" title="following hyperlinks">follow the
|
|
hyperlinks</a> created using the <code><a href="#the-link-element">link</a></code> element,
|
|
somewhere within their user interface. The exact interface is not
|
|
defined by this specification, but it could 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="#the-link-element">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="#attr-link-rel">rel</a></code> attribute)</li>
|
|
|
|
<li>The title of the resource (given by the <code title="attr-link-title"><a href="#attr-link-title">title</a></code> attribute).</li>
|
|
|
|
<li>The address of the resource (given by the <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute).</li>
|
|
|
|
<li>The language of the resource (given by the <code title="attr-link-hreflang"><a href="#attr-link-hreflang">hreflang</a></code> attribute).</li>
|
|
|
|
<li>The optimum media for the resource (given by the <code title="attr-link-media"><a href="#attr-link-media">media</a></code> attribute).</li>
|
|
|
|
</ul><p>User agents could also include other information, such as the
|
|
type of the resource (as given by the <code title="attr-link-type"><a href="#attr-link-type">type</a></code> attribute).</p>
|
|
|
|
</div><p class="note">Hyperlinks created with the <code><a href="#the-link-element">link</a></code>
|
|
element and its <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute
|
|
apply to the whole page. This contrasts with the <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code> attribute of <code><a href="#the-a-element">a</a></code>
|
|
and <code><a href="#the-area-element">area</a></code> elements, which indicates the type of a link
|
|
whose context is given by the link's location within the
|
|
document.<p>The <dfn id="attr-link-media" title="attr-link-media"><code>media</code></dfn>
|
|
attribute says which media the resource applies to. The value must
|
|
be a <a href="#valid-media-query">valid media query</a>.<div class="impl">
|
|
|
|
<p>If the link is a <a href="#hyperlink">hyperlink</a> then the <code title="attr-link-media"><a href="#attr-link-media">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="#external-resource-link">external resource link</a>,
|
|
then the <code title="attr-link-media"><a href="#attr-link-media">media</a></code> attribute is
|
|
prescriptive. The user agent must apply the external resource when
|
|
the <code title="attr-link-media"><a href="#attr-link-media">media</a></code> attribute's value
|
|
<a href="#matches-the-environment">matches the environment</a> and the other relevant
|
|
conditions apply, and must not apply it otherwise.</p>
|
|
<p class="note">The external resource might have further
|
|
restrictions defined within that limit its applicability. For
|
|
example, a CSS style sheet might have some <code title="">@media</code> blocks. This specification does not override
|
|
such further restrictions or requirements.</p>
|
|
</div><p id="default-media">The default, if the <code title="attr-link-media"><a href="#attr-link-media">media</a></code> attribute is omitted, is "<code title="">all</code>", meaning that by default links apply to all
|
|
media.<p>The <dfn id="attr-link-hreflang" title="attr-link-hreflang"><code>hreflang</code></dfn>
|
|
attribute on the <code><a href="#the-link-element">link</a></code> element has the same semantics as
|
|
the <a href="#attr-hyperlink-hreflang" title="attr-hyperlink-hreflang"><code>hreflang</code>
|
|
attribute on <code>a</code> and <code>area</code>
|
|
elements</a>.<p>The <dfn id="attr-link-type" title="attr-link-type"><code>type</code></dfn> attribute
|
|
gives the <a href="#mime-type">MIME type</a> of the linked resource. It is
|
|
purely advisory. The value must be a <a href="#valid-mime-type">valid MIME
|
|
type</a>.<p>For <a href="#external-resource-link" title="external resource link">external resource
|
|
links</a>, the <code title="attr-link-type"><a href="#attr-link-type">type</a></code> attribute
|
|
is used as a hint to user agents so that they can avoid fetching
|
|
resources they do not support. <span class="impl">If the attribute
|
|
is present, then the user agent must assume that the resource is of
|
|
the given type (even if that is not a <a href="#valid-mime-type">valid MIME type</a>,
|
|
e.g. the empty string). If the attribute is omitted, but the
|
|
external resource link type has a default type defined, then the
|
|
user agent must assume that the resource is of that type. If the UA
|
|
does not support the given <a href="#mime-type">MIME type</a> for the given link
|
|
relationship, then the UA should not <a href="#concept-link-obtain" title="concept-link-obtain">obtain</a> the resource; if the UA
|
|
does support the given <a href="#mime-type">MIME type</a> for the given link
|
|
relationship, then the UA should <a href="#concept-link-obtain" title="concept-link-obtain">obtain</a> the resource at the
|
|
appropriate time as specified for the <a href="#external-resource-link">external resource
|
|
link</a>'s particular type. If the attribute is omitted, and the
|
|
external resource link type does not have a default type defined,
|
|
but the user agent would <a href="#concept-link-obtain" title="concept-link-obtain">obtain</a> the resource if the type
|
|
was known and supported, then the user agent should <a href="#concept-link-obtain" title="concept-link-obtain">obtain</a> the resource under the
|
|
assumption that it will be supported.</span><div class="impl">
|
|
|
|
<p>User agents must not consider the <code title="attr-link-type"><a href="#attr-link-type">type</a></code> attribute authoritative —
|
|
upon fetching the resource, user agents must not use the <code title="attr-link-type"><a href="#attr-link-type">type</a></code> attribute to determine its actual
|
|
type. Only the actual type (as defined in the next paragraph) is
|
|
used to determine whether to <em>apply</em> the resource, not the
|
|
aforementioned assumed type.</p>
|
|
|
|
<p id="concept-link-type-sniffing">If the external resource link
|
|
type defines rules for processing the resource's <a href="#content-type" title="Content-Type">Content-Type metadata</a>, then those rules
|
|
apply. Otherwise, if the resource is expected to be an image, user
|
|
agents may apply the <a href="#content-type-sniffing:-image" title="Content-Type sniffing:
|
|
image">image sniffing rules</a>, with the <var title="">official
|
|
type</var> being the type determined from the resource's <a href="#content-type" title="Content-Type">Content-Type metadata</a>, and use the
|
|
resulting sniffed type of the resource as if it was the actual
|
|
type. Otherwise, if neither of these conditions apply or if the user
|
|
agent opts not to apply the image sniffing rules, then the user
|
|
agent must use the resource's <a href="#content-type" title="Content-Type">Content-Type metadata</a> to determine the
|
|
type of the resource. If there is no type metadata, but the external
|
|
resource link type has a default type defined, then the user agent
|
|
must assume that the resource is of that type.</p>
|
|
|
|
<p class="note">The <code title="rel-stylesheet"><a href="#link-type-stylesheet">stylesheet</a></code>
|
|
link type defines rules for processing the resource's <a href="#content-type" title="Content-Type">Content-Type metadata</a>.</p>
|
|
|
|
<p>Once the user agent has established the type of the resource, the
|
|
user agent must apply the resource if it is of a supported type and
|
|
the other relevant conditions apply, and must ignore the resource
|
|
otherwise.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>If a document contains style sheet links labeled as follows:</p>
|
|
|
|
<pre><link rel="stylesheet" href="A" type="text/plain">
|
|
<link rel="stylesheet" href="B" type="text/css">
|
|
<link rel="stylesheet" href="C"></pre>
|
|
|
|
<p>...then a compliant UA that supported only CSS style sheets
|
|
would fetch the B and C files, and skip the A file (since
|
|
<code>text/plain</code> is not the <a href="#mime-type">MIME type</a> for CSS style
|
|
sheets).</p>
|
|
|
|
<p>For files B and C, it would then check the actual types returned
|
|
by the server. For those that are sent as <code>text/css</code>, it
|
|
would apply the styles, but for those labeled as
|
|
<code>text/plain</code>, or any other type, it would not.</p>
|
|
|
|
<p>If one of the two files was returned without a
|
|
<a href="#content-type">Content-Type</a> metadata, or with a syntactically
|
|
incorrect type like <code title="">Content-Type: "null"</code>, then the default type
|
|
for <code title="rel-stylesheet"><a href="#link-type-stylesheet">stylesheet</a></code> links would kick
|
|
in. Since that default type is <code title="">text/css</code>, the
|
|
style sheet <em>would</em> nonetheless be applied.</p>
|
|
|
|
</div>
|
|
|
|
</div><p>The <dfn id="attr-link-title" 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="#attr-link-title">title</a></code>
|
|
attribute defines <span>alternative style sheet sets</span>.<p class="note">The <code title="attr-link-title"><a href="#attr-link-title">title</a></code>
|
|
attribute on <code><a href="#the-link-element">link</a></code> elements differs from the global
|
|
<code title="attr-title"><a href="#the-title-attribute">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>The <code title="attr-link-sizes"><a href="#attr-link-sizes">sizes</a></code> attribute is used
|
|
with the <code title="rel-icon"><a href="#rel-icon">icon</a></code> link type. The attribute
|
|
must not be specified on <code><a href="#the-link-element">link</a></code> elements that do not have
|
|
a <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute that specifies
|
|
the <code title="rel-icon"><a href="#rel-icon">icon</a></code> keyword.<div class="impl">
|
|
|
|
<p>HTTP <code title="">Link:</code> headers, if supported, must be
|
|
assumed to come before any links in the document, in the order that
|
|
they were given in the HTTP entity header. (URLs in these headers
|
|
are to be processed and resolved according to the rules given in the
|
|
relevant specification; the rules of <em>this</em> specification
|
|
don't apply.) <a href="#refsHTTP">[HTTP]</a> <a href="#refsWEBLINK">[WEBLINK]</a></p>
|
|
<p>The IDL attributes <dfn id="dom-link-href" title="dom-link-href"><code>href</code></dfn>, <dfn id="dom-link-rel" title="dom-link-rel"><code>rel</code></dfn>, <dfn id="dom-link-media" title="dom-link-media"><code>media</code></dfn>, <dfn id="dom-link-hreflang" title="dom-link-hreflang"><code>hreflang</code></dfn>, and <dfn id="dom-link-type" title="dom-link-type"><code>type</code></dfn>, and <dfn id="dom-link-sizes" title="dom-link-sizes"><code>sizes</code></dfn> each must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
<p>The IDL attribute <dfn id="dom-link-rellist" title="dom-link-rellist"><code>relList</code></dfn> <span class="impl">must</span> <a href="#reflect" title="reflect">reflect</a> the <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> content attribute.</p>
|
|
|
|
</div><p>The IDL attribute <dfn id="dom-link-disabled" title="dom-link-disabled"><code>disabled</code></dfn> only applies
|
|
to style sheet links. When the <code><a href="#the-link-element">link</a></code> element defines a
|
|
style sheet link, then the <code title="dom-link-disabled"><a href="#dom-link-disabled">disabled</a></code> attribute behaves as
|
|
defined <a href="#dom-linkstyle-disabled" title="dom-linkstyle-disabled">for the alternative
|
|
style sheets DOM</a>. For all other <code><a href="#the-link-element">link</a></code> elements it
|
|
always return false and does nothing on setting.</p><p>The <code>LinkStyle</code> interface is also implemented by
|
|
this element; the <a href="#styling">styling processing model</a> defines
|
|
how. <a href="#refsCSSOM">[CSSOM]</a><div class="example">
|
|
|
|
<p>Here, a set of <code><a href="#the-link-element">link</a></code> elements provide some style
|
|
sheets:</p>
|
|
|
|
<pre><!-- a persistent style sheet -->
|
|
<link rel="stylesheet" href="default.css">
|
|
|
|
<!-- the preferred alternate style sheet -->
|
|
<link rel="stylesheet" href="green.css" title="Green styles">
|
|
|
|
<!-- some alternate style sheets -->
|
|
<link rel="alternate stylesheet" href="contrast.css" title="High contrast">
|
|
<link rel="alternate stylesheet" href="big.css" title="Big fonts">
|
|
<link rel="alternate stylesheet" href="wide.css" title="Wide screen"></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows how you can specify versions of the
|
|
page that use alternative formats, are aimed at other languages,
|
|
and that are intended for other media:</p>
|
|
|
|
<pre><link rel=alternate href="/en/html" hreflang=en type=text/html title="English HTML">
|
|
<link rel=alternate href="/fr/html" hreflang=fr type=text/html title="French HTML">
|
|
<link rel=alternate href="/en/html/print" hreflang=en type=text/html media=print title="English HTML (for printing)">
|
|
<link rel=alternate href="/fr/html/print" hreflang=fr type=text/html media=print title="French HTML (for printing)">
|
|
<link rel=alternate href="/en/pdf" hreflang=en type=application/pdf title="English PDF">
|
|
<link rel=alternate href="/fr/pdf" hreflang=fr type=application/pdf title="French PDF"></pre>
|
|
|
|
</div><h4 id="the-meta-element"><span class="secno">4.2.5 </span>The <dfn id="meta"><code>meta</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#metadata-content">Metadata content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>If the <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute is present, or if the element's <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute is in the <a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration state</a>: in a <code><a href="#the-head-element">head</a></code> element.</dd>
|
|
<dd>If the <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute is present but not in the <a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration state</a>: in a <code><a href="#the-head-element">head</a></code> element.</dd>
|
|
<dd>If the <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute is present but not in the <a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration state</a>: in a <code><a href="#the-noscript-element">noscript</a></code> element that is a child of a <code><a href="#the-head-element">head</a></code> element.</dd>
|
|
<dd>If the <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute is present: where <a href="#metadata-content">metadata content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-meta-name"><a href="#attr-meta-name">name</a></code></dd>
|
|
<dd><code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code></dd>
|
|
<dd><code title="attr-meta-content"><a href="#attr-meta-content">content</a></code></dd>
|
|
<dd><code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlmetaelement">HTMLMetaElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-meta-name" title="dom-meta-name">name</a>;
|
|
attribute DOMString <a href="#dom-meta-httpequiv" title="dom-meta-httpEquiv">httpEquiv</a>;
|
|
attribute DOMString <a href="#dom-meta-content" title="dom-meta-content">content</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-meta-element">meta</a></code> element <a href="#represents">represents</a> various
|
|
kinds of metadata that cannot be expressed using the
|
|
<code><a href="#the-title-element">title</a></code>, <code><a href="#the-base-element">base</a></code>, <code><a href="#the-link-element">link</a></code>,
|
|
<code><a href="#the-style-element">style</a></code>, and <code><a href="#the-script-element">script</a></code> elements.<p>The <code><a href="#the-meta-element">meta</a></code> element can represent document-level
|
|
metadata with the <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code>
|
|
attribute, pragma directives with the <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute, and the
|
|
file's <a href="#character-encoding-declaration">character encoding declaration</a> when an HTML
|
|
document is serialized to string form (e.g. for transmission over
|
|
the network or for disk storage) with the <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute.<p>Exactly one of the <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code>,
|
|
<code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code>, and <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attributes must be
|
|
specified.<p>If either <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> or <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> is specified, then
|
|
the <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute must
|
|
also be specified. Otherwise, it must be omitted.</p><p>The <dfn id="attr-meta-charset" title="attr-meta-charset"><code>charset</code></dfn>
|
|
attribute specifies the character encoding used by the
|
|
document. This is a <a href="#character-encoding-declaration">character encoding declaration</a>. If
|
|
the attribute is present in an <a href="#xml-documents" title="XML documents">XML
|
|
document</a>, its value must be an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">UTF-8</code>" (and the document is therefore forced to use
|
|
UTF-8 as its encoding).<p class="note">The <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code>
|
|
attribute on the <code><a href="#the-meta-element">meta</a></code> element has no effect in XML
|
|
documents, and is only allowed in order to facilitate migration to
|
|
and from XHTML.<p>There must not be more than one <code><a href="#the-meta-element">meta</a></code> element with a
|
|
<code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute per
|
|
document.<p>The <dfn id="attr-meta-content" 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>If a <code><a href="#the-meta-element">meta</a></code> element has a <dfn id="attr-meta-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="#attr-meta-name">name</a></code>
|
|
attribute on the <code><a href="#the-meta-element">meta</a></code> element giving the name, and the
|
|
<code title="attr-meta-content"><a href="#attr-meta-content">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="#the-meta-element">meta</a></code> element
|
|
has no <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute,
|
|
then the value part of the metadata name/value pair is the empty
|
|
string.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-meta-name" title="dom-meta-name"><code>name</code></dfn> and <dfn id="dom-meta-content" title="dom-meta-content"><code>content</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name. The IDL attribute <dfn id="dom-meta-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="#attr-meta-http-equiv">http-equiv</a></code>.</p>
|
|
|
|
</div><h5 id="standard-metadata-names"><span class="secno">4.2.5.1 </span>Standard metadata names</h5><p>This specification defines a few names for the <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute of the
|
|
<code><a href="#the-meta-element">meta</a></code> element.<p>Names are case-insensitive<span class="impl">, and must be compared
|
|
in an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> manner</span>.<dl><dt><dfn id="meta-application-name" title="meta-application-name"><code>application-name</code></dfn></dt>
|
|
|
|
<dd><p>The value must be a short free-form string giving the name
|
|
of the Web application that the page represents. If the page is not
|
|
a Web application, the <code title="meta-application-name"><a href="#meta-application-name">application-name</a></code> metadata name
|
|
must not be used. There must not be more than one <code><a href="#the-meta-element">meta</a></code>
|
|
element with its <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute
|
|
set to the value <code title="meta-application-name"><a href="#meta-application-name">application-name</a></code> per
|
|
document. <span class="impl">User agents may use the application
|
|
name in UI in preference to the page's <code><a href="#the-title-element">title</a></code>, since
|
|
the 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.</span></dd>
|
|
|
|
<dt><dfn id="meta-author" title="meta-author"><code>author</code></dfn></dt>
|
|
|
|
<dd><p>The value must be a free-form string giving the name of one
|
|
of the page's authors.</dd>
|
|
|
|
<dt><dfn id="meta-description" title="meta-description"><code>description</code></dfn></dt>
|
|
|
|
<dd><p>The value must be a free-form string that describes the
|
|
page. The value must be appropriate for use in a directory of
|
|
pages, e.g. in a search engine. There must not be more than one
|
|
<code><a href="#the-meta-element">meta</a></code> element with its <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute set to the value <code title="meta-description"><a href="#meta-description">description</a></code> per document.</dd>
|
|
|
|
<dt><dfn id="meta-generator" title="meta-generator"><code>generator</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The value must be a free-form string that identifies one of the
|
|
software packages used to generate the document. This value must
|
|
not be used on hand-authored pages.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>Here is what a tool called "Frontweaver" could include in its
|
|
output, in the page's <code><a href="#the-head-element">head</a></code> element, to identify
|
|
itself as the tool used to generate the page:</p>
|
|
|
|
<pre><meta name=generator content="Frontweaver 8.2"></pre>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="meta-keywords" title="meta-keywords"><code>keywords</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The value must be a <a href="#set-of-comma-separated-tokens">set of comma-separated tokens</a>,
|
|
each of which is a keyword relevant to the page.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>This page about typefaces on British motorways uses a
|
|
<code><a href="#the-meta-element">meta</a></code> element to specify some keywords that users
|
|
might use to look for the page:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Typefaces on UK motorways</title>
|
|
<meta name="keywords" content="british,type face,font,fonts,highway,highways">
|
|
</head>
|
|
<body>
|
|
...</pre>
|
|
|
|
</div>
|
|
|
|
<p class="note">Many search engines do not consider such keywords,
|
|
because this feature has historically been used unreliably and
|
|
even misleadingly as a way to spam search engine results in a way
|
|
that is not helpful for users.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p>To obtain the list of keywords that the author has specified as
|
|
applicable to the page, the user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">keywords</var> be an empty
|
|
list.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each <code><a href="#the-meta-element">meta</a></code> element with a <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute and a <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute and whose
|
|
<code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute's value is
|
|
<code title="meta-keywords"><a href="#meta-keywords">keywords</a></code>, run the following
|
|
substeps:</p>
|
|
|
|
<ol><li><p><a href="#split-a-string-on-commas" title="split a string on commas">Split the value
|
|
of the element's <code title="attr-meta-content">content</code>
|
|
attribute on commas</a>.</li>
|
|
|
|
<li><p>Add the resulting tokens, if any, to <var title="">keywords</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Remove any duplicates from <var title="">keywords</var>.</li>
|
|
|
|
<li><p>Return <var title="">keywords</var>. This is the list of
|
|
keywords that the author has specified as applicable to the
|
|
page.</li>
|
|
|
|
</ol><p>User agents should not use this information when there is
|
|
insufficient confidence in the reliability of the value.</p>
|
|
|
|
<p class="example">For instance, it would be reasonable for a
|
|
content management system to use the keyword information of pages
|
|
within the system to populate the index of a site-specific search
|
|
engine, but a large-scale content aggregator that used this
|
|
information would likely find that certain users would try to game
|
|
its ranking mechanism through the use of inappropriate
|
|
keywords.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
</dl><h5 id="other-metadata-names"><span class="secno">4.2.5.2 </span>Other metadata names</h5><p><dfn id="concept-meta-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>. <a href="#refsWHATWGWIKI">[WHATWGWIKI]</a><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:<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).</dd>
|
|
|
|
|
|
<dt>Brief description</dt>
|
|
|
|
<dd><p>A short non-normative description of what the metadata
|
|
name's meaning is, including the format the value is required to be
|
|
in.</dd>
|
|
|
|
|
|
<dt>Specification</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. Anyone may remove synonyms that are not used in
|
|
practice; only names that need to be processed as synonyms for
|
|
compatibility with legacy content are to be registered in this
|
|
way.</dd>
|
|
|
|
|
|
<dt>Status</dt>
|
|
|
|
<dd>
|
|
|
|
<p>One of the following:</p>
|
|
|
|
<dl><dt>Proposed</dt>
|
|
|
|
<dd>The name has not received wide peer review and
|
|
approval. Someone has proposed it and is, or soon will be, using
|
|
it.</dd>
|
|
|
|
<dt>Ratified</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>Discontinued</dt>
|
|
|
|
<dd>The metadata name has received wide peer review and it has
|
|
been found wanting. Existing pages are using this metadata name,
|
|
but new pages should avoid it. The "brief description" and
|
|
"specification" entries will give details of what authors should
|
|
use instead, if anything.</dd>
|
|
|
|
</dl><p>If a metadata name is found to be redundant with existing
|
|
values, it should be removed and listed as a synonym for the
|
|
existing value.</p>
|
|
|
|
<p>If a metadata name is registered in the "proposed" state for a
|
|
period of a month or more without being used or specified, then it
|
|
may be removed from the registry.</p>
|
|
|
|
<p>If a metadata name is added with the "proposed" status and
|
|
found to be redundant with existing values, it should be removed
|
|
and listed as a synonym for the existing value. If a metadata name
|
|
is added with the "proposed" status and found to be harmful, then
|
|
it should be changed to "discontinued" status.</p>
|
|
|
|
<p>Anyone can change the status at any time, but should only do so
|
|
in accordance with the definitions above.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>Conformance checkers must use the information given on the WHATWG
|
|
Wiki MetaExtensions page to establish if a value is allowed or not:
|
|
values defined in this specification or marked as "proposed" or
|
|
"ratified" must be accepted, whereas values marked as "discontinued"
|
|
or not listed in either this specification or on the aforementioned
|
|
page must be rejected as invalid. Conformance checkers may cache
|
|
this information (e.g. for performance reasons or to avoid the use
|
|
of unreliable network connectivity).</p>
|
|
|
|
<p>When an author uses a new metadata name 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 "proposed" status.</p>
|
|
|
|
</div><p>Metadata names whose values are to be <a href="#url" title="URL">URLs</a> must not be proposed or accepted. Links must
|
|
be represented using the <code><a href="#the-link-element">link</a></code> element, not the
|
|
<code><a href="#the-meta-element">meta</a></code> element.<h5 id="pragma-directives"><span class="secno">4.2.5.3 </span>Pragma directives</h5><p>When the <dfn id="attr-meta-http-equiv" title="attr-meta-http-equiv"><code>http-equiv</code></dfn> attribute
|
|
is specified on a <code><a href="#the-meta-element">meta</a></code> element, the element is a pragma
|
|
directive.<p>The <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code>
|
|
attribute is an <a href="#enumerated-attribute">enumerated attribute</a>. The following
|
|
table lists the keywords defined for this attribute. The states
|
|
given in the first cell of the rows with keywords give the states to
|
|
which those keywords map. <span class="impl">Some of the keywords
|
|
are non-conforming, as noted in the last column.</span></p><table id="table-http-equiv"><thead><tr><th>State
|
|
<th>Keyword
|
|
<th>Notes
|
|
<tbody><tr class="impl"><td><a href="#attr-meta-http-equiv-content-language" title="attr-meta-http-equiv-content-language">Content Language</a>
|
|
<td><code title="">content-language</code>
|
|
<td>Non-conforming
|
|
<tr><td><a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration</a>
|
|
<td><code title="">content-type</code>
|
|
<td>
|
|
<tr><td><a href="#attr-meta-http-equiv-default-style" title="attr-meta-http-equiv-default-style">Default style</a>
|
|
<td><code title="">default-style</code>
|
|
<td>
|
|
<tr><td><a href="#attr-meta-http-equiv-refresh" title="attr-meta-http-equiv-refresh">Refresh</a>
|
|
<td><code title="">refresh</code>
|
|
<td>
|
|
<tr class="impl"><td><a href="#attr-meta-http-equiv-set-cookie" title="attr-meta-http-equiv-set-cookie">Cookie setter</a>
|
|
<td><code title="">set-cookie</code>
|
|
<td>Non-conforming
|
|
</table><div class="impl">
|
|
|
|
<p>When a <code><a href="#the-meta-element">meta</a></code> element is <a href="#insert-an-element-into-a-document" title="insert an
|
|
element into a document">inserted into the document</a>, if its
|
|
<code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">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>
|
|
|
|
</div><dl><dt class="impl"><dfn id="attr-meta-http-equiv-content-language" title="attr-meta-http-equiv-content-language">Content language state</dfn> (<code title="">http-equiv="content-language"</code>)
|
|
|
|
<dd class="impl">
|
|
|
|
<p class="note">This feature is non-conforming. Authors are
|
|
encouraged to use the <code title="attr-lang"><a href="#attr-lang">lang</a></code>
|
|
attribute instead.</p>
|
|
|
|
<p>This pragma sets the <dfn id="pragma-set-default-language">pragma-set default
|
|
language</dfn>. Until the pragma is successfully processed, there
|
|
is no <a href="#pragma-set-default-language">pragma-set default language</a>.</p>
|
|
|
|
<ol><li><p>If another <code><a href="#the-meta-element">meta</a></code> element with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in the
|
|
<a href="#attr-meta-http-equiv-content-language" title="attr-meta-http-equiv-content-language">Content
|
|
Language 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.</li>
|
|
|
|
<li><p>If the <code><a href="#the-meta-element">meta</a></code> element has no <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute, or if that
|
|
attribute's value is the empty string, then abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the element's <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute contains a
|
|
U+002C COMMA character (,) then abort these steps.</li>
|
|
<li><p>Let <var title="">input</var> be the value of the
|
|
element's <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code>
|
|
attribute.</li>
|
|
|
|
<li><p>Let <var title="">position</var> point at the first
|
|
character of <var title="">input</var>.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters" title="collect a sequence of characters">Collect a
|
|
sequence of characters</a> that are not <a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
<li><p>Let the <a href="#pragma-set-default-language">pragma-set default language</a> be the
|
|
string that resulted from the previous step.</li>
|
|
|
|
</ol><p class="note">This pragma is not exactly equivalent to the HTTP
|
|
<code>Content-Language</code> header. <a href="#refsHTTP">[HTTP]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration state</dfn> (<code title="">http-equiv="content-type"</code>)
|
|
|
|
<dd>
|
|
|
|
<p>The <a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding
|
|
declaration state</a> is just an alternative form of setting
|
|
the <code title="meta-charset">charset</code> attribute: it is a
|
|
<a href="#character-encoding-declaration">character encoding declaration</a>. <span class="impl">This state's user agent requirements are all handled
|
|
by the parsing section of the specification.</span></p>
|
|
|
|
<p>For <code><a href="#the-meta-element">meta</a></code> elements with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in the
|
|
<a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding
|
|
declaration state</a>, the <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute must have a
|
|
value that is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for a
|
|
string that consists of: the literal string "<code title="">text/html;</code>", optionally followed by any number of
|
|
<a href="#space-character" title="space character">space characters</a>, followed by
|
|
the literal string "<code title="">charset=</code>", followed by
|
|
the character encoding name of the <a href="#character-encoding-declaration">character encoding
|
|
declaration</a>.</p>
|
|
|
|
<p>A document must not contain both a <code><a href="#the-meta-element">meta</a></code> element
|
|
with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code>
|
|
attribute in the <a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration
|
|
state</a> and a <code><a href="#the-meta-element">meta</a></code> element with the <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute present.</p>
|
|
|
|
<p>The <a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding
|
|
declaration state</a> may be used in <a href="#html-documents">HTML
|
|
documents</a>, but elements with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in that
|
|
state must not be used in <a href="#xml-documents">XML documents</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="attr-meta-http-equiv-default-style" title="attr-meta-http-equiv-default-style">Default style state</dfn> (<code title="">http-equiv="default-style"</code>)
|
|
|
|
<dd>
|
|
|
|
<p>This pragma sets the name of the default <span title="alternative style sheet sets">alternative style sheet
|
|
set</span>.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<ol><li><p>If the <code><a href="#the-meta-element">meta</a></code> element has no <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute, or if that
|
|
attribute's value is the empty string, then abort these
|
|
steps.</li>
|
|
|
|
<li><p>Set the <span>preferred style sheet set</span> to the
|
|
value of the element's <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute. <a href="#refsCSSOM">[CSSOM]</a></li>
|
|
|
|
</ol></div>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="attr-meta-http-equiv-refresh" title="attr-meta-http-equiv-refresh">Refresh state</dfn> (<code title="">http-equiv="refresh"</code>)
|
|
|
|
<dd>
|
|
|
|
<p>This pragma acts as timed redirect.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<ol><li><p>If another <code><a href="#the-meta-element">meta</a></code> element with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in the
|
|
<a href="#attr-meta-http-equiv-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.</li>
|
|
|
|
<li><p>If the <code><a href="#the-meta-element">meta</a></code> element has no <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute, or if that
|
|
attribute's value is the empty string, then abort these
|
|
steps.</li>
|
|
|
|
<li><p>Let <var title="">input</var> be the value of the
|
|
element's <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code>
|
|
attribute.</li>
|
|
|
|
<li><p>Let <var title="">position</var> point at the first
|
|
character of <var title="">input</var>.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters" title="collect a sequence of characters">Collect a
|
|
sequence of characters</a> in the range U+0030 DIGIT ZERO (0)
|
|
to U+0039 DIGIT NINE (9), and parse the resulting string using
|
|
the <a href="#rules-for-parsing-non-negative-integers">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.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters" title="collect a sequence of characters">Collect a
|
|
sequence of characters</a> in the range U+0030 DIGIT ZERO (0) to
|
|
U+0039 DIGIT NINE (9) and U+002E FULL STOP (.). Ignore any collected
|
|
characters.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p>Let <var title="">url</var> be the address of the current
|
|
page.</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.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p>If the character in <var title="">input</var> pointed to
|
|
by <var title="">position</var> is a U+0055 LATIN CAPITAL LETTER
|
|
U character (U) or a U+0075 LATIN SMALL LETTER U character (u),
|
|
then advance <var title="">position</var> to the next
|
|
character. Otherwise, jump to the last step.</li>
|
|
|
|
<li><p>If the character in <var title="">input</var> pointed to
|
|
by <var title="">position</var> is a U+0052 LATIN CAPITAL LETTER
|
|
R character (R) or a U+0072 LATIN SMALL LETTER R character (r),
|
|
then advance <var title="">position</var> to the next
|
|
character. Otherwise, jump to the last step.</li>
|
|
|
|
<li><p>If the character in <var title="">input</var> pointed to
|
|
by <var title="">position</var> is s U+004C LATIN CAPITAL LETTER
|
|
L character (L) or a U+006C LATIN SMALL LETTER L character (l),
|
|
then advance <var title="">position</var> to the next
|
|
character. Otherwise, jump to the last step.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</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.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p>If the character in <var title="">input</var> pointed to
|
|
by <var title="">position</var> is either a U+0027 APOSTROPHE
|
|
character (') or U+0022 QUOTATION MARK character ("), then let
|
|
<var title="">quote</var> be that character, and advance <var title="">position</var> to the next character. Otherwise, let
|
|
<var title="">quote</var> be the empty string.</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.</li>
|
|
|
|
<li><p>If <var title="">quote</var> is not the empty string, and
|
|
there is a character in <var title="">url</var> equal to <var title="">quote</var>, then truncate <var title="">url</var> at
|
|
that character, so that it and all subsequent characters are
|
|
removed.</p>
|
|
|
|
<li><p>Strip any trailing <a href="#space-character" title="space character">space
|
|
characters</a> from the end of <var title="">url</var>.</li>
|
|
|
|
<li><p>Strip any U+0009 CHARACTER TABULATION (tab), U+000A LINE
|
|
FEED (LF), and U+000D CARRIAGE RETURN (CR) characters from <var title="">url</var>.</li>
|
|
|
|
<li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the <var title="">url</var> value to an <a href="#absolute-url">absolute URL</a>,
|
|
relative to the <code><a href="#the-meta-element">meta</a></code> element. If this fails, abort
|
|
these steps.</li>
|
|
|
|
<li>
|
|
|
|
<p>Perform one or more of the following steps:</p>
|
|
|
|
<ul><li>
|
|
|
|
<p>After the refresh has come due (as defined below), if the
|
|
user has not canceled the redirect and if the
|
|
<code><a href="#the-meta-element">meta</a></code> element's <code><a href="#document">Document</a></code>'s
|
|
<a href="#browsing-context">browsing context</a> did not have the <a href="#sandboxed-automatic-features-browsing-context-flag">sandboxed
|
|
automatic features browsing context flag</a> set when the
|
|
<code><a href="#document">Document</a></code> was created, <a href="#navigate" title="navigate">navigate</a> the
|
|
<code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> to <var title="">url</var>, with <a href="#replacement-enabled">replacement enabled</a>, and
|
|
with the <code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a>
|
|
as the <a href="#source-browsing-context">source browsing context</a>.</p>
|
|
|
|
<p>For the purposes of the previous paragraph, a refresh is
|
|
said to have come due as soon as the <em>later</em> of the
|
|
following two conditions occurs:</p>
|
|
|
|
<ul><li>At least <var title="">time</var> seconds have elapsed
|
|
since the document has <a href="#completely-loaded">completely loaded</a>,
|
|
adjusted to take into account user or user agent
|
|
preferences.</li>
|
|
|
|
|
|
<li>At least <var title="">time</var> seconds have elapsed
|
|
since the <code><a href="#the-meta-element">meta</a></code> element was <a href="#insert-an-element-into-a-document" title="insert
|
|
an element into a document">inserted into the
|
|
<code>Document</code></a>, adjusted to take into account
|
|
user or user agent preferences.</li>
|
|
|
|
|
|
</ul></li>
|
|
|
|
<li><p>Provide the user with an interface that, when selected,
|
|
<a href="#navigate" title="navigate">navigates</a> a <a href="#browsing-context">browsing context</a> to <var title="">url</var>, with the document's browsing context as the
|
|
<a href="#source-browsing-context">source browsing context</a>.</li>
|
|
|
|
<li><p>Do nothing.</li>
|
|
|
|
</ul><p>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.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div>
|
|
|
|
<p>For <code><a href="#the-meta-element">meta</a></code> elements with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in the
|
|
<a href="#attr-meta-http-equiv-refresh" title="attr-meta-http-equiv-refresh">Refresh state</a>,
|
|
the <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute must
|
|
have a value consisting either of:</p>
|
|
|
|
<ul><li>just a <a href="#valid-non-negative-integer">valid non-negative integer</a>, or</li>
|
|
|
|
<li>a <a href="#valid-non-negative-integer">valid non-negative integer</a>, followed by a
|
|
U+003B SEMICOLON character (;), followed by one or more <a href="#space-character" title="space character">space characters</a>, followed by a
|
|
substring that is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match
|
|
for the string "<code title="">URL</code>", followed by a U+003D
|
|
EQUALS SIGN character (=), followed by a <a href="#valid-url">valid URL</a>
|
|
that does not start with a literal U+0027 APOSTROPHE (') or
|
|
U+0022 QUOTATION MARK (") character.</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 <a href="#url">URL</a>.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>A news organization's front page could include the following
|
|
markup in the page's <code><a href="#the-head-element">head</a></code> element, to ensure that
|
|
the page automatically reloads from the server every five
|
|
minutes:</p>
|
|
|
|
<pre><meta http-equiv="Refresh" content="300"></pre>
|
|
|
|
</div>
|
|
|
|
<div class="example">
|
|
|
|
<p>A sequence of pages could be used as an automated slide show
|
|
by making each page refresh to the next page in the sequence,
|
|
using markup such as the following:</p>
|
|
|
|
<pre><meta http-equiv="Refresh" content="20; URL=page4.html"></pre>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
<dt class="impl"><dfn id="attr-meta-http-equiv-set-cookie" title="attr-meta-http-equiv-set-cookie">Cookie setter</dfn> (<code title="">http-equiv="set-cookie"</code>)
|
|
|
|
<dd class="impl">
|
|
|
|
<p>This pragma sets an HTTP cookie. <a href="#refsCOOKIES">[COOKIES]</a></p>
|
|
|
|
<p>It is non-conforming. Real HTTP headers should be used instead.</p>
|
|
|
|
<ol><li><p>If the <code><a href="#the-meta-element">meta</a></code> element has no <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute, or if that
|
|
attribute's value is the empty string, then abort these
|
|
steps.</li>
|
|
|
|
<li><p><a href="#obtain-the-storage-mutex">Obtain the storage mutex</a>.</li>
|
|
|
|
<li><p>Act as if <span title="receives a
|
|
set-cookie-string">receiving a set-cookie-string</span> for
|
|
<a href="#the-document-s-address">the document's address</a> via a "non-HTTP" API,
|
|
consisting of the value of the element's <code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute encoded as
|
|
UTF-8. <a href="#refsCOOKIES">[COOKIES]</a> <a href="#refsRFC3629">[RFC3629]</a></li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl><p>There must not be more than one <code><a href="#the-meta-element">meta</a></code> element with
|
|
any particular state in the document at a time.<h5 id="other-pragma-directives"><span class="secno">4.2.5.4 </span>Other pragma directives</h5><p><dfn id="concept-http-equiv-extensions" title="concept-http-equiv-extensions">Extensions to the
|
|
predefined set of pragma directives</dfn> may, under certain
|
|
conditions, be registered in the <a href="http://wiki.whatwg.org/wiki/PragmaExtensions">WHATWG Wiki
|
|
PragmaExtensions page</a>. <a href="#refsWHATWGWIKI">[WHATWGWIKI]</a><p>Such extensions must use a name that is identical to an HTTP
|
|
header registered in the Permanent Message Header Field Registry,
|
|
and must have behavior identical to that described for the HTTP
|
|
header. <a href="#refsIANAPERMHEADERS">[IANAPERMHEADERS]</a><p>Pragma directives corresponding to headers describing metadata,
|
|
or not requiring specific user agent processing, must not be
|
|
registered; instead, use <a href="#concept-meta-extensions" title="concept-meta-extensions">metadata names</a>. Pragma
|
|
directives corresponding to headers that affect the HTTP processing
|
|
model (e.g. caching) must not be registered, as they would result in
|
|
HTTP-level behavior being different for user agents that implement
|
|
HTML than for user agents that do not.<p>Anyone is free to edit the WHATWG Wiki PragmaExtensions page at
|
|
any time to add a pragma directive satisfying these conditions. Such
|
|
registrations must specify the following information:<dl><dt>Keyword</dt>
|
|
|
|
<dd><p>The actual name being defined. The name must match a
|
|
previously-registered HTTP name with the same
|
|
requirements.</dd>
|
|
|
|
|
|
<dt>Brief description</dt>
|
|
|
|
<dd><p>A short non-normative description of the purpose of the
|
|
pragma directive.</dd>
|
|
|
|
|
|
<dt>Specification</dt>
|
|
|
|
<dd>A link to the specification defining the corresponding HTTP
|
|
header.</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>Conformance checkers must use the information given on the WHATWG
|
|
Wiki PragmaExtensions page to establish if a value is allowed or
|
|
not: values defined in this specification or listed on the
|
|
aforementioned page must be accepted, whereas values not listed in
|
|
either this specification or on the aforementioned page must be
|
|
rejected as invalid. Conformance checkers may cache this information
|
|
(e.g. for performance reasons or to avoid the use of unreliable
|
|
network connectivity).</p>
|
|
|
|
</div><h5 id="charset"><span class="secno">4.2.5.5 </span>Specifying the document's character encoding</h5><p>A <dfn id="character-encoding-declaration">character encoding declaration</dfn> is a mechanism by
|
|
which the character encoding used to store or transmit a document is
|
|
specified.<p>The following restrictions apply to character encoding
|
|
declarations:<ul><li>The character encoding name given must be the name of the
|
|
character encoding used to serialize the file.</li>
|
|
|
|
<li>The value must be a valid character encoding name, and must be
|
|
an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the
|
|
<a href="#preferred-mime-name">preferred MIME name</a> for that encoding. <a href="#refsIANACHARSET">[IANACHARSET]</a></li>
|
|
|
|
<li>The character encoding declaration must be serialized without
|
|
the use of <a href="#syntax-charref" title="syntax-charref">character references</a>
|
|
or character escapes of any kind.</li>
|
|
|
|
<li id="charset1024"><span id="charset512" title="">The element
|
|
containing the character encoding declaration must be serialized
|
|
completely within the first 1024 bytes of the document.</span></li>
|
|
|
|
|
|
</ul><p>In addition, due to a number of restrictions on <code><a href="#the-meta-element">meta</a></code>
|
|
elements, there can only be one <code><a href="#the-meta-element">meta</a></code>-based character
|
|
encoding declaration per document.</p><p>If an <a href="#html-documents" title="HTML documents">HTML document</a> does not
|
|
start with a BOM, and if its encoding is not explicitly given by
|
|
<a href="#content-type" title="Content-Type">Content-Type metadata</a>, and the
|
|
document is not <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a>, then the
|
|
character encoding used must be an <a href="#ascii-compatible-character-encoding">ASCII-compatible character
|
|
encoding</a>, and, in addition, if that encoding isn't US-ASCII
|
|
itself, then the encoding must be specified using a
|
|
<code><a href="#the-meta-element">meta</a></code> element with a <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute or a
|
|
<code><a href="#the-meta-element">meta</a></code> element with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in the
|
|
<a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration
|
|
state</a>.<p>If the document is <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a>, the
|
|
document must not have a <a href="#character-encoding-declaration">character encoding
|
|
declaration</a>. (In this case, the source is already decoded,
|
|
since it is part of the document that contained the
|
|
<code><a href="#the-iframe-element">iframe</a></code>.)<p>If an <a href="#html-documents" title="HTML documents">HTML document</a> contains
|
|
a <code><a href="#the-meta-element">meta</a></code> element with a <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute or a
|
|
<code><a href="#the-meta-element">meta</a></code> element with an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute in the
|
|
<a href="#attr-meta-http-equiv-content-type" title="attr-meta-http-equiv-content-type">Encoding declaration
|
|
state</a>, then the character encoding used must be an
|
|
<a href="#ascii-compatible-character-encoding">ASCII-compatible character encoding</a>.<p>Authors are encouraged to use UTF-8. Conformance checkers may
|
|
advise authors against using legacy encodings. <a href="#refsRFC3629">[RFC3629]</a><div class="impl">
|
|
|
|
<p>Authoring tools should default to using UTF-8 for newly-created
|
|
documents. <a href="#refsRFC3629">[RFC3629]</a></p>
|
|
|
|
</div><p>Encodings in which a series of bytes in the range 0x20 to 0x7E
|
|
can encode characters other than the corresponding characters in the
|
|
range U+0020 to U+007E represent a potential security vulnerability:
|
|
a user agent that does not support the encoding (or does not support
|
|
the label used to declare the encoding, or does not use the same
|
|
mechanism to detect the encoding of unlabelled content as another
|
|
user agent) might end up interpreting technically benign plain text
|
|
content as HTML tags and JavaScript. For example, this applies to
|
|
encodings in which the bytes corresponding to "<code title=""><script></code>" in ASCII can encode a different
|
|
string. Authors should not use such encodings, which are known to
|
|
include JIS_C6226-1983,
|
|
JIS_X0212-1990, HZ-GB-2312, JOHAB (Windows code
|
|
page 1361), encodings based on ISO-2022, and encodings based on EBCDIC. Furthermore, authors must not
|
|
use the CESU-8, UTF-7, BOCU-1 and SCSU encodings, which also fall
|
|
into this category, because these encodings were never intended for
|
|
use for Web content.
|
|
<a href="#refsRFC1345">[RFC1345]</a>
|
|
<a href="#refsRFC1842">[RFC1842]</a><!-- HZ-GB-2312 -->
|
|
<a href="#refsRFC1468">[RFC1468]</a><!-- ISO-2022-JP -->
|
|
<a href="#refsRFC2237">[RFC2237]</a><!-- ISO-2022-JP-1 -->
|
|
<a href="#refsRFC1554">[RFC1554]</a><!-- ISO-2022-JP-2 -->
|
|
<a href="#refsRFC1922">[RFC1922]</a>
|
|
<a href="#refsRFC1557">[RFC1557]</a><!-- ISO-2022-KR -->
|
|
<a href="#refsCESU8">[CESU8]</a>
|
|
<a href="#refsUTF7">[UTF7]</a>
|
|
<a href="#refsBOCU1">[BOCU1]</a>
|
|
<a href="#refsSCSU">[SCSU]</a>
|
|
|
|
<p>Authors should not use UTF-32, as the encoding detection
|
|
algorithms described in this specification intentionally do not
|
|
distinguish it from UTF-16. <a href="#refsUNICODE">[UNICODE]</a><p class="note">Using non-UTF-8 encodings can have unexpected
|
|
results on form submission and URL encodings, which use the
|
|
<a href="#document-s-character-encoding">document's character encoding</a> by default.<p>In XHTML, the XML declaration should be used for inline character
|
|
encoding information, if necessary.<div class="example">
|
|
|
|
<p>In HTML, to declare that the character encoding is UTF-8, the
|
|
author could include the following markup near the top of the
|
|
document (in the <code><a href="#the-head-element">head</a></code> element):</p>
|
|
|
|
<pre><meta charset="utf-8"></pre>
|
|
|
|
<p>In XML, the XML declaration would be used instead, at the very
|
|
top of the markup:</p>
|
|
|
|
<pre><?xml version="1.0" encoding="utf-8"?></pre>
|
|
|
|
</div><h4 id="the-style-element"><span class="secno">4.2.6 </span>The <dfn><code>style</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#metadata-content">Metadata content</a>.</dd>
|
|
<dd>If the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is present: <a href="#flow-content">flow content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>If the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is absent: where <a href="#metadata-content">metadata content</a> is expected.</dd>
|
|
<dd>If the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is absent: in a <code><a href="#the-noscript-element">noscript</a></code> element that is a child of a <code><a href="#the-head-element">head</a></code> element.</dd>
|
|
<dd>If the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is present: where <a href="#flow-content">flow content</a> is expected, but before any other <a href="#flow-content">flow content</a> other than other <code><a href="#the-style-element">style</a></code> elements and <a href="#inter-element-whitespace">inter-element whitespace</a>.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Depends on the value of the <code title="attr-style-type"><a href="#attr-style-type">type</a></code> attribute, but must match requirements described in prose below.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-style-media"><a href="#attr-style-media">media</a></code></dd>
|
|
<dd><code title="attr-style-type"><a href="#attr-style-type">type</a></code></dd>
|
|
<dd><code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code></dd>
|
|
<dd>Also, the <code title="attr-style-title"><a href="#attr-style-title">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 <a href="#dom-style-disabled" title="dom-style-disabled">disabled</a>;
|
|
attribute DOMString <a href="#dom-style-media" title="dom-style-media">media</a>;
|
|
attribute DOMString <a href="#dom-style-type" title="dom-style-type">type</a>;
|
|
attribute boolean <a href="#dom-style-scoped" title="dom-style-scoped">scoped</a>;
|
|
};
|
|
<a href="#htmlstyleelement">HTMLStyleElement</a> implements <span>LinkStyle</span>;</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-style-element">style</a></code> element allows authors to embed style
|
|
information in their documents. The <code><a href="#the-style-element">style</a></code> element is
|
|
one of several inputs to the <a href="#styling">styling processing
|
|
model</a>. The element does not <a href="#represents" title="represents">represent</a> content for the user.<p>The <dfn id="attr-style-type" title="attr-style-type"><code>type</code></dfn>
|
|
attribute gives the styling language. If the attribute is present,
|
|
its value must be a <a href="#valid-mime-type">valid MIME type</a> that designates a
|
|
styling language. The <code title="">charset</code> parameter must
|
|
not be specified. The default value for the <code title="attr-style-type"><a href="#attr-style-type">type</a></code> attribute, which is used if the
|
|
attribute is absent, is "<code title="">text/css</code>". <a href="#refsRFC2318">[RFC2318]</a><div class="impl">
|
|
|
|
|
|
<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. The <code title="">charset</code> parameter must be treated as an unknown
|
|
parameter for the purpose of comparing <a href="#mime-type" title="MIME type">MIME
|
|
types</a> here.</p>
|
|
|
|
</div><p>The <dfn id="attr-style-media" title="attr-style-media"><code>media</code></dfn>
|
|
attribute says which media the styles apply to. The value must be a
|
|
<a href="#valid-media-query">valid media query</a>. <span class="impl">The user agent
|
|
must apply the styles when the <code title="attr-style-media"><a href="#attr-style-media">media</a></code> attribute's value
|
|
<a href="#matches-the-environment">matches the environment</a> and the other relevant
|
|
conditions apply, and must not apply them otherwise.</span></p><div class="impl">
|
|
|
|
<p class="note">The styles might be further limited in scope,
|
|
e.g. in CSS with the use of <code title="">@media</code>
|
|
blocks. This specification does not override such further
|
|
restrictions or requirements.</p>
|
|
</div><p id="style-default-media">The default, if the <code title="attr-style-media"><a href="#attr-style-media">media</a></code> attribute is omitted, is
|
|
"<code title="">all</code>", meaning that by default styles apply to
|
|
all media.<p>The <dfn id="attr-style-scoped" title="attr-style-scoped"><code>scoped</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. If set, it indicates
|
|
that the styles are intended just for the subtree rooted at the
|
|
<code><a href="#the-style-element">style</a></code> element's parent element, as opposed to the whole
|
|
<code><a href="#document">Document</a></code>.<div class="impl">
|
|
|
|
<p>If the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is
|
|
present, then the user agent must apply the specified style
|
|
information only to the <code><a href="#the-style-element">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.</p>
|
|
|
|
<p>For scoped CSS resources, the effect of @-rules must be scoped to
|
|
the scoped sheet and its subresources, even if the @-rule in
|
|
question would ordinarily apply to all style sheets that affect the
|
|
<code><a href="#document">Document</a></code>. Any '@page' rules in scoped CSS resources
|
|
must be ignored.</p>
|
|
|
|
<p class="example">For example, an '@font-face' rule defined in a
|
|
scoped style sheet would only define the font for the purposes of
|
|
font rules in the scoped section; style sheets outside the scoped
|
|
section using the same font name would not end up using that
|
|
embedded font.</p>
|
|
|
|
</div><p id="title-on-style">The <dfn id="attr-style-title" title="attr-style-title"><code>title</code></dfn> attribute on
|
|
<code><a href="#the-style-element">style</a></code> elements defines <span>alternative style sheet
|
|
sets</span>. If the <code><a href="#the-style-element">style</a></code> element has no <code title="attr-style-title"><a href="#attr-style-title">title</a></code> attribute, then it has no
|
|
title; the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute of
|
|
ancestors does not apply to the <code><a href="#the-style-element">style</a></code> element. <a href="#refsCSSOM">[CSSOM]</a><p class="note">The <code title="attr-style-title"><a href="#attr-style-title">title</a></code>
|
|
attribute on <code><a href="#the-style-element">style</a></code> elements, like the <code title="attr-link-title"><a href="#attr-link-title">title</a></code> attribute on <code><a href="#the-link-element">link</a></code>
|
|
elements, differs from the global <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute in that a
|
|
<code><a href="#the-style-element">style</a></code> block without a title does not inherit the title
|
|
of the parent element: it merely has no title.<p>The <code><a href="#textcontent">textContent</a></code> of a <code><a href="#the-style-element">style</a></code> element must
|
|
match the <code title="">style</code> production in the following
|
|
ABNF, the character set for which is Unicode. <a href="#refsABNF">[ABNF]</a><pre>style = no-c-start *( c-start no-c-end c-end no-c-start )
|
|
no-c-start = <any string that doesn't contain a substring that matches c-start >
|
|
c-start = "<!--"
|
|
no-c-end = <any string that doesn't contain a substring that matches c-end >
|
|
c-end = "-->"</pre><div class="impl">
|
|
|
|
<p>All descendant elements must be processed, according to their
|
|
semantics, before the <code><a href="#the-style-element">style</a></code> element itself is
|
|
evaluated. For styling languages that consist of pure text (as
|
|
opposed to XML), user agents must evaluate <code><a href="#the-style-element">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="#the-style-element">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 child nodes of the <code><a href="#the-style-element">style</a></code> element to the style
|
|
system.</p>
|
|
|
|
<p>All <a href="#url" title="URL">URLs</a> found by the styling language's
|
|
processor must be <a href="#resolve-a-url" title="resolve a url">resolved</a>,
|
|
relative to the element (or as defined by the styling language),
|
|
when the processor is invoked.</p>
|
|
|
|
|
|
<p>Once the attempts to obtain the style sheet's <a href="#critical-subresources">critical
|
|
subresources</a>, if any, are complete, or, if the style sheet
|
|
has no <a href="#critical-subresources">critical subresources</a>, once the style sheet has
|
|
been parsed and processed, the user agent must, if the loads were
|
|
successful or there were none, <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-load">load</code> at the <code><a href="#the-style-element">style</a></code> element,
|
|
or, if one of the style sheet's <a href="#critical-subresources">critical subresources</a>
|
|
failed to completely load for any reason (e.g. DNS error, HTTP 404
|
|
response, a connection being prematurely closed, unsupported
|
|
Content-Type), <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-error">error</code> at the
|
|
<code><a href="#the-style-element">style</a></code> element. Non-network errors in processing the
|
|
style sheet or its subresources (e.g. CSS parse errors, PNG decoding
|
|
errors) are not failures for the purposes of this paragraph.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <a href="#dom-manipulation-task-source">DOM manipulation task
|
|
source</a>.</p>
|
|
|
|
<p>The element must <a href="#delay-the-load-event">delay the load event</a> of the
|
|
element's document until all the attempts to obtain the style
|
|
sheet's <a href="#critical-subresources">critical subresources</a>, if any, are
|
|
complete.</p>
|
|
|
|
</div><p class="note">This specification does not specify a style system,
|
|
but CSS is expected to be supported by most Web browsers. <a href="#refsCSS">[CSS]</a><div class="impl">
|
|
|
|
<p>The <dfn id="dom-style-media" title="dom-style-media"><code>media</code></dfn>, <dfn id="dom-style-type" title="dom-style-type"><code>type</code></dfn> and <dfn id="dom-style-scoped" title="dom-style-scoped"><code>scoped</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name.</p>
|
|
|
|
</div><p>The <dfn id="dom-style-disabled" title="dom-style-disabled"><code>disabled</code></dfn>
|
|
IDL attribute behaves as defined <a href="#dom-linkstyle-disabled" title="dom-linkstyle-disabled">for the alternative style sheets
|
|
DOM</a>.<p>The <code>LinkStyle</code> interface is also implemented by
|
|
this element; the <a href="#styling">styling processing model</a> defines
|
|
how. <a href="#refsCSSOM">[CSSOM]</a><div class="example">
|
|
|
|
<p>The following document has its emphasis styled as bright red
|
|
text rather than italics text, while leaving titles of works and
|
|
Latin words in their default italics. It shows how using
|
|
appropriate elements enables easier restyling of documents.</p>
|
|
|
|
<pre><!DOCTYPE html>
|
|
<html lang="en-US">
|
|
<head>
|
|
<title>My favorite book</title>
|
|
<style>
|
|
body { color: black; background: white; }
|
|
em { font-style: normal; color: red; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<p>My <em>favorite</em> book of all time has <em>got</em> to be
|
|
<cite>A Cat's Life</cite>. It is a book by P. Rahmel that talks
|
|
about the <i lang="la">Felis Catus</i> in modern human society.</p>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><h4 id="styling"><span class="secno">4.2.7 </span><dfn title="styling processing model">Styling</dfn></h4><p>The <code><a href="#the-link-element">link</a></code> and <code><a href="#the-style-element">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="#refsCSSOM">[CSSOM]</a><p>The <code><a href="#the-style-element">style</a></code> and <code><a href="#the-link-element">link</a></code> elements implement
|
|
the <code>LinkStyle</code> interface. <a href="#refsCSSOM">[CSSOM]</a><div class="impl">
|
|
|
|
<p>For <code><a href="#the-style-element">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="#the-link-element">link</a></code> elements that do not represent <a href="#link-type-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="#link-type-stylesheet">stylesheet</a></code> keyword in their <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute), and <code><a href="#the-link-element">link</a></code>
|
|
elements whose specified resource has not yet been fetched, 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 following properties: <a href="#refsCSSOM">[CSSOM]</a></p>
|
|
|
|
<dl><dt>The style sheet type</dt>
|
|
|
|
<dd><p>The style sheet type must be the same as the style's specified
|
|
type. For <code><a href="#the-style-element">style</a></code> elements, this is the same as the
|
|
<code title="attr-style-type"><a href="#attr-style-type">type</a></code> content attribute's
|
|
value, or <code title="">text/css</code> if that is omitted. For
|
|
<code><a href="#the-link-element">link</a></code> elements, this is the <a href="#content-type" title="Content-Type">Content-Type metadata of the specified
|
|
resource</a>.</dd>
|
|
|
|
<dt>The style sheet location</dt>
|
|
|
|
<dd><p>For <code><a href="#the-link-element">link</a></code> elements, the location must be the
|
|
result of <a href="#resolve-a-url" title="resolve a url">resolving</a> the
|
|
<a href="#url">URL</a> given by the element's <code title="attr-link-href"><a href="#attr-link-href">href</a></code> content attribute, relative to
|
|
the element, or the empty string if that fails. For
|
|
<code><a href="#the-style-element">style</a></code> elements, there is no location.</dd>
|
|
<dt>The style sheet media</dt>
|
|
|
|
<dd><p>The media must be the same as the value of the element's
|
|
<code title="">media</code> content attribute, or the empty string,
|
|
if the attribute is omitted.</dd>
|
|
|
|
<dt>The style sheet title</dt>
|
|
|
|
<dd><p>The title must be the same as the value of the element's
|
|
<code title="dom-title"><a href="#dom-title">title</a></code> content attribute, if the
|
|
attribute is present and has a non-empty value. If the attribute is
|
|
absent or its value is the empty string, then the style sheet does
|
|
not have a title (it is the empty string). The title is used for
|
|
defining <span>alternative style sheet sets</span>.</dd>
|
|
|
|
<dt>The style sheet alternate flag</dt>
|
|
|
|
<dd><p>For <code><a href="#the-link-element">link</a></code> elements, true if <a href="#the-link-is-an-alternative-stylesheet">the link is an
|
|
alternative stylesheet</a>. In all other cases, false.</dd>
|
|
|
|
|
|
</dl><p>The same object must be returned each time.</p>
|
|
|
|
<p>The <dfn id="dom-linkstyle-disabled" title="dom-LinkStyle-disabled"><code>disabled</code></dfn> IDL
|
|
attribute on <code><a href="#the-link-element">link</a></code> and <code><a href="#the-style-element">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>
|
|
|
|
|
|
<p id="alternate-style-sheets">The rules for handling alternative
|
|
style sheets are defined in the CSS object model specification. <a href="#refsCSSOM">[CSSOM]</a></p>
|
|
|
|
<hr><p>Style sheets, whether added by a <code><a href="#the-link-element">link</a></code> element, a
|
|
<code><a href="#the-style-element">style</a></code> element, an <code><?xml-stylesheet></code> PI,
|
|
an HTTP <code title="http-link">Link:</code> header, or some other
|
|
mechanism, have a <dfn id="style-sheet-ready">style sheet ready</dfn> flag, which is
|
|
initially unset.</p>
|
|
|
|
<p>When a style sheet is ready to be applied, its <a href="#style-sheet-ready">style sheet
|
|
ready</a> flag must be set. If the style sheet referenced no
|
|
other resources (e.g. it was an internal style sheet given by a
|
|
<code><a href="#the-style-element">style</a></code> element with no <code title="">@import</code>
|
|
rules), then the style rules must be synchronously made available to
|
|
script; otherwise, the style rules must only be made available to
|
|
script once the <a href="#event-loop">event loop</a> reaches its "update the
|
|
rendering" step.</p>
|
|
|
|
<p>A style sheet in the context of the <code><a href="#document">Document</a></code> of an
|
|
<a href="#html-parser">HTML parser</a> or <a href="#xml-parser">XML parser</a> is said to be
|
|
<dfn id="a-style-sheet-that-is-blocking-scripts">a style sheet that is blocking scripts</dfn> if the element was
|
|
created by that <code><a href="#document">Document</a></code>'s parser, and the element is
|
|
either a <code><a href="#the-style-element">style</a></code> element or a <code><a href="#the-link-element">link</a></code> element
|
|
that was an <a href="#link-type-stylesheet" title="rel-stylesheet">external resource link that
|
|
contributes to the styling processing model</a> when the element
|
|
was created by the parser, and the element's style sheet was enabled
|
|
when the element was created by the parser, and the element's
|
|
<a href="#style-sheet-ready">style sheet ready</a> flag is not yet set, and, the last
|
|
time the <a href="#event-loop">event loop</a> reached step 1, the element was
|
|
<a href="#in-a-document" title="in a document">in that <code>Document</code></a>,
|
|
and the user agent hasn't given up on that particular style sheet
|
|
yet. A user agent may give up on a style sheet at any time.</p>
|
|
|
|
<p>A <code><a href="#document">Document</a></code> <dfn id="has-a-style-sheet-that-is-blocking-scripts">has a style sheet that is blocking
|
|
scripts</dfn> if there is either <a href="#a-style-sheet-that-is-blocking-scripts">a style sheet that is
|
|
blocking scripts</a> in the context of that
|
|
<code><a href="#document">Document</a></code>, or if that <code><a href="#document">Document</a></code> is in a
|
|
<a href="#browsing-context">browsing context</a> that has a <a href="#parent-browsing-context">parent browsing
|
|
context</a>, and the <a href="#active-document">active document</a> of that
|
|
<a href="#parent-browsing-context">parent browsing context</a> itself <a href="#has-a-style-sheet-that-is-blocking-scripts">has a style sheet
|
|
that is blocking scripts</a>.</p>
|
|
|
|
<p>A <code><a href="#document">Document</a></code> <dfn id="has-no-style-sheet-that-is-blocking-scripts">has no style sheet that is blocking
|
|
scripts</dfn> if it does not <a href="#has-a-style-sheet-that-is-blocking-scripts" title="has a style sheet that is
|
|
blocking scripts">have a style sheet that is blocking scripts</a>
|
|
as defined in the previous paragraph.</p>
|
|
|
|
</div><h3 id="scripting-1"><span class="secno">4.3 </span>Scripting</h3><p>Scripts allow authors to add interactivity to their documents.<p>Authors are encouraged to use declarative alternatives to
|
|
scripting where possible, as declarative mechanisms are often more
|
|
maintainable, and many users disable scripting.<div class="example">
|
|
<p>For example, instead of using script to show or hide a section
|
|
to show more details, the <code><a href="#the-details-element">details</a></code> element could be
|
|
used.</p>
|
|
</div><p>Authors are also encouraged to make their applications degrade
|
|
gracefully in the absence of scripting support.<div class="example">
|
|
<p>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.</p>
|
|
</div><h4 id="the-script-element"><span class="secno">4.3.1 </span>The <dfn id="script"><code>script</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#metadata-content">Metadata content</a>.</dd>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#metadata-content">metadata content</a> is expected.</dd>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>If there is no <code title="attr-script-src"><a href="#attr-script-src">src</a></code>
|
|
attribute, depends on the value of the <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute, but must match
|
|
<a href="#restrictions-for-contents-of-script-elements">script content restrictions</a>.</dd>
|
|
<dd>If there <em>is</em> a <code title="attr-script-src"><a href="#attr-script-src">src</a></code>
|
|
attribute, the element must be either empty or contain only
|
|
<a href="#inline-documentation-for-external-scripts">script documentation</a> that also matches <a href="#restrictions-for-contents-of-script-elements">script
|
|
content restrictions</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-script-src"><a href="#attr-script-src">src</a></code></dd>
|
|
<dd><code title="attr-script-async"><a href="#attr-script-async">async</a></code></dd>
|
|
<dd><code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code></dd>
|
|
<dd><code title="attr-script-type"><a href="#attr-script-type">type</a></code></dd>
|
|
<dd><code title="attr-script-charset"><a href="#attr-script-charset">charset</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlscriptelement">HTMLScriptElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-script-src" title="dom-script-src">src</a>;
|
|
attribute boolean <a href="#dom-script-async" title="dom-script-async">async</a>;
|
|
attribute boolean <a href="#dom-script-defer" title="dom-script-defer">defer</a>;
|
|
attribute DOMString <a href="#dom-script-type" title="dom-script-type">type</a>;
|
|
attribute DOMString <a href="#dom-script-charset" title="dom-script-charset">charset</a>;
|
|
attribute DOMString <a href="#dom-script-text" title="dom-script-text">text</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-script-element">script</a></code> element allows authors to include dynamic
|
|
script and data blocks in their documents. The element does not
|
|
<a href="#represents" title="represents">represent</a> content for the user.<p>When used to include dynamic scripts, the scripts may either be
|
|
embedded inline or may be imported from an external file using the
|
|
<code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute. If the language
|
|
is not that described by "<code title="">text/javascript</code>",
|
|
then the <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute must
|
|
be present, as described below. Whatever language is used, the
|
|
contents of the <code><a href="#the-script-element">script</a></code> element must conform with the
|
|
requirements of that language's specification.<p>When used to include data blocks (as opposed to scripts), the
|
|
data must be embedded inline, the format of the data must be given
|
|
using the <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute, the
|
|
<code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute must not be
|
|
specified, and the contents of the <code><a href="#the-script-element">script</a></code> element must
|
|
conform to the requirements defined for the format used.<p>The <dfn id="attr-script-type" title="attr-script-type"><code>type</code></dfn>
|
|
attribute gives the language of the script or format of the data. If
|
|
the attribute is present, its value must be a <a href="#valid-mime-type">valid MIME
|
|
type</a>. The <code title="">charset</code> parameter must not be
|
|
specified. The default, which is used if the attribute is absent,
|
|
is "<code title="">text/javascript</code>".<p>The <dfn id="attr-script-src" title="attr-script-src"><code>src</code></dfn>
|
|
attribute, if specified, gives the address of the external script
|
|
resource to use. The value of the attribute must be a <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid
|
|
non-empty URL potentially surrounded by spaces</a> identifying a
|
|
script resource of the type given by the <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute, if the attribute is
|
|
present, or of the type "<code title="">text/javascript</code>", if
|
|
the attribute is absent. A resource is a script resource of a given
|
|
type if that type identifies a scripting language and the resource
|
|
conforms with the requirements of that language's specification.<p>The <dfn id="attr-script-charset" title="attr-script-charset"><code>charset</code></dfn>
|
|
attribute gives the character encoding of the external script
|
|
resource. The attribute must not be specified if the <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute is not present. If the
|
|
attribute is set, its value must be a valid character encoding name,
|
|
must be an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the
|
|
<a href="#preferred-mime-name">preferred MIME name</a> for that encoding, and must match
|
|
the encoding given in the <code title="">charset</code> parameter of
|
|
the <a href="#content-type" title="Content-Type">Content-Type metadata</a> of the
|
|
external file, if any. <a href="#refsIANACHARSET">[IANACHARSET]</a><p>The <dfn id="attr-script-async" title="attr-script-async"><code>async</code></dfn> and
|
|
<dfn id="attr-script-defer" title="attr-script-defer"><code>defer</code></dfn> attributes
|
|
are <a href="#boolean-attribute" title="boolean attribute">boolean attributes</a> that
|
|
indicate how the script should be executed. The <code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code> and <code title="attr-script-async"><a href="#attr-script-async">async</a></code> attributes must not be
|
|
specified if the <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute
|
|
is not present.<p>There are three possible modes that can be selected using these
|
|
attributes. If the <code title="attr-script-async"><a href="#attr-script-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="#attr-script-async">async</a></code> attribute is not present but
|
|
the <code title="attr-script-defer"><a href="#attr-script-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
|
|
fetched and executed immediately, before the user agent continues
|
|
parsing the page.<p class="note">The exact processing details for these attributes
|
|
are, for mostly historical reasons, somewhat non-trivial, involving
|
|
a number of aspects of HTML. The implementation requirements are
|
|
therefore by necessity scattered throughout the specification. The
|
|
algorithms below (in this section) describe the core of this
|
|
processing, but these algorithms reference and are referenced by the
|
|
parsing rules for <code><a href="#the-script-element">script</a></code> <a href="#scriptTag">start</a>
|
|
and <a href="#scriptEndTag">end</a> tags in HTML, <a href="#scriptForeignEndTag">in foreign content</a>, and <a href="#scriptTagXML">in XML</a>, the rules for the <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code> method, the
|
|
handling of <a href="#scripting">scripting</a>, etc.<p>The <code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code> attribute may be
|
|
specified even if the <code title="attr-script-async"><a href="#attr-script-async">async</a></code>
|
|
attribute is specified, to cause legacy Web browsers that only
|
|
support <code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code> (and not <code title="attr-script-async"><a href="#attr-script-async">async</a></code>) to fall back to the <code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code> behavior instead of the
|
|
synchronous blocking behavior that is the default.<p>Changing the <code title="attr-script-src"><a href="#attr-script-src">src</a></code>, <code title="attr-script-type"><a href="#attr-script-type">type</a></code>, <code title="attr-script-charset"><a href="#attr-script-charset">charset</a></code>, <code title="attr-script-async"><a href="#attr-script-async">async</a></code>, and <code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code> attributes dynamically has no
|
|
direct effect; these attribute are only used at specific times
|
|
described below.</p><div class="impl">
|
|
|
|
<p>A <code><a href="#the-script-element">script</a></code> element has several associated pieces of
|
|
state.</p>
|
|
|
|
<p>The first is a flag indicating whether or not the script block
|
|
has been <dfn id="already-started">"already started"</dfn>. Initially,
|
|
<code><a href="#the-script-element">script</a></code> elements must have this flag unset (script
|
|
blocks, when created, are not "already started"). When a
|
|
<code><a href="#the-script-element">script</a></code> element is <a href="#concept-clone" title="concept-clone">cloned</a>, the "already started" flag, if
|
|
set, must be propagated to the clone when it is created.</p>
|
|
|
|
<p>The second is a flag indicating whether the element was
|
|
<dfn id="parser-inserted">"parser-inserted"</dfn>. Initially, <code><a href="#the-script-element">script</a></code>
|
|
elements must have this flag unset. It is set by the <a href="#html-parser">HTML
|
|
parser</a> and the <a href="#xml-parser">XML parser</a> on <code><a href="#the-script-element">script</a></code>
|
|
elements they insert and affects the processing of those
|
|
elements.</p>
|
|
|
|
<p>The third is a flag indicating whether the element will
|
|
<dfn id="force-async">"force-async"</dfn>. Initially, <code><a href="#the-script-element">script</a></code> elements
|
|
must have this flag set. It is unset by the <a href="#html-parser">HTML parser</a>
|
|
and the <a href="#xml-parser">XML parser</a> on <code><a href="#the-script-element">script</a></code> elements they
|
|
insert. In addition, whenever a <code><a href="#the-script-element">script</a></code> element whose
|
|
<a href="#force-async">"force-async"</a> flag is set has a <code title="attr-script-async"><a href="#attr-script-async">async</a></code> content attribute added, the
|
|
element's <a href="#force-async">"force-async"</a> flag must be unset.</p>
|
|
<p>The fourth is a flag indicating whether or not the script block is
|
|
<dfn id="ready-to-be-parser-executed">"ready to be parser-executed"</dfn>. Initially,
|
|
<code><a href="#the-script-element">script</a></code> elements must have this flag unset (script
|
|
blocks, when created, are not "ready to be parser-executed"). This
|
|
flag is used only for elements that are also
|
|
<a href="#parser-inserted">"parser-inserted"</a>, to let the parser know when to
|
|
execute the script.</p>
|
|
|
|
<p>The last few pieces of state are <dfn id="the-script-block-s-type"><var>the script block's
|
|
type</var></dfn>, <dfn id="the-script-block-s-character-encoding"><var>the script block's character
|
|
encoding</var></dfn>, and <dfn id="the-script-block-s-fallback-character-encoding"><var>the script block's fallback
|
|
character encoding</var></dfn>. They are determined when the script
|
|
is prepared, based on the attributes on the element at that time,
|
|
and the <code><a href="#document">Document</a></code> of the <code><a href="#the-script-element">script</a></code>
|
|
element.</p>
|
|
|
|
<p>When a <code><a href="#the-script-element">script</a></code> element that is not marked as being
|
|
<a href="#parser-inserted">"parser-inserted"</a> experiences one of the events listed
|
|
in the following list, the user agent must synchronously <a href="#prepare-a-script" title="prepare a script">prepare</a> the <code><a href="#the-script-element">script</a></code>
|
|
element:</p>
|
|
|
|
<ul><li>The <code><a href="#the-script-element">script</a></code> element gets <a href="#insert-an-element-into-a-document" title="insert an
|
|
element into a document">inserted into a document</a>.</li>
|
|
|
|
<li>The <code><a href="#the-script-element">script</a></code> element is <a href="#in-a-document">in a
|
|
<code>Document</code></a> and its child nodes are changed.</li>
|
|
|
|
<li>The <code><a href="#the-script-element">script</a></code> element is <a href="#in-a-document">in a
|
|
<code>Document</code></a> and has a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute set where previously
|
|
the element had no such attribute.</li>
|
|
|
|
</ul><p>To <dfn id="prepare-a-script" title="prepare a script">prepare a script</dfn>, the user
|
|
agent must act as follows:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the <code><a href="#the-script-element">script</a></code> element is marked as having
|
|
<a href="#already-started">"already started"</a>, then the user agent must abort
|
|
these steps at this point. The script is not executed.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the element has its <a href="#parser-inserted">"parser-inserted"</a> flag set,
|
|
then set <var title="">was-parser-inserted</var> to true and unset
|
|
the element's <a href="#parser-inserted">"parser-inserted"</a> flag. Otherwise, set
|
|
<var title="">was-parser-inserted</var> to false.</p>
|
|
|
|
<p class="note">This is done so that if parser-inserted
|
|
<code><a href="#the-script-element">script</a></code> elements fail to run when the parser tries to
|
|
run them, e.g. because they are empty or specify an unsupported
|
|
scripting language, another script can later mutate them and cause
|
|
them to run again.</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">was-parser-inserted</var> is true and the
|
|
element does not have an <code title="attr-script-async"><a href="#attr-script-async">async</a></code> attribute, then set the
|
|
element's <a href="#force-async">"force-async"</a> flag to true.</p>
|
|
|
|
<p class="note">This is done so that if a parser-inserted
|
|
<code><a href="#the-script-element">script</a></code> element fails to run when the parser tries to
|
|
run it, but it is later executed after a script dynamically
|
|
updates it, it will execute asynchronously even if the
|
|
<code title="attr-script-async"><a href="#attr-script-async">async</a></code> attribute isn't
|
|
set.</p>
|
|
|
|
</li>
|
|
|
|
<li id="script-processing-empty">
|
|
|
|
<p>If the element has no <code title="attr-script-src"><a href="#attr-script-src">src</a></code>
|
|
attribute, and its child nodes, if any, consist only of comment
|
|
nodes and empty <a href="#text-node" title="text node">text nodes</a>, then
|
|
the user agent must abort these steps at this point. The script is
|
|
not executed.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the element is not <a href="#in-a-document">in a <code>Document</code></a>,
|
|
then the user agent must abort these steps at this point. The
|
|
script is not executed.</p>
|
|
|
|
</li>
|
|
|
|
<li id="script-processing-prepare">
|
|
|
|
<p>If either:</p>
|
|
|
|
<ul class="brief"><li>the <code><a href="#the-script-element">script</a></code> element has a <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute and its value is
|
|
the empty string, or</li>
|
|
|
|
<li>the <code><a href="#the-script-element">script</a></code> element has no <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute but it has a <code title="attr-script-language"><a href="#attr-script-language">language</a></code> attribute and
|
|
<em>that</em> attribute's value is the empty string, or</li>
|
|
|
|
<li>the <code><a href="#the-script-element">script</a></code> element has neither a <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute nor a <code title="attr-script-language"><a href="#attr-script-language">language</a></code> attribute, then</li>
|
|
|
|
</ul><p>...let <var><a href="#the-script-block-s-type">the script block's type</a></var> for this
|
|
<code><a href="#the-script-element">script</a></code> element be "<code title="">text/javascript</code>".</p>
|
|
|
|
<p>Otherwise, if the <code><a href="#the-script-element">script</a></code> element has a <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute, let <var><a href="#the-script-block-s-type">the
|
|
script block's type</a></var> for this <code><a href="#the-script-element">script</a></code> element be
|
|
the value of that attribute with any leading or trailing sequences
|
|
of <a href="#space-character" title="space character">space characters</a>
|
|
removed.</p>
|
|
|
|
<p>Otherwise, the element has a non-empty <code title="attr-script-language"><a href="#attr-script-language">language</a></code> attribute; let
|
|
<var><a href="#the-script-block-s-type">the script block's type</a></var> for this <code><a href="#the-script-element">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"><a href="#attr-script-language">language</a></code> attribute.</p>
|
|
<p class="note">The <code title="attr-script-language"><a href="#attr-script-language">language</a></code> attribute is never
|
|
conforming, and is always ignored if there is a <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute present.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the user agent does not <a href="#support-the-scripting-language">support the scripting
|
|
language</a> given by <var><a href="#the-script-block-s-type">the script block's type</a></var> for
|
|
this <code><a href="#the-script-element">script</a></code> element, then the user agent must abort
|
|
these steps at this point. The script is not executed.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">was-parser-inserted</var> is true, then flag
|
|
the element as <a href="#parser-inserted">"parser-inserted"</a> again, and set the
|
|
element's <a href="#force-async">"force-async"</a> flag to false.</p>
|
|
|
|
</li>
|
|
|
|
<li id="script-processing-start">
|
|
|
|
<p>The user agent must set the element's <a href="#already-started">"already
|
|
started"</a> flag.</p>
|
|
|
|
<p class="note">The state of the element at this moment <a href="#establish-script-block-source">is later used</a> to
|
|
determine the script source.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the element is flagged as <a href="#parser-inserted">"parser-inserted"</a>,
|
|
but the element's <code><a href="#document">Document</a></code> is not the
|
|
<code><a href="#document">Document</a></code> of the parser that created the element, then
|
|
abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li id="script-processing-noscript">
|
|
|
|
<p>If <a href="#concept-n-noscript" title="concept-n-noscript">scripting is
|
|
disabled</a> for the <code><a href="#the-script-element">script</a></code> element, then the user
|
|
agent must abort these steps at this point. The script is not
|
|
executed.</p>
|
|
|
|
<p class="note">The definition of <a href="#concept-n-noscript" title="concept-n-noscript">scripting is disabled</a> means
|
|
that, amongst others, the following scripts will not execute:
|
|
scripts in <code>XMLHttpRequest</code>'s <code title="dom-XMLHttpRequest-responseXML">responseXML</code>
|
|
documents, scripts in <code>DOMParser</code>-created documents,
|
|
scripts in documents created by <code>XSLTProcessor</code>'s <code title="dom-XSLTProcessor-transformToDocument">transformToDocument</code>
|
|
feature, and scripts that are first inserted by a script into a
|
|
<code><a href="#document">Document</a></code> that was created using the <code title="dom-DOMImplementation-createDocument"><a href="#dom-domimplementation-createdocument">createDocument()</a></code>
|
|
API. <a href="#refsXHR">[XHR]</a> <a href="#refsDOMPARSER">[DOMPARSER]</a> <a href="#refsDOMCORE">[DOMCORE]</a></p>
|
|
|
|
|
|
</li>
|
|
|
|
<li id="script-processing-for">
|
|
|
|
<p>If the <code><a href="#the-script-element">script</a></code> element has an <code title="attr-script-event"><a href="#attr-script-event">event</a></code> attribute and a <code title="attr-script-for"><a href="#attr-script-for">for</a></code> attribute, then run these
|
|
substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">for</var> be the value of the <code title="attr-script-for"><a href="#attr-script-for">for</a></code> attribute.</li>
|
|
|
|
<li><p>Let <var title="">event</var> be the value of the <code title="attr-script-event"><a href="#attr-script-event">event</a></code> attribute.</li>
|
|
|
|
<li><p><a href="#strip-leading-and-trailing-whitespace">Strip leading and trailing whitespace</a> from
|
|
<var title="">event</var> and <var title="">for</var>.</li>
|
|
|
|
<li><p>If <var title="">for</var> is not an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">window</code>", then the user agent must abort these
|
|
steps at this point. The script is not executed.</li>
|
|
|
|
<li><p>If <var title="">event</var> is not an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for either the string "<code title="">onload</code>" or the string "<code title="">onload()</code>", then the user agent must abort these
|
|
steps at this point. The script is not executed.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li id="script-processing-encoding">
|
|
|
|
<p>If the <code><a href="#the-script-element">script</a></code> element has a <code title="attr-script-charset"><a href="#attr-script-charset">charset</a></code> attribute, then let
|
|
<var><a href="#the-script-block-s-character-encoding">the script block's character encoding</a></var> for this
|
|
<code><a href="#the-script-element">script</a></code> element be the encoding given by the <code title="attr-script-charset"><a href="#attr-script-charset">charset</a></code> attribute.</p>
|
|
|
|
<p>Otherwise, let <var><a href="#the-script-block-s-fallback-character-encoding">the script block's fallback character
|
|
encoding</a></var> for this <code><a href="#the-script-element">script</a></code> element be the same as
|
|
<a href="#document-s-character-encoding" title="document's character encoding">the encoding of the
|
|
document itself</a>.</p>
|
|
|
|
<p class="note">Only one of these two pieces of state is set.</p>
|
|
|
|
</li>
|
|
|
|
<li id="script-processing-src-prepare">
|
|
|
|
<p>If the element has a <code title="attr-script-src"><a href="#attr-script-src">src</a></code>
|
|
attribute whose value is not the empty string, then the value of
|
|
that attribute must be <a href="#resolve-a-url" title="resolve a url">resolved</a>
|
|
relative to the element, and if that is successful, the specified
|
|
resource must then be <a href="#fetch" title="fetch">fetched</a>, from the
|
|
<a href="#origin">origin</a> of the element's <code><a href="#document">Document</a></code>.</p>
|
|
|
|
|
|
<p>If the <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute's
|
|
value is the empty string or if it could not be resolved, then the
|
|
user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-error">error</code> at the
|
|
element, and abort these steps.</p>
|
|
|
|
<p>For historical reasons, if the <a href="#url">URL</a> is a <a href="#javascript-protocol" title="javascript protocol"><code title="">javascript:</code>
|
|
URL</a>, then the user agent must not, despite the requirements
|
|
in the definition of the <a href="#fetch" title="fetch">fetching</a>
|
|
algorithm, actually execute the script in the URL; instead the
|
|
user agent must act as if it had received an empty HTTP 400
|
|
response.</p>
|
|
|
|
<p>For performance reasons, user agents may start fetching 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 <a href="#insert-an-element-into-a-document" title="insert an element into a
|
|
document">inserted into the document</a>, 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="#attr-script-src">src</a></code> attribute is dynamically
|
|
changed, then the
|
|
user agent will not execute the script, and the fetching process
|
|
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 id="script-processing-defer">If the element has a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute, and the element has
|
|
a <code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code> attribute, and the
|
|
element has been flagged as <a href="#parser-inserted">"parser-inserted"</a>, and
|
|
the element does not have an <code title="attr-script-async"><a href="#attr-script-async">async</a></code> attribute</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The element must be added to the end of the <dfn id="list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of
|
|
scripts that will execute when the document has finished
|
|
parsing</dfn> associated with the <code><a href="#document">Document</a></code> of the
|
|
parser that created the element.</p>
|
|
|
|
<p>The <a href="#concept-task" title="concept-task">task</a> that the
|
|
<a href="#networking-task-source">networking task source</a> places on the <a href="#task-queue">task
|
|
queue</a> once the <a href="#fetch" title="fetch">fetching
|
|
algorithm</a> has completed must set the element's
|
|
<a href="#ready-to-be-parser-executed">"ready to be parser-executed"</a> flag. The parser will
|
|
handle executing the script.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt id="script-processing-parser-inserted">If the element has a
|
|
<code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute, and the
|
|
element has been flagged as <a href="#parser-inserted">"parser-inserted"</a>, and
|
|
the element does not have an <code title="attr-script-async"><a href="#attr-script-async">async</a></code> attribute</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The element is the <a href="#pending-parsing-blocking-script">pending parsing-blocking
|
|
script</a> of the <code><a href="#document">Document</a></code> of the parser that
|
|
created the element. (There can only be one such script per
|
|
<code><a href="#document">Document</a></code> at a time.)</p>
|
|
|
|
<p>The <a href="#concept-task" title="concept-task">task</a> that the
|
|
<a href="#networking-task-source">networking task source</a> places on the <a href="#task-queue">task
|
|
queue</a> once the <a href="#fetch" title="fetch">fetching
|
|
algorithm</a> has completed must set the element's
|
|
<a href="#ready-to-be-parser-executed">"ready to be parser-executed"</a> flag. The parser will
|
|
handle executing the script.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt id="script-processing-style-delayed">If the element does not
|
|
have a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute, and
|
|
the element has been flagged as <a href="#parser-inserted">"parser-inserted"</a>,
|
|
and the <code><a href="#document">Document</a></code> of the <a href="#html-parser">HTML parser</a> or
|
|
<a href="#xml-parser">XML parser</a> that created the <code><a href="#the-script-element">script</a></code>
|
|
element <a href="#has-a-style-sheet-that-is-blocking-scripts">has a style sheet that is blocking
|
|
scripts</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The element is the <a href="#pending-parsing-blocking-script">pending parsing-blocking
|
|
script</a> of the <code><a href="#document">Document</a></code> of the parser that
|
|
created the element. (There can only be one such script per
|
|
<code><a href="#document">Document</a></code> at a time.)</p>
|
|
|
|
<p>Set the element's <a href="#ready-to-be-parser-executed">"ready to be parser-executed"</a>
|
|
flag. The parser will handle executing the script.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt id="script-processing-src-sync">If the element has a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute, does not have an
|
|
<code title="attr-script-async"><a href="#attr-script-async">async</a></code> attribute, and does
|
|
not have the <a href="#force-async">"force-async"</a> flag set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The element must be added to the end of the <dfn id="list-of-scripts-that-will-execute-in-order-as-soon-as-possible">list of
|
|
scripts that will execute in order as soon as possible</dfn>
|
|
associated with the <code><a href="#document">Document</a></code> of the
|
|
<code><a href="#the-script-element">script</a></code> element at the time the <a href="#prepare-a-script">prepare a
|
|
script</a> algorithm started.</p>
|
|
|
|
<p>The <a href="#concept-task" title="concept-task">task</a> that the
|
|
<a href="#networking-task-source">networking task source</a> places on the <a href="#task-queue">task
|
|
queue</a> once the <a href="#fetch" title="fetch">fetching
|
|
algorithm</a> has completed must run the following steps:</p>
|
|
|
|
<ol><li><p>If the element is not now the first element in the
|
|
<a href="#list-of-scripts-that-will-execute-in-order-as-soon-as-possible">list of scripts that will execute in order as soon as
|
|
possible</a> to which it was added above, then mark the
|
|
element as ready but abort these steps without executing the
|
|
script yet.</li>
|
|
|
|
<li><p><i>Execution</i>: <a href="#execute-the-script-block">Execute the script block</a>
|
|
corresponding to the first script element in this <a href="#list-of-scripts-that-will-execute-in-order-as-soon-as-possible">list of
|
|
scripts that will execute in order as soon as
|
|
possible</a>.</li>
|
|
|
|
<li><p>Remove the first element from this <a href="#list-of-scripts-that-will-execute-in-order-as-soon-as-possible">list of scripts
|
|
that will execute in order as soon as possible</a>.</li>
|
|
|
|
<li><p>If this <a href="#list-of-scripts-that-will-execute-in-order-as-soon-as-possible">list of scripts that will execute in order
|
|
as soon as possible</a> is still not empty and the first
|
|
entry has already been marked as ready, then jump back to the
|
|
step labeled <i>execution</i>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt id="script-processing-src">If the element has a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The element must be added to the <dfn id="set-of-scripts-that-will-execute-as-soon-as-possible">set of scripts that
|
|
will execute as soon as possible</dfn> of the
|
|
<code><a href="#document">Document</a></code> of the <code><a href="#the-script-element">script</a></code> element at the
|
|
time the <a href="#prepare-a-script">prepare a script</a> algorithm started.</p>
|
|
|
|
<p>The <a href="#concept-task" title="concept-task">task</a> that the
|
|
<a href="#networking-task-source">networking task source</a> places on the <a href="#task-queue">task
|
|
queue</a> once the <a href="#fetch" title="fetch">fetching
|
|
algorithm</a> has completed must <a href="#execute-the-script-block">execute the script
|
|
block</a> and then remove the element from the <a href="#set-of-scripts-that-will-execute-as-soon-as-possible">set of
|
|
scripts that will execute as soon as possible</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt id="script-processing-inline">Otherwise</dt>
|
|
|
|
<dd>The user agent must immediately <a href="#execute-the-script-block">execute the script
|
|
block</a>, even if other scripts are already executing.</dd>
|
|
|
|
</dl></li>
|
|
|
|
</ol><p>Fetching an external script must <a href="#delay-the-load-event">delay the load
|
|
event</a> of the element's document until the <a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue a
|
|
task">queued</a> by the <a href="#networking-task-source">networking task source</a> once
|
|
the resource has been <a href="#fetch" title="fetch">fetched</a> (defined
|
|
above) has been run.</p>
|
|
|
|
<p>The <dfn id="pending-parsing-blocking-script">pending parsing-blocking script</dfn> of a
|
|
<code><a href="#document">Document</a></code> is used by the <code><a href="#document">Document</a></code>'s
|
|
parser(s).</p>
|
|
|
|
<p class="note">If a <code><a href="#the-script-element">script</a></code> element that blocks a
|
|
parser gets moved to another <code><a href="#document">Document</a></code> before it would
|
|
normally have stopped blocking that parser, it nonetheless continues
|
|
blocking that parser until the condition that causes it to be
|
|
blocking the parser no longer applies (e.g. if the script is a
|
|
<a href="#pending-parsing-blocking-script">pending parsing-blocking script</a> because there was
|
|
<a href="#a-style-sheet-that-is-blocking-scripts">a style sheet that is blocking scripts</a> when it was
|
|
parsed, but then the script is moved to another
|
|
<code><a href="#document">Document</a></code> before the style sheet loads, the script still
|
|
blocks the parser until the style sheets are all loaded, at which
|
|
time the script executes and the parser is unblocked).</p>
|
|
|
|
|
|
<p>When the user agent is required to <dfn id="execute-the-script-block" title="execute the script
|
|
block">execute a script block</dfn>, it must run the following
|
|
steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the element is flagged as <a href="#parser-inserted">"parser-inserted"</a>,
|
|
but the element's <code><a href="#document">Document</a></code> is not the
|
|
<code><a href="#document">Document</a></code> of the parser that created the element, then
|
|
abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Jump to the appropriate set of steps from the list below:</p>
|
|
|
|
<dl class="switch"><dt>If the load resulted in an error (for example a DNS error, or
|
|
an HTTP 404 error)</dt>
|
|
|
|
<dd><p>Executing the script block must just consist of <a href="#fire-a-simple-event" title="fire a simple event">firing a simple event</a> named
|
|
<code title="event-error">error</code> at the element.</dd>
|
|
|
|
<dt>If the load was successful</dt>
|
|
|
|
<!-- SCRIPT EXEC -->
|
|
<dd>
|
|
|
|
<p>Executing the script block must consist of running the
|
|
following steps. For the purposes of these steps, the script is
|
|
considered to be from an <i>external file</i> if, while the
|
|
<a href="#prepare-a-script">prepare a script</a> algorithm above was running for
|
|
this script, the <code><a href="#the-script-element">script</a></code> element had a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute specified.</p>
|
|
|
|
<ol><li id="establish-script-block-source">
|
|
|
|
<p>Initialize <dfn id="the-script-block-s-source"><var>the script block's source</var></dfn>
|
|
as follows:</p>
|
|
|
|
<dl class="switch"><dt>If the script is from an external file and <var><a href="#the-script-block-s-type">the
|
|
script block's type</a></var> is a text-based language</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The contents of that file, interpreted as string of
|
|
Unicode characters, are the script source.</p>
|
|
|
|
<p>To obtain the string of Unicode characters, the user
|
|
agent run the following steps:</p>
|
|
|
|
<ol><li><p>If the resource's <a href="#content-type" title="Content-Type">Content
|
|
Type metadata</a>, if any, specifies a character
|
|
encoding, and the user agent supports that encoding, then
|
|
let <var title="">character encoding</var> be that
|
|
encoding, and jump to the bottom step in this series of
|
|
steps.</li>
|
|
|
|
<li><p>If the algorithm above set <var><a href="#the-script-block-s-character-encoding">the script block's
|
|
character encoding</a></var>, then let <var title="">character
|
|
encoding</var> be that encoding, and jump to the bottom
|
|
step in this series of steps.</li>
|
|
|
|
<li><p>For each of the rows in the following table,
|
|
starting with the first one and going down, if the file has
|
|
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 set <var title="">character encoding</var> to the encoding given in
|
|
the cell in the second column of that row, and jump to the
|
|
bottom step in this series of steps:</p>
|
|
|
|
|
|
<table id="table-script-bom"><thead><tr><th>Bytes in Hexadecimal
|
|
<th>Encoding
|
|
<tbody><tr><td>FE FF
|
|
<td>Big-endian UTF-16
|
|
<tr><td>FF FE
|
|
<td>Little-endian UTF-16
|
|
<tr><td>EF BB BF
|
|
<td>UTF-8
|
|
</table><p class="note">This step looks for Unicode Byte Order
|
|
Marks (BOMs).</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">character encoding</var> be
|
|
<var><a href="#the-script-block-s-fallback-character-encoding">the script block's fallback character
|
|
encoding</a></var>.</li>
|
|
|
|
<li><p>Convert the file to Unicode using <var>character
|
|
encoding</var>, following the rules for doing so given by
|
|
the specification for <var><a href="#the-script-block-s-type">the script block's
|
|
type</a></var>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>If the script is from an external file and <var><a href="#the-script-block-s-type">the
|
|
script block's type</a></var> is an XML-based language</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The external file is the script source. When it is later
|
|
executed, it must be interpreted in a manner consistent with
|
|
the specification defining the language given by <var><a href="#the-script-block-s-type">the
|
|
script block's type</a></var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the script is inline and <var><a href="#the-script-block-s-type">the script block's
|
|
type</a></var> is a text-based language</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The value of the <code title="dom-script-text"><a href="#dom-script-text">text</a></code> IDL attribute at the
|
|
time the element's <a href="#already-started">"already started"</a> flag was
|
|
last set is the script source.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the script is inline and <var><a href="#the-script-block-s-type">the script block's
|
|
type</a></var> is an XML-based language</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The child nodes of the <code><a href="#the-script-element">script</a></code> element at the
|
|
time the element's <a href="#already-started">"already started"</a> flag was
|
|
last set are the script source.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>If the script is from an external file, then increment the
|
|
<a href="#ignore-destructive-writes-counter">ignore-destructive-writes counter</a> of the
|
|
<code><a href="#the-script-element">script</a></code> element's <code><a href="#document">Document</a></code>. Let <var title="">neutralized doc</var> be that
|
|
<code><a href="#document">Document</a></code>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#create-a-script-from-a-node" title="create a script from a node">Create a
|
|
script</a> from the <code><a href="#the-script-element">script</a></code> element node, using
|
|
<var><a href="#the-script-block-s-source">the script block's source</a></var> and <var><a href="#the-script-block-s-type">the script
|
|
block's type</a></var>.</p>
|
|
|
|
<p class="note">This is where the script is compiled and
|
|
actually executed.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Decrement the <a href="#ignore-destructive-writes-counter">ignore-destructive-writes
|
|
counter</a> of <var title="">neutralized doc</var>, if it
|
|
was incremented in the earlier step.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the script is from an external file, <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-load">load</code> at the
|
|
<code><a href="#the-script-element">script</a></code> element.</p>
|
|
|
|
<p>Otherwise, the script is internal; <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-load">load</code> at the <code><a href="#the-script-element">script</a></code>
|
|
element.</p>
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl></li>
|
|
|
|
</ol><p>The IDL attributes <dfn id="dom-script-src" title="dom-script-src"><code>src</code></dfn>, <dfn id="dom-script-type" title="dom-script-type"><code>type</code></dfn>, <dfn id="dom-script-charset" title="dom-script-charset"><code>charset</code></dfn>, and <dfn id="dom-script-defer" 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 <dfn id="dom-script-async" title="dom-script-async"><code>async</code></dfn> IDL
|
|
attribute controls whether the element will execute asynchronously
|
|
or not. If the element's <a href="#force-async">"force-async"</a> flag is set,
|
|
then, on getting, the <code title="dom-script-async"><a href="#dom-script-async">async</a></code>
|
|
IDL attribute must return true, and on setting, the
|
|
<a href="#force-async">"force-async"</a> flag must first be unset, and then the
|
|
content attribute must be removed if the IDL attribute's new value
|
|
is false, and must be set to the empty string if the IDL attribute's
|
|
new value is true. If the element's <a href="#force-async">"force-async"</a> flag
|
|
is <em>not</em> set, the IDL attribute must <a href="#reflect">reflect</a> the
|
|
<code title="attr-script-async"><a href="#attr-script-async">async</a></code> content attribute.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">script</var> . <code title="dom-script-text"><a href="#dom-script-text">text</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the contents of the element, ignoring child nodes that
|
|
aren't <a href="#text-node" title="text node">text nodes</a>.</p>
|
|
|
|
<p>Can be set, to replace the element's children with the given
|
|
value.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The IDL attribute <dfn id="dom-script-text" 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="#the-script-element">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> IDL attribute.</p>
|
|
|
|
</div><p class="note">When inserted using the <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code> method,
|
|
<code><a href="#the-script-element">script</a></code> elements execute (typically synchronously), but
|
|
when inserted using <code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code> and <code title="dom-outerHTML"><a href="#dom-outerhtml">outerHTML</a></code> attributes, they do not
|
|
execute at all.<div class="example">
|
|
|
|
<p>In this example, two <code><a href="#the-script-element">script</a></code> elements are used. One
|
|
embeds an external script, and the other includes some data.</p>
|
|
|
|
<pre><script src="game-engine.js"></script>
|
|
<script type="text/x-game-map">
|
|
........U.........e
|
|
o............A....e
|
|
.....A.....AAA....e
|
|
.A..AAA...AAAAA...e
|
|
</script></pre>
|
|
|
|
<p>The data in this case might be used by the script to generate
|
|
the map of a video game. The data doesn't have to be used that way,
|
|
though; maybe the map data is actually embedded in other parts of
|
|
the page's markup, and the data block here is just used by the
|
|
site's search engine to help users who are looking for particular
|
|
features in their game maps.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following sample shows how a script element can be used to
|
|
define a function that is then used by other parts of the
|
|
document. It also shows how a <code><a href="#the-script-element">script</a></code> element can be
|
|
used to invoke script while the document is being parsed, in this
|
|
case to initialize the form's output.</p>
|
|
|
|
<pre><script>
|
|
function calculate(form) {
|
|
var price = 52000;
|
|
if (form.elements.brakes.checked)
|
|
price += 1000;
|
|
if (form.elements.radio.checked)
|
|
price += 2500;
|
|
if (form.elements.turbo.checked)
|
|
price += 5000;
|
|
if (form.elements.sticker.checked)
|
|
price += 250;
|
|
form.elements.result.value = price;
|
|
}
|
|
</script>
|
|
<form name="pricecalc" onsubmit="return false" onchange="calculate(this)">
|
|
<fieldset>
|
|
<legend>Work out the price of your car</legend>
|
|
<p>Base cost: £52000.</p>
|
|
<p>Select additional options:</p>
|
|
<ul>
|
|
<li><label><input type=checkbox name=brakes> Ceramic brakes (£1000)</label></li>
|
|
<li><label><input type=checkbox name=radio> Satellite radio (£2500)</label></li>
|
|
<li><label><input type=checkbox name=turbo> Turbo charger (£5000)</label></li>
|
|
<li><label><input type=checkbox name=sticker> "XZ" sticker (£250)</label></li>
|
|
</ul>
|
|
<p>Total: £<output name=result></output></p>
|
|
</fieldset>
|
|
<script>
|
|
calculate(document.forms.pricecalc);
|
|
</script>
|
|
</form></pre>
|
|
|
|
</div><h5 id="scriptingLanguages"><span class="secno">4.3.1.1 </span>Scripting languages</h5><div class="impl">
|
|
|
|
<p>A user agent is said to <dfn id="support-the-scripting-language">support the scripting language</dfn>
|
|
if <var><a href="#the-script-block-s-type">the script block's type</a></var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the <a href="#mime-type">MIME type</a> string
|
|
of a scripting language that the user agent implements.</p>
|
|
|
|
</div><p>The following lists some <a href="#mime-type">MIME type</a> strings and the
|
|
languages to which they refer:<dl><dt>"<code>application/ecmascript</code>"</dt>
|
|
<dt>"<code>application/javascript</code>"</dt>
|
|
<dt>"<code>application/x-ecmascript</code>"</dt>
|
|
<dt>"<code>application/x-javascript</code>"</dt>
|
|
<dt>"<code>text/ecmascript</code>"</dt>
|
|
<dt>"<code>text/javascript</code>"</dt>
|
|
<dt>"<code>text/javascript1.0</code>"</dt>
|
|
<dt>"<code>text/javascript1.1</code>"</dt>
|
|
<dt>"<code>text/javascript1.2</code>"</dt>
|
|
<dt>"<code>text/javascript1.3</code>"</dt>
|
|
<dt>"<code>text/javascript1.4</code>"</dt>
|
|
<dt>"<code>text/javascript1.5</code>"</dt>
|
|
<dt>"<code>text/jscript</code>"</dt>
|
|
<dt>"<code>text/livescript</code>"</dt>
|
|
<dt>"<code>text/x-ecmascript</code>"</dt>
|
|
<dt>"<code>text/x-javascript</code>"</dt>
|
|
<dd>JavaScript. <a href="#refsECMA262">[ECMA262]</a></dd>
|
|
|
|
<dt>"<code>text/javascript;e4x=1</code>"</dt>
|
|
<dd>JavaScript with ECMAScript for XML. <a href="#refsECMA357">[ECMA357]</a></dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>User agents may support other <a href="#mime-type" title="MIME type">MIME
|
|
types</a> 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. The <code title="">charset</code> parameter must be treated as an unknown
|
|
parameter for the purpose of comparing <a href="#mime-type" title="MIME type">MIME
|
|
types</a> here.</p>
|
|
|
|
</div><h5 id="restrictions-for-contents-of-script-elements"><span class="secno">4.3.1.2 </span><dfn title="script content restrictions">Restrictions for contents of <code>script</code> elements</dfn></h5><p>The <code><a href="#textcontent">textContent</a></code> of a <code><a href="#the-script-element">script</a></code> element
|
|
must match the <code title="">script</code> production in the
|
|
following ABNF, the character set for which is Unicode. <a href="#refsABNF">[ABNF]</a><pre>script = data1 *( escape [ script-start data3 ] "-->" data1 ) [ escape ]
|
|
escape = "<!--" data2 *( script-start data3 script-end data2 )
|
|
|
|
data1 = <any string that doesn't contain a substring that matches not-data1>
|
|
not-data1 = "<!--"
|
|
|
|
data2 = <any string that doesn't contain a substring that matches not-data2>
|
|
not-data2 = script-start / "-->"
|
|
|
|
data3 = <any string that doesn't contain a substring that matches not-data3>
|
|
not-data3 = script-end / "-->"
|
|
|
|
script-start = lt s c r i p t tag-end
|
|
script-end = lt slash s c r i p t tag-end
|
|
|
|
lt = %x003C ; U+003C LESS-THAN SIGN character (<)
|
|
slash = %x002F ; U+002F SOLIDUS character (/)
|
|
|
|
s = %x0053 ; U+0053 LATIN CAPITAL LETTER S
|
|
s =/ %x0073 ; U+0073 LATIN SMALL LETTER S
|
|
c = %x0043 ; U+0043 LATIN CAPITAL LETTER C
|
|
c =/ %x0063 ; U+0063 LATIN SMALL LETTER C
|
|
r = %x0052 ; U+0052 LATIN CAPITAL LETTER R
|
|
r =/ %x0072 ; U+0072 LATIN SMALL LETTER R
|
|
i = %x0049 ; U+0049 LATIN CAPITAL LETTER I
|
|
i =/ %x0069 ; U+0069 LATIN SMALL LETTER I
|
|
p = %x0050 ; U+0050 LATIN CAPITAL LETTER P
|
|
p =/ %x0070 ; U+0070 LATIN SMALL LETTER P
|
|
t = %x0054 ; U+0054 LATIN CAPITAL LETTER T
|
|
t =/ %x0074 ; U+0074 LATIN SMALL LETTER T
|
|
|
|
tag-end = %x0009 ; U+0009 CHARACTER TABULATION (tab)
|
|
tag-end =/ %x000A ; U+000A LINE FEED (LF)
|
|
tag-end =/ %x000C ; U+000C FORM FEED (FF)
|
|
tag-end =/ %x0020 ; U+0020 SPACE
|
|
tag-end =/ %x002F ; U+002F SOLIDUS (/)
|
|
tag-end =/ %x003E ; U+003E GREATER-THAN SIGN (>)</pre><p>When a <code><a href="#the-script-element">script</a></code> element contains <a href="#inline-documentation-for-external-scripts">script
|
|
documentation</a>, there are further restrictions on the contents
|
|
of the element, as described in the section below.<h5 id="inline-documentation-for-external-scripts"><span class="secno">4.3.1.3 </span><dfn title="script documentation">Inline documentation for external scripts</dfn></h5><p>If a <code><a href="#the-script-element">script</a></code> element's <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute is specified, then the
|
|
contents of the <code><a href="#the-script-element">script</a></code> element, if any, must be such
|
|
that the value of the <code title="dom-script-text"><a href="#dom-script-text">text</a></code> IDL
|
|
attribute, which is derived from the element's contents, matches the
|
|
<code title="">documentation</code> production in the following
|
|
ABNF, the character set for which is Unicode. <a href="#refsABNF">[ABNF]</a><pre>documentation = *( *( space / tab / comment ) [ line-comment ] newline )
|
|
comment = slash star *( not-star / star not-slash ) 1*star slash
|
|
line-comment = slash slash *not-newline
|
|
|
|
; characters
|
|
tab = %x0009 ; U+0009 CHARACTER TABULATION (tab)
|
|
newline = %x000A ; U+000A LINE FEED (LF)
|
|
space = %x0020 ; U+0020 SPACE
|
|
star = %x002A ; U+002A ASTERISK (*)
|
|
slash = %x002F ; U+002F SOLIDUS (/)
|
|
not-newline = %x0000-0009 / %x000B-10FFFF
|
|
; a Unicode character other than U+000A LINE FEED (LF)
|
|
not-star = %x0000-0029 / %x002B-10FFFF
|
|
; a Unicode character other than U+002A ASTERISK (*)
|
|
not-slash = %x0000-002E / %x0030-10FFFF
|
|
; a Unicode character other than U+002F SOLIDUS (/)</pre><p class="note">This corresponds to putting the contents of the
|
|
element in JavaScript comments.<p class="note">This requirement is in addition to the earlier
|
|
restrictions on the syntax of contents of <code><a href="#the-script-element">script</a></code>
|
|
elements.<div class="example">
|
|
|
|
<p>This allows authors to include documentation, such as license
|
|
information or API information, inside their documents while still
|
|
referring to external script files. The syntax is constrained so
|
|
that authors don't accidentally include what looks like valid
|
|
script while also providing a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute.</p>
|
|
|
|
<pre><script src="cool-effects.js">
|
|
// create new instances using:
|
|
// var e = new Effect();
|
|
// start the effect using .play, stop using .stop:
|
|
// e.play();
|
|
// e.stop();
|
|
</script></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="scriptTagXSLT"><span class="secno">4.3.1.4 </span>Interaction of <code><a href="#the-script-element">script</a></code> elements and XSLT</h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>This specification does not define how XSLT interacts with the
|
|
<code><a href="#the-script-element">script</a></code> element (or, indeed, how XSLT processing
|
|
triggers the <a href="#stop-parsing">stop parsing</a> steps, how it interacts with
|
|
the <a href="#navigate" title="navigate">navigation</a> algorithm, or how it
|
|
fits in with the <a href="#event-loop">event loop</a>). However, in the absence
|
|
of another specification actually defining this, here are some
|
|
guidelines for implementors, based on existing implementations:</p>
|
|
|
|
<ul><li><p>When an XSLT transformation program is triggered by an <code title=""><?xml-stylesheet?></code> processing instruction and
|
|
the browser implements a direct-to-DOM transformation,
|
|
<code><a href="#the-script-element">script</a></code> elements created by the XSLT processor need to
|
|
be marked <a href="#parser-inserted">"parser-inserted"</a> and run in document order
|
|
(modulo scripts marked <code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code>
|
|
or <code title="attr-script-async"><a href="#attr-script-async">async</a></code>), asynchronously
|
|
while the transformation is occurring.</li>
|
|
|
|
<li><p>The <code title="dom-XSLTProcessor-transformToDocument">XSLTProcessor.transformToDocument()</code>
|
|
method adds elements to a <code><a href="#document">Document</a></code> that is not in a
|
|
<a href="#browsing-context">browsing context</a>, and, accordingly, any
|
|
<code><a href="#the-script-element">script</a></code> elements they create need to have their
|
|
<a href="#already-started">"already started"</a> flag set in the <a href="#prepare-a-script">prepare a
|
|
script</a> algorithm and never get executed (<a href="#concept-bc-noscript" title="concept-bc-noscript">scripting is disabled</a>). Such
|
|
<code><a href="#the-script-element">script</a></code> elements still need to be marked
|
|
<a href="#parser-inserted">"parser-inserted"</a>, though, such that their <code title="dom-script-async"><a href="#dom-script-async">async</a></code> IDL attribute will return
|
|
false in the absence of an <code title="attr-script-async"><a href="#attr-script-async">async</a></code> content attribute.</li>
|
|
|
|
<li><p>The <code title="dom-XSLTProcessor-transformToFragment">XSLTProcessor.transformToFragment()</code>
|
|
method needs to create a fragment that is equivalent to one built
|
|
manually by creating the elements using <code title="dom-document-createElementNS"><a href="#dom-document-createelementns">document.createElementNS()</a></code>.
|
|
For instance, it needs to create <code><a href="#the-script-element">script</a></code> elements that
|
|
aren't <a href="#parser-inserted">"parser-inserted"</a> and that don't have their
|
|
<a href="#already-started">"already started"</a> flag set, so that they will execute
|
|
when the fragment is inserted into a document.</li>
|
|
|
|
</ul><p>The main distinction between the first two cases and the last
|
|
case is that the first two operate on <code><a href="#document">Document</a></code>s and the
|
|
last operates on a fragment.</p>
|
|
|
|
</div><h4 id="the-noscript-element"><span class="secno">4.3.2 </span>The <dfn><code>noscript</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#metadata-content">Metadata content</a>.</dd>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>In a <code><a href="#the-head-element">head</a></code> element of an <a href="#html-documents" title="HTML documents">HTML document</a>, if there are no ancestor <code><a href="#the-noscript-element">noscript</a></code> elements.</dd>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected in <a href="#html-documents">HTML documents</a>, if there are no ancestor <code><a href="#the-noscript-element">noscript</a></code> elements.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>When <a href="#concept-n-noscript" title="concept-n-noscript">scripting is disabled</a>, in a <code><a href="#the-head-element">head</a></code> element: in any order, zero or more <code><a href="#the-link-element">link</a></code> elements, zero or more <code><a href="#the-style-element">style</a></code> elements, and zero or more <code><a href="#the-meta-element">meta</a></code> elements.</dd>
|
|
<dd>When <a href="#concept-n-noscript" title="concept-n-noscript">scripting is disabled</a>, not in a <code><a href="#the-head-element">head</a></code> element: <a href="#transparent">transparent</a>, but there must be no <code><a href="#the-noscript-element">noscript</a></code> element descendants.</dd>
|
|
<dd>Otherwise: text that conforms to the requirements given in the prose.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-noscript-element">noscript</a></code> element <a href="#represents">represents</a> nothing
|
|
if <a href="#concept-n-script" title="concept-n-script">scripting is enabled</a>, and
|
|
<a href="#represents">represents</a> its children if <a href="#concept-n-noscript" title="concept-n-noscript">scripting is disabled</a>. 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>When used in <a href="#html-documents">HTML documents</a>, the allowed content
|
|
model is as follows:<dl><dt>In a <code><a href="#the-head-element">head</a></code> element, if <a href="#concept-n-noscript" title="concept-n-noscript">scripting is disabled</a> for the
|
|
<code><a href="#the-noscript-element">noscript</a></code> element</dt>
|
|
|
|
<dd><p>The <code><a href="#the-noscript-element">noscript</a></code> element must contain only
|
|
<code><a href="#the-link-element">link</a></code>, <code><a href="#the-style-element">style</a></code>, and <code><a href="#the-meta-element">meta</a></code>
|
|
elements.</dd>
|
|
|
|
<dt>In a <code><a href="#the-head-element">head</a></code> element, if <a href="#concept-n-script" title="concept-n-script">scripting is enabled</a> for the
|
|
<code><a href="#the-noscript-element">noscript</a></code> element</dt>
|
|
|
|
<dd><p>The <code><a href="#the-noscript-element">noscript</a></code> element must contain only text,
|
|
except that invoking the <a href="#html-fragment-parsing-algorithm">HTML fragment parsing
|
|
algorithm</a> with
|
|
the <code><a href="#the-noscript-element">noscript</a></code> element as the <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element and the
|
|
text contents as the <var title="">input</var> must result in a
|
|
list of nodes that consists only of <code><a href="#the-link-element">link</a></code>,
|
|
<code><a href="#the-style-element">style</a></code>, and <code><a href="#the-meta-element">meta</a></code> elements that would be
|
|
conforming if they were children of the <code><a href="#the-noscript-element">noscript</a></code>
|
|
element, and no <a href="#parse-error" title="parse error">parse
|
|
errors</a>.</dd>
|
|
|
|
<dt>Outside of <code><a href="#the-head-element">head</a></code> elements, if <a href="#concept-n-noscript" title="concept-n-noscript">scripting is disabled</a> for the
|
|
<code><a href="#the-noscript-element">noscript</a></code> element</dt>
|
|
|
|
<dd><p>The <code><a href="#the-noscript-element">noscript</a></code> element's content model is
|
|
<a href="#transparent">transparent</a>, with the additional restriction that a
|
|
<code><a href="#the-noscript-element">noscript</a></code> element must not have a <code><a href="#the-noscript-element">noscript</a></code>
|
|
element as an ancestor (that is, <code><a href="#the-noscript-element">noscript</a></code> can't be
|
|
nested).</dd>
|
|
|
|
<dt>Outside of <code><a href="#the-head-element">head</a></code> elements, if <a href="#concept-n-script" title="concept-n-script">scripting is enabled</a> for the
|
|
<code><a href="#the-noscript-element">noscript</a></code> element</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code><a href="#the-noscript-element">noscript</a></code> element must contain only text,
|
|
except that the text must be such that running the following
|
|
algorithm results in a conforming document with no
|
|
<code><a href="#the-noscript-element">noscript</a></code> elements and no <code><a href="#the-script-element">script</a></code>
|
|
elements, and such that no step in the algorithm causes an
|
|
<a href="#html-parser">HTML parser</a> to flag a <a href="#parse-error">parse error</a>:</p>
|
|
|
|
<ol><li>Remove every <code><a href="#the-script-element">script</a></code> element from the
|
|
document.</li>
|
|
|
|
<li>Make a list of every <code><a href="#the-noscript-element">noscript</a></code> element in the
|
|
document. For every <code><a href="#the-noscript-element">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="#the-noscript-element">noscript</a></code> element.</li>
|
|
|
|
<li>Take all the children of the <var title="">parent element</var>
|
|
that come before the <code><a href="#the-noscript-element">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="#the-noscript-element">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="#the-noscript-element">noscript</a></code>
|
|
element.</li>
|
|
|
|
<li>Set the <code title="dom-innerHTML"><a href="#dom-innerhtml">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="#the-noscript-element">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></dd>
|
|
|
|
</dl><p class="note">All these contortions are required because, for
|
|
historical reasons, the <code><a href="#the-noscript-element">noscript</a></code> element is handled
|
|
differently by the <a href="#html-parser">HTML parser</a> based on whether <a href="#scripting-flag" title="scripting flag">scripting was enabled or not</a> when the
|
|
parser was invoked.<p>The <code><a href="#the-noscript-element">noscript</a></code> element must not be used in <a href="#xml-documents">XML
|
|
documents</a>.<p class="note"><strong>The <code><a href="#the-noscript-element">noscript</a></code> element is only
|
|
effective in <a href="#syntax">the HTML syntax</a>, it has no effect in
|
|
<a href="#the-xhtml-syntax">the XHTML syntax</a>.</strong><div class="impl">
|
|
|
|
<p>The <code><a href="#the-noscript-element">noscript</a></code> element has no other requirements. In
|
|
particular, children of the <code><a href="#the-noscript-element">noscript</a></code> element are not
|
|
exempt from <a href="#form-submission">form submission</a>, scripting, and so forth,
|
|
even when <a href="#concept-n-script" title="concept-n-script">scripting is enabled</a>
|
|
for the element.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, a <code><a href="#the-noscript-element">noscript</a></code> element is
|
|
used to provide fallback for a script.</p>
|
|
|
|
<pre><form action="calcSquare.php">
|
|
<p>
|
|
<label for=x>Number</label>:
|
|
<input id="x" name="x" type="number">
|
|
</p>
|
|
<script>
|
|
var x = document.getElementById('x');
|
|
var output = document.createElement('p');
|
|
output.textContent = 'Type a number; it will be squared right then!';
|
|
x.form.appendChild(output);
|
|
x.form.onsubmit = function () { return false; }
|
|
x.oninput = function () {
|
|
var v = x.valueAsNumber;
|
|
output.textContent = v + ' squared is ' + v * v;
|
|
};
|
|
</script>
|
|
<noscript>
|
|
<input type=submit value="Calculate Square">
|
|
</noscript>
|
|
</form></pre>
|
|
|
|
<p>When script is disabled, a button appears to do the calculation
|
|
on the server side. When script is enabled, the value is computed
|
|
on-the-fly instead.</p>
|
|
|
|
<p>The <code><a href="#the-noscript-element">noscript</a></code> element is a blunt
|
|
instrument. Sometimes, scripts might be enabled, but for some
|
|
reason the page's script might fail. For this reason, it's
|
|
generally better to avoid using <code><a href="#the-noscript-element">noscript</a></code>, and to
|
|
instead design the script to change the page from being a
|
|
scriptless page to a scripted page on the fly, as in the next
|
|
example:</p>
|
|
|
|
<pre><form action="calcSquare.php">
|
|
<p>
|
|
<label for=x>Number</label>:
|
|
<input id="x" name="x" type="number">
|
|
</p>
|
|
<strong><input id="submit" type=submit value="Calculate Square"></strong>
|
|
<script>
|
|
var x = document.getElementById('x');
|
|
var output = document.createElement('p');
|
|
output.textContent = 'Type a number; it will be squared right then!';
|
|
x.form.appendChild(output);
|
|
x.form.onsubmit = function () { return false; }
|
|
x.oninput = function () {
|
|
var v = x.valueAsNumber;
|
|
output.textContent = v + ' squared is ' + v * v;
|
|
};
|
|
<strong> var submit = document.getElementById('submit');
|
|
submit.parentNode.removeChild(submit);</strong>
|
|
</script>
|
|
</form></pre>
|
|
|
|
<p>The above technique is also useful in XHTML, since
|
|
<code><a href="#the-noscript-element">noscript</a></code> is not supported in <a href="#the-xhtml-syntax">the XHTML
|
|
syntax</a>.</p>
|
|
|
|
</div><h3 id="sections"><span class="secno">4.4 </span>Sections</h3><h4 id="the-body-element"><span class="secno">4.4.1 </span>The <dfn><code>body</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#sectioning-root">Sectioning root</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As the second element in an <code><a href="#the-html-element">html</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="handler-window-onafterprint"><a href="#handler-window-onafterprint">onafterprint</a></code></dd>
|
|
<dd><code title="handler-window-onbeforeprint"><a href="#handler-window-onbeforeprint">onbeforeprint</a></code></dd>
|
|
<dd><code title="handler-window-onbeforeunload"><a href="#handler-window-onbeforeunload">onbeforeunload</a></code></dd>
|
|
<dd><code title="handler-window-onblur"><a href="#handler-window-onblur">onblur</a></code></dd>
|
|
<dd><code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code></dd>
|
|
<dd><code title="handler-window-onfocus"><a href="#handler-window-onfocus">onfocus</a></code></dd>
|
|
<dd><code title="handler-window-onhashchange"><a href="#handler-window-onhashchange">onhashchange</a></code></dd>
|
|
<dd><code title="handler-window-onload"><a href="#handler-window-onload">onload</a></code></dd>
|
|
<dd><code title="handler-window-onmessage"><a href="#handler-window-onmessage">onmessage</a></code></dd>
|
|
<dd><code title="handler-window-onoffline"><a href="#handler-window-onoffline">onoffline</a></code></dd>
|
|
<dd><code title="handler-window-ononline"><a href="#handler-window-ononline">ononline</a></code></dd>
|
|
<dd><code title="handler-window-onpagehide"><a href="#handler-window-onpagehide">onpagehide</a></code></dd>
|
|
<dd><code title="handler-window-onpageshow"><a href="#handler-window-onpageshow">onpageshow</a></code></dd>
|
|
<dd><code title="handler-window-onpopstate"><a href="#handler-window-onpopstate">onpopstate</a></code></dd>
|
|
<dd><code title="handler-window-onredo"><a href="#handler-window-onredo">onredo</a></code></dd>
|
|
<dd><code title="handler-window-onresize"><a href="#handler-window-onresize">onresize</a></code></dd>
|
|
<dd><code title="handler-window-onscroll"><a href="#handler-window-onscroll">onscroll</a></code></dd>
|
|
<dd><code title="handler-window-onstorage"><a href="#handler-window-onstorage">onstorage</a></code></dd>
|
|
<dd><code title="handler-window-onundo"><a href="#handler-window-onundo">onundo</a></code></dd>
|
|
<dd><code title="handler-window-onunload"><a href="#handler-window-onunload">onunload</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlbodyelement">HTMLBodyElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onafterprint" title="handler-window-onafterprint">onafterprint</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onbeforeprint" title="handler-window-onbeforeprint">onbeforeprint</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onbeforeunload" title="handler-window-onbeforeunload">onbeforeunload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onblur" title="handler-window-onblur">onblur</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onerror" title="handler-window-onerror">onerror</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onfocus" title="handler-window-onfocus">onfocus</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onhashchange" title="handler-window-onhashchange">onhashchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onload" title="handler-window-onload">onload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onmessage" title="handler-window-onmessage">onmessage</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onoffline" title="handler-window-onoffline">onoffline</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-ononline" title="handler-window-ononline">ononline</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpopstate" title="handler-window-onpopstate">onpopstate</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpagehide" title="handler-window-onpagehide">onpagehide</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpageshow" title="handler-window-onpageshow">onpageshow</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onredo" title="handler-window-onredo">onredo</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onresize" title="handler-window-onresize">onresize</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onscroll" title="handler-window-onscroll">onscroll</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onstorage" title="handler-window-onstorage">onstorage</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onundo" title="handler-window-onundo">onundo</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onunload" title="handler-window-onunload">onunload</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-body-element">body</a></code> element <a href="#represents">represents</a> the main
|
|
content of the document.<p>In conforming documents, there is only one <code><a href="#the-body-element">body</a></code>
|
|
element. The <code title="dom-document-body"><a href="#dom-document-body">document.body</a></code>
|
|
IDL attribute provides scripts with easy access to a document's
|
|
<code><a href="#the-body-element">body</a></code> element.<div class="impl">
|
|
|
|
<p class="note">Some DOM operations (for example, parts of the
|
|
<a href="#dnd">drag and drop</a> model) are defined in terms of "<a href="#the-body-element-0">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="#the-body-element">body</a></code> element.</p>
|
|
|
|
</div><p>The <code><a href="#the-body-element">body</a></code> element exposes as <a href="#event-handler-content-attributes">event handler
|
|
content attributes</a> a number of the <a href="#event-handlers">event
|
|
handlers</a> of the <code><a href="#window">Window</a></code> object. It also mirrors
|
|
their <a href="#event-handler-idl-attributes">event handler IDL attributes</a>.<p>The <code title="handler-window-onblur"><a href="#handler-window-onblur">onblur</a></code>, <code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code>, <code title="handler-window-onfocus"><a href="#handler-window-onfocus">onfocus</a></code>, <code title="handler-window-onload"><a href="#handler-window-onload">onload</a></code>, and <code title="handler-window-onscroll"><a href="#handler-window-onscroll">onscroll</a></code> <a href="#event-handlers">event
|
|
handlers</a> of the <code><a href="#window">Window</a></code> object, exposed on the
|
|
<code><a href="#the-body-element">body</a></code> element, shadow the generic <a href="#event-handlers">event
|
|
handlers</a> with the same names normally supported by <a href="#html-elements">HTML
|
|
elements</a>.<p class="example">Thus, for example, a bubbling <code title="event-error">error</code> event fired on a child of <a href="#the-body-element-0">the
|
|
body element</a> of a <code><a href="#document">Document</a></code> would first trigger
|
|
the <code title="handler-onerror"><a href="#handler-onerror">onerror</a></code> <a href="#event-handler-content-attributes">event handler
|
|
content attributes</a> of that element, then that of the root
|
|
<code><a href="#the-html-element">html</a></code> element, and only <em>then</em> would it trigger
|
|
the <code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code> <a href="#event-handler-content-attributes" title="event handler content attributes">event handler content
|
|
attribute</a> on the <code><a href="#the-body-element">body</a></code> element. This is because
|
|
the event would bubble from the target, to the <code><a href="#the-body-element">body</a></code>, to
|
|
the <code><a href="#the-html-element">html</a></code>, to the <code><a href="#document">Document</a></code>, to the
|
|
<code><a href="#window">Window</a></code>, and the <a href="#event-handlers" title="event handlers">event
|
|
handler</a> on the <code><a href="#the-body-element">body</a></code> is watching the
|
|
<code><a href="#window">Window</a></code> not the <code><a href="#the-body-element">body</a></code>. A regular event
|
|
listener attached to the <code><a href="#the-body-element">body</a></code> using <code title="">addEventListener()</code>, however, would fire when the
|
|
event bubbled through the <code><a href="#the-body-element">body</a></code> and not when it reaches
|
|
the <code><a href="#window">Window</a></code> object.<div class="example">
|
|
|
|
<p>This page updates an indicator to show whether or not the user
|
|
is online:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Online or offline?</title>
|
|
<script>
|
|
function update(online) {
|
|
document.getElementById('status').textContent =
|
|
online ? 'Online' : 'Offline';
|
|
}
|
|
</script>
|
|
</head>
|
|
<body ononline="update(true)"
|
|
onoffline="update(false)"
|
|
onload="update(navigator.onLine)">
|
|
<p>You are: <span id="status">(Unknown)</span></p>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><h4 id="the-section-element"><span class="secno">4.4.2 </span>The <dfn><code>section</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#sectioning-content">Sectioning content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-section-element">section</a></code> element <a href="#represents">represents</a> a
|
|
generic section of a document or application. A section, in this
|
|
context, is a thematic grouping of content, typically with a
|
|
heading.<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, and contact
|
|
information.<p class="note">Authors are encouraged to use the
|
|
<code><a href="#the-article-element">article</a></code> element instead of the <code><a href="#the-section-element">section</a></code>
|
|
element when it would make sense to syndicate the contents of the
|
|
element.<p class="note" id="use-div-for-wrappers">The <code><a href="#the-section-element">section</a></code>
|
|
element is not a generic container element. When an element is
|
|
needed for styling purposes or as a convenience for scripting,
|
|
authors are encouraged to use the <code><a href="#the-div-element">div</a></code> element
|
|
instead. A general rule is that the <code><a href="#the-section-element">section</a></code> element is
|
|
appropriate only if the element's contents would be listed
|
|
explicitly in the document's <a href="#outline">outline</a>.<div class="example">
|
|
|
|
<p>In the following example, we see an article (part of a larger
|
|
Web page) about apples, containing two short sections.</p>
|
|
|
|
<pre><article>
|
|
<hgroup>
|
|
<h1>Apples</h1>
|
|
<h2>Tasty, delicious fruit!</h2>
|
|
</hgroup>
|
|
<p>The apple is the pomaceous fruit of the apple tree.</p>
|
|
<section>
|
|
<h1>Red Delicious</h1>
|
|
<p>These bright red apples are the most common found in many
|
|
supermarkets.</p>
|
|
</section>
|
|
<section>
|
|
<h1>Granny Smith</h1>
|
|
<p>These juicy, green apples make a great filling for
|
|
apple pies.</p>
|
|
</section>
|
|
</article></pre>
|
|
|
|
<p>Notice how the use of <code><a href="#the-section-element">section</a></code> means that the author
|
|
can use <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> elements throughout, without having to
|
|
worry about whether a particular section is at the top level, the
|
|
second level, the third level, and so on.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is a graduation programme with two sections, one for the
|
|
list of people graduating, and one for the description of the
|
|
ceremony.</p>
|
|
|
|
<pre><!DOCTYPE Html>
|
|
<Html
|
|
><Head
|
|
><Title
|
|
>Graduation Ceremony Summer 2022</Title
|
|
></Head
|
|
><Body
|
|
><H1
|
|
>Graduation</H1
|
|
><Section
|
|
><H1
|
|
>Ceremony</H1
|
|
><P
|
|
>Opening Procession</P
|
|
><P
|
|
>Speech by Validactorian</P
|
|
><P
|
|
>Speech by Class President</P
|
|
><P
|
|
>Presentation of Diplomas</P
|
|
><P
|
|
>Closing Speech by Headmaster</P
|
|
></Section
|
|
><Section
|
|
><H1
|
|
>Graduates</H1
|
|
><Ul
|
|
><Li
|
|
>Molly Carpenter</Li
|
|
><Li
|
|
>Anastasia Luccio</Li
|
|
><Li
|
|
>Ebenezar McCoy</Li
|
|
><Li
|
|
>Karrin Murphy</Li
|
|
><Li
|
|
>Thomas Raith</Li
|
|
><Li
|
|
>Susan Rodriguez</Li
|
|
></Ul
|
|
></Section
|
|
></Body
|
|
></Html></pre>
|
|
|
|
</div><h4 id="the-nav-element"><span class="secno">4.4.3 </span>The <dfn><code>nav</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#sectioning-content">Sectioning content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-nav-element">nav</a></code> element <a href="#represents">represents</a> a section of
|
|
a page that links to other pages or to parts within the page: a
|
|
section with navigation links.<p class="note">Not all groups of links on a page need to be in a
|
|
<code><a href="#the-nav-element">nav</a></code> element — the element is primarily intended
|
|
for sections that consist of major navigation blocks. In particular,
|
|
it is common for footers to have a short list of links to various
|
|
pages of a site, such as the terms of service, the home page, and a
|
|
copyright page. The <code><a href="#the-footer-element">footer</a></code> element alone is sufficient
|
|
for such cases; while a <code><a href="#the-nav-element">nav</a></code> element can be used in such
|
|
cases, it is usually unnecessary.<p class="note">User agents (such as screen readers) that are
|
|
targeted at users who can benefit from navigation information being
|
|
omitted in the initial rendering, or who can benefit from navigation
|
|
information being immediately available, can use this element as a
|
|
way to determine what content on the page to initially skip and/or
|
|
provide on request.<div class="example">
|
|
|
|
<p>In the following example, the page has several places where
|
|
links are present, but only one of those places is considered a
|
|
navigation section.</p>
|
|
|
|
<pre><body>
|
|
<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>
|
|
<p>Last Modified: <time>2009-04-01</time></p>
|
|
<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>
|
|
</header>
|
|
<div>
|
|
<article>
|
|
<header>
|
|
<h1>My Day at the Beach</h1>
|
|
</header>
|
|
<div>
|
|
<p>Today I went to the beach and had a lot of fun.</p>
|
|
<em>...more content...</em>
|
|
</div>
|
|
<footer>
|
|
<p>Posted <time pubdate="" datetime="2009-10-10T14:36-08:00">Thursday</time>.</p>
|
|
</footer>
|
|
</article>
|
|
<em>...more blog posts...</em>
|
|
</div>
|
|
<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></pre>
|
|
|
|
<p>Notice the <code><a href="#the-div-element">div</a></code> elements being used to wrap all the
|
|
contents of the page other than the header and footer, and all the
|
|
contents of the blog entry other than its header and footer.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, there are two <code><a href="#the-nav-element">nav</a></code>
|
|
elements, one for primary navigation around the site, and one for
|
|
secondary navigation around the page itself.</p>
|
|
|
|
<pre><body>
|
|
<h1>The Wiki Center Of Exampland</h1>
|
|
<nav>
|
|
<ul>
|
|
<li><a href="/">Home</a></li>
|
|
<li><a href="/events">Current Events</a></li>
|
|
<em>...more...</em>
|
|
</ul>
|
|
</nav>
|
|
<article>
|
|
<header>
|
|
<h1>Demos in Exampland</h1>
|
|
<p>Written by A. N. Other.</p>
|
|
</header>
|
|
<nav>
|
|
<ul>
|
|
<li><a href="#public">Public demonstrations</a></li>
|
|
<li><a href="#destroy">Demolitions</a></li>
|
|
<em>...more...</em>
|
|
</ul>
|
|
</nav>
|
|
<div>
|
|
<section id="public">
|
|
<h1>Public demonstrations</h1>
|
|
<p><em>...more...</em></p>
|
|
</section>
|
|
<section id="destroy">
|
|
<h1>Demolitions</h1>
|
|
<p><em>...more...</em></p>
|
|
</section>
|
|
<em>...more...</em>
|
|
</div>
|
|
<footer>
|
|
<p><a href="?edit">Edit</a> | <a href="?delete">Delete</a> | <a href="?Rename">Rename</a></p>
|
|
</footer>
|
|
</article>
|
|
<footer>
|
|
<p><small>© copyright 1998 Exampland Emperor</small></p>
|
|
</footer>
|
|
</body></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>A <code><a href="#the-nav-element">nav</a></code> element doesn't have to contain a list, it
|
|
can contain other kinds of content as well. In this navigation
|
|
block, links are provided in prose:</p>
|
|
|
|
<pre><nav>
|
|
<h1>Navigation</h1>
|
|
<p>You are on my home page. To the north lies <a href="/blog">my
|
|
blog</a>, from whence the sounds of battle can be heard. To the east
|
|
you can see a large mountain, upon which many <a
|
|
href="/school">school papers</a> are littered. Far up thus mountain
|
|
you can spy a little figure who appears to be me, desperately
|
|
scribbling a <a href="/school/thesis">thesis</a>.</p>
|
|
<p>To the west are several exits. One fun-looking exit is labeled <a
|
|
href="http://games.example.com/">"games"</a>. Another more
|
|
boring-looking exit is labeled <a
|
|
href="http://isp.example.net/">ISP™</a>.</p>
|
|
<p>To the south lies a dark and dank <a href="/about">contacts
|
|
page</a>. Cobwebs cover its disused entrance, and at one point you
|
|
see a rat run quickly out of the page.</p>
|
|
</nav></pre>
|
|
|
|
</div><h4 id="the-article-element"><span class="secno">4.4.4 </span>The <dfn><code>article</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#sectioning-content">Sectioning content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-article-element">article</a></code> element <a href="#represents">represents</a> a
|
|
self-contained composition in a document, page, application, or site
|
|
and that is, in principle, independently distributable or reusable,
|
|
e.g. in syndication. This could be a forum post, a magazine or
|
|
newspaper article, a blog entry, a user-submitted comment, an
|
|
interactive widget or gadget, or any other independent item of
|
|
content.<p>When <code><a href="#the-article-element">article</a></code> elements are nested, the inner
|
|
<code><a href="#the-article-element">article</a></code> elements represent articles that are in
|
|
principle related to the contents of the outer article. For
|
|
instance, a blog entry on a site that accepts user-submitted
|
|
comments could represent the comments as <code><a href="#the-article-element">article</a></code>
|
|
elements nested within the <code><a href="#the-article-element">article</a></code> element for the blog
|
|
entry.<p>Author information associated with an <code><a href="#the-article-element">article</a></code>
|
|
element (q.v. the <code><a href="#the-address-element">address</a></code> element) does not apply to
|
|
nested <code><a href="#the-article-element">article</a></code> elements.<p class="note">When used specifically with content to be
|
|
redistributed in syndication, the <code><a href="#the-article-element">article</a></code> element is
|
|
similar in purpose to the <code title="">entry</code> element in
|
|
Atom. <a href="#refsATOM">[ATOM]</a>
|
|
|
|
<p class="note">The <code><a href="#the-time-element">time</a></code> element's <code title="attr-time-pubdate"><a href="#attr-time-pubdate">pubdate</a></code> attribute can be used to
|
|
provide the publication date for an <code><a href="#the-article-element">article</a></code>
|
|
element.<div class="example" id="article-example">
|
|
|
|
<p>This example shows a blog post using the <code><a href="#the-article-element">article</a></code>
|
|
element:</p>
|
|
|
|
<pre><article>
|
|
<header>
|
|
<h1>The Very First Rule of Life</h1>
|
|
<p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p>
|
|
</header>
|
|
<p>If there's a microphone anywhere near you, assume it's hot and
|
|
sending whatever you're saying to the world. Seriously.</p>
|
|
<p><em>...</em></p>
|
|
<footer>
|
|
<a href="?comments=1">Show comments...</a>
|
|
</footer>
|
|
</article></pre>
|
|
|
|
<p>Here is that same blog post, but showing some of the comments:</p>
|
|
|
|
<pre><article>
|
|
<header>
|
|
<h1>The Very First Rule of Life</h1>
|
|
<p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p>
|
|
</header>
|
|
<p>If there's a microphone anywhere near you, assume it's hot and
|
|
sending whatever you're saying to the world. Seriously.</p>
|
|
<p><em>...</em></p>
|
|
<section>
|
|
<h1>Comments</h1>
|
|
<article>
|
|
<footer>
|
|
<p>Posted by: George Washington</p>
|
|
<p><time pubdate datetime="2009-10-10T19:10-08:00"></time></p>
|
|
</footer>
|
|
<p>Yeah! Especially when talking about your lobbyist friends!</p>
|
|
</article>
|
|
<article>
|
|
<footer>
|
|
<p>Posted by: George Hammond</p>
|
|
<p><time pubdate datetime="2009-10-10T19:15-08:00"></time></p>
|
|
</footer>
|
|
<p>Hey, you have the same first name as me.</p>
|
|
</article>
|
|
</section>
|
|
</article></pre>
|
|
|
|
<p>Notice the use of <code><a href="#the-footer-element">footer</a></code> to give the information
|
|
for each comment (such as who wrote it and when): the
|
|
<code><a href="#the-footer-element">footer</a></code> element <em>can</em> appear at the start of its
|
|
section when appropriate, such as in this case. (Using
|
|
<code><a href="#the-header-element">header</a></code> in this case wouldn't be wrong either; it's
|
|
mostly a matter of authoring preference.)</p>
|
|
|
|
</div><h4 id="the-aside-element"><span class="secno">4.4.5 </span>The <dfn><code>aside</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#sectioning-content">Sectioning content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-aside-element">aside</a></code> element <a href="#represents">represents</a> a section
|
|
of a page that consists of content that is tangentially related to
|
|
the content around the <code><a href="#the-aside-element">aside</a></code> element, and which could
|
|
be considered separate from that content. Such sections are often
|
|
represented as sidebars in printed typography.<p>The element can be used for typographical effects like pull
|
|
quotes or sidebars, for advertising, for groups of <code><a href="#the-nav-element">nav</a></code>
|
|
elements, and for other content that is considered separate from the
|
|
main content of the page.<p class="note">It's not appropriate to use the <code><a href="#the-aside-element">aside</a></code>
|
|
element just for parentheticals, since those are part of the main
|
|
flow of the document.<div class="example">
|
|
|
|
<p>The following example shows how an aside is used to mark up
|
|
background material on Switzerland in a much longer news story on
|
|
Europe.</p>
|
|
|
|
<pre><aside>
|
|
<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></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows how an aside is used to mark up
|
|
a pull quote in a longer article.</p>
|
|
|
|
<pre>...
|
|
|
|
<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>
|
|
|
|
...</pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following extract shows how <code><a href="#the-aside-element">aside</a></code> can be used
|
|
for blogrolls and other side content on a blog:</p>
|
|
|
|
<pre><body>
|
|
<header>
|
|
<h1>My wonderful blog</h1>
|
|
<p>My tagline</p>
|
|
</header>
|
|
<aside>
|
|
<!-- <em>this aside contains two sections that are tangentially related
|
|
to the page, namely, links to other blogs, and links to blog posts
|
|
from this blog</em> -->
|
|
<nav>
|
|
<h1>My blogroll</h1>
|
|
<ul>
|
|
<li><a href="http://blog.example.com/">Example Blog</a>
|
|
</ul>
|
|
</nav>
|
|
<nav>
|
|
<h1>Archives</h1>
|
|
<ol reversed>
|
|
<li><a href="/last-post">My last post</a>
|
|
<li><a href="/first-post">My first post</a>
|
|
</ol>
|
|
</nav>
|
|
</aside>
|
|
<aside>
|
|
<!-- <em>this aside is tangentially related to the page also, it
|
|
contains twitter messages from the blog author</em> -->
|
|
<h1>Twitter Feed</h1>
|
|
<blockquote cite="http://twitter.example.net/t31351234">
|
|
I'm on vacation, writing my blog.
|
|
</blockquote>
|
|
<blockquote cite="http://twitter.example.net/t31219752">
|
|
I'm going to go on vacation soon.
|
|
</blockquote>
|
|
</aside>
|
|
<article>
|
|
<!-- <em>this is a blog post</em> -->
|
|
<h1>My last post</h1>
|
|
<p>This is my last post.</p>
|
|
<footer>
|
|
<p><a href="/last-post" rel=bookmark>Permalink</a>
|
|
</footer>
|
|
</article>
|
|
<article>
|
|
<!-- <em>this is also a blog post</em> -->
|
|
<h1>My first post</h1>
|
|
<p>This is my first post.</p>
|
|
<aside>
|
|
<!-- <em>this aside is about the blog post, since it's inside the
|
|
<article> element; it would be wrong, for instance, to put the
|
|
blogroll here, since the blogroll isn't really related to this post
|
|
specifically, only to the page as a whole</em> -->
|
|
<h1>Posting</h1>
|
|
<p>While I'm thinking about it, I wanted to say something about
|
|
posting. Posting is fun!</p>
|
|
</aside>
|
|
<footer>
|
|
<p><a href="/first-post" rel=bookmark>Permalink</a>
|
|
</footer>
|
|
</article>
|
|
<footer>
|
|
<nav>
|
|
<a href="/archives">Archives</a> —
|
|
<a href="/about">About me</a> —
|
|
<a href="/copyright">Copyright</a>
|
|
</nav>
|
|
</footer>
|
|
</body></pre>
|
|
|
|
</div><h4 id="the-h1-h2-h3-h4-h5-and-h6-elements"><span class="secno">4.4.6 </span>The <dfn id="the-h1-element"><code>h1</code></dfn>, <dfn id="the-h2-element"><code>h2</code></dfn>, <dfn id="the-h3-element"><code>h3</code></dfn>, <dfn id="the-h4-element"><code>h4</code></dfn>, <dfn id="the-h5-element"><code>h5</code></dfn>, and <dfn id="the-h6-element"><code>h6</code></dfn> elements</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#heading-content">Heading content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of an <code><a href="#the-hgroup-element">hgroup</a></code> element.</dd>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlheadingelement">HTMLHeadingElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>These elements <a href="#represents" title="represents">represent</a> headings
|
|
for their sections.<p>The semantics and meaning of these elements are defined in the
|
|
section on <a href="#headings-and-sections">headings and sections</a>.<p>These elements have a <dfn id="rank">rank</dfn> given by the number in
|
|
their name. The <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> element is said to have the highest
|
|
rank, the <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> element has the lowest rank, and two
|
|
elements with the same name have equal rank.<div class="example">
|
|
|
|
<p>These two snippets are equivalent:</p>
|
|
|
|
<pre><body>
|
|
<h1>Let's call it a draw(ing surface)</h1>
|
|
<h2>Diving in</h2>
|
|
<h2>Simple shapes</h2>
|
|
<h2>Canvas coordinates</h2>
|
|
<h3>Canvas coordinates diagram</h3>
|
|
<h2>Paths</h2>
|
|
</body></pre>
|
|
|
|
<pre><body>
|
|
<h1>Let's call it a draw(ing surface)</h1>
|
|
<section>
|
|
<h1>Diving in</h1>
|
|
</section>
|
|
<section>
|
|
<h1>Simple shapes</h1>
|
|
</section>
|
|
<section>
|
|
<h1>Canvas coordinates</h1>
|
|
<section>
|
|
<h1>Canvas coordinates diagram</h1>
|
|
</section>
|
|
</section>
|
|
<section>
|
|
<h1>Paths</h1>
|
|
</section>
|
|
</body></pre>
|
|
|
|
</div><h4 id="the-hgroup-element"><span class="secno">4.4.7 </span>The <dfn><code>hgroup</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#heading-content">Heading content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>One or more <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>, and/or <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-hgroup-element">hgroup</a></code> element <a href="#represents">represents</a> the
|
|
heading of a section. The element is used to group a set of
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>–<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements when the heading has
|
|
multiple levels, such as subheadings, alternative titles, or
|
|
taglines.<p>For the purposes of document summaries, outlines, and the like,
|
|
the text of <code><a href="#the-hgroup-element">hgroup</a></code> elements is defined to be the text
|
|
of the highest <a href="#rank" title="rank">ranked</a>
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>–<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> element descendant of the
|
|
<code><a href="#the-hgroup-element">hgroup</a></code> element, if there are any such elements, and the
|
|
first such element if there are multiple elements with that
|
|
<a href="#rank">rank</a>. If there are no such elements, then the text of
|
|
the <code><a href="#the-hgroup-element">hgroup</a></code> element is the empty string.<p>Other elements of <a href="#heading-content">heading content</a> in the
|
|
<code><a href="#the-hgroup-element">hgroup</a></code> element indicate subheadings or subtitles.<p>The <a href="#rank">rank</a> of an <code><a href="#the-hgroup-element">hgroup</a></code> element is the
|
|
rank of the highest-ranked <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>–<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code>
|
|
element descendant of the <code><a href="#the-hgroup-element">hgroup</a></code> element, if there are
|
|
any such elements, or otherwise the same as for an <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>
|
|
element (the highest rank).<p>The section on <a href="#headings-and-sections">headings and sections</a>
|
|
defines how <code><a href="#the-hgroup-element">hgroup</a></code> elements are assigned to individual
|
|
sections.<div class="example">
|
|
|
|
<p>Here are some examples of valid headings. In each case, the
|
|
emphasized text represents the text that would be used as the
|
|
heading in an application extracting heading data and ignoring
|
|
subheadings.</p>
|
|
|
|
<pre><hgroup>
|
|
<h1><strong>The reality dysfunction</strong></h1>
|
|
<h2>Space is not the only void</h2>
|
|
</hgroup></pre>
|
|
|
|
<pre><hgroup>
|
|
<h1><strong>Dr. Strangelove</strong></h1>
|
|
<h2>Or: How I Learned to Stop Worrying and Love the Bomb</h2>
|
|
</hgroup></pre>
|
|
|
|
<p>The point of using <code><a href="#the-hgroup-element">hgroup</a></code> in these examples is to
|
|
mask the <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> element (which acts as a secondary title)
|
|
from the <a href="#outline">outline</a> algorithm.</p>
|
|
</div><h4 id="the-header-element"><span class="secno">4.4.8 </span>The <dfn><code>header</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>, but with no <code><a href="#the-header-element">header</a></code> or
|
|
<code><a href="#the-footer-element">footer</a></code> element descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-header-element">header</a></code> element <a href="#represents">represents</a> a group
|
|
of introductory or navigational aids.<p class="note">A <code><a href="#the-header-element">header</a></code> element is intended to usually
|
|
contain the section's heading (an
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>–<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> element or an
|
|
<code><a href="#the-hgroup-element">hgroup</a></code> element), but this is not required. The
|
|
<code><a href="#the-header-element">header</a></code> element can also be used to wrap a section's
|
|
table of contents, a search form, or any relevant logos.<div class="example">
|
|
|
|
<p>Here are some sample headers. This first one is for a game:</p>
|
|
|
|
<pre><header>
|
|
<p>Welcome to...</p>
|
|
<h1>Voidwars!</h1>
|
|
</header></pre>
|
|
|
|
<p>The following snippet shows how the element can be used to mark
|
|
up a specification's header:</p>
|
|
|
|
<pre><header>
|
|
<hgroup>
|
|
<h1>Scalable Vector Graphics (SVG) 1.2</h1>
|
|
<h2>W3C Working Draft 27 October 2004</h2>
|
|
</hgroup>
|
|
<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><p class="note">The <code><a href="#the-header-element">header</a></code> element is not
|
|
<a href="#sectioning-content">sectioning content</a>; it doesn't introduce a new
|
|
section.<div class="example">
|
|
|
|
<p>In this example, the page has a page heading given by the
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> element, and two subsections whose headings are
|
|
given by <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> elements. The content after the
|
|
<code><a href="#the-header-element">header</a></code> element is still part of the last subsection
|
|
started in the <code><a href="#the-header-element">header</a></code> element, because the
|
|
<code><a href="#the-header-element">header</a></code> element doesn't take part in the
|
|
<a href="#outline">outline</a> algorithm.</p>
|
|
|
|
<pre><body>
|
|
<header>
|
|
<h1>Little Green Guys With Guns</h1>
|
|
<nav>
|
|
<ul>
|
|
<li><a href="/games">Games</a>
|
|
<li><a href="/forum">Forum</a>
|
|
<li><a href="/download">Download</a>
|
|
</ul>
|
|
</nav>
|
|
<h2>Important News</h2> <!-- this starts a second subsection -->
|
|
<!-- this is part of the subsection entitled "Important News" -->
|
|
<p>To play today's games you will need to update your client.</p>
|
|
<h2>Games</h2> <!-- this starts a third subsection -->
|
|
</header>
|
|
<p>You have three active games:</p>
|
|
<!-- this is still part of the subsection entitled "Games" -->
|
|
...</pre>
|
|
|
|
</div><h4 id="the-footer-element"><span class="secno">4.4.9 </span>The <dfn><code>footer</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>, but with no <code><a href="#the-header-element">header</a></code> or
|
|
<code><a href="#the-footer-element">footer</a></code> element descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-footer-element">footer</a></code> element <a href="#represents">represents</a> a footer
|
|
for its nearest ancestor <a href="#sectioning-content">sectioning content</a> or
|
|
<a href="#sectioning-root">sectioning root</a> element. A footer typically contains
|
|
information about its section such as who wrote it, links to related
|
|
documents, copyright data, and the like.<p>When the <code><a href="#the-footer-element">footer</a></code> element contains entire sections,
|
|
they <a href="#represents" title="represents">represent</a> appendices, indexes,
|
|
long colophons, verbose license agreements, and other such
|
|
content.<p class="note">Contact information for the author or editor of a
|
|
section belongs in an <code><a href="#the-address-element">address</a></code> element, possibly itself
|
|
inside a <code><a href="#the-footer-element">footer</a></code>.<p>Footers don't necessarily have to appear at the <em>end</em> of a
|
|
section, though they usually do.<p>When the nearest ancestor <a href="#sectioning-content">sectioning content</a> or
|
|
<a href="#sectioning-root">sectioning root</a> element is <a href="#the-body-element-0">the body
|
|
element</a>, then it applies to the whole page.<p class="note">The <code><a href="#the-footer-element">footer</a></code> element is not
|
|
<a href="#sectioning-content">sectioning content</a>; it doesn't introduce a new
|
|
section.<div class="example">
|
|
|
|
<p>Here is a page with two footers, one at the top and one at the
|
|
bottom, with the same content:</p>
|
|
|
|
<pre><body>
|
|
<footer><a href="../">Back to index...</a></footer>
|
|
<hgroup>
|
|
<h1>Lorem ipsum</h1>
|
|
<h2>The ipsum of all lorems</h2>
|
|
</hgroup>
|
|
<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></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is an example which shows the <code><a href="#the-footer-element">footer</a></code> element
|
|
being used both for a site-wide footer and for a section
|
|
footer.</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<HTML><HEAD>
|
|
<TITLE>The Ramblings of a Scientist</TITLE>
|
|
<BODY>
|
|
<H1>The Ramblings of a Scientist</H1>
|
|
<ARTICLE>
|
|
<H1>Episode 15</H1>
|
|
<VIDEO SRC="/fm/015.ogv" CONTROLS PRELOAD>
|
|
<P><A HREF="/fm/015.ogv">Download video</A>.</P>
|
|
</VIDEO>
|
|
<FOOTER> <!-- footer for article -->
|
|
<P>Published <TIME PUBDATE DATETIME="2009-10-21T18:26-07:00"></TIME></P>
|
|
</FOOTER>
|
|
</ARTICLE>
|
|
<ARTICLE>
|
|
<H1>My Favorite Trains</H1>
|
|
<P>I love my trains. My favorite train of all time is a Köf.</P>
|
|
<P>It is fun to see them pull some coal cars because they look so
|
|
dwarfed in comparison.</P>
|
|
<FOOTER> <!-- footer for article -->
|
|
<P>Published <TIME PUBDATE DATETIME="2009-09-15T14:54-07:00"></TIME></P>
|
|
</FOOTER>
|
|
</ARTICLE>
|
|
<FOOTER> <!-- site wide footer -->
|
|
<NAV>
|
|
<P><A HREF="/credits.html">Credits</A> —
|
|
<A HREF="/tos.html">Terms of Service</A> —
|
|
<A HREF="/index.html">Blog Index</A></P>
|
|
</NAV>
|
|
<P>Copyright © 2009 Gordon Freeman</P>
|
|
</FOOTER>
|
|
</BODY>
|
|
</HTML></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Some site designs have what is sometimes referred to as "fat
|
|
footers" — footers that contain a lot of material, including
|
|
images, links to other articles, links to pages for sending
|
|
feedback, special offers... in some ways, a whole "front page" in
|
|
the footer.</p>
|
|
|
|
<p>This fragment shows the bottom of a page on a site with a "fat
|
|
footer":</p>
|
|
|
|
<pre>...
|
|
<footer>
|
|
<nav>
|
|
<section>
|
|
<h1>Articles</h1>
|
|
<p><img src="somersaults.jpeg" alt=""> Go to the gym with
|
|
our somersaults class! Our teacher Jim takes you through the paces
|
|
in this two-part article. <a href="articles/somersaults/1">Part
|
|
1</a> · <a href="articles/somersaults/1">Part 2</a></p>
|
|
<p><img src="kindplus.jpeg"> Tired of walking on the edge of
|
|
a clif<!-- sic -->? Our guest writer Lara shows you how to bumble
|
|
your way through the bars. <a href="articles/kindplus/1">Read
|
|
more...</a></p>
|
|
<p><img src="crisps.jpeg"> The chips are down, now all
|
|
that's left is a potato. What can you do with it? <a
|
|
href="articles/crisps/1">Read more...</a></p>
|
|
</section>
|
|
<ul>
|
|
<li> <a href="/about">About us...</a>
|
|
<li> <a href="/feedback">Send feedback!</a>
|
|
<li> <a href="/sitemap">Sitemap</a>
|
|
</ul>
|
|
</nav>
|
|
<p><small>Copyright © 2015 The Snacker —
|
|
<a href="/tos">Terms of Service</a></small></p>
|
|
</footer>
|
|
</body></pre>
|
|
|
|
</div><h4 id="the-address-element"><span class="secno">4.4.10 </span>The <dfn><code>address</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>, but with no <a href="#heading-content">heading
|
|
content</a> descendants, no <a href="#sectioning-content">sectioning content</a>
|
|
descendants, and no <code><a href="#the-header-element">header</a></code>, <code><a href="#the-footer-element">footer</a></code>, or
|
|
<code><a href="#the-address-element">address</a></code> element descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-address-element">address</a></code> element <a href="#represents">represents</a> the
|
|
contact information for its nearest <code><a href="#the-article-element">article</a></code> or
|
|
<code><a href="#the-body-element">body</a></code> element ancestor. If that is <a href="#the-body-element-0">the body
|
|
element</a>, then the contact information applies to the document
|
|
as a whole.<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="#the-address-element">address</a></code> element must not be used to represent
|
|
arbitrary addresses (e.g. postal addresses), unless those addresses
|
|
are in fact the relevant contact information. (The <code><a href="#the-p-element">p</a></code>
|
|
element is the appropriate element for marking up postal addresses
|
|
in general.)<p>The <code><a href="#the-address-element">address</a></code> element must not contain information
|
|
other than contact information.<div class="example">
|
|
<p>For example, the following is non-conforming use of the
|
|
<code><a href="#the-address-element">address</a></code> element:</p>
|
|
<pre class="bad"><ADDRESS>Last Modified: 1999/12/24 23:37:50</ADDRESS></pre>
|
|
</div><p>Typically, the <code><a href="#the-address-element">address</a></code> element would be included
|
|
along with other information in a <code><a href="#the-footer-element">footer</a></code> element.<div class="impl">
|
|
|
|
<p>The contact information for a node <var title="">node</var> is a
|
|
collection of <code><a href="#the-address-element">address</a></code> elements defined by the first
|
|
applicable entry from the following list:</p>
|
|
|
|
<dl class="switch"><dt>If <var title="">node</var> is an <code><a href="#the-article-element">article</a></code> element</dt>
|
|
<dt>If <var title="">node</var> is a <code><a href="#the-body-element">body</a></code> element</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The contact information consists of all the
|
|
<code><a href="#the-address-element">address</a></code> elements that have <var title="">node</var>
|
|
as an ancestor and do not have another <code><a href="#the-body-element">body</a></code> or
|
|
<code><a href="#the-article-element">article</a></code> element ancestor that is a descendant of <var title="">node</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">node</var> has an ancestor element that is an <code><a href="#the-article-element">article</a></code> element</dt>
|
|
<dt>If <var title="">node</var> has an ancestor element that is a <code><a href="#the-body-element">body</a></code> element</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The contact information of <var title="">node</var> is the same
|
|
as the contact information of the nearest <code><a href="#the-article-element">article</a></code> or
|
|
<code><a href="#the-body-element">body</a></code> element ancestor, whichever is nearest.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">node</var>'s <code><a href="#document">Document</a></code> has <a href="#the-body-element-0" title="the body element">a body element</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The contact information of <var title="">node</var> is the same
|
|
as the contact information of <a href="#the-body-element-0">the body element</a> of the
|
|
<code><a href="#document">Document</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>There is no contact information for <var title="">node</var>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>User agents may expose the contact information of a node to the
|
|
user, or use it for other purposes, such as indexing sections based
|
|
on the sections' contact information.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this example the footer contains contact information and a
|
|
copyright notice.</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>
|
|
|
|
</div><h4 id="headings-and-sections"><span class="secno">4.4.11 </span><dfn>Headings and sections</dfn></h4><p>The <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>–<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements and the
|
|
<code><a href="#the-hgroup-element">hgroup</a></code> element are headings.<p>The first element of <a href="#heading-content">heading content</a> in an element
|
|
of <a href="#sectioning-content">sectioning content</a> <a href="#represents">represents</a> the
|
|
heading for that section. Subsequent headings of equal or higher
|
|
<a href="#rank">rank</a> start new (implied) sections, headings of lower
|
|
<a href="#rank">rank</a> start implied subsections that are part of the
|
|
previous one. In both cases, the element <a href="#represents">represents</a> the
|
|
heading of the implied section.<p>Certain elements are said to be <dfn id="sectioning-root" title="sectioning
|
|
root">sectioning roots</dfn>, including <code><a href="#the-blockquote-element">blockquote</a></code> and
|
|
<code><a href="#the-td-element">td</a></code> elements. These elements can have their own
|
|
outlines, but the sections and headings inside these elements do not
|
|
contribute to the outlines of their ancestors.</p><ul class="brief category-list"><li><code><a href="#the-blockquote-element">blockquote</a></code></li>
|
|
<li><code><a href="#the-body-element">body</a></code></li>
|
|
<li><code><a href="#the-details-element">details</a></code></li>
|
|
<li><code><a href="#the-fieldset-element">fieldset</a></code></li>
|
|
<li><code><a href="#the-figure-element">figure</a></code></li>
|
|
<li><code><a href="#the-td-element">td</a></code></li>
|
|
</ul><p><a href="#sectioning-content">Sectioning content</a> elements are always considered
|
|
subsections of their nearest ancestor <a href="#sectioning-root">sectioning root</a>
|
|
or their nearest ancestor element of <a href="#sectioning-content">sectioning
|
|
content</a>, whichever is nearest, regardless of what implied
|
|
sections other headings may have created.<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="#the-body-element">body</a></code> section, containing the "Grunt" paragraph)
|
|
<ol><li>
|
|
Bar (heading starting implied section, containing a block quote and the "Baz" paragraph)
|
|
</li>
|
|
<li>
|
|
Quux (heading starting implied section with no content other than the heading itself)
|
|
</li>
|
|
<li>
|
|
Thud (heading of explicit <code><a href="#the-section-element">section</a></code> section)
|
|
</li>
|
|
</ol></li>
|
|
</ol><p>Notice how the <code><a href="#the-section-element">section</a></code> ends the earlier implicit
|
|
section so that a later paragraph ("Grunt") is back at the top
|
|
level.</p>
|
|
</div><p>Sections may contain headings of any <a href="#rank">rank</a>, but
|
|
authors are strongly encouraged to either use only <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>
|
|
elements, or to use elements of the appropriate <a href="#rank">rank</a>
|
|
for the section's nesting level.<p>Authors are also encouraged to explicitly wrap sections in
|
|
elements of <a href="#sectioning-content">sectioning content</a>, instead of relying on
|
|
the implicit sections generated by having multiple headings in one
|
|
element of <a href="#sectioning-content">sectioning content</a>.<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>
|
|
|
|
<p>This third example is also semantically identical, and might be
|
|
easier to maintain (e.g. if sections are often moved around in
|
|
editing):</p>
|
|
|
|
<pre><body>
|
|
<h1>Apples</h1>
|
|
<p>Apples are fruit.</p>
|
|
<section>
|
|
<h1>Taste</h1>
|
|
<p>They taste lovely.</p>
|
|
<section>
|
|
<h1>Sweet</h1>
|
|
<p>Red apples are sweeter than green ones.</p>
|
|
</section>
|
|
</section>
|
|
<section>
|
|
<h1>Color</h1>
|
|
<p>Apples come in various colors.</p>
|
|
</section>
|
|
</body></pre>
|
|
|
|
</div><h5 id="outlines"><span class="secno">4.4.11.1 </span>Creating an outline</h5><div class="impl">
|
|
|
|
|
|
<p>This section defines an algorithm for creating an outline for a
|
|
<a href="#sectioning-content">sectioning content</a> element or a <a href="#sectioning-root">sectioning
|
|
root</a> element. It is defined in terms of a walk over the nodes
|
|
of a DOM tree, in tree order, with each node being visited when it
|
|
is <i>entered</i> and when it is <i>exited</i> during the walk.</p>
|
|
|
|
</div><p>The <dfn id="outline">outline</dfn> for a <a href="#sectioning-content">sectioning content</a>
|
|
element or a <a href="#sectioning-root">sectioning root</a> element consists of a list
|
|
of one or more potentially nested <a href="#concept-section" title="concept-section">sections</a>. A <dfn id="concept-section" title="concept-section">section</dfn> is a container that
|
|
corresponds to some nodes in the original DOM tree. Each section can
|
|
have one heading associated with it, and can contain any number of
|
|
further nested sections. <span class="impl">The algorithm for the
|
|
outline also associates each node in the DOM tree with a particular
|
|
section and potentially a heading.</span> (The sections in the
|
|
outline aren't <code><a href="#the-section-element">section</a></code> elements, though some may
|
|
correspond to such elements — they are merely conceptual
|
|
sections.)<div class="example">
|
|
|
|
<p>The following markup fragment:</p>
|
|
|
|
<pre><body>
|
|
<h1>A</h1>
|
|
<p>B</p>
|
|
<h2>C</h2>
|
|
<p>D</p>
|
|
<h2>E</h2>
|
|
<p>F</p>
|
|
</body></pre>
|
|
|
|
<p>...results in the following outline being created for the
|
|
<code><a href="#the-body-element">body</a></code> node (and thus the entire document):</p>
|
|
|
|
<ol class="brief"><li>
|
|
<p>Section created for <code><a href="#the-body-element">body</a></code> node.</p>
|
|
<p>Associated with heading "A".</p>
|
|
<p>Also associated with paragraph "B".</p>
|
|
<p>Nested sections:</p>
|
|
<ol class="brief"><li>
|
|
<p>Section implied for first <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> element.</p>
|
|
<p>Associated with heading "C".</p>
|
|
<p>Also associated with paragraph "D".</p>
|
|
<p>No nested sections.</p>
|
|
</li>
|
|
<li>
|
|
<p>Section implied for second <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code> element.</p>
|
|
<p>Associated with heading "E".</p>
|
|
<p>Also associated with paragraph "F".</p>
|
|
<p>No nested sections.</p>
|
|
</li>
|
|
</ol></li>
|
|
</ol></div><div class="impl">
|
|
|
|
<p>The algorithm that must be followed during a walk of a DOM
|
|
subtree rooted at a <a href="#sectioning-content">sectioning content</a> element or a
|
|
<a href="#sectioning-root">sectioning root</a> element to determine that element's
|
|
<a href="#outline">outline</a> is as follows:</p>
|
|
|
|
<ol><li><p>Let <var title="">current outlinee</var> be null. (It holds
|
|
the element whose <a href="#outline">outline</a> is being created.)</li>
|
|
|
|
<li><p>Let <var title="">current section</var> be null. (It holds a
|
|
pointer to a <a href="#concept-section" title="concept-section">section</a>, so that
|
|
elements in the DOM can all be associated with a section.)</li>
|
|
|
|
<li><p>Create a stack to hold elements, which is used to handle
|
|
nesting. Initialize this stack to empty.</li>
|
|
|
|
<li>
|
|
|
|
<p>As you walk over the DOM in <a href="#tree-order">tree order</a>, trigger
|
|
the first relevant step below for each element as you enter and
|
|
exit it.</p>
|
|
|
|
<dl class="switch"><dt>If you are exiting an element and that element is the element
|
|
at the top of the stack</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="note">The element being exited is a <a href="#heading-content">heading
|
|
content</a> element.</p>
|
|
|
|
<p>Pop that element from the stack.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the top of the stack is a <a href="#heading-content">heading content</a>
|
|
element</dt>
|
|
|
|
<dd><p>Do nothing.</dd>
|
|
|
|
|
|
<dt>When entering a <a href="#sectioning-content">sectioning content</a> element or a
|
|
<a href="#sectioning-root">sectioning root</a> element</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If <var title="">current outlinee</var> is not null, and the
|
|
<var title="">current section</var> has no heading, create an
|
|
implied heading and let that be the heading for the <var title="">current section</var>.</p>
|
|
|
|
<p>If <var title="">current outlinee</var> is not null, push
|
|
<var title="">current outlinee</var> onto the stack.</p>
|
|
|
|
<p>Let <var title="">current outlinee</var> be the element
|
|
that is being entered.</p>
|
|
|
|
<p>Let <var title="">current section</var> be a newly created
|
|
<a href="#concept-section" title="concept-section">section</a> for the <var title="">current outlinee</var> element.</p>
|
|
|
|
<p>Associate <var title="">current outlinee</var> with <var title="">current section</var>.</p>
|
|
|
|
<p>Let there be a new <a href="#outline">outline</a> for the new <var title="">current outlinee</var>, initialized with just the new
|
|
<var title="">current section</var> as the only <a href="#concept-section" title="concept-section">section</a> in the outline.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>When exiting a <a href="#sectioning-content">sectioning content</a> element, if
|
|
the stack is not empty</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</p>
|
|
|
|
<p>Let <var title="">current section</var> be the last section
|
|
in the <a href="#outline">outline</a> of the <var title="">current
|
|
outlinee</var> element.</p>
|
|
|
|
<p>Append the <a href="#outline">outline</a> of the <a href="#sectioning-content">sectioning
|
|
content</a> element being exited to the <var title="">current
|
|
section</var>. (This does not change which section is the last
|
|
section in the <a href="#outline">outline</a>.)</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>When exiting a <a href="#sectioning-root">sectioning root</a> element, if the
|
|
stack is not empty</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Run these steps:</p>
|
|
|
|
<ol><li><p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</li>
|
|
|
|
<li><p>Let <var title="">current section</var> be the last
|
|
section in the <a href="#outline">outline</a> of the <var title="">current
|
|
outlinee</var> element.</li>
|
|
|
|
<li><p><i>Finding the deepest child</i>: If <var title="">current section</var> has no child sections, stop
|
|
these steps.</li>
|
|
|
|
<li><p>Let <var title="">current section</var> be the last
|
|
child <a href="#concept-section" title="concept-section">section</a> of the
|
|
current <var title="">current section</var>.</li>
|
|
|
|
<li><p>Go back to the substep labeled <i>finding the deepest
|
|
child</i>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>When exiting a <a href="#sectioning-content">sectioning content</a> element or a
|
|
<a href="#sectioning-root">sectioning root</a> element</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="note">The <var title="">current outlinee</var> is
|
|
the element being exited.</p>
|
|
|
|
<p>Let <var title="">current section</var> be the first <a href="#concept-section" title="concept-section">section</a> in the
|
|
<a href="#outline">outline</a> of the <var title="">current outlinee</var>
|
|
element.</p>
|
|
|
|
<p>Skip to the next step in the overall set of steps. (The walk
|
|
is over.)</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the <var title="">current outlinee</var> is null</dt>
|
|
|
|
<dd><p>Do nothing.</dd>
|
|
|
|
|
|
<dt>When entering a <a href="#heading-content">heading content</a> element</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <var title="">current section</var> has no heading,
|
|
let the element being entered be the heading for the <var title="">current section</var>.</p>
|
|
|
|
<p>Otherwise, if the element being entered has a
|
|
<a href="#rank">rank</a> equal to or greater than the heading of the
|
|
last section of the <a href="#outline">outline</a> of the <var title="">current outlinee</var>, then create a new <a href="#concept-section" title="concept-section">section</a> and append it to the
|
|
<a href="#outline">outline</a> of the <var title="">current outlinee</var>
|
|
element, so that this new section is the new last section of
|
|
that outline. Let <var title="">current section</var> be that
|
|
new section. Let the element being entered be the new heading
|
|
for the <var title="">current section</var>.</p>
|
|
|
|
<p>Otherwise, run these substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">candidate section</var> be <var title="">current section</var>.</li>
|
|
|
|
<li><p>If the element being entered has a <a href="#rank">rank</a>
|
|
lower than the <a href="#rank">rank</a> of the heading of the <var title="">candidate section</var>, then create a new <a href="#concept-section" title="concept-section">section</a>, and append it to <var title="">candidate section</var>. (This does not change which
|
|
section is the last section in the outline.) Let <var title="">current section</var> be this new section. Let the
|
|
element being entered be the new heading for the <var title="">current section</var>. Abort these substeps.</p>
|
|
|
|
<li><p>Let <var title="">new candidate section</var> be the
|
|
<a href="#concept-section" title="concept-section">section</a> that contains <var title="">candidate section</var> in the <a href="#outline">outline</a> of
|
|
<var title="">current outlinee</var>.</li>
|
|
|
|
<li><p>Let <var title="">candidate section</var> be <var title="">new candidate section</var>.</li>
|
|
|
|
<li><p>Return to step 2.</li>
|
|
|
|
</ol><p>Push the element being entered onto the stack. (This causes
|
|
the algorithm to skip any descendants of the element.)</p>
|
|
|
|
<p class="note">Recall that <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> has the
|
|
<em>highest</em> rank, and <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> has the lowest
|
|
rank.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>Do nothing.</dd>
|
|
|
|
</dl><p id="associatedSection">In addition, whenever you exit a node,
|
|
after doing the steps above, if the node is not associated with a
|
|
<a href="#concept-section" title="concept-section">section</a> yet and <var title="">current section</var> is not null, associate the node
|
|
with the <a href="#concept-section" title="concept-section">section</a> <var title="">current section</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the <var title="">current outlinee</var> is null,
|
|
then there was no <a href="#sectioning-content">sectioning content</a> element or
|
|
<a href="#sectioning-root">sectioning root</a> element in the DOM. There is no
|
|
<a href="#outline">outline</a>. Abort these steps.</li>
|
|
|
|
<li><p>Associate any nodes that were not associated with a <a href="#concept-section" title="concept-section">section</a> in the steps above with <var title="">current outlinee</var> as their section.</li>
|
|
|
|
<li><p>Associate all nodes with the heading of the <a href="#concept-section" title="concept-section">section</a> with which they are
|
|
associated, if any.</li>
|
|
|
|
<li><p>If <var title="">current outlinee</var> is <a href="#the-body-element-0">the body
|
|
element</a>, then the outline created for that element is the
|
|
<a href="#outline">outline</a> of the entire document.</li>
|
|
|
|
</ol><p>The tree of sections created by the algorithm above, or a proper
|
|
subset thereof, must be used when generating document outlines, for
|
|
example when generating tables of contents.</p>
|
|
|
|
<p>When creating an interactive table of contents, entries should
|
|
jump the user to the relevant <a href="#sectioning-content">sectioning content</a>
|
|
element, if the <a href="#concept-section" title="concept-section">section</a> was
|
|
created for a real element in the original document, or to the
|
|
relevant <a href="#heading-content">heading content</a> element, if the <a href="#concept-section" title="concept-section">section</a> in the tree was generated for
|
|
a heading in the above process.</p>
|
|
|
|
<p class="note">Selecting the first <a href="#concept-section" title="concept-section">section</a> of the document therefore
|
|
always takes the user to the top of the document, regardless of
|
|
where the first heading in the <code><a href="#the-body-element">body</a></code> is to be found.</p>
|
|
|
|
<p>The <dfn id="outline-depth">outline depth</dfn> of a <a href="#heading-content">heading content</a>
|
|
element associated with a <a href="#concept-section" title="concept-section">section</a> <var title="">section</var>
|
|
is the number of <a href="#concept-section" title="concept-section">sections</a> that
|
|
are ancestors of <var title="">section</var> in the
|
|
<a href="#outline">outline</a> that <var title="">section</var> finds itself
|
|
in when the <a href="#outline" title="outline">outlines</a> of its
|
|
<code><a href="#document">Document</a></code>'s elements are created, plus 1. The
|
|
<a href="#outline-depth">outline depth</a> of a <a href="#heading-content">heading content</a> element
|
|
not associated with a <a href="#concept-section" title="concept-section">section</a>
|
|
is 1.</p>
|
|
|
|
<p>User agents should provide default headings for sections that do
|
|
not have explicit section headings.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>Consider the following snippet:</p>
|
|
|
|
<pre><body>
|
|
<nav>
|
|
<p><a href="/">Home</a></p>
|
|
</nav>
|
|
<p>Hello world.</p>
|
|
<aside>
|
|
<p>My cat is cute.</p>
|
|
</aside>
|
|
</body></pre>
|
|
|
|
<p>Although it contains no headings, this snippet has three
|
|
sections: a document (the <code><a href="#the-body-element">body</a></code>) with two subsections
|
|
(a <code><a href="#the-nav-element">nav</a></code> and an <code><a href="#the-aside-element">aside</a></code>). A user agent could
|
|
present the outline as follows:</p>
|
|
|
|
<ol class="brief"><li>Untitled document
|
|
<ol><li>Navigation</li>
|
|
<li>Sidebar</li>
|
|
</ol></li>
|
|
</ol><p>These default headings ("Untitled document", "Navigation",
|
|
"Sidebar") are not specified by this specification, and might vary
|
|
with the user's language, the page's language, the user's
|
|
preferences, the user agent implementor's preferences, etc.</p>
|
|
|
|
</div>
|
|
|
|
<div class="note">
|
|
|
|
<p>The following JavaScript function shows how the tree walk could
|
|
be implemented. The <var title="">root</var> argument is the root
|
|
of the tree to walk, and the <var title="">enter</var> and <var title="">exit</var> arguments are callbacks that are called with
|
|
the nodes as they are entered and exited. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
<pre>function (root, enter, exit) {
|
|
var node = root;
|
|
start: 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;
|
|
}
|
|
}
|
|
}</pre>
|
|
|
|
</div>
|
|
|
|
</div><h3 id="grouping-content"><span class="secno">4.5 </span>Grouping content</h3><h4 id="the-p-element"><span class="secno">4.5.1 </span>The <dfn><code>p</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlparagraphelement">HTMLParagraphElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-p-element">p</a></code> element <a href="#represents">represents</a> a
|
|
<a href="#paragraph">paragraph</a>.<p class="note">While paragraphs are usually represented in visual
|
|
media by blocks of text that are physically separated from adjacent
|
|
blocks through blank lines, a style sheet or user agent would be
|
|
equally justified in presenting paragraph breaks in a different
|
|
manner, for instance using inline pilcrows (¶).<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="#the-p-element">p</a></code> element should not be used when a more
|
|
specific element is more appropriate.<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-element"><span class="secno">4.5.2 </span>The <dfn><code>hr</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlhrelement">HTMLHRElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-hr-element">hr</a></code> element <a href="#represents">represents</a> 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.<div class="example">
|
|
|
|
<p>The following fictional extract from a project manual shows two
|
|
sections that use the <code><a href="#the-hr-element">hr</a></code> element to separate topics
|
|
within the section.</p>
|
|
|
|
<pre><section>
|
|
<h1>Communication</h1>
|
|
<p>There are various methods of communication. This section
|
|
covers a few of the important ones used by the project.</p>
|
|
<strong><hr></strong>
|
|
<p>Communication stones seem to come in pairs and have mysterious
|
|
properties:</p>
|
|
<ul>
|
|
<li>They can transfer thoughts in two directions once activated
|
|
if used alone.</li>
|
|
<li>If used with another device, they can transfer one's
|
|
consciousness to another body.</li>
|
|
<li>If both stones are used with another device, the
|
|
consciousnesses switch bodies.</li>
|
|
</ul>
|
|
<strong><hr></strong>
|
|
<p>Radios use the electromagnetic spectrum in the meter range and
|
|
longer.</p>
|
|
<strong><hr></strong>
|
|
<p>Signal flares use the electromagnetic spectrum in the
|
|
nanometer range.</p>
|
|
</section>
|
|
<section>
|
|
<h1>Food</h1>
|
|
<p>All food at the project is rationed:</p>
|
|
<dl>
|
|
<dt>Potatoes</dt>
|
|
<dd>Two per day</dd>
|
|
<dt>Soup</dt>
|
|
<dd>One bowl per day</dd>
|
|
</dl>
|
|
<strong><hr></strong>
|
|
<p>Cooking is done by the chefs on a set rotation.</p>
|
|
</section></pre>
|
|
|
|
<p>There is no need for an <code><a href="#the-hr-element">hr</a></code> element between the
|
|
sections themselves, since the <code><a href="#the-section-element">section</a></code> elements and
|
|
the <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> elements imply thematic changes themselves.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following extract from <cite>Pandora's Star</cite> by Peter
|
|
F. Hamilton shows two paragraphs that precede a scene change and
|
|
the paragraph that follows it. The scene change, represented in the
|
|
printed book by a gap containing a solitary centered star between
|
|
the second and third paragraphs, is here represented using the
|
|
<code><a href="#the-hr-element">hr</a></code> element.</p>
|
|
|
|
|
|
|
|
<pre lang="en-GB"><p>Dudley was ninety-two, in his second life, and fast approaching
|
|
time for another rejuvenation. Despite his body having the physical
|
|
age of a standard fifty-year-old, the prospect of a long degrading
|
|
campaign within academia was one he regarded with dread. For a
|
|
supposedly advanced civilization, the Intersolar Commonwearth could be
|
|
appallingly backward at times, not to mention cruel.</p>
|
|
<p><i>Maybe it won't be that bad</i>, he told himself. The lie was
|
|
comforting enough to get him through the rest of the night's
|
|
shift.</p>
|
|
<strong><hr></strong>
|
|
<p>The Carlton AllLander drove Dudley home just after dawn. Like the
|
|
astronomer, the vehicle was old and worn, but perfectly capable of
|
|
doing its job. It had a cheap diesel engine, common enough on a
|
|
semi-frontier world like Gralmond, although its drive array was a
|
|
thoroughly modern photoneural processor. With its high suspension and
|
|
deep-tread tyres it could plough along the dirt track to the
|
|
observatory in all weather and seasons, including the metre-deep snow
|
|
of Gralmond's winters.</p></pre>
|
|
|
|
</div><p class="note">The <code><a href="#the-hr-element">hr</a></code> element does not affect the
|
|
document's <a href="#outline">outline</a>.<h4 id="the-pre-element"><span class="secno">4.5.3 </span>The <dfn><code>pre</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlpreelement">HTMLPreElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-pre-element">pre</a></code> element <a href="#represents">represents</a> a block of
|
|
preformatted text, in which structure is represented by typographic
|
|
conventions rather than by elements.<p class="note">In <a href="#syntax">the HTML syntax</a>, a leading
|
|
newline character immediately following the <code><a href="#the-pre-element">pre</a></code> element
|
|
start tag is stripped.<p>Some examples of cases where the <code><a href="#the-pre-element">pre</a></code> element could
|
|
be used:<ul><li>Including an e-mail, with paragraphs indicated by blank lines,
|
|
lists indicated by lines prefixed with a bullet, and so on.</li>
|
|
|
|
<li>Including fragments of computer code, with structure indicated
|
|
according to the conventions of that language.</li>
|
|
|
|
<li>Displaying ASCII art.</li>
|
|
|
|
</ul><p class="note">Authors are encouraged to consider how preformatted
|
|
text will be experienced when the formatting is lost, as will be the
|
|
case for users of speech synthesizers, braille displays, and the
|
|
like. For cases like ASCII art, it is likely that an alternative
|
|
presentation, such as a textual description, would be more
|
|
universally accessible to the readers of the document.<p>To represent a block of computer code, the <code><a href="#the-pre-element">pre</a></code>
|
|
element can be used with a <code><a href="#the-code-element">code</a></code> element; to represent a
|
|
block of computer output the <code><a href="#the-pre-element">pre</a></code> element can be used
|
|
with a <code><a href="#the-samp-element">samp</a></code> element. Similarly, the <code><a href="#the-kbd-element">kbd</a></code>
|
|
element can be used within a <code><a href="#the-pre-element">pre</a></code> element to indicate
|
|
text that the user is to enter.<div class="impl">
|
|
|
|
<p>A newline in a <code><a href="#the-pre-element">pre</a></code> element should separate
|
|
paragraphs for the purposes of the Unicode bidirectional algorithm.
|
|
This requirement may be implemented indirectly through the style
|
|
layer. For example, an HTML+CSS user agent could implement these
|
|
requirements by implementing the CSS 'unicode-bidi' property. <a href="#refsBIDI">[BIDI]</a> <a href="#refsCSS">[CSS]</a></p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following snippet, a sample of computer code is
|
|
presented.</p>
|
|
|
|
<pre><p>This is the <code>Panel</code> constructor:</p>
|
|
<pre><code>function Panel(element, canClose, closeHandler) {
|
|
this.element = element;
|
|
this.canClose = canClose;
|
|
this.closeHandler = function () { if (closeHandler) closeHandler() };
|
|
}</code></pre></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following snippet, <code><a href="#the-samp-element">samp</a></code> and <code><a href="#the-kbd-element">kbd</a></code>
|
|
elements are mixed in the contents of a <code><a href="#the-pre-element">pre</a></code> element to
|
|
show a session of Zork I.</p>
|
|
|
|
<pre><pre><samp>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></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following shows a contemporary poem that uses the
|
|
<code><a href="#the-pre-element">pre</a></code> element to preserve its unusual formatting, which
|
|
forms an intrinsic part of the poem itself.</p>
|
|
|
|
<pre><pre> maxling
|
|
|
|
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></pre>
|
|
|
|
</div><h4 id="the-blockquote-element"><span class="secno">4.5.4 </span>The <dfn><code>blockquote</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#sectioning-root">Sectioning root</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-blockquote-cite"><a href="#attr-blockquote-cite">cite</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlquoteelement">HTMLQuoteElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-quote-cite" title="dom-quote-cite">cite</a>;
|
|
};</pre>
|
|
<p class="note">The <code><a href="#htmlquoteelement">HTMLQuoteElement</a></code> interface is
|
|
also used by the <code><a href="#the-q-element">q</a></code> element.</p>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-blockquote-element">blockquote</a></code> element <a href="#represents">represents</a> a
|
|
section that is quoted from another source.<p>Content inside a <code><a href="#the-blockquote-element">blockquote</a></code> must be quoted from
|
|
another source, whose address, if it has one, may be cited in the
|
|
<dfn id="attr-blockquote-cite" title="attr-blockquote-cite"><code>cite</code></dfn>
|
|
attribute.<p>If the <code title="attr-blockquote-cite"><a href="#attr-blockquote-cite">cite</a></code> attribute
|
|
is present, it must be a <a href="#valid-url-potentially-surrounded-by-spaces">valid URL potentially surrounded by
|
|
spaces</a>. <span class="impl">To obtain the corresponding
|
|
citation link, the value of the attribute must be <a href="#resolve-a-url" title="resolve a url">resolved</a> relative to the element. User
|
|
agents should allow users to follow such citation links.</span><div class="impl">
|
|
|
|
<p>The <dfn id="dom-quote-cite" title="dom-quote-cite"><code>cite</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the element's <code title="">cite</code> content attribute.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This next example shows the use of <code><a href="#the-cite-element">cite</a></code> alongside
|
|
<code><a href="#the-blockquote-element">blockquote</a></code>:</p>
|
|
|
|
<pre><p>His next piece was the aptly named <cite>Sonnet 130</cite>:</p>
|
|
<blockquote cite="http://quotes.example.org/s/sonnet130.html">
|
|
<p>My mistress' eyes are nothing like the sun,<br>
|
|
Coral is far more red, than her lips red,<br>
|
|
...</pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This example shows how a forum post could use
|
|
<code><a href="#the-blockquote-element">blockquote</a></code> to show what post a user is replying
|
|
to. The <code><a href="#the-article-element">article</a></code> element is used for each post, to mark
|
|
up the threading.</p>
|
|
|
|
<pre><article>
|
|
<h1><a href="http://bacon.example.com/?blog=109431">Bacon on a crowbar</a></h1>
|
|
<article>
|
|
<header><strong>t3yw</strong> 12 points 1 hour ago</header>
|
|
<p>I bet a narwhal would love that.</p>
|
|
<footer><a href="?pid=29578">permalink</a></footer>
|
|
<article>
|
|
<header><strong>greg</strong> 8 points 1 hour ago</header>
|
|
<blockquote><p>I bet a narwhal would love that.</p></blockquote>
|
|
<p>Dude narwhals don't eat bacon.</p>
|
|
<footer><a href="?pid=29579">permalink</a></footer>
|
|
<article>
|
|
<header><strong>t3yw</strong> 15 points 1 hour ago</header>
|
|
<blockquote>
|
|
<blockquote><p>I bet a narwhal would love that.</p></blockquote>
|
|
<p>Dude narwhals don't eat bacon.</p>
|
|
</blockquote>
|
|
<p>Next thing you'll be saying they don't get capes and wizard
|
|
hats either!</p>
|
|
<footer><a href="?pid=29580">permalink</a></footer>
|
|
<article>
|
|
<article>
|
|
<header><strong>boing</strong> -5 points 1 hour ago</header>
|
|
<p>narwhals are worse than ceiling cat</p>
|
|
<footer><a href="?pid=29581">permalink</a></footer>
|
|
</article>
|
|
</article>
|
|
</article>
|
|
</article>
|
|
<article>
|
|
<header><strong>fred</strong> 1 points 23 minutes ago</header>
|
|
<blockquote><p>I bet a narwhal would love that.</p></blockquote>
|
|
<p>I bet they'd love to peel a banana too.</p>
|
|
<footer><a href="?pid=29582">permalink</a></footer>
|
|
</article>
|
|
</article>
|
|
</article></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This example shows the use of a <code><a href="#the-blockquote-element">blockquote</a></code> for
|
|
short snippets, demonstrating that one does not have to use
|
|
<code><a href="#the-p-element">p</a></code> elements inside <code><a href="#the-blockquote-element">blockquote</a></code>
|
|
elements:</p>
|
|
|
|
<pre><p>He began his list of "lessons" with the following:</p>
|
|
<blockquote>One should never assume that his side of
|
|
the issue will be recognized, let alone that it will
|
|
be conceded to have merits.</blockquote>
|
|
<p>He continued with a number of similar points, ending with:</p>
|
|
<blockquote>Finally, one should be prepared for the threat
|
|
of breakdown in negotiations at any given moment and not
|
|
be cowed by the possiblity.</blockquote>
|
|
<p>We shall now discuss these points...</pre>
|
|
|
|
</div><p class="note"><a href="#conversations">Examples of how to
|
|
represent a conversation</a> are shown in a later section; it is not
|
|
appropriate to use the <code><a href="#the-cite-element">cite</a></code> and <code><a href="#the-blockquote-element">blockquote</a></code>
|
|
elements for this purpose.<h4 id="the-ol-element"><span class="secno">4.5.5 </span>The <dfn><code>ol</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-li-element">li</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-ol-reversed"><a href="#attr-ol-reversed">reversed</a></code></dd>
|
|
<dd><code title="attr-ol-start"><a href="#attr-ol-start">start</a></code></dd>
|
|
<dd><code title="attr-ol-type"><a href="#attr-ol-type">type</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlolistelement">HTMLOListElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-ol-reversed" title="dom-ol-reversed">reversed</a>;
|
|
attribute long <a href="#dom-ol-start" title="dom-ol-start">start</a>;
|
|
attribute DOMString <a href="#dom-ol-type" title="dom-ol-type">type</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-ol-element">ol</a></code> element <a href="#represents">represents</a> a list of
|
|
items, where the items have been intentionally ordered, such that
|
|
changing the order would change the meaning of the document.<p>The items of the list are the <code><a href="#the-li-element">li</a></code> element child nodes
|
|
of the <code><a href="#the-ol-element">ol</a></code> element, in <a href="#tree-order">tree order</a>.<p>The <dfn id="attr-ol-reversed" title="attr-ol-reversed"><code>reversed</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. 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,
|
|
...).<p>The <dfn id="attr-ol-start" title="attr-ol-start"><code>start</code></dfn>
|
|
attribute, if present, must be a <a href="#valid-integer">valid integer</a> giving
|
|
the <a href="#ordinal-value">ordinal value</a> of the first list item.<div class="impl">
|
|
|
|
<p>If the <code title="attr-ol-start"><a href="#attr-ol-start">start</a></code> attribute is
|
|
present, user agents must <a href="#rules-for-parsing-integers" 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 1 if the element has no <code title="attr-ol-reversed"><a href="#attr-ol-reversed">reversed</a></code> attribute, and is the
|
|
number of child <code><a href="#the-li-element">li</a></code> elements otherwise.</p>
|
|
|
|
<p>The first item in the list has the <a href="#ordinal-value">ordinal value</a>
|
|
given by the <code><a href="#the-ol-element">ol</a></code> element's <code title="attr-ol-start"><a href="#attr-ol-start">start</a></code> attribute, unless that
|
|
<code><a href="#the-li-element">li</a></code> element has a <code title="attr-li-value"><a href="#attr-li-value">value</a></code> attribute with a value that can
|
|
be successfully parsed, in which case it has the <a href="#ordinal-value">ordinal
|
|
value</a> given by that <code title="attr-li-value"><a href="#attr-li-value">value</a></code>
|
|
attribute.</p>
|
|
|
|
<p>Each subsequent item in the list has the <a href="#ordinal-value">ordinal
|
|
value</a> given by its <code title="attr-li-value"><a href="#attr-li-value">value</a></code>
|
|
attribute, if it has one, or, if it doesn't, the <a href="#ordinal-value">ordinal
|
|
value</a> of the previous item, plus one if the <code title="attr-ol-reversed"><a href="#attr-ol-reversed">reversed</a></code> is absent, or minus one if
|
|
it is present.</p>
|
|
|
|
</div><p>The <dfn id="attr-ol-type" title="attr-ol-type"><code>type</code></dfn> attribute
|
|
can be used to specify the kind of marker to use in the list, in the
|
|
cases where that matters (e.g. because items are to be referenced by
|
|
their number/letter). The attribute, if specified, must have a value
|
|
that is a <a href="#case-sensitive">case-sensitive</a> match for one of the
|
|
characters given in the first cell of one of the rows of the
|
|
following table. <span class="impl">The <code title="attr-ol-type"><a href="#attr-ol-type">type</a></code> attribute represents the state
|
|
given in the cell in the second column of the row whose first cell
|
|
matches the attribute's value; if none of the cells match, or if the
|
|
attribute is omitted, then the attribute represents the <a href="#attr-ol-type-state-decimal" title="attr-ol-type-state-decimal">decimal</a> state.</span><table><thead><tr><th>Keyword
|
|
<th>State
|
|
<th>Description
|
|
<th colspan="8">Examples for values 1-3 and 3999-4001
|
|
<tbody><tr><td><dfn id="attr-ol-type-keyword-decimal" title="attr-ol-type-keyword-decimal"><code>1</code></dfn> (U+0031)
|
|
<td><dfn id="attr-ol-type-state-decimal" title="attr-ol-type-state-decimal">decimal</dfn>
|
|
<td>Decimal numbers
|
|
<td class="eg"><samp>1.</samp> <td class="eg"><samp>2.</samp> <td class="eg"><samp>3.</samp> <td class="eg">... <td class="eg"><samp>3999.</samp> <td class="eg"><samp>4000.</samp> <td class="eg"><samp>4001.</samp> <td class="eg">...
|
|
<tr><td><dfn id="attr-ol-type-keyword-lower-alpha" title="attr-ol-type-keyword-lower-alpha"><code>a</code></dfn> (U+0061)
|
|
<td><dfn id="attr-ol-type-state-lower-alpha" title="attr-ol-type-state-lower-alpha">lower-alpha</dfn>
|
|
<td>Lowercase latin alphabet
|
|
<td class="eg"><samp>a.</samp> <td class="eg"><samp>b.</samp> <td class="eg"><samp>c.</samp> <td class="eg">... <td class="eg"><samp>ewu.</samp> <td class="eg"><samp>ewv.</samp> <td class="eg"><samp>eww.</samp> <td class="eg">...
|
|
<tr><td><dfn id="attr-ol-type-keyword-upper-alpha" title="attr-ol-type-keyword-upper-alpha"><code>A</code></dfn> (U+0041)
|
|
<td><dfn id="attr-ol-type-state-upper-alpha" title="attr-ol-type-state-upper-alpha">upper-alpha</dfn>
|
|
<td>Uppercase latin alphabet
|
|
<td class="eg"><samp>A.</samp> <td class="eg"><samp>B.</samp> <td class="eg"><samp>C.</samp> <td class="eg">... <td class="eg"><samp>EWU.</samp> <td class="eg"><samp>EWV.</samp> <td class="eg"><samp>EWW.</samp> <td class="eg">...
|
|
<tr><td><dfn id="attr-ol-type-keyword-lower-roman" title="attr-ol-type-keyword-lower-roman"><code>i</code></dfn> (U+0069)
|
|
<td><dfn id="attr-ol-type-state-lower-roman" title="attr-ol-type-state-lower-roman">lower-roman</dfn>
|
|
<td>Lowercase roman numerals
|
|
<td class="eg"><samp>i.</samp> <td class="eg"><samp>ii.</samp> <td class="eg"><samp>iii.</samp> <td class="eg">... <td class="eg"><samp>mmmcmxcix.</samp> <td class="eg"><samp>i̅v̅.</samp> <td class="eg"><samp>i̅v̅i.</samp> <td class="eg">...
|
|
<tr><td><dfn id="attr-ol-type-keyword-upper-roman" title="attr-ol-type-keyword-upper-roman"><code>I</code></dfn> (U+0049)
|
|
<td><dfn id="attr-ol-type-state-upper-roman" title="attr-ol-type-state-upper-roman">upper-roman</dfn>
|
|
<td>Uppercase roman numerals
|
|
<td class="eg"><samp>I.</samp> <td class="eg"><samp>II.</samp> <td class="eg"><samp>III.</samp> <td class="eg">... <td class="eg"><samp>MMMCMXCIX.</samp> <td class="eg"><samp>I̅V̅.</samp> <td class="eg"><samp>I̅V̅I.</samp> <td class="eg">...
|
|
</table><div class="impl">
|
|
|
|
<p>User agents should render the items of the list in a manner
|
|
consistent with the state of the <code title="attr-ol-type"><a href="#attr-ol-type">type</a></code> attribute of the <code><a href="#the-ol-element">ol</a></code>
|
|
element. Numbers less than or equal to zero should always use the
|
|
decimal system regardless of the <code title="attr-ol-type"><a href="#attr-ol-type">type</a></code> attribute.</p>
|
|
|
|
<p class="note">For CSS user agents, a mapping for this attribute to
|
|
the 'list-style-type' CSS property is given <a href="#decohints">in
|
|
the rendering section</a> (the mapping is straightforward: the
|
|
states above have the same names as their corresponding CSS
|
|
values).</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<p>The <dfn id="dom-ol-reversed" title="dom-ol-reversed"><code>reversed</code></dfn>,
|
|
<dfn id="dom-ol-start" title="dom-ol-start"><code>start</code></dfn>, and <dfn id="dom-ol-type" title="dom-ol-type"><code>type</code></dfn> IDL attributes must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name. The <code title="dom-ol-start"><a href="#dom-ol-start">start</a></code> IDL attribute has
|
|
the same default as its content attribute.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following markup shows a list where the order matters, and
|
|
where the <code><a href="#the-ol-element">ol</a></code> element is therefore appropriate. Compare
|
|
this list to the equivalent list in the <code><a href="#the-ul-element">ul</a></code> section to
|
|
see an example of the same items using the <code><a href="#the-ul-element">ul</a></code>
|
|
element.</p>
|
|
|
|
<pre><p>I have lived in the following countries (given in the order of when
|
|
I first lived there):</p>
|
|
<ol>
|
|
<li>Switzerland
|
|
<li>United Kingdom
|
|
<li>United States
|
|
<li>Norway
|
|
</ol></pre>
|
|
|
|
<p>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:</p>
|
|
|
|
<pre><p>I have lived in the following countries (given in the order of when
|
|
I first lived there):</p>
|
|
<ol>
|
|
<li>United Kingdom
|
|
<li>Switzerland
|
|
<li>United States
|
|
<li>Norway
|
|
</ol></pre>
|
|
|
|
</div><h4 id="the-ul-element"><span class="secno">4.5.6 </span>The <dfn><code>ul</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-li-element">li</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlulistelement">HTMLUListElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-ul-element">ul</a></code> element <a href="#represents">represents</a> a list of
|
|
items, where the order of the items is not important — that
|
|
is, where changing the order would not materially change the meaning
|
|
of the document.<p>The items of the list are the <code><a href="#the-li-element">li</a></code> element child nodes
|
|
of the <code><a href="#the-ul-element">ul</a></code> element.<div class="example">
|
|
|
|
<p>The following markup shows a list where the order does not
|
|
matter, and where the <code><a href="#the-ul-element">ul</a></code> element is therefore
|
|
appropriate. Compare this list to the equivalent list in the
|
|
<code><a href="#the-ol-element">ol</a></code> section to see an example of the same items using
|
|
the <code><a href="#the-ol-element">ol</a></code> element.</p>
|
|
|
|
<pre><p>I have lived in the following countries:</p>
|
|
<ul>
|
|
<li>Norway
|
|
<li>Switzerland
|
|
<li>United Kingdom
|
|
<li>United States
|
|
</ul></pre>
|
|
|
|
<p>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:</p>
|
|
|
|
<pre><p>I have lived in the following countries:</p>
|
|
<ul>
|
|
<li>Switzerland
|
|
<li>Norway
|
|
<li>United Kingdom
|
|
<li>United States
|
|
</ul></pre>
|
|
|
|
</div><h4 id="the-li-element"><span class="secno">4.5.7 </span>The <dfn><code>li</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Inside <code><a href="#the-ol-element">ol</a></code> elements.</dd>
|
|
<dd>Inside <code><a href="#the-ul-element">ul</a></code> elements.</dd>
|
|
<dd>Inside <code><a href="#the-menu-element">menu</a></code> elements.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd>If the element is a child of an <code><a href="#the-ol-element">ol</a></code> element: <code title="attr-li-value"><a href="#attr-li-value">value</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmllielement">HTMLLIElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute long <a href="#dom-li-value" title="dom-li-value">value</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-li-element">li</a></code> element <a href="#represents">represents</a> a list
|
|
item. If its parent element is an <code><a href="#the-ol-element">ol</a></code>, <code><a href="#the-ul-element">ul</a></code>,
|
|
or <code><a href="#the-menu-element">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="#the-li-element">li</a></code> element.<p>If the parent element is an <code><a href="#the-ol-element">ol</a></code> element, then the
|
|
<code><a href="#the-li-element">li</a></code> element has an <dfn id="ordinal-value">ordinal value</dfn>.<p>The <dfn id="attr-li-value" title="attr-li-value"><code>value</code></dfn>
|
|
attribute, if present, must be a <a href="#valid-integer">valid integer</a> giving
|
|
the <a href="#ordinal-value">ordinal value</a> of the list item.<div class="impl">
|
|
|
|
<p>If the <code title="attr-li-value"><a href="#attr-li-value">value</a></code> attribute is
|
|
present, user agents must <a href="#rules-for-parsing-integers" 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="#attr-li-value">value</a></code> attribute is
|
|
processed relative to the element's parent <code><a href="#the-ol-element">ol</a></code> element
|
|
(q.v.), if there is one. If there is not, the attribute has no
|
|
effect.</p>
|
|
|
|
<p>The <dfn id="dom-li-value" title="dom-li-value"><code>value</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the value of the <code title="dom-li-value"><a href="#dom-li-value">value</a></code> content attribute.</p>
|
|
|
|
</div><div class="example">
|
|
<p>The following example, the top ten movies are listed (in reverse
|
|
order). Note the way the list is given a title by using a
|
|
<code><a href="#the-figure-element">figure</a></code> element and its <code><a href="#the-figcaption-element">figcaption</a></code>
|
|
element.</p>
|
|
<pre><figure>
|
|
<figcaption>The top 10 movies of all time</figcaption>
|
|
<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 Bug's 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></pre>
|
|
|
|
<p>The markup could also be written as follows, using the <code title="attr-ol-reversed"><a href="#attr-ol-reversed">reversed</a></code> attribute on the
|
|
<code><a href="#the-ol-element">ol</a></code> element:</p>
|
|
|
|
<pre><figure>
|
|
<figcaption>The top 10 movies of all time</figcaption>
|
|
<ol reversed>
|
|
<li><cite>Josie and the Pussycats</cite>, 2001</li>
|
|
<li><cite lang="sh">Црна мачка, бели мачор</cite>, 1998</li>
|
|
<li><cite>A Bug's 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></pre>
|
|
</div><p class="note">If the <code><a href="#the-li-element">li</a></code> element is the child of a
|
|
<code><a href="#the-menu-element">menu</a></code> element and itself has a child that defines a
|
|
<a href="#concept-command" title="concept-command">command</a>, then the
|
|
<code><a href="#the-li-element">li</a></code> element will match the <code title="selector-enabled"><a href="#selector-enabled">:enabled</a></code> and <code title="selector-disabled"><a href="#selector-disabled">:disabled</a></code> pseudo-classes in the
|
|
same way as the first such child element does.<h4 id="the-dl-element"><span class="secno">4.5.8 </span>The <dfn><code>dl</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more groups each consisting of one or more
|
|
<code><a href="#the-dt-element">dt</a></code> elements followed by one or more <code><a href="#the-dd-element">dd</a></code>
|
|
elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmldlistelement">HTMLDListElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-dl-element">dl</a></code> element <a href="#represents">represents</a> an
|
|
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="#the-dt-element">dt</a></code> elements) followed by one or more values
|
|
(<code><a href="#the-dd-element">dd</a></code> elements). Within a single <code><a href="#the-dl-element">dl</a></code> element,
|
|
there should not be more than one <code><a href="#the-dt-element">dt</a></code> element for each
|
|
name.<p>Name-value groups may be terms and definitions, metadata topics
|
|
and values, questions and answers, or any other groups of name-value
|
|
data.<p>The values within a group are alternatives; multiple paragraphs
|
|
forming part of the same value must all be given within the same
|
|
<code><a href="#the-dd-element">dd</a></code> element.<p>The order of the list of groups, and of the names and values
|
|
within each group, may be significant.<div class="impl">
|
|
|
|
<p>If a <code><a href="#the-dl-element">dl</a></code> element is empty, it contains no groups.</p>
|
|
|
|
<p>If a <code><a href="#the-dl-element">dl</a></code> element contains non-<a href="#inter-element-whitespace" title="inter-element whitespace">whitespace</a> <a href="#text-node" title="text
|
|
node">text nodes</a>, or elements other than <code><a href="#the-dt-element">dt</a></code> and
|
|
<code><a href="#the-dd-element">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="#the-dl-element">dl</a></code>.</p>
|
|
|
|
<p>If a <code><a href="#the-dl-element">dl</a></code> element contains only <code><a href="#the-dt-element">dt</a></code>
|
|
elements, then it consists of one group with names but no
|
|
values.</p>
|
|
|
|
<p>If a <code><a href="#the-dl-element">dl</a></code> element contains only <code><a href="#the-dd-element">dd</a></code>
|
|
elements, then it consists of one group with values but no
|
|
names.</p>
|
|
|
|
<p>If a <code><a href="#the-dl-element">dl</a></code> element starts with one or more
|
|
<code><a href="#the-dd-element">dd</a></code> elements, then the first group has no associated
|
|
name.</p>
|
|
|
|
<p>If a <code><a href="#the-dl-element">dl</a></code> element ends with one or more
|
|
<code><a href="#the-dt-element">dt</a></code> elements, then the last group has no associated
|
|
value.</p>
|
|
|
|
<p class="note">When a <code><a href="#the-dl-element">dl</a></code> element doesn't match its
|
|
content model, it is often due to accidentally using <code><a href="#the-dd-element">dd</a></code>
|
|
elements in the place of <code><a href="#the-dt-element">dt</a></code> elements and vice
|
|
versa. Conformance checkers can spot such mistakes and might be able
|
|
to advise authors how to correctly use the markup.</p>
|
|
|
|
</div><div class="example">
|
|
<p>In the following example, one entry ("Authors") is linked to two
|
|
values ("John" and "Luke").</p>
|
|
<pre><dl>
|
|
<dt> Authors
|
|
<dd> John
|
|
<dd> Luke
|
|
<dt> Editor
|
|
<dd> Frank
|
|
</dl></pre>
|
|
</div><div class="example">
|
|
<p>In the following example, one definition is linked to two
|
|
terms.</p>
|
|
<pre><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></pre>
|
|
</div><div class="example">
|
|
<p>The following example illustrates the use of the <code><a href="#the-dl-element">dl</a></code>
|
|
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").</p>
|
|
<pre><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></pre>
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows the <code><a href="#the-dl-element">dl</a></code> 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).</p>
|
|
|
|
<pre><p>Determine the victory points as follows (use the
|
|
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></pre>
|
|
</div><div class="example">
|
|
<p>The following snippet shows a <code><a href="#the-dl-element">dl</a></code> element being used
|
|
as a glossary. Note the use of <code><a href="#the-dfn-element">dfn</a></code> to indicate the
|
|
word being defined.</p>
|
|
<pre><dl>
|
|
<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></pre>
|
|
</div><p class="note">The <code><a href="#the-dl-element">dl</a></code> element is inappropriate for
|
|
marking up dialogue. <a href="#conversations">Examples of how to
|
|
mark up dialogue</a> are shown below.<h4 id="the-dt-element"><span class="secno">4.5.9 </span>The <dfn><code>dt</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Before <code><a href="#the-dd-element">dd</a></code> or <code><a href="#the-dt-element">dt</a></code> elements inside <code><a href="#the-dl-element">dl</a></code> elements.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-dt-element">dt</a></code> element <a href="#represents">represents</a> the term, or
|
|
name, part of a term-description group in a description list
|
|
(<code><a href="#the-dl-element">dl</a></code> element).<p class="note">The <code><a href="#the-dt-element">dt</a></code> element itself, when used in a
|
|
<code><a href="#the-dl-element">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="#the-dfn-element">dfn</a></code> element.<div class="example">
|
|
|
|
<p>This example shows a list of frequently asked questions (a FAQ)
|
|
marked up using the <code><a href="#the-dt-element">dt</a></code> element for questions and the
|
|
<code><a href="#the-dd-element">dd</a></code> element for answers.</p>
|
|
|
|
<pre><article>
|
|
<h1>FAQ</h1>
|
|
<dl>
|
|
<dt>What do we want?</dt>
|
|
<dd>Our data.</dd>
|
|
<dt>When do we want it?</dt>
|
|
<dd>Now.</dd>
|
|
<dt>Where is it?</dt>
|
|
<dd>We are not sure.</dd>
|
|
</dl>
|
|
</article></pre>
|
|
|
|
</div><h4 id="the-dd-element"><span class="secno">4.5.10 </span>The <dfn><code>dd</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>After <code><a href="#the-dt-element">dt</a></code> or <code><a href="#the-dd-element">dd</a></code> elements inside <code><a href="#the-dl-element">dl</a></code> elements.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-dd-element">dd</a></code> element <a href="#represents">represents</a> the
|
|
description, definition, or value, part of a term-description group
|
|
in a description list (<code><a href="#the-dl-element">dl</a></code> element).<div class="example">
|
|
|
|
<p>A <code><a href="#the-dl-element">dl</a></code> can be used to define a vocabulary list, like
|
|
in a dictionary. In the following example, each entry, given by a
|
|
<code><a href="#the-dt-element">dt</a></code> with a <code><a href="#the-dfn-element">dfn</a></code>, has several
|
|
<code><a href="#the-dd-element">dd</a></code>s, showing the various parts of the definition.</p>
|
|
|
|
|
|
<pre><dl>
|
|
<dt><dfn>happiness</dfn></dt>
|
|
<dd class="pronunciation">/'hæ p. nes/</dd>
|
|
<dd class="part-of-speech"><i><abbr>n.</abbr></i></dd>
|
|
<dd>The state of being happy.</dd>
|
|
<dd>Good fortune; success. <q>Oh <b>happiness</b>! It worked!</q></dd>
|
|
<dt><dfn>rejoice</dfn></dt>
|
|
<dd class="pronunciation">/ri jois'/</dd>
|
|
<dd><i class="part-of-speech"><abbr>v.intr.</abbr></i> To be delighted oneself.</dd>
|
|
<dd><i class="part-of-speech"><abbr>v.tr.</abbr></i> To cause one to be delighted.</dd>
|
|
</dl></pre>
|
|
</div><h4 id="the-figure-element"><span class="secno">4.5.11 </span>The <dfn><code>figure</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#sectioning-root">Sectioning root</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Either: One <code><a href="#the-figcaption-element">figcaption</a></code> element followed by <a href="#flow-content">flow content</a>.</dd>
|
|
<dd>Or: <a href="#flow-content">Flow content</a> followed by one <code><a href="#the-figcaption-element">figcaption</a></code> element.</dd>
|
|
<dd>Or: <a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-figure-element">figure</a></code> element <a href="#represents">represents</a> some
|
|
<a href="#flow-content">flow content</a>, optionally with a caption, that is
|
|
self-contained and is typically referenced as a single unit from the
|
|
main flow of the document.<p>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.<p>The <span class="impl">first</span> <code><a href="#the-figcaption-element">figcaption</a></code>
|
|
element child of the element, if any, represents the caption of the
|
|
<code><a href="#the-figure-element">figure</a></code> element's contents. If there is no child
|
|
<code><a href="#the-figcaption-element">figcaption</a></code> element, then there is no caption.<div class="example">
|
|
|
|
<p>This example shows the <code><a href="#the-figure-element">figure</a></code> element to mark up a
|
|
code listing.</p>
|
|
|
|
<pre><p>In <a href="#l4">listing 4</a> we see the primary core interface
|
|
API declaration.</p>
|
|
<figure id="l4">
|
|
<figcaption>Listing 4. The primary core interface API declaration.</figcaption>
|
|
<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></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here we see a <code><a href="#the-figure-element">figure</a></code> element to mark up a
|
|
photo.</p>
|
|
|
|
<pre><figure>
|
|
<img src="bubbles-work.jpeg"
|
|
alt="Bubbles, sitting in his office chair, works on his
|
|
latest project intently.">
|
|
<figcaption>Bubbles at work</figcaption>
|
|
</figure></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this example, we see an image that is <em>not</em>
|
|
a figure, as well as an image and a video that are.</p>
|
|
|
|
<pre><h2>Malinko's comics</h2>
|
|
|
|
<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:
|
|
|
|
<blockquote>
|
|
<img src="promblem-packed-action.png" alt="ROUGH COPY! Promblem-Packed Action!">
|
|
</blockquote>
|
|
|
|
<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.
|
|
|
|
<figure>
|
|
<img src="ex-a.png" alt="Two squiggles on a dirty piece of paper.">
|
|
<figcaption>Exhibit A. The alleged <cite>rough copy</cite> comic.</figcaption>
|
|
</figure>
|
|
|
|
<figure>
|
|
<video src="ex-b.mov"></video>
|
|
<figcaption>Exhibit B. The <cite>Rough Copy</cite> trailer.</figcaption>
|
|
</figure>
|
|
|
|
<p>The case was resolved out of court.</pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here, a part of a poem is marked up using
|
|
<code><a href="#the-figure-element">figure</a></code>.</p>
|
|
|
|
<pre><figure>
|
|
<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>
|
|
<figcaption><cite>Jabberwocky</cite> (first verse). Lewis Carroll, 1832-98</figcaption>
|
|
</figure></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this example, which could be part of a much larger work
|
|
discussing a castle, the figure has three images in it.</p>
|
|
|
|
<pre><figure>
|
|
<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.">
|
|
<figcaption>The castle through the ages: 1423, 1858, and 1999 respectively.</figcaption>
|
|
</figure></pre>
|
|
|
|
</div><h4 id="the-figcaption-element"><span class="secno">4.5.12 </span>The <dfn><code>figcaption</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As the first or last child of a <code><a href="#the-figure-element">figure</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-figcaption-element">figcaption</a></code> element <a href="#represents">represents</a> a
|
|
caption or legend for the rest of the contents of the
|
|
<code><a href="#the-figcaption-element">figcaption</a></code> element's parent <code><a href="#the-figure-element">figure</a></code>
|
|
element<span class="impl">, if any</span>.<h4 id="the-div-element"><span class="secno">4.5.13 </span>The <dfn><code>div</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmldivelement">HTMLDivElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-div-element">div</a></code> element has no special meaning at all. It
|
|
<a href="#represents">represents</a> its children. It can be used with the <code title="attr-class"><a href="#classes">class</a></code>, <code title="attr-lang"><a href="#attr-lang">lang</a></code>, and <code title="attr-title"><a href="#the-title-attribute">title</a></code> attributes to mark up semantics
|
|
common to a group of consecutive elements.<p class="note">Authors are strongly encouraged to view the
|
|
<code><a href="#the-div-element">div</a></code> element as an element of last resort, for when no
|
|
other element is suitable. Use of the <code><a href="#the-div-element">div</a></code> element
|
|
instead of more appropriate elements leads to poor accessibility for
|
|
readers and poor maintainability for authors.<div class="example">
|
|
|
|
<p>For example, a blog post would be marked up using
|
|
<code><a href="#the-article-element">article</a></code>, a chapter using <code><a href="#the-section-element">section</a></code>, a
|
|
page's navigation aids using <code><a href="#the-nav-element">nav</a></code>, and a group of form
|
|
controls using <code><a href="#the-fieldset-element">fieldset</a></code>.</p>
|
|
|
|
<p>On the other hand, <code><a href="#the-div-element">div</a></code> elements can be useful for
|
|
stylistic purposes or to wrap multiple paragraphs within a section
|
|
that are all to be annotated in a similar way. In the following
|
|
example, we see <code><a href="#the-div-element">div</a></code> elements used as a way to set the
|
|
language of two paragraphs at once, instead of setting the language
|
|
on the two paragraph elements separately:</p>
|
|
|
|
<pre><article lang="en-US">
|
|
<h1>My use of language and my cats</h1>
|
|
<p>My cat's behavior hasn't changed much since her absence, except
|
|
that she plays her new physique to the neighbors regularly, in an
|
|
attempt to get pets.</p>
|
|
<div lang="en-GB">
|
|
<p>My other cat, coloured black and white, is a sweetie. He followed
|
|
us to the pool today, walking down the pavement with us. Yesterday
|
|
he apparently visited our neighbours. I wonder if he recognises that
|
|
their flat is a mirror image of ours.</p>
|
|
<p>Hm, I just noticed that in the last paragraph I used British
|
|
English. But I'm supposed to write in American English. So I
|
|
shouldn't say "pavement" or "flat" or "colour"...</p>
|
|
</div>
|
|
<p>I should say "sidewalk" and "apartment" and "color"!</p>
|
|
</article></pre>
|
|
|
|
</div><h3 id="text-level-semantics"><span class="secno">4.6 </span>Text-level semantics</h3><h4 id="the-a-element"><span class="secno">4.6.1 </span>The <dfn><code>a</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd>When the element only contains <a href="#phrasing-content">phrasing content</a>: <a href="#phrasing-content">phrasing content</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>When the element only contains <a href="#phrasing-content">phrasing content</a>: where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dd>Otherwise: where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#transparent">Transparent</a>, but there must be no <a href="#interactive-content">interactive content</a> descendant.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code></dd>
|
|
<dd><code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code></dd>
|
|
<dd><code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code></dd>
|
|
<dd><code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code></dd>
|
|
<dd><code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code></dd>
|
|
<dd><code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlanchorelement">HTMLAnchorElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
stringifier attribute DOMString <a href="#dom-a-href" title="dom-a-href">href</a>;
|
|
attribute DOMString <a href="#dom-a-target" title="dom-a-target">target</a>;
|
|
attribute DOMString <a href="#dom-a-rel" title="dom-a-rel">rel</a>;
|
|
readonly attribute <a href="#domtokenlist">DOMTokenList</a> <a href="#dom-a-rellist" title="dom-a-relList">relList</a>;
|
|
attribute DOMString <a href="#dom-a-media" title="dom-a-media">media</a>;
|
|
attribute DOMString <a href="#dom-a-hreflang" title="dom-a-hreflang">hreflang</a>;
|
|
attribute DOMString <a href="#dom-a-type" title="dom-a-type">type</a>;
|
|
|
|
attribute DOMString <a href="#dom-a-text" title="dom-a-text">text</a>;
|
|
|
|
// <a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a>
|
|
attribute DOMString <a href="#dom-a-protocol" title="dom-a-protocol">protocol</a>;
|
|
attribute DOMString <a href="#dom-a-host" title="dom-a-host">host</a>;
|
|
attribute DOMString <a href="#dom-a-hostname" title="dom-a-hostname">hostname</a>;
|
|
attribute DOMString <a href="#dom-a-port" title="dom-a-port">port</a>;
|
|
attribute DOMString <a href="#dom-a-pathname" title="dom-a-pathname">pathname</a>;
|
|
attribute DOMString <a href="#dom-a-search" title="dom-a-search">search</a>;
|
|
attribute DOMString <a href="#dom-a-hash" title="dom-a-hash">hash</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>If the <code><a href="#the-a-element">a</a></code> element has an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute, then it
|
|
<a href="#represents">represents</a> a <a href="#hyperlink">hyperlink</a> (a hypertext
|
|
anchor).</p><p>If the <code><a href="#the-a-element">a</a></code> element has no <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute, then the element
|
|
<a href="#represents">represents</a> a placeholder for where a link might
|
|
otherwise have been placed, if it had been relevant.<p>The <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code>,
|
|
<code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>, <code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code>, <code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code>, and <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code> attributes must be omitted
|
|
if the <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute is
|
|
not present.<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="#the-a-element">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><div class="impl">
|
|
|
|
<p>The <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>, <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code>
|
|
attributes affect what
|
|
happens when users <a href="#following-hyperlinks" title="following hyperlinks">follow
|
|
hyperlinks</a> created using the <code><a href="#the-a-element">a</a></code> element. The
|
|
<code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>, <code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code>, <code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code>, and <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">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="#activation-behavior">activation behavior</a> of <code><a href="#the-a-element">a</a></code> elements
|
|
that create <a href="#hyperlink" title="hyperlink">hyperlinks</a> is to run the
|
|
following steps:</p>
|
|
|
|
<ol><li><p>If the <code title="event-click"><a href="#event-click">click</a></code>
|
|
event in question is not <a href="#concept-events-trusted" title="concept-events-trusted">trusted</a> (i.e. a <code title="dom-click"><a href="#dom-click">click()</a></code> method call was the reason for the
|
|
event being dispatched), and the <code><a href="#the-a-element">a</a></code> element's <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code> attribute is such that
|
|
applying <a href="#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">the rules for choosing a browsing context given a
|
|
browsing context name</a>, using the value of the <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code> attribute as the
|
|
browsing context name, would result in there not being a chosen
|
|
browsing context, then raise an <code><a href="#invalid_access_err">INVALID_ACCESS_ERR</a></code>
|
|
exception and abort these steps.</li>
|
|
|
|
<li><p>If the target of the <code title="event-click"><a href="#event-click">click</a></code>
|
|
event is an <code><a href="#the-img-element">img</a></code> element with an <code title="attr-img-ismap"><a href="#attr-img-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-click"><a href="#event-click">click</a></code> event was a
|
|
real pointing-device-triggered <code title="event-click"><a href="#event-click">click</a></code> event on the <code><a href="#the-img-element">img</a></code>
|
|
element, then let <var title="">x</var> be the distance in CSS
|
|
pixels from the left edge of the image's left border, if it has
|
|
one, or the left edge of the image otherwise, 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's top border, if it has
|
|
one, or the top edge of the image otherwise, 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="hyperlink-suffix"><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, a U+002C
|
|
COMMA character (,), and the value of <var title="">y</var>
|
|
expressed as a base-ten integer using ASCII digits. ASCII digits
|
|
are the characters in the range U+0030 DIGIT ZERO (0) to U+0039
|
|
DIGIT NINE (9).</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Finally, the user agent must <a href="#following-hyperlinks" title="following
|
|
hyperlinks">follow the hyperlink</a> created by the
|
|
<code><a href="#the-a-element">a</a></code> element. If the steps above defined a <var><a href="#hyperlink-suffix">hyperlink
|
|
suffix</a></var>, then take that into account when following the
|
|
hyperlink.</li>
|
|
|
|
</ol></div><dl class="domintro"><dt><var title="">a</var> . <code title="dom-a-text"><a href="#dom-a-text">text</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Same as <code><a href="#textcontent">textContent</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The IDL attributes <dfn id="dom-a-href" title="dom-a-href"><code>href</code></dfn>,
|
|
<dfn id="dom-a-target" title="dom-a-target"><code>target</code></dfn>, <dfn id="dom-a-rel" title="dom-a-rel"><code>rel</code></dfn>, <dfn id="dom-a-media" title="dom-a-media"><code>media</code></dfn>, <dfn id="dom-a-hreflang" title="dom-a-hreflang"><code>hreflang</code></dfn>, and <dfn id="dom-a-type" title="dom-a-type"><code>type</code></dfn>, must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
<p>The IDL attribute <dfn id="dom-a-rellist" title="dom-a-rellist"><code>relList</code></dfn> must
|
|
<a href="#reflect">reflect</a> the <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>
|
|
content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-a-text" title="dom-a-text"><code>text</code></dfn> IDL
|
|
attribute, on getting, must return the same value as the
|
|
<code><a href="#textcontent">textContent</a></code> IDL attribute on the element, and on
|
|
setting, must act as if the <code><a href="#textcontent">textContent</a></code> IDL attribute
|
|
on the element had been set to the new value.</p>
|
|
|
|
<p>The <code><a href="#the-a-element">a</a></code> element also supports the complement of
|
|
<a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a>, <dfn id="dom-a-protocol" title="dom-a-protocol"><code>protocol</code></dfn>, <dfn id="dom-a-host" title="dom-a-host"><code>host</code></dfn>, <dfn id="dom-a-port" title="dom-a-port"><code>port</code></dfn>, <dfn id="dom-a-hostname" title="dom-a-hostname"><code>hostname</code></dfn>, <dfn id="dom-a-pathname" title="dom-a-pathname"><code>pathname</code></dfn>, <dfn id="dom-a-search" title="dom-a-search"><code>search</code></dfn>, and <dfn id="dom-a-hash" title="dom-a-hash"><code>hash</code></dfn>. These must follow the
|
|
rules given for <a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a>, with
|
|
the <a href="#concept-uda-input" title="concept-uda-input">input</a> being the result of
|
|
<a href="#resolve-a-url" title="resolve a url">resolving</a> the element's <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute relative to the
|
|
element, if there is such an attribute and resolving it is
|
|
successful, or the empty string otherwise; and the <a href="#concept-uda-setter" title="concept-uda-setter">common setter action</a> being the
|
|
same as setting the element's <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute to the new output
|
|
value.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The <code><a href="#the-a-element">a</a></code> element may be wrapped around entire
|
|
paragraphs, lists, tables, and so forth, even entire sections, so
|
|
long as there is no interactive content within (e.g. buttons or
|
|
other links). This example shows how this can be used to make an
|
|
entire advertising block into a link:</p>
|
|
|
|
<pre><aside class="advertising">
|
|
<h1>Advertising</h1>
|
|
<a href="http://ad.example.com/?adid=1929&amp;pubid=1422">
|
|
<section>
|
|
<h1>Mellblomatic 9000!</h1>
|
|
<p>Turn all your widgets into mellbloms!</p>
|
|
<p>Only $9.99 plus shipping and handling.</p>
|
|
</section>
|
|
</a>
|
|
<a href="http://ad.example.com/?adid=375&amp;pubid=1422">
|
|
<section>
|
|
<h1>The Mellblom Browser</h1>
|
|
<p>Web browsing at the speed of light.</p>
|
|
<p>No other browser goes faster!</p>
|
|
</section>
|
|
</a>
|
|
</aside></pre>
|
|
|
|
</div><h4 id="the-em-element"><span class="secno">4.6.2 </span>The <dfn><code>em</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-em-element">em</a></code> element <a href="#represents">represents</a> stress
|
|
emphasis of its contents.<p>The level of emphasis that a particular piece of content has is
|
|
given by its number of ancestor <code><a href="#the-em-element">em</a></code> elements.<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.<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 emphasizing 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 emphasize the last word:</p>
|
|
|
|
<pre><p>Cats are cute <em>animals</em>.</p></pre>
|
|
|
|
<p>By emphasizing 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 emphasizing the cuteness could lead to markup
|
|
such as:</p>
|
|
|
|
<pre><p><em>Cats are <em>cute</em> animals!</em></p></pre>
|
|
|
|
</div><div class="note">
|
|
|
|
<p>The <code><a href="#the-em-element">em</a></code> element isn't a generic "italics"
|
|
element. Sometimes, text is intended to stand out from the rest of
|
|
the paragraph, as if it was in a different mood or voice. For this,
|
|
the <code><a href="#the-i-element">i</a></code> element is more appropriate.</p>
|
|
|
|
<p>The <code><a href="#the-em-element">em</a></code> element also isn't intended to convey
|
|
importance; for that purpose, the <code><a href="#the-strong-element">strong</a></code> element is
|
|
more appropriate.</p>
|
|
|
|
|
|
</div><h4 id="the-strong-element"><span class="secno">4.6.3 </span>The <dfn><code>strong</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-strong-element">strong</a></code> element <a href="#represents">represents</a> strong
|
|
importance for its contents.<p>The relative level of importance of a piece of content is given
|
|
by its number of ancestor <code><a href="#the-strong-element">strong</a></code> elements; each
|
|
<code><a href="#the-strong-element">strong</a></code> element increases the importance of its
|
|
contents.<p>Changing the importance of a piece of text with the
|
|
<code><a href="#the-strong-element">strong</a></code> element does not change the meaning of the
|
|
sentence.<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-element"><span class="secno">4.6.4 </span>The <dfn><code>small</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-small-element">small</a></code> element <a href="#represents">represents</a> side
|
|
comments such as small print.<p class="note">Small print typically features disclaimers, caveats,
|
|
legal restrictions, or copyrights. Small print is also sometimes
|
|
used for attribution, or for satisfying licensing requirements.<p class="note">The <code><a href="#the-small-element">small</a></code> element does not
|
|
"de-emphasize" or lower the importance of text emphasized by the
|
|
<code><a href="#the-em-element">em</a></code> element or marked as important with the
|
|
<code><a href="#the-strong-element">strong</a></code> element. To mark text as not emphasized or
|
|
important, simply do not mark it up with the <code><a href="#the-em-element">em</a></code> or
|
|
<code><a href="#the-strong-element">strong</a></code> elements respectively.<p>The <code><a href="#the-small-element">small</a></code> element should not be used for extended
|
|
spans of text, such as multiple paragraphs, lists, or sections of
|
|
text. It is only intended for short runs of text. The text of a page
|
|
listing terms of use, for instance, would not be a suitable
|
|
candidate for the <code><a href="#the-small-element">small</a></code> element: in such a case, the
|
|
text is not a side comment, it is the main content of the page.<div class="example">
|
|
|
|
<p>In this example, the <code><a href="#the-small-element">small</a></code> element is used to
|
|
indicate that value-added tax is not included in a price of a hotel
|
|
room:</p>
|
|
|
|
<pre class="example"><dl>
|
|
<dt>Single room
|
|
<dd>199 € <small>breakfast included, VAT not included</small>
|
|
<dt>Double room
|
|
<dd>239 € <small>breakfast included, VAT not included</small>
|
|
</dl></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this second example, the <code><a href="#the-small-element">small</a></code> element is used
|
|
for a side comment in an article.</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>This is distinct from a sidebar, which might be multiple
|
|
paragraphs long and is removed from the main flow of text. In the
|
|
following example, we see a sidebar from the same article. This
|
|
sidebar also has small print, indicating the source of the
|
|
information in the sidebar.</p>
|
|
|
|
<pre><aside>
|
|
<h1>Example Corp</h1>
|
|
<p>This company mostly creates small software and Web
|
|
sites.</p>
|
|
<p>The Example Corp company mission is "To provide entertainment
|
|
and news on a sample basis".</p>
|
|
<p><small>Information obtained from <a
|
|
href="http://example.com/about.html">example.com</a> home
|
|
page.</small></p>
|
|
</aside></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this last example, the <code><a href="#the-small-element">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-s-element"><span class="secno">4.6.5 </span>The <dfn><code>s</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-s-element">s</a></code> element <a href="#represents">represents</a> contents that
|
|
are no longer accurate or no longer relevant.<p class="note">The <code><a href="#the-s-element">s</a></code> element is not appropriate when
|
|
indicating document edits; to mark a span of text as having been
|
|
removed from a document, use the <code><a href="#the-del-element">del</a></code> element.<div class="example">
|
|
|
|
<p>In this example a recommended retail price has been marked as no
|
|
longer relevant as the product in question has a new sale
|
|
price.</p>
|
|
|
|
<pre><p>Buy our Iced Tea and Lemonade!</p>
|
|
<p><s>Recommended retail price: $3.99 per bottle</s></p>
|
|
<p><strong>Now selling for just $2.99 a bottle!</strong></p></pre>
|
|
|
|
</div><h4 id="the-cite-element"><span class="secno">4.6.6 </span>The <dfn><code>cite</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-cite-element">cite</a></code> element <a href="#represents">represents</a> the 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,
|
|
a legal case report,
|
|
etc). This can be a work that is being quoted or
|
|
referenced in detail (i.e. a citation), or it can just be a work
|
|
that is mentioned in passing.<p>A person's name is not the 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
|
|
<code><a href="#the-b-element">b</a></code> 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 <em>really</em> needed, the
|
|
<code><a href="#the-span-element">span</a></code> element can be used.)</p><div class="example">
|
|
|
|
<p>This next example shows a typical use of the <code><a href="#the-cite-element">cite</a></code>
|
|
element:</p>
|
|
|
|
<pre><p>My favorite book is <cite>The Reality Dysfunction</cite> by
|
|
Peter F. Hamilton. My favorite comic is <cite>Pearls Before
|
|
Swine</cite> by Stephan Pastis. My favorite track is <cite>Jive
|
|
Samba</cite> by the Cannonball Adderley Sextet.</p></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This is correct usage:</p>
|
|
|
|
<pre><p>According to the Wikipedia article <cite>HTML</cite>, as it
|
|
stood in mid-February 2008, leaving attribute values unquoted is
|
|
unsafe. This is obviously an over-simplification.</p></pre>
|
|
|
|
<p>The following, however, is incorrect usage, as the
|
|
<code><a href="#the-cite-element">cite</a></code> element here is containing far more than the
|
|
title of the work:</p>
|
|
|
|
<pre 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>The <code><a href="#the-cite-element">cite</a></code> element is obviously a key part of any
|
|
citation in a bibliography, but it is only used to mark the
|
|
title:</p>
|
|
|
|
<pre><p><cite>Universal Declaration of Human Rights</cite>, United Nations,
|
|
December 1948. Adopted by General Assembly resolution 217 A (III).</p></pre>
|
|
|
|
</div><p class="note">A <em>citation</em> is not a <em>quote</em> (for
|
|
which the <code><a href="#the-q-element">q</a></code> element is appropriate).<div class="example">
|
|
|
|
<p>This is incorrect usage, because <code><a href="#the-cite-element">cite</a></code> is not for
|
|
quotes:</p>
|
|
|
|
<pre><p><cite>This is wrong!</cite>, said Ian.</p></pre>
|
|
|
|
<p>This is also incorrect usage, because a person is not a
|
|
work:</p>
|
|
|
|
<pre><p><q>This is still wrong!</q>, said <cite>Ian</cite>.</p></pre>
|
|
|
|
<p>The correct usage does not use a <code><a href="#the-cite-element">cite</a></code> element:</p>
|
|
|
|
<pre><p><q>This is correct</q>, said Ian.</p></pre>
|
|
|
|
<p>As mentioned above, the <code><a href="#the-b-element">b</a></code> element might be relevant
|
|
for marking names as being keywords in certain kinds of
|
|
documents:</p>
|
|
|
|
<pre><p>And then <b>Ian</b> said <q>this might be right, in a
|
|
gossip column, maybe!</q>.</p></pre>
|
|
|
|
</div><h4 id="the-q-element"><span class="secno">4.6.7 </span>The <dfn><code>q</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-q-cite"><a href="#attr-q-cite">cite</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlquoteelement">HTMLQuoteElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-q-element">q</a></code> element <a href="#represents">represents</a> some <a href="#phrasing-content" title="phrasing content">phrasing content</a> quoted from another
|
|
source.<p>Quotation punctuation (such as quotation marks) that is quoting
|
|
the contents of the element must not appear immediately before,
|
|
after, or inside <code><a href="#the-q-element">q</a></code> elements; they will be inserted into
|
|
the rendering by the user agent.<p>Content inside a <code><a href="#the-q-element">q</a></code> element must be quoted from
|
|
another source, whose address, if it has one, may be cited in the
|
|
<dfn id="attr-q-cite" title="attr-q-cite"><code>cite</code></dfn> attribute. The
|
|
source may be fictional, as when quoting characters in a novel or
|
|
screenplay.<p>If the <code title="attr-q-cite"><a href="#attr-q-cite">cite</a></code> attribute is
|
|
present, it must be a <a href="#valid-url-potentially-surrounded-by-spaces">valid URL potentially surrounded by
|
|
spaces</a>. <span class="impl">To obtain the corresponding
|
|
citation link, the value of the attribute must be <a href="#resolve-a-url" title="resolve a url">resolved</a> relative to the element. User
|
|
agents should allow users to follow such citation links.</span><p>The <code><a href="#the-q-element">q</a></code> element must not be used in place of quotation
|
|
marks that do not represent quotes; for example, it is inappropriate
|
|
to use the <code><a href="#the-q-element">q</a></code> element for marking up sarcastic
|
|
statements.<p>The use of <code><a href="#the-q-element">q</a></code> elements to mark up quotations is
|
|
entirely optional; using explicit quotation punctuation without
|
|
<code><a href="#the-q-element">q</a></code> elements is just as correct.<div class="example">
|
|
|
|
<p>Here is a simple example of the use of the <code><a href="#the-q-element">q</a></code>
|
|
element:</p>
|
|
|
|
<pre><p>The man said <q>Things that are impossible just take
|
|
longer</q>. I disagreed with him.</p></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is an example with both an explicit citation link in the
|
|
<code><a href="#the-q-element">q</a></code> element, and an explicit citation outside:</p>
|
|
|
|
<pre><p>The W3C page <cite>About W3C</cite> says the W3C's
|
|
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></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, the quotation itself contains a
|
|
quotation:</p>
|
|
|
|
<pre><p>In <cite>Example One</cite>, he writes <q>The man
|
|
said <q>Things that are impossible just take longer</q>. I
|
|
disagreed with him</q>. Well, I disagree even more!</p></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, quotation marks are used instead of
|
|
the <code><a href="#the-q-element">q</a></code> element:</p>
|
|
|
|
<pre><p>His best argument was ❝I disagree❞, which
|
|
I thought was laughable.</p></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, there is no quote — the
|
|
quotation marks are used to name a word. Use of the <code><a href="#the-q-element">q</a></code>
|
|
element in this case would be inappropriate.</p>
|
|
|
|
<pre><p>The word "ineffable" could have been used to describe the disaster
|
|
resulting from the campaign's mismanagement.</p></pre>
|
|
|
|
</div><h4 id="the-dfn-element"><span class="secno">4.6.8 </span>The <dfn><code>dfn</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>, but there must be no <code><a href="#the-dfn-element">dfn</a></code> element descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd>Also, the <code title="attr-dfn-title"><a href="#attr-dfn-title">title</a></code> attribute has special semantics on this element.</dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-dfn-element">dfn</a></code> element <a href="#represents">represents</a> the defining
|
|
instance of a term. The <a href="#paragraph" title="paragraph">paragraph</a>,
|
|
<a href="#the-dl-element" title="dl">description list group</a>, or <a href="#sectioning-content" title="sectioning content">section</a> that is the nearest
|
|
ancestor of the <code><a href="#the-dfn-element">dfn</a></code> element must also contain the
|
|
definition(s) for the <a href="#defining-term" title="defining term">term</a> given
|
|
by the <code><a href="#the-dfn-element">dfn</a></code> element.<p><dfn id="defining-term">Defining term</dfn>: If the <code><a href="#the-dfn-element">dfn</a></code> element has a
|
|
<dfn id="attr-dfn-title" 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="#the-abbr-element">abbr</a></code> element with a <code title="attr-abbr-title"><a href="#attr-abbr-title">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="#the-dfn-element">dfn</a></code>
|
|
element that gives the term being defined.</p><p>If the <code title="attr-dfn-title"><a href="#attr-dfn-title">title</a></code> attribute of the
|
|
<code><a href="#the-dfn-element">dfn</a></code> element is present, then it must contain only the
|
|
term being defined.<p class="note">The <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute
|
|
of ancestor elements does not affect <code><a href="#the-dfn-element">dfn</a></code> elements.<p>An <code><a href="#the-a-element">a</a></code> element that links to a <code><a href="#the-dfn-element">dfn</a></code>
|
|
element represents an instance of the term defined by the
|
|
<code><a href="#the-dfn-element">dfn</a></code> element.<div class="example">
|
|
|
|
<p>In the following fragment, the term "GDO" is first defined in
|
|
the first paragraph, then used in the second.</p>
|
|
|
|
<pre><p>The <dfn><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: -->
|
|
<p>Teal'c activated his <abbr title="Garage Door Opener">GDO</abbr>
|
|
and so Hammond ordered the iris to be opened.</p></pre>
|
|
|
|
<p>With the addition of an <code><a href="#the-a-element">a</a></code> element, the reference
|
|
can be made explicit:</p>
|
|
|
|
<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: -->
|
|
<p>Teal'c activated his <a href=#gdo><abbr title="Garage Door Opener">GDO</abbr></a>
|
|
and so Hammond ordered the iris to be opened.</p></pre>
|
|
|
|
</div><h4 id="the-abbr-element"><span class="secno">4.6.9 </span>The <dfn><code>abbr</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd>Also, the <code title="attr-abbr-title"><a href="#attr-abbr-title">title</a></code> attribute has special semantics on this element.</dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-abbr-element">abbr</a></code> element <a href="#represents">represents</a> an
|
|
abbreviation or acronym, optionally with its expansion. The <dfn id="attr-abbr-title" title="attr-abbr-title"><code>title</code></dfn> attribute may be
|
|
used to provide an expansion of the abbreviation. The attribute, if
|
|
specified, must contain an expansion of the abbreviation, and
|
|
nothing else.<div class="example">
|
|
<p>The paragraph below contains an abbreviation marked up with the
|
|
<code><a href="#the-abbr-element">abbr</a></code> element. This paragraph <a href="#defining-term" title="defining
|
|
term">defines the term</a> "Web Hypertext Application Technology
|
|
Working Group".</p>
|
|
<pre><p>The <dfn id=whatwg><abbr
|
|
title="Web Hypertext Application 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 Applications over the World Wide
|
|
Web.</p></pre>
|
|
<p>An alternative way to write this would be:</p>
|
|
<pre><p>The <dfn id=whatwg>Web Hypertext Application Technology
|
|
Working Group</dfn> (<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 Applications over the World Wide
|
|
Web.</p></pre>
|
|
</div><div class="example">
|
|
<p>This paragraph has two abbreviations. Notice how only one is
|
|
defined; the other, with no expansion associated with it, does not
|
|
use the <code><a href="#the-abbr-element">abbr</a></code> element.</p>
|
|
<pre><p>The
|
|
<abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr>
|
|
started working on HTML5 in 2004.</p></pre>
|
|
</div><div class="example">
|
|
<p>This paragraph links an abbreviation to its definition.</p>
|
|
<pre><p>The <a href="#whatwg"><abbr
|
|
title="Web Hypertext Application Technology Working Group">WHATWG</abbr></a>
|
|
community does not have much representation from Asia.</p></pre>
|
|
</div><div class="example">
|
|
<p>This paragraph marks up an abbreviation without giving an
|
|
expansion, possibly as a hook to apply styles for abbreviations
|
|
(e.g. smallcaps).</p>
|
|
<pre><p>Philip` and Dashiva both denied that they were going to
|
|
get the issue counts from past revisions of the specification to
|
|
backfill the <abbr>WHATWG</abbr> issue graph.</p></pre>
|
|
</div><p>If an abbreviation is pluralized, the expansion's grammatical
|
|
number (plural vs singular) must match the grammatical number of the
|
|
contents of the element.<div class="example">
|
|
|
|
<p>Here the plural is outside the element, so the expansion is in
|
|
the singular:</p>
|
|
|
|
<pre><p>Two <abbr title="Working Group">WG</abbr>s worked on
|
|
this specification: the <abbr>WHATWG</abbr> and the
|
|
<abbr>HTMLWG</abbr>.</p></pre>
|
|
|
|
<p>Here the plural is inside the element, so the expansion is in
|
|
the plural:</p>
|
|
|
|
<pre><p>Two <abbr title="Working Groups">WGs</abbr> worked on
|
|
this specification: the <abbr>WHATWG</abbr> and the
|
|
<abbr>HTMLWG</abbr>.</p></pre>
|
|
|
|
</div><p>Abbreviations do not have to be marked up using this element. It
|
|
is expected to be useful in the following cases:<ul><li>Abbreviations for which the author wants to give expansions,
|
|
where using the <code><a href="#the-abbr-element">abbr</a></code> element with a <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute is an alternative to
|
|
including the expansion inline (e.g. in parentheses).</li>
|
|
|
|
<li>Abbreviations that are likely to be unfamiliar to the
|
|
document's readers, for which authors are encouraged to either mark
|
|
up the abbreviation using a <code><a href="#the-abbr-element">abbr</a></code> element with a <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute or include the expansion
|
|
inline in the text the first time the abbreviation is used.</li>
|
|
|
|
<li>Abbreviations whose presence needs to be semantically
|
|
annotated, e.g. so that they can be identified from a style sheet
|
|
and given specific styles, for which the <code><a href="#the-abbr-element">abbr</a></code> element
|
|
can be used without a <code title="attr-title"><a href="#the-title-attribute">title</a></code>
|
|
attribute.</li>
|
|
|
|
</ul><p title="note">Providing an expansion in a <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute once will not necessarily
|
|
cause other <code><a href="#the-abbr-element">abbr</a></code> elements in the same document with the
|
|
same contents but without a <code title="attr-title"><a href="#the-title-attribute">title</a></code>
|
|
attribute to behave as if they had the same expansion. Every
|
|
<code><a href="#the-abbr-element">abbr</a></code> element is independent.<h4 id="the-time-element"><span class="secno">4.6.10 </span>The <dfn><code>time</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>, but there must be no <code><a href="#the-time-element">time</a></code> element descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code></dd>
|
|
<dd><code title="attr-time-pubdate"><a href="#attr-time-pubdate">pubdate</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="#dom-time-datetime" title="dom-time-datetime">dateTime</a>;
|
|
attribute boolean <a href="#dom-time-pubdate" title="dom-time-pubDate">pubDate</a>;
|
|
readonly attribute <span>Date</span> <a href="#dom-time-valueasdate" title="dom-time-valueAsDate">valueAsDate</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-time-element">time</a></code> element <a href="#represents">represents</a> either a
|
|
time on a 24 hour clock, or a precise date in the proleptic
|
|
Gregorian calendar, optionally with a time and a time-zone
|
|
offset. <a href="#refsGREGORIAN">[GREGORIAN]</a><p>This element is intended as a way to encode modern dates and
|
|
times in a machine-readable way so that, for example, user agents
|
|
can offer to add birthday reminders or scheduled events to the
|
|
user's calendar.</p><div class="note">
|
|
|
|
<p>The <code><a href="#the-time-element">time</a></code> element is not intended for encoding times
|
|
for which a precise date or time cannot be established. For
|
|
example, it would be inappropriate for encoding times like "one
|
|
millisecond after the big bang", "the early part of the Jurassic
|
|
period", or "a winter around 250 BCE".</p>
|
|
|
|
<p>For dates before the introduction of the Gregorian calendar,
|
|
authors are encouraged to not use the <code><a href="#the-time-element">time</a></code> element, or
|
|
else to be very careful about converting dates and times from the
|
|
period to the Gregorian calendar. This is complicated by the manner
|
|
in which the Gregorian calendar was phased in, which occurred at
|
|
different times in different countries, ranging from partway
|
|
through the 16th century all the way to early in the 20th.</p>
|
|
|
|
</div><p>The <dfn id="attr-time-pubdate" title="attr-time-pubdate"><code>pubdate</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. If specified, it
|
|
indicates that the date and time given by the element is the
|
|
publication date and time of the nearest ancestor
|
|
<code><a href="#the-article-element">article</a></code> element, or, if the element has no ancestor
|
|
<code><a href="#the-article-element">article</a></code> element, of the document as a whole. If the
|
|
element has a <code title="attr-time-pubdate"><a href="#attr-time-pubdate">pubdate</a></code>
|
|
attribute specified, then the element <dfn id="needs-a-date">needs a date</dfn>. For
|
|
each <code><a href="#the-article-element">article</a></code> element, there must be no more than one
|
|
<code><a href="#the-time-element">time</a></code> element with a <code title="attr-time-pubdate"><a href="#attr-time-pubdate">pubdate</a></code> attribute whose nearest
|
|
ancestor is that <code><a href="#the-article-element">article</a></code> element. Furthermore, for each
|
|
<code><a href="#document">Document</a></code>, there must be no more than one
|
|
<code><a href="#the-time-element">time</a></code> element with a <code title="attr-time-pubdate"><a href="#attr-time-pubdate">pubdate</a></code> attribute that does not
|
|
have an ancestor <code><a href="#the-article-element">article</a></code> element.<p>The <dfn id="attr-time-datetime" title="attr-time-datetime"><code>datetime</code></dfn>
|
|
attribute, if present, gives the date or time being
|
|
specified. Otherwise, the date or time is given by the element's
|
|
contents.<p>If the element <i><a href="#needs-a-date">needs a date</a></i>, and the <code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code> attribute is present,
|
|
then the attribute's value must be a <a href="#valid-date-string-with-optional-time">valid date string with
|
|
optional time</a>.<p>If the element <i><a href="#needs-a-date">needs a date</a></i>, but the <code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code> attribute is not present,
|
|
then the element's <code><a href="#textcontent">textContent</a></code> must be a <a href="#valid-date-string-in-content-with-optional-time">valid
|
|
date string in content with optional time</a>.<p>If the element does not <i title="needs a date"><a href="#needs-a-date">need a date</a></i>,
|
|
and the <code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code> attribute
|
|
is present, then the attribute's value must be a <a href="#valid-date-or-time-string">valid date or
|
|
time string</a>.<p>If the element does not <i title="needs a date"><a href="#needs-a-date">need a date</a></i>,
|
|
but the <code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code> attribute
|
|
is not present, then the element's <code><a href="#textcontent">textContent</a></code> must be
|
|
a <a href="#valid-date-or-time-string-in-content">valid date or time string in content</a>.<p>The date, if any, must be expressed using the Gregorian
|
|
calendar.<div class="impl">
|
|
|
|
<p>If the <code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code> attribute
|
|
is present, the user agent should convey the attribute's value to
|
|
the user when rendering the element.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The <code><a href="#the-time-element">time</a></code> element can be used to encode dates, for
|
|
example in Microformats. The following shows a hypothetical way of
|
|
encoding an event using a variant on hCalendar that uses the
|
|
<code><a href="#the-time-element">time</a></code> element:</p>
|
|
|
|
<pre><div class="vevent">
|
|
<a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
|
|
<span class="summary">Web 2.0 Conference</span>:
|
|
<time class="dtstart" datetime="2007-10-05">October 5</time> -
|
|
<time class="dtend" datetime="2007-10-20">19</time>,
|
|
at the <span class="location">Argent Hotel, San Francisco, CA</span>
|
|
</div></pre>
|
|
|
|
<p>(The end date is encoded as one day after the last date of the
|
|
event because in the iCalendar format, end dates are
|
|
<em>exclusive</em>, not inclusive.)</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The <code><a href="#the-time-element">time</a></code> element is not necessary for encoding
|
|
dates or times. In the following snippet, the time is encoded using
|
|
<code><a href="#the-time-element">time</a></code>, so that it can be restyled (e.g. using XBL2) to
|
|
match local conventions, while the year is not marked up at all,
|
|
since marking it up would not be particularly useful, and doing so
|
|
is thus not allowed.</p>
|
|
|
|
<pre><p>I usually have a snack at <time>16:00</time>.</p>
|
|
<p>I've liked model trains since at least 1983.</p></pre>
|
|
|
|
<p>Using a styling technology that supports restyling times, the
|
|
first paragraph from the above snippet could be rendered as follows:</p>
|
|
|
|
<blockquote><p>I usually have a snack at 4pm.</blockquote>
|
|
|
|
<p>Or it could be rendered as follows:</p>
|
|
|
|
<blockquote><p>I usually have a snack at 16h00.</blockquote>
|
|
|
|
</div><div class="impl">
|
|
|
|
<p>The <dfn id="dom-time-datetime" title="dom-time-datetime"><code>dateTime</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code> content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-time-pubdate" title="dom-time-pubDate"><code>pubDate</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-time-pubdate"><a href="#attr-time-pubdate">pubdate</a></code> content attribute.</p>
|
|
|
|
<p>User agents, to obtain the <dfn id="concept-time-date" title="concept-time-date">date</dfn>, <dfn id="concept-time-time" title="concept-time-time">time</dfn>, and <dfn id="concept-time-timezone" title="concept-time-timezone">time-zone offset</dfn> represented by
|
|
a <code><a href="#the-time-element">time</a></code> element, must follow these steps:</p>
|
|
|
|
<ol><li>If the <code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code>
|
|
attribute is present, then use the rules to <a href="#parse-a-date-or-time-string">parse a date or
|
|
time string</a> with the flag <i>in attribute</i> from the value
|
|
of that attribute, and let the result be <var title="">result</var>.</li>
|
|
|
|
<li>Otherwise, use the rules to <a href="#parse-a-date-or-time-string">parse a date or time
|
|
string</a> with the flag <i>in content</i> from the element's
|
|
<code><a href="#textcontent">textContent</a></code>, 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="#concept-time-date" title="concept-time-date">date</a> is
|
|
unknown, the <a href="#concept-time-time" title="concept-time-time">time</a> is
|
|
unknown, and the <a href="#concept-time-timezone" title="concept-time-timezone">time-zone
|
|
offset</a> is unknown.</li>
|
|
|
|
<li>Otherwise: if <var title="">result</var> contains a date, then
|
|
that is the <a href="#concept-time-date" title="concept-time-date">date</a>; if <var title="">result</var> contains a time, then that is the <a href="#concept-time-time" title="concept-time-time">time</a>; and if <var title="">result</var> contains a time-zone offset, then the
|
|
time-zone offset is the element's <a href="#concept-time-timezone" title="concept-time-timezone">time-zone offset</a>. (A time-zone
|
|
offset can only be present if both a date and a time are also
|
|
present.)</li>
|
|
|
|
</ol></div><dl class="domintro"><dt><var title="">time</var> . <code title="dom-time-valueAsDate"><a href="#dom-time-valueasdate">valueAsDate</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code>Date</code> object representing the specified date and time.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-time-valueasdate" title="dom-time-valueAsDate"><code>valueAsDate</code></dfn> IDL
|
|
attribute must return either null or a new <code>Date</code> object
|
|
initialised to the relevant value as defined by the following
|
|
list:</p>
|
|
|
|
<dl><dt>If the <a href="#concept-time-date" title="concept-time-date">date</a> is known but
|
|
the <a href="#concept-time-time" title="concept-time-time">time</a> is not</dt>
|
|
|
|
<dd>The time corresponding to midnight UTC (i.e. the first second)
|
|
of the given <a href="#concept-time-date" title="concept-time-date">date</a>.</dd>
|
|
|
|
<dt>If the <a href="#concept-time-time" title="concept-time-time">time</a> is known but
|
|
the <a href="#concept-time-date" title="concept-time-date">date</a> is not</dt>
|
|
|
|
<dd>The time corresponding to the given <a href="#concept-time-time" title="concept-time-time">time</a> of 1970-01-01, with the time
|
|
zone UTC.</dd>
|
|
|
|
<dt>If both the <a href="#concept-time-date" title="concept-time-date">date</a> and the
|
|
<a href="#concept-time-time" title="concept-time-time">time</a> are known</dt>
|
|
|
|
<dd>The time corresponding to the <a href="#concept-time-date" title="concept-time-date">date</a> and <a href="#concept-time-time" title="concept-time-time">time</a>, with the given <a href="#concept-time-timezone" title="concept-time-timezone">time-zone offset</a>.</dd>
|
|
|
|
<dt>If neither the <a href="#concept-time-date" title="concept-time-date">date</a> nor
|
|
the <a href="#concept-time-time" title="concept-time-time">time</a> are known</dt>
|
|
|
|
<dd>The null value.</dd>
|
|
|
|
</dl><p>When a <code>Date</code> object is to be returned, a new one must
|
|
be constructed.</p>
|
|
</div><div class="example">
|
|
|
|
<p>In the following snippet:</p>
|
|
|
|
<pre><p>Our first date was <time datetime="2006-09-23">a Saturday</time>.</p></pre>
|
|
|
|
<p>...the <code><a href="#the-time-element">time</a></code> element's <code title="dom-time-valueAsDate"><a href="#dom-time-valueasdate">valueAsDate</a></code> attribute would
|
|
have the value 1,158,969,600,000ms.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following snippet:</p>
|
|
|
|
<pre><p>Many people get up at <time>08:00</time>.</p></pre>
|
|
|
|
<p>...the <code><a href="#the-time-element">time</a></code> element's <code title="dom-time-valueAsDate"><a href="#dom-time-valueasdate">valueAsDate</a></code> attribute would
|
|
have the value 28,800,000ms.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this example, an article's publication date is marked up
|
|
using <code><a href="#the-time-element">time</a></code>:</p>
|
|
|
|
<pre><article>
|
|
<h1>Small tasks</h1>
|
|
<footer>Published <time pubdate>2009-08-30</time>.</footer>
|
|
<p>I put a bike bell on his bike.</p>
|
|
</article></pre>
|
|
|
|
<p>Here is another way that could be marked up. In this example,
|
|
legacy user agents would say "today", while newer user agents would
|
|
render the time in a locale-specific manner based on the value of
|
|
the attribute.</p>
|
|
|
|
<pre><article>
|
|
<h1>Small tasks</h1>
|
|
<footer>Published <time pubdate datetime="2009-08-30">today</time>.</footer>
|
|
<p>I put a bike bell on his bike.</p>
|
|
</article></pre>
|
|
|
|
<p>Here is the same thing but with the time included only. Because
|
|
the element is empty, legacy user agents will not show anything
|
|
useful; user agents that implement this specification, on the other
|
|
hand, would show the date and time in a locale-specific manner.</p>
|
|
|
|
<pre><article>
|
|
<h1>Small tasks</h1>
|
|
<footer>Published <time pubdate datetime="2009-08-30T07:13Z"></time>.</footer>
|
|
<p>I put a bike bell on his bike.</p>
|
|
</article></pre>
|
|
|
|
</div><h4 id="the-code-element"><span class="secno">4.6.11 </span>The <dfn><code>code</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-code-element">code</a></code> element <a href="#represents">represents</a> 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
|
|
recognize.<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="#the-code-element">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.<div class="example">
|
|
|
|
<p>The following example shows how the element can be used in a
|
|
paragraph to mark up element names and computer code, including
|
|
punctuation.</p>
|
|
|
|
<pre><p>The <code>code</code> element represents a fragment of computer
|
|
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></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows how a block of code could be marked
|
|
up using the <code><a href="#the-pre-element">pre</a></code> and <code><a href="#the-code-element">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="#the-pre-element">pre</a></code> element for more details.<h4 id="the-var-element"><span class="secno">4.6.12 </span>The <dfn><code>var</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-var-element">var</a></code> element <a href="#represents">represents</a> 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.<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>
|
|
flavors of ice cream to be available for purchase!</p></pre>
|
|
</div><p>For mathematics, in particular for anything beyond the simplest
|
|
of expressions, MathML is more appropriate. However, the
|
|
<code><a href="#the-var-element">var</a></code> element can still be used to refer to specific
|
|
variables that are then mentioned in MathML expressions.<div class="example">
|
|
|
|
<p>In this example, an equation is shown, with a legend that
|
|
references the variables in the equation. The expression itself is
|
|
marked up with MathML, but the variables are mentioned in the
|
|
figure's legend using <code><a href="#the-var-element">var</a></code>.</p>
|
|
|
|
<pre><figure>
|
|
<math>
|
|
<mi>a</mi>
|
|
<mo>=</mo>
|
|
<msqrt>
|
|
<msup><mi>b</mi><mn>2</mn></msup>
|
|
<mi>+</mi>
|
|
<msup><mi>c</mi><mn>2</mn></msup>
|
|
</msqrt>
|
|
</math>
|
|
<figcaption>
|
|
Using Pythagoras' theorem to solve for the hypotenuse <var>a</var> of
|
|
a triangle with sides <var>b</var> and <var>c</var>
|
|
</figcaption>
|
|
</figure></pre>
|
|
|
|
</div><h4 id="the-samp-element"><span class="secno">4.6.13 </span>The <dfn><code>samp</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-samp-element">samp</a></code> element <a href="#represents">represents</a> (sample)
|
|
output from a program or computing system.<p class="note">See the <code><a href="#the-pre-element">pre</a></code> and <code><a href="#the-kbd-element">kbd</a></code>
|
|
elements for more details.<div class="example">
|
|
<p>This example shows the <code><a href="#the-samp-element">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="#the-samp-element">samp</a></code> and <code><a href="#the-kbd-element">kbd</a></code> elements allow for the
|
|
styling of specific elements of the sample output using a
|
|
style sheet.</p>
|
|
|
|
<pre><pre><samp><span class="prompt">jdoe@mowmow:~$</span> <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
|
|
|
|
<span class="prompt">jdoe@demo:~$</span> <span class="cursor">_</span></samp></pre></pre>
|
|
</div><h4 id="the-kbd-element"><span class="secno">4.6.14 </span>The <dfn><code>kbd</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-kbd-element">kbd</a></code> element <a href="#represents">represents</a> user input
|
|
(typically keyboard input, although it may also be used to represent
|
|
other input, such as voice commands).<p>When the <code><a href="#the-kbd-element">kbd</a></code> element is nested inside a
|
|
<code><a href="#the-samp-element">samp</a></code> element, it represents the input as it was echoed
|
|
by the system.<p>When the <code><a href="#the-kbd-element">kbd</a></code> element <em>contains</em> a
|
|
<code><a href="#the-samp-element">samp</a></code> element, it represents input based on system
|
|
output, for example invoking a menu item.<p>When the <code><a href="#the-kbd-element">kbd</a></code> element is nested inside another
|
|
<code><a href="#the-kbd-element">kbd</a></code> element, it represents an actual key or other
|
|
single unit of input as appropriate for the input mechanism.<div class="example">
|
|
<p>Here the <code><a href="#the-kbd-element">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="#the-kbd-element">kbd</a></code> element marks up a block of
|
|
input, with the inner <code><a href="#the-kbd-element">kbd</a></code> elements representing each
|
|
individual step of the input, and the <code><a href="#the-samp-element">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>
|
|
|
|
<p>Such precision isn't necessary; the following is equally fine:</p>
|
|
|
|
<pre><p>To make George eat an apple, select <kbd>File | Eat Apple...</kbd></p></pre>
|
|
|
|
</div><h4 id="the-sub-and-sup-elements"><span class="secno">4.6.15 </span>The <dfn id="the-sub-element"><code>sub</code></dfn> and <dfn id="the-sup-element"><code>sup</code></dfn> elements</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Use <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-sub-and-sup-elements">sup</a></code> element <a href="#represents">represents</a> a
|
|
superscript and the <code><a href="#the-sub-and-sup-elements">sub</a></code> element <a href="#represents">represents</a>
|
|
a subscript.<p>These elements must be used only 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="#the-sub-and-sup-elements">sub</a></code> and <code><a href="#the-sub-and-sup-elements">sup</a></code> elements
|
|
to be used in the name of the LaTeX document preparation system. In
|
|
general, authors should use these elements only if the
|
|
<em>absence</em> of those elements would change the meaning of the
|
|
content.<p>In certain languages, superscripts are part of the typographical
|
|
conventions for some abbreviations.<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>The <code><a href="#the-sub-and-sup-elements">sub</a></code> element can be used inside a
|
|
<code><a href="#the-var-element">var</a></code> element, for variables that have subscripts.<div class="example">
|
|
|
|
<p>Here, the <code><a href="#the-sub-and-sup-elements">sub</a></code> element is used to represents the
|
|
subscript that identifies the variable in a family of
|
|
variables:</p>
|
|
|
|
<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>Mathematical expressions often use subscripts and superscripts.
|
|
Authors are encouraged to use MathML for marking up mathematics, but
|
|
authors may opt to use <code><a href="#the-sub-and-sup-elements">sub</a></code> and <code><a href="#the-sub-and-sup-elements">sup</a></code> if
|
|
detailed mathematical markup is not desired. <a href="#refsMATHML">[MATHML]</a><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-i-element"><span class="secno">4.6.16 </span>The <dfn><code>i</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-i-element">i</a></code> element <a href="#represents">represents</a> a span of text
|
|
in an alternate voice or mood, or otherwise offset from the normal
|
|
prose in a manner indicating a different quality of text, such as a
|
|
taxonomic designation, a technical term, an idiomatic phrase from
|
|
another language, a thought, or a ship name in Western texts.<p>Terms in languages different from the main text should be
|
|
annotated with <code title="attr-lang"><a href="#attr-lang">lang</a></code> attributes (or,
|
|
in XML, <a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code>
|
|
attributes in the <span>XML namespace</span></a>).<div class="example">
|
|
<p>The examples below show uses of the <code><a href="#the-i-element">i</a></code> element:</p>
|
|
<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="#the-i-element">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>Authors can use the <code title="attr-class"><a href="#classes">class</a></code>
|
|
attribute on the <code><a href="#the-i-element">i</a></code> 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.<p>Authors are encouraged to consider whether other elements might
|
|
be more applicable than the <code><a href="#the-i-element">i</a></code> element, for instance the
|
|
<code><a href="#the-em-element">em</a></code> element for marking up stress emphasis, or the
|
|
<code><a href="#the-dfn-element">dfn</a></code> element to mark up the defining instance of a
|
|
term.<p class="note">Style sheets can be used to format <code><a href="#the-i-element">i</a></code>
|
|
elements, just like any other element can be restyled. Thus, it is
|
|
not the case that content in <code><a href="#the-i-element">i</a></code> elements will
|
|
necessarily be italicized.<h4 id="the-b-element"><span class="secno">4.6.17 </span>The <dfn><code>b</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-b-element">b</a></code> element <a href="#represents">represents</a> a span of text
|
|
to which attention is being drawn for utilitarian purposes without
|
|
conveying any extra importance and with no implication of an
|
|
alternate voice or mood, such as key words in a document abstract,
|
|
product names in a review, actionable words in interactive
|
|
text-driven software, or an article lede.<div class="example">
|
|
<p>The following example shows a use of the <code><a href="#the-b-element">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>In the following example, objects in a text adventure are
|
|
highlighted as being special by use of the <code><a href="#the-b-element">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="#the-b-element">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:</p>
|
|
<pre><article>
|
|
<h2>Kittens 'adopted' by pet rabbit</h2>
|
|
<p><b class="lede">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>As with the <code><a href="#the-i-element">i</a></code> element, authors can use the <code title="attr-class"><a href="#classes">class</a></code> attribute on the <code><a href="#the-b-element">b</a></code>
|
|
element to identify why the element is being used, so that if the
|
|
style of a particular use is to be changed at a later date, the
|
|
author doesn't have to go through annotating each use.<p>The <code><a href="#the-b-element">b</a></code> element should be used as a last resort when
|
|
no other element is more appropriate. In particular, headings should
|
|
use the <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> to <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements, stress emphasis
|
|
should use the <code><a href="#the-em-element">em</a></code> element, importance should be denoted
|
|
with the <code><a href="#the-strong-element">strong</a></code> element, and text marked or highlighted
|
|
should use the <code><a href="#the-mark-element">mark</a></code> element.<div class="example">
|
|
<p>The following would be <em>incorrect</em> usage:</p>
|
|
<pre class="bad"><p><b>WARNING!</b> Do not frob the barbinator!</p></pre>
|
|
<p>In the previous example, the correct element to use would have
|
|
been <code><a href="#the-strong-element">strong</a></code>, not <code><a href="#the-b-element">b</a></code>.</p>
|
|
</div><p class="note">Style sheets can be used to format <code><a href="#the-b-element">b</a></code>
|
|
elements, just like any other element can be restyled. Thus, it is
|
|
not the case that content in <code><a href="#the-b-element">b</a></code> elements will
|
|
necessarily be boldened.<h4 id="the-u-element"><span class="secno">4.6.18 </span>The <dfn><code>u</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-u-element">u</a></code> element <a href="#represents">represents</a> a span of text
|
|
with an unarticulated, though explicitly rendered, non-textual
|
|
annotation, such as labeling the text as being a proper name in
|
|
Chinese text (a Chinese proper name mark), or labeling the text as
|
|
being misspelt.<p>In most cases, another element is likely to be more appropriate:
|
|
for marking stress emphasis, the <code><a href="#the-em-element">em</a></code> element should be
|
|
used; for marking key words or phrases either the <code><a href="#the-b-element">b</a></code>
|
|
element or the <code><a href="#the-mark-element">mark</a></code> element should be used, depending
|
|
on the context; for marking book titles, the <code><a href="#the-cite-element">cite</a></code>
|
|
element should be used; for labeling text with explicit textual
|
|
annotations, the <code><a href="#the-ruby-element">ruby</a></code> element should be used; for
|
|
labeling ship names in Western texts, the <code><a href="#the-i-element">i</a></code> element
|
|
should be used.<p class="note">The default rendering of the <code><a href="#the-u-element">u</a></code> element
|
|
in visual presentations clashes with the conventional rendering of
|
|
hyperlinks (underlining). Authors are encouraged to avoid using the
|
|
<code><a href="#the-u-element">u</a></code> element where it could be confused for a
|
|
hyperlink.<h4 id="the-mark-element"><span class="secno">4.6.19 </span>The <dfn><code>mark</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-mark-element">mark</a></code> element <a href="#represents">represents</a> a run of
|
|
text in one document marked or highlighted for reference purposes,
|
|
due to its relevance in another context. When used in a quotation or
|
|
other block of text referred to from the prose, it indicates a
|
|
highlight that was not originally present but which has been added
|
|
to bring the reader's attention to a part of the text 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 to the user's current activity.<div class="example">
|
|
<p>This example shows how the <code><a href="#the-mark-element">mark</a></code> element can be used
|
|
to bring attention to a particular part of a quotation:</p>
|
|
<pre><p lang="en-US">Consider the following quote:</p>
|
|
<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></pre>
|
|
<p>(If the goal was to mark the element as misspelt, however, the
|
|
<code><a href="#the-u-element">u</a></code> element, possibly with a class, would be more
|
|
appropriate.</p>
|
|
</div><div class="example">
|
|
|
|
<p>Another example of the <code><a href="#the-mark-element">mark</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>
|
|
|
|
<pre><p>I also have some <mark>kitten</mark>s who are visiting me
|
|
these days. They're really cute. I think they like my garden! Maybe I
|
|
should adopt a <mark>kitten</mark>.</p></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following snippet, a paragraph of text refers to a
|
|
specific part of a code fragment.</p>
|
|
|
|
<pre><p>The highlighted part below is where the error lies:</p>
|
|
<pre><code>var i: Integer;
|
|
begin
|
|
i := <mark>1.1</mark>;
|
|
end.</code></pre></pre>
|
|
|
|
<p>This is separate from <em>syntax highlighting</em>, for which
|
|
<code><a href="#the-span-element">span</a></code> is more appropriate. Combining both, one would
|
|
get:</p>
|
|
|
|
<pre><p>The highlighted part below is where the error lies:</p>
|
|
<pre><code><span class=keyword>var</span> <span class=ident>i</span>: <span class=type>Integer</span>;
|
|
<span class=keyword>begin</span>
|
|
<span class=ident>i</span> := <span class=literal><mark>1.1</mark></span>;
|
|
<span class=keyword>end</span>.</code></pre></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This is another example showing the use of <code><a href="#the-mark-element">mark</a></code> to
|
|
highlight a part of quoted text that was originally not
|
|
emphasized. In this example, common typographic conventions have
|
|
led the author to explicitly style <code><a href="#the-mark-element">mark</a></code> elements in
|
|
quotes to render in italics.</p>
|
|
|
|
<pre><article>
|
|
<style scoped>
|
|
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></pre>
|
|
|
|
<p>Note, incidentally, the distinction between the <code><a href="#the-em-element">em</a></code>
|
|
element in this example, which is part of the original text being
|
|
quoted, and the <code><a href="#the-mark-element">mark</a></code> element, which is highlighting a
|
|
part for comment.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows the difference between denoting the
|
|
<em>importance</em> of a span of text (<code><a href="#the-strong-element">strong</a></code>) as
|
|
opposed to denoting the <em>relevance</em> of a span of text
|
|
(<code><a href="#the-mark-element">mark</a></code>). It is an extract from a textbook, where the
|
|
extract has had the parts relevant to the exam highlighted. The
|
|
safety warnings, important though they may be, are apparently not
|
|
relevant to the exam.</p>
|
|
|
|
<pre><h3>Wormhole Physics Introduction</h3>
|
|
|
|
<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></pre>
|
|
|
|
</div><h4 id="the-ruby-element"><span class="secno">4.6.20 </span>The <dfn><code>ruby</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>One or more groups of: <a href="#phrasing-content">phrasing content</a> followed either by a single <code><a href="#the-rt-element">rt</a></code> element, or an <code><a href="#the-rp-element">rp</a></code> element, an <code><a href="#the-rt-element">rt</a></code> element, and another <code><a href="#the-rp-element">rp</a></code> element.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-ruby-element">ruby</a></code> element allows one or more spans of
|
|
phrasing content to be marked with ruby annotations. Ruby
|
|
annotations are short runs of text presented alongside base text,
|
|
primarily used in East Asian typography as a guide for
|
|
pronunciation or to include other annotations. In Japanese, this
|
|
form of typography is also known as <i>furigana</i>.<p>A <code><a href="#the-ruby-element">ruby</a></code> element <a href="#represents">represents</a> the spans of
|
|
phrasing content it contains, ignoring all the child <code><a href="#the-rt-element">rt</a></code>
|
|
and <code><a href="#the-rp-element">rp</a></code> elements and their descendants. Those spans of
|
|
phrasing content have associated annotations created using the
|
|
<code><a href="#the-rt-element">rt</a></code> element.<div class="example">
|
|
|
|
|
|
|
|
|
|
<p>In this example, each ideograph in the Japanese text <span lang="ja" title="">漢字</span> is annotated with its
|
|
reading in hiragana.</p>
|
|
|
|
<pre lang="ja">...
|
|
<ruby>漢<rt>かん</rt>字<rt>じ </rt></ruby>
|
|
...</pre>
|
|
|
|
<p>This might be rendered as:</p>
|
|
|
|
<p><img alt="The two main ideographs, each with its annotation in hiragana rendered in a smaller font above it." height="78" src="sample-ruby-ja.png" width="171"></p>
|
|
|
|
</div><div class="example">
|
|
|
|
|
|
|
|
<p>In this example, each ideograph in the traditional Chinese text
|
|
<span lang="zh-TW" title="">漢字</span> is annotated
|
|
with its bopomofo reading.</p>
|
|
|
|
<pre lang="zh-TW"><ruby>漢<rt>ㄏㄢˋ</rt>字<rt>ㄗˋ </rt></ruby></pre>
|
|
|
|
<p>This might be rendered as:</p>
|
|
|
|
<p><img alt="The two main ideographs, each with its bopomofo annotation rendered in a smaller font next to it." height="100" src="sample-ruby-bopomofo.png" width="78"></p>
|
|
|
|
</div><div class="example">
|
|
|
|
|
|
|
|
<p>In this example, each ideograph in the simplified Chinese text
|
|
<span lang="zh-CN" title="">汉字</span> is annotated
|
|
with its pinyin reading.</p>
|
|
|
|
<pre lang="zh-CN">...<ruby>汉<rt>hàn</rt>字<rt>zì </rt></ruby>...</pre>
|
|
|
|
<p>This might be rendered as:</p>
|
|
|
|
<p><img alt="The two main ideographs, each with its pinyin annotation rendered in a smaller font above it." height="79" src="sample-ruby-pinyin.png" width="173"></p>
|
|
|
|
</div><h4 id="the-rt-element"><span class="secno">4.6.21 </span>The <dfn><code>rt</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-ruby-element">ruby</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-rt-element">rt</a></code> element marks the ruby text component of a
|
|
ruby annotation.<p>An <code><a href="#the-rt-element">rt</a></code> element <span class="impl">that is a child of
|
|
a <code><a href="#the-ruby-element">ruby</a></code> element</span> <a href="#represents">represents</a> an
|
|
annotation (given by its children) for the zero or more nodes of
|
|
phrasing content that immediately precedes it in the
|
|
<code><a href="#the-ruby-element">ruby</a></code> element, ignoring <code><a href="#the-rp-element">rp</a></code> elements.<div class="impl">
|
|
|
|
<p>An <code><a href="#the-rt-element">rt</a></code> element that is not a child of a
|
|
<code><a href="#the-ruby-element">ruby</a></code> element represents the same thing as its
|
|
children.</p>
|
|
|
|
</div><h4 id="the-rp-element"><span class="secno">4.6.22 </span>The <dfn><code>rp</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-ruby-element">ruby</a></code> element, either immediately before or immediately after an <code><a href="#the-rt-element">rt</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-rp-element">rp</a></code> element can be used to provide parentheses
|
|
around a ruby text component of a ruby annotation, to be shown by
|
|
user agents that don't support ruby annotations.<p>An <code><a href="#the-rp-element">rp</a></code> element <span class="impl">that is a child of
|
|
a <code><a href="#the-ruby-element">ruby</a></code> element</span> <a href="#represents">represents</a>
|
|
nothing<span class="impl"> and its contents must be
|
|
ignored</span>. <span class="impl">An <code><a href="#the-rp-element">rp</a></code> element whose
|
|
parent element is not a <code><a href="#the-ruby-element">ruby</a></code> element
|
|
<a href="#represents">represents</a> its children.</span><div class="example">
|
|
|
|
<p>The example above, in which each ideograph in the text <span lang="ja" title="">漢字</span> is annotated with its
|
|
phonetic reading, could be expanded to use <code><a href="#the-rp-element">rp</a></code> so that in
|
|
legacy user agents the readings are in parentheses:</p>
|
|
|
|
<pre lang="ja">...
|
|
<ruby>
|
|
漢 <rp>(</rp><rt>かん</rt><rp>)</rp>
|
|
字 <rp>(</rp><rt>じ</rt><rp>)</rp>
|
|
</ruby>
|
|
...</pre>
|
|
|
|
<p>In conforming user agents the rendering would be as above, but
|
|
in user agents that do not support ruby, the rendering would
|
|
be:</p>
|
|
|
|
<pre lang="ja">... 漢 (かん) 字 (じ) ...</pre>
|
|
|
|
</div><h4 id="the-bdi-element"><span class="secno">4.6.23 </span>The <dfn><code>bdi</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd>Also, the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> global attribute has special semantics on this element.</dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-bdi-element">bdi</a></code> element <a href="#represents">represents</a> a span of
|
|
text that is to be isolated from its surroundings for the purposes
|
|
of bidirectional text formatting. <a href="#refsBIDI">[BIDI]</a><p class="note">The <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> global
|
|
attribute defaults to <code title="attr-dir-auto"><a href="#attr-dir-auto">auto</a></code> on
|
|
this element (it never inherits from the parent element like with
|
|
other elements).<div class="impl">
|
|
|
|
<p>For the purposes of applying the bidirectional algorithm to the
|
|
contents of a <code><a href="#the-bdi-element">bdi</a></code> element, user agents must treat the
|
|
element as a paragraph-level container.</p>
|
|
|
|
<p>For the purposes of applying the bidirectional algorithm to the
|
|
paragraph-level container that a <code><a href="#the-bdi-element">bdi</a></code> element finds
|
|
itself within, the <code><a href="#the-bdi-element">bdi</a></code> element must be treated like a
|
|
U+FFFC OBJECT REPLACEMENT CHARACTER (in the same manner that an
|
|
image or other inline object is handled).</p>
|
|
|
|
<p>The requirements on handling the <code><a href="#the-bdi-element">bdi</a></code> element for the
|
|
bidirectional algorithm may be implemented indirectly through the
|
|
style layer. For example, an HTML+CSS user agent could implement
|
|
these requirements by implementing the CSS 'unicode-bidi' property.
|
|
<a href="#refsCSS">[CSS]</a></p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This element is especially useful when embedding user-generated
|
|
content with an unknown directionality.</p>
|
|
|
|
<p>In this example, usernames are shown along with the number of
|
|
posts that the user has submitted. If the <code><a href="#the-bdi-element">bdi</a></code> element
|
|
were not used, the username of the Arabic user would end up
|
|
confusing the text (the bidirectional algorithm would put the colon
|
|
and the number "3" next to the word "User" rather than next to the
|
|
word "posts").</p>
|
|
|
|
<pre><ul>
|
|
<li>User <bdi>jcranmer</bdi>: 12 posts.
|
|
<li>User <bdi>hober</bdi>: 5 posts.
|
|
<li>User <bdi><bdo dir="rtl">إيان</bdo></bdi>: 3 posts.
|
|
</ul></pre>
|
|
|
|
</div><h4 id="the-bdo-element"><span class="secno">4.6.24 </span>The <dfn><code>bdo</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd>Also, the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> global attribute has special semantics on this element.</dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-bdo-element">bdo</a></code> element <a href="#represents">represents</a> explicit
|
|
text directionality formatting control for its children. It allows
|
|
authors to override the Unicode bidirectional algorithm by
|
|
explicitly specifying a direction override. <a href="#refsBIDI">[BIDI]</a><p>Authors must specify the <code title="attr-dir"><a href="#the-dir-attribute">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.<div class="impl">
|
|
|
|
<p>If the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is
|
|
in the <i title="attr-dir-rtl-state"><a href="#attr-dir-rtl-state">rtl</a></i> state, then for the
|
|
purposes of the bidirectional 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's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute is
|
|
in the <i title="attr-dir-ltr-state"><a href="#attr-dir-ltr-state">ltr</a></i>, then for the purposes
|
|
of the bidirectional 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="#the-bdo-element">bdo</a></code> element for the
|
|
bidirectional algorithm may be implemented indirectly through the
|
|
style layer. For example, an HTML+CSS user agent could implement
|
|
these requirements by implementing the CSS 'unicode-bidi' property.
|
|
<a href="#refsCSS">[CSS]</a></p>
|
|
|
|
</div><h4 id="the-span-element"><span class="secno">4.6.25 </span>The <dfn><code>span</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlspanelement">HTMLSpanElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-span-element">span</a></code> element doesn't mean anything on its own,
|
|
but can be useful when used together with the <a href="#global-attributes">global
|
|
attributes</a>, e.g. <code title="attr-class"><a href="#classes">class</a></code>, <code title="attr-lang"><a href="#attr-lang">lang</a></code>, or <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code>.
|
|
It <a href="#represents">represents</a> its children.<div class="example">
|
|
|
|
<p>In this example, a code fragment is marked up using
|
|
<code><a href="#the-span-element">span</a></code> elements and <code title="attr-class"><a href="#classes">class</a></code> attributes so that its keywords and
|
|
identifiers can be color-coded from CSS:</p>
|
|
|
|
|
|
|
|
<pre><pre><code class="lang-c"><span class="keyword">for</span> (<span class="ident">j</span> = 0; <span class="ident">j</span> &lt; 256; <span class="ident">j</span>++) {
|
|
<span class="ident">i_t3</span> = (<span class="ident">i_t3</span> & 0x1ffff) | (<span class="ident">j</span> &lt;&lt; 17);
|
|
<span class="ident">i_t6</span> = (((((((<span class="ident">i_t3</span> >> 3) ^ <span class="ident">i_t3</span>) >> 1) ^ <span class="ident">i_t3</span>) >> 8) ^ <span class="ident">i_t3</span>) >> 5) & 0xff;
|
|
<span class="keyword">if</span> (<span class="ident">i_t6</span> == <span class="ident">i_t1</span>)
|
|
<span class="keyword">break</span>;
|
|
}</code></pre></pre>
|
|
|
|
</div><h4 id="the-br-element"><span class="secno">4.6.26 </span>The <dfn><code>br</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlbrelement">HTMLBRElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-br-element">br</a></code> element <a href="#represents">represents</a> a line
|
|
break.<p class="note">While line breaks are usually represented in visual
|
|
media by physically moving subsequent text to a new line, a style
|
|
sheet or user agent would be equally justified in causing line
|
|
breaks to be rendered in a different manner, for instance as green
|
|
dots, or as extra spacing.<p><code><a href="#the-br-element">br</a></code> elements must be used only for line breaks that
|
|
are actually part of the content, as in poems or addresses.<div class="example">
|
|
|
|
<p>The following example is correct usage of the <code><a href="#the-br-element">br</a></code>
|
|
element:</p>
|
|
|
|
<pre><p>P. Sherman<br>
|
|
42 Wallaby Way<br>
|
|
Sydney</p></pre>
|
|
|
|
</div><p><code><a href="#the-br-element">br</a></code> elements must not be used for separating thematic
|
|
groups in a paragraph.<div class="example">
|
|
|
|
<p>The following examples are non-conforming, as they abuse the
|
|
<code><a href="#the-br-element">br</a></code> element:</p>
|
|
|
|
<pre><p><a ...>34 comments.</a><br>
|
|
<a ...>Add a comment.</a></p></pre>
|
|
|
|
<pre><p><label>Name: <input name="name"></label><br>
|
|
<label>Address: <input name="address"></label></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><label>Name: <input name="name"></label></p>
|
|
<p><label>Address: <input name="address"></label></p></pre>
|
|
|
|
</div><p>If a <a href="#paragraph">paragraph</a> consists of nothing but a single
|
|
<code><a href="#the-br-element">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.<div class="impl">
|
|
|
|
<p>Any content inside <code><a href="#the-br-element">br</a></code> elements must not be
|
|
considered part of the surrounding text.</p>
|
|
|
|
<p>A <code><a href="#the-br-element">br</a></code> element should separate paragraphs for the
|
|
purposes of the Unicode bidirectional algorithm. This requirement
|
|
may be implemented indirectly through the style layer. For example,
|
|
an HTML+CSS user agent could implement these requirements by
|
|
implementing the CSS 'unicode-bidi' property. <a href="#refsBIDI">[BIDI]</a> <a href="#refsCSS">[CSS]</a></p>
|
|
|
|
|
|
</div><h4 id="the-wbr-element"><span class="secno">4.6.27 </span>The <dfn><code>wbr</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-wbr-element">wbr</a></code> element <a href="#represents">represents</a> a line break
|
|
opportunity.<div class="example">
|
|
|
|
<p>In the following example, someone is quoted as saying something
|
|
which, for effect, is written as one long word. However, to ensure
|
|
that the text can be wrapped in a readable fashion, the individual
|
|
words in the quote are separated using a <code><a href="#the-wbr-element">wbr</a></code>
|
|
element.</p>
|
|
|
|
<pre><p>So then he pointed at the tiger and screamed
|
|
"there<wbr>is<wbr>no<wbr>way<wbr>you<wbr>are<wbr>ever<wbr>going<wbr>to<wbr>catch<wbr>me"!</p></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<p>Any content inside <code><a href="#the-wbr-element">wbr</a></code> elements must not be
|
|
considered part of the surrounding text.</p>
|
|
|
|
</div><h4 id="usage-summary"><span class="secno">4.6.28 </span>Usage summary</h4><p><i>This section is non-normative.</i><table><thead><tr><th>Element
|
|
<th>Purpose
|
|
<th>Example
|
|
<tbody><tr><td><code><a href="#the-a-element">a</a></code>
|
|
<td>Hyperlinks
|
|
<td><pre class="example">Visit my <strong><a href="drinks.html">drinks</a></strong> page.</pre>
|
|
|
|
<tr><td><code><a href="#the-em-element">em</a></code>
|
|
<td>Stress emphasis
|
|
<td><pre class="example">I must say I <strong><em>adore</em></strong> lemonade.</pre>
|
|
|
|
<tr><td><code><a href="#the-strong-element">strong</a></code>
|
|
<td>Importance
|
|
<td><pre class="example">This tea is <strong><strong>very hot</strong></strong>.</pre>
|
|
|
|
<tr><td><code><a href="#the-small-element">small</a></code>
|
|
<td>Side comments
|
|
<td><pre class="example">These grapes are made into wine. <strong><small>Alcohol is addictive.</small></strong></pre>
|
|
|
|
<tr><td><code><a href="#the-s-element">s</a></code>
|
|
<td>Inaccurate text
|
|
<td><pre class="example">Price: <strong><s>£4.50</s></strong> £2.00!</pre>
|
|
|
|
<tr><td><code><a href="#the-cite-element">cite</a></code>
|
|
<td>Titles of works
|
|
<td><pre class="example">The case <strong><cite>Hugo v. Danielle</cite></strong> is relevant here.</pre>
|
|
|
|
<tr><td><code><a href="#the-q-element">q</a></code>
|
|
<td>Quotations
|
|
<td><pre class="example">The judge said <strong><q>You can drink water from the fish tank</q></strong> but advised against it.</pre>
|
|
|
|
<tr><td><code><a href="#the-dfn-element">dfn</a></code>
|
|
<td>Defining instance
|
|
<td><pre class="example">The term <strong><dfn>organic food</dfn></strong> refers to food produced without synthetic chemicals.</pre>
|
|
|
|
<tr><td><code><a href="#the-abbr-element">abbr</a></code>
|
|
<td>Abbreviations
|
|
<td><pre class="example">Organic food in Ireland is certified by the <strong><abbr title="Irish Organic Farmers and Growers Association">IOFGA</abbr></strong>.</pre>
|
|
|
|
<tr><td><code><a href="#the-time-element">time</a></code>
|
|
<td>Date and/or time
|
|
<td><pre class="example">Published <strong><time>2009-10-21</time></strong>.</pre>
|
|
|
|
<tr><td><code><a href="#the-code-element">code</a></code>
|
|
<td>Computer code
|
|
<td><pre class="example">The <strong><code>fruitdb</code></strong> program can be used for tracking fruit production.</pre>
|
|
|
|
<tr><td><code><a href="#the-var-element">var</a></code>
|
|
<td>Variables
|
|
<td><pre class="example">If there are <strong><var>n</var></strong> fruit in the bowl, at least <strong><var>n</var></strong>÷2 will be ripe.</pre>
|
|
|
|
<tr><td><code><a href="#the-samp-element">samp</a></code>
|
|
<td>Computer output
|
|
<td><pre class="example">The computer said <strong><samp>Unknown error -3</samp></strong>.</pre>
|
|
|
|
<tr><td><code><a href="#the-kbd-element">kbd</a></code>
|
|
<td>User input
|
|
<td><pre class="example">Hit <strong><kbd>F1</kbd></strong> to continue.</pre>
|
|
|
|
<tr><td><code><a href="#the-sub-and-sup-elements">sub</a></code>
|
|
<td>Subscripts
|
|
<td><pre class="example">Water is H<strong><sub>2</sub></strong>O.</pre>
|
|
|
|
<tr><td><code><a href="#the-sub-and-sup-elements">sup</a></code>
|
|
<td>Superscripts
|
|
<td><pre class="example">The Hydrogen in heavy water is usually <strong><sup>2</sup></strong>H.</pre>
|
|
|
|
<tr><td><code><a href="#the-i-element">i</a></code>
|
|
<td>Alternative voice
|
|
<td><pre class="example">Lemonade consists primarily of <strong><i>Citrus limon</i></strong>.</pre>
|
|
|
|
<tr><td><code><a href="#the-b-element">b</a></code>
|
|
<td>Keywords
|
|
<td><pre class="example">Take a <strong><b>lemon</b></strong> and squeeze it with a <strong><b>juicer</b></strong>.</pre>
|
|
|
|
<tr><td><code><a href="#the-u-element">u</a></code>
|
|
<td>Annotations
|
|
<td><pre class="example">The mixture of apple juice and <u class="spelling">eldeflower</u> juice is very pleasant.</pre>
|
|
|
|
<tr><td><code><a href="#the-mark-element">mark</a></code>
|
|
<td>Highlight
|
|
<td><pre class="example">Elderflower cordial, with one <strong><mark>part</mark></strong> cordial to ten <strong><mark>part</mark></strong>s water, stands a<strong><mark>part</mark></strong> from the rest.</pre>
|
|
|
|
<tr><td><code><a href="#the-ruby-element">ruby</a></code>, <code><a href="#the-rt-element">rt</a></code>, <code><a href="#the-rp-element">rp</a></code>
|
|
<td>Ruby annotations
|
|
<td><pre class="example"><strong><ruby> OJ <rp>(<rt>Orange Juice<rp>)</ruby></strong></pre>
|
|
|
|
<tr><td><code><a href="#the-bdi-element">bdi</a></code>
|
|
<td>Text directionality isolation
|
|
<td><pre class="example">The recommended restaurant is <strong><bdi lang="">My Juice Café (At The Beach)</bdi></strong>.</pre>
|
|
|
|
<tr><td><code><a href="#the-bdo-element">bdo</a></code>
|
|
<td>Text directionality formatting
|
|
<td><pre class="example">The proposal is to write English, but in reverse order. "Juice" would become "<strong><bdo dir=rtl>Juice</bdo></strong>"</pre>
|
|
|
|
<tr><td><code><a href="#the-span-element">span</a></code>
|
|
<td>Other
|
|
<td><pre class="example">In French we call it <strong><span lang="fr">sirop de sureau</span></strong>.</pre>
|
|
|
|
<tr><td><code><a href="#the-br-element">br</a></code>
|
|
<td>Line break
|
|
<td><pre class="example">Simply Orange Juice Company<strong><br></strong>Apopka, FL 32703<strong><br></strong>U.S.A.</pre>
|
|
|
|
<tr><td><code><a href="#the-wbr-element">wbr</a></code>
|
|
<td>Line breaking opportunity
|
|
<td><pre class="example">www.simply<strong><wbr></strong>orange<strong><wbr></strong>juice.com</pre>
|
|
|
|
</table><h3 id="edits"><span class="secno">4.7 </span>Edits</h3><p>The <code><a href="#the-ins-element">ins</a></code> and <code><a href="#the-del-element">del</a></code> elements represent
|
|
edits to the document.<h4 id="the-ins-element"><span class="secno">4.7.1 </span>The <dfn><code>ins</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd>When the element only contains <a href="#phrasing-content">phrasing content</a>: <a href="#phrasing-content">phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>When the element only contains <a href="#phrasing-content">phrasing content</a>: where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dd>Otherwise: where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#transparent">Transparent</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-mod-cite"><a href="#attr-mod-cite">cite</a></code></dd>
|
|
<dd><code title="attr-mod-datetime"><a href="#attr-mod-datetime">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="#the-ins-element">ins</a></code> element <a href="#represents">represents</a> an addition
|
|
to the document.<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="#the-aside-element">aside</a></code>
|
|
element here counts as <a href="#phrasing-content">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="#the-ins-element">ins</a></code> elements should not cross <a href="#paragraph" title="paragraph">implied paragraph</a> boundaries.<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="#the-ins-element">ins</a></code> element in this example thus crosses a paragraph
|
|
boundary, which is considered poor form.</p>
|
|
|
|
<pre class="bad"><aside>
|
|
<!-- don't do this -->
|
|
<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-element"><span class="secno">4.7.2 </span>The <dfn><code>del</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd>When the element only contains <a href="#phrasing-content">phrasing content</a>: <a href="#phrasing-content">phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>When the element only contains <a href="#phrasing-content">phrasing content</a>: where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dd>Otherwise: where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#transparent">Transparent</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-mod-cite"><a href="#attr-mod-cite">cite</a></code></dd>
|
|
<dd><code title="attr-mod-datetime"><a href="#attr-mod-datetime">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="#the-del-element">del</a></code> element <a href="#represents">represents</a> a removal
|
|
from the document.<p><code><a href="#the-del-element">del</a></code> elements should not cross <a href="#paragraph" title="paragraph">implied paragraph</a> boundaries.<div class="example">
|
|
|
|
<p>The following shows a "to do" list where items that have been
|
|
done are crossed-off with the date and time of their
|
|
completion.</p>
|
|
|
|
<pre><h1>To Do</h1>
|
|
<ul>
|
|
<li>Empty the dishwasher</li>
|
|
<li><del datetime="2009-10-11T01:25-07:00">Watch Walter Lewin's lectures</del></li>
|
|
<li><del datetime="2009-10-10T23:38-07:00">Download more tracks</del></li>
|
|
<li>Buy a printer</li>
|
|
</ul></pre>
|
|
|
|
</div><h4 id="attributes-common-to-ins-and-del-elements"><span class="secno">4.7.3 </span>Attributes common to <code><a href="#the-ins-element">ins</a></code> and <code><a href="#the-del-element">del</a></code> elements</h4><p>The <dfn id="attr-mod-cite" title="attr-mod-cite"><code>cite</code></dfn> attribute
|
|
may be used to specify the address of a document 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>If the <code title="attr-mod-cite"><a href="#attr-mod-cite">cite</a></code> attribute is
|
|
present, it must be a <a href="#valid-url-potentially-surrounded-by-spaces">valid URL potentially surrounded by
|
|
spaces</a> that explains the change. <span class="impl">To obtain
|
|
the corresponding citation link, the value of the attribute must be
|
|
<a href="#resolve-a-url" title="resolve a url">resolved</a> relative to the
|
|
element. User agents should allow users to follow such citation
|
|
links.</span><p>The <dfn id="attr-mod-datetime" title="attr-mod-datetime"><code>datetime</code></dfn>
|
|
attribute may be used to specify the time and date of the change.<p>If present, the <code title="attr-mod-datetime"><a href="#attr-mod-datetime">datetime</a></code>
|
|
attribute's value must be a <a href="#valid-date-string-with-optional-time">valid date string with optional
|
|
time</a>.<div class="impl">
|
|
|
|
<p>User agents must parse the <code title="attr-mod-datetime"><a href="#attr-mod-datetime">datetime</a></code> attribute according to the
|
|
<a href="#parse-a-date-or-time-string">parse a date or time string</a> algorithm. If that doesn't
|
|
return a <a href="#concept-date" title="concept-date">date</a> or a <a href="#concept-datetime" title="concept-datetime">global date and time</a>, then the
|
|
modification has no associated timestamp (the value is
|
|
non-conforming; it is not a <a href="#valid-date-string-with-optional-time">valid date string with optional
|
|
time</a>). Otherwise, the modification is marked as having been
|
|
made at the given <a href="#concept-date" title="concept-date">date</a> or <a href="#concept-datetime" title="concept-datetime">global date and time</a>. If the given
|
|
value is a <a href="#concept-datetime" title="concept-datetime">global date and
|
|
time</a> then user agents should use the associated time-zone
|
|
offset information to determine which time zone to present the given
|
|
datetime in.</p>
|
|
|
|
</div><p>The <code><a href="#the-ins-element">ins</a></code> and <code><a href="#the-del-element">del</a></code> elements <span class="impl">must</span> implement the <code><a href="#htmlmodelement">HTMLModElement</a></code>
|
|
interface:<pre class="idl">interface <dfn id="htmlmodelement">HTMLModElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-mod-cite" title="dom-mod-cite">cite</a>;
|
|
attribute DOMString <a href="#dom-mod-datetime" title="dom-mod-datetime">dateTime</a>;
|
|
};</pre><div class="impl">
|
|
|
|
<p>The <dfn id="dom-mod-cite" title="dom-mod-cite"><code>cite</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the element's <code title="attr-mod-cite"><a href="#attr-mod-cite">cite</a></code> content attribute. The <dfn id="dom-mod-datetime" title="dom-mod-datetime"><code>dateTime</code></dfn> IDL attribute
|
|
must <a href="#reflect">reflect</a> the element's <code title="attr-mod-datetime"><a href="#attr-mod-datetime">datetime</a></code> content attribute.</p>
|
|
|
|
</div><h4 id="edits-and-paragraphs"><span class="secno">4.7.4 </span>Edits and paragraphs</h4><p><i>This section is non-normative.</i><p>Since the <code><a href="#the-ins-element">ins</a></code> and <code><a href="#the-del-element">del</a></code> elements do not
|
|
affect <a href="#paragraph" title="paragraph">paragraphing</a>, it is possible,
|
|
in some cases where paragraphs are <a href="#paragraph" title="paragraph">implied</a> (without explicit <code><a href="#the-p-element">p</a></code>
|
|
elements), for an <code><a href="#the-ins-element">ins</a></code> or <code><a href="#the-del-element">del</a></code> element to
|
|
span both an entire paragraph or other non-<a href="#phrasing-content">phrasing
|
|
content</a> elements and part of another paragraph. For
|
|
example:<pre><section>
|
|
<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></pre><p>By only wrapping some paragraphs in <code><a href="#the-p-element">p</a></code> 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
|
|
<code><a href="#the-ins-element">ins</a></code> or <code><a href="#the-del-element">del</a></code> element (though this is very
|
|
confusing, and not considered good practice):<pre class="bad"><section>
|
|
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.
|
|
<!-- (don't do this) -->
|
|
</section></pre><p>However, due to the way <a href="#paragraph" title="paragraph">implied
|
|
paragraphs</a> 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 <code><a href="#the-ins-element">ins</a></code> or <code><a href="#the-del-element">del</a></code> element. You instead have
|
|
to use one (or two) <code><a href="#the-p-element">p</a></code> element(s) and two
|
|
<code><a href="#the-ins-element">ins</a></code> or <code><a href="#the-del-element">del</a></code> elements, as for example:<pre><section>
|
|
<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></pre><p>Partly because of the confusion described above, authors are
|
|
strongly encouraged to always mark up all paragraphs with the
|
|
<code><a href="#the-p-element">p</a></code> element, instead of having <code><a href="#the-ins-element">ins</a></code> or
|
|
<code><a href="#the-del-element">del</a></code> elements that cross <a href="#paragraph" title="paragraph">implied
|
|
paragraphs</a> boundaries.<h4 id="edits-and-lists"><span class="secno">4.7.5 </span>Edits and lists</h4><p><i>This section is non-normative.</i><p>The content models of the <code><a href="#the-ol-element">ol</a></code> and <code><a href="#the-ul-element">ul</a></code>
|
|
elements do not allow <code><a href="#the-ins-element">ins</a></code> and <code><a href="#the-del-element">del</a></code> elements
|
|
as children. Lists always represent all their items, including items
|
|
that would otherwise have been marked as deleted.<p>To indicate that an item is inserted or deleted, an
|
|
<code><a href="#the-ins-element">ins</a></code> or <code><a href="#the-del-element">del</a></code> element can be wrapped around
|
|
the contents of the <code><a href="#the-li-element">li</a></code> element. To indicate that an
|
|
item has been replaced by another, a single <code><a href="#the-li-element">li</a></code> element
|
|
can have one or more <code><a href="#the-del-element">del</a></code> elements followed by one or
|
|
more <code><a href="#the-ins-element">ins</a></code> elements.<div class="example">
|
|
|
|
<p>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 emphasized show the parts that are the "current" state of
|
|
the list. The list item numbers don't take into account the edits,
|
|
though.</p>
|
|
|
|
<pre><h1>Stop-ship bugs</h1>
|
|
<ol>
|
|
<li><ins datetime="2008-02-12T15:20Z"><em>Bug 225:
|
|
Rain detector doesn't work in snow</em></ins></li>
|
|
<li><del datetime="2008-03-01T20:22Z"><ins datetime="2008-02-14T12:02Z">Bug 228:
|
|
Water buffer overflows in April</ins></del></li>
|
|
<li><ins datetime="2008-02-16T13:50Z"><em>Bug 230:
|
|
Water heater doesn't use renewable fuels</em></ins></li>
|
|
<li><del datetime="2008-02-20T21:15Z"><ins datetime="2008-02-16T14:25Z">Bug 232:
|
|
Carbon dioxide emissions detected after startup</ins></del></li>
|
|
</ol></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, a list that started with just fruit
|
|
was replaced by a list with just colors.</p>
|
|
|
|
<pre><h1>List of <del>fruits</del><ins>colors</ins></h1>
|
|
<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></li>
|
|
</ul></pre>
|
|
|
|
</div><h3 id="embedded-content-1"><span class="secno">4.8 </span>Embedded content</h3><h4 id="the-img-element"><span class="secno">4.8.1 </span>The <dfn><code>img</code></dfn> element</h4>
|
|
|
|
<p class="XXX annotation"><span><a
|
|
href="http://www.w3.org/html/wg/tracker/issues/30">ISSUE-30</a>
|
|
(longdesc) impacts this section. Priority feedback is requested on this
|
|
issue from Last Call reviewers. In particular, reviewers are invited to
|
|
review and comment on any change proposals that are related to this issue.
|
|
See the
|
|
<a href="http://dev.w3.org/html5/status/issue-status.html">current list of open Last Call issues and change proposals</a>
|
|
maintained by the HTML Working Group chairs.</span>
|
|
|
|
<dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#embedded-content">Embedded content</a>.</dd>
|
|
<dd>If the element has a <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute: <a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#embedded-content">embedded content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code></dd>
|
|
<dd><code title="attr-img-src"><a href="#attr-img-src">src</a></code></dd>
|
|
<dd><code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code></dd>
|
|
<dd><code title="attr-img-ismap"><a href="#attr-img-ismap">ismap</a></code></dd>
|
|
<dd><code title="attr-dim-width"><a href="#attr-dim-width">width</a></code></dd>
|
|
<dd><code title="attr-dim-height"><a href="#attr-dim-height">height</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">[NamedConstructor=<a href="#dom-image" title="dom-image">Image</a>(),
|
|
NamedConstructor=<a href="#dom-image-w" title="dom-image-w">Image</a>(in unsigned long width),
|
|
NamedConstructor=<a href="#dom-image-wh" title="dom-image-wh">Image</a>(in unsigned long width, in unsigned long height)]
|
|
interface <dfn id="htmlimageelement">HTMLImageElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-img-alt" title="dom-img-alt">alt</a>;
|
|
attribute DOMString <a href="#dom-img-src" title="dom-img-src">src</a>;
|
|
attribute DOMString <a href="#dom-img-usemap" title="dom-img-useMap">useMap</a>;
|
|
attribute boolean <a href="#dom-img-ismap" title="dom-img-isMap">isMap</a>;
|
|
attribute unsigned long <a href="#dom-img-width" title="dom-img-width">width</a>;
|
|
attribute unsigned long <a href="#dom-img-height" title="dom-img-height">height</a>;
|
|
readonly attribute unsigned long <a href="#dom-img-naturalwidth" title="dom-img-naturalWidth">naturalWidth</a>;
|
|
readonly attribute unsigned long <a href="#dom-img-naturalheight" title="dom-img-naturalHeight">naturalHeight</a>;
|
|
readonly attribute boolean <a href="#dom-img-complete" title="dom-img-complete">complete</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>An <code><a href="#the-img-element">img</a></code> element represents an image.</p><p>The image given by the <dfn id="attr-img-src" title="attr-img-src"><code>src</code></dfn> attribute is the
|
|
embedded content; the value of the <dfn id="attr-img-alt" title="attr-img-alt"><code>alt</code></dfn> attribute provides
|
|
equivalent content for those who cannot process images or who have
|
|
image loading disabled.<p>The <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute must be
|
|
present, and must contain a <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially
|
|
surrounded by spaces</a> referencing a non-interactive,
|
|
optionally animated, image resource that is neither paged nor
|
|
scripted.<p class="note">Images can thus be static bitmaps (e.g. PNGs, GIFs,
|
|
JPEGs), single-page vector documents (single-page PDFs, XML files
|
|
with an SVG root element), animated bitmaps (APNGs, animated GIFs),
|
|
animated vector graphics (XML files with an SVG root element that
|
|
use declarative SMIL animation), and so forth. However, this also
|
|
precludes SVG files with script, multipage PDF files, interactive
|
|
MNG files, HTML documents, plain text documents, and so forth.<p>The requirements on the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code>
|
|
attribute's value are described <a href="#alt">in the next
|
|
section</a>.<p>The <code><a href="#the-img-element">img</a></code> element must not be used as a layout tool.
|
|
In particular, <code><a href="#the-img-element">img</a></code> elements should not be used to
|
|
display transparent images, as they rarely convey meaning and rarely
|
|
add anything useful to the document.<div class="impl">
|
|
|
|
<hr><p>An <code><a href="#the-img-element">img</a></code> is always in one of the following states:</p>
|
|
|
|
<dl><dt><dfn id="img-none" title="img-none">Unavailable</dfn></dt>
|
|
<dd>The user agent hasn't obtained any image data.</dd>
|
|
|
|
<dt><dfn id="img-inc" title="img-inc">Partially available</dfn></dt>
|
|
<dd>The user agent has obtained some of the image data.</dd>
|
|
|
|
<dt><dfn id="img-all" title="img-all">Completely available</dfn></dt>
|
|
<dd>The user agent has obtained all of the image data.</dd>
|
|
|
|
<dt><dfn id="img-error" title="img-error">Broken</dfn></dt>
|
|
<dd>The user agent has obtained all of the image data that it can,
|
|
but it cannot decode the image (e.g. the image is corrupted, or the
|
|
format is not supported, or no data could be obtained).</dd>
|
|
|
|
</dl><p>When an <code><a href="#the-img-element">img</a></code> element is either in the <a href="#img-inc" title="img-inc">partially available</a> state or in the <a href="#img-all" title="img-all">completely available</a> state, it is said to be
|
|
<dfn id="img-yes" title="img-yes">available</dfn>.</p>
|
|
|
|
<p>An <code><a href="#the-img-element">img</a></code> element is initially <a href="#img-none" title="img-none">unavailable</a>.</p>
|
|
|
|
<p>User agents may obtain images immediately or on demand.</p>
|
|
|
|
<p>A user agent that obtains images immediately must synchronously
|
|
<a href="#update-the-image-data">update the image data</a> of an <code><a href="#the-img-element">img</a></code> element
|
|
whenever that element is either created with a <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute, or has its <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute set, changed, or
|
|
removed.</p>
|
|
<p>A user agent that obtains images on demand must <a href="#update-the-image-data">update the
|
|
image data</a> of an <code><a href="#the-img-element">img</a></code> element whenever it needs
|
|
the image data (i.e. on demand), but only if the <code><a href="#the-img-element">img</a></code>
|
|
element has a <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute, and
|
|
if it has not <a href="#update-the-image-data" title="update the image data">updated the image
|
|
data</a> since the last time the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute was set. When an
|
|
<code><a href="#the-img-element">img</a></code> element's <code title="attr-img-src"><a href="#attr-img-src">src</a></code>
|
|
attribute is changed or removed, if the user agent only obtains
|
|
images on demand, the <code><a href="#the-img-element">img</a></code> element must return to the
|
|
<a href="#img-none" title="img-none">unavailable</a> state.</p>
|
|
<p>When the user agent is to <dfn id="update-the-image-data">update the image data</dfn> of an
|
|
<code><a href="#the-img-element">img</a></code> element, it must run the following steps:</p>
|
|
|
|
<ol><li><p>Return the <code><a href="#the-img-element">img</a></code> element to the <a href="#img-none" title="img-none">unavailable</a> state.</p>
|
|
|
|
<li><p>If an instance of the <a href="#fetch" title="fetch">fetching</a>
|
|
algorithm is still running for this element, then abort that
|
|
algorithm, discarding any pending <a href="#concept-task" title="concept-task">tasks</a> generated by that
|
|
algorithm.</li>
|
|
|
|
<li><p>Forget the <code><a href="#the-img-element">img</a></code> element's current image data, if
|
|
any.</li>
|
|
|
|
<li><p>If the user agent cannot support images, or its support for
|
|
images has been disabled, then abort these steps.</li>
|
|
|
|
<li><p>If the element's <code title="attr-img-src"><a href="#attr-img-src">src</a></code>
|
|
attribute's value is the empty string, then set the element to the
|
|
<a href="#img-error" title="img-error">broken</a> state, <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-error">error</code> at the <code><a href="#the-img-element">img</a></code> element,
|
|
and abort these steps.</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, <a href="#resolve-a-url" title="resolve a url">resolve</a> the value
|
|
of the element's <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute,
|
|
relative to the element, and, if that is successful,
|
|
<a href="#fetch">fetch</a> that resource.</p>
|
|
<p>The resouce obtained in this fashion is the <code><a href="#the-img-element">img</a></code>
|
|
element's image data.</p>
|
|
|
|
<p>Fetching the image must <a href="#delay-the-load-event">delay the load
|
|
event</a> of the element's document until the <a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue a
|
|
task">queued</a> by the <a href="#networking-task-source">networking task source</a>
|
|
once the resource has been <a href="#fetch" title="fetch">fetched</a> (<a href="#img-load">defined below</a>) has been run.</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="#origin" title="origin">cross-origin</a> access control policies
|
|
that mitigate this attack, but unfortunately such policies are
|
|
typically not compatible with existing Web content.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>Each <a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue a task">queued</a> by the <a href="#networking-task-source">networking task
|
|
source</a> while the image is being <a href="#fetch" title="fetch">fetched</a> must set the <code><a href="#the-img-element">img</a></code> element's
|
|
state to <a href="#img-inc" title="img-inc">partially available</a> and update
|
|
the presentation of the image appropriately.</p>
|
|
|
|
<p id="img-load">The <a href="#concept-task" title="concept-task">task</a> that is
|
|
<a href="#queue-a-task" title="queue a task">queued</a> by the <a href="#networking-task-source">networking
|
|
task source</a> once the resource has been <a href="#fetch" title="fetch">fetched</a> must act as appropriate given the
|
|
following alternatives:</p>
|
|
|
|
<dl class="switch"><dt>If the download was successful</dt>
|
|
|
|
<dd>Set the <code><a href="#the-img-element">img</a></code> element to the <a href="#img-all" title="img-all">completely available</a> state, update the
|
|
presentation of the image appropriately, and <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-load">load</code> at the <code><a href="#the-img-element">img</a></code>
|
|
element.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>Set the <code><a href="#the-img-element">img</a></code> element to the <a href="#img-error" title="img-error">broken</a> state, and <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-error">error</code> at the <code><a href="#the-img-element">img</a></code>
|
|
element.</dd>
|
|
|
|
</dl><p>If at any point the user agent discovers that the image data is
|
|
corrupted in some fatal way, or that the image is not in a supported
|
|
file format, then the user agent must set the <code><a href="#the-img-element">img</a></code>
|
|
element to the <a href="#img-error" title="img-error">broken</a> state. If the
|
|
<a href="#fetch" title="fetch">fetching</a> algorithm is still running for
|
|
this element, then the user agent must also abort that algorithm,
|
|
discarding any pending <a href="#concept-task" title="concept-task">tasks</a>
|
|
generated by that algorithm, and then <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-error">error</code> at the <code><a href="#the-img-element">img</a></code>
|
|
element.</p>
|
|
|
|
<p>When an <code><a href="#the-img-element">img</a></code> element is in the <a href="#img-all" title="img-all">completely available</a> state <em>and</em> the
|
|
user agent can completely decode the media data without errors, then
|
|
the <code><a href="#the-img-element">img</a></code> element is said to be <dfn id="img-good" title="img-good">fully decodable</dfn>.</p>
|
|
|
|
<p>Whether the image is fetched successfully or not (e.g. whether
|
|
the response code was a 2xx code <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a>) must be
|
|
ignored when determining the image's type and whether it is a valid
|
|
image.</p>
|
|
|
|
<p class="note">This allows servers to return images with error
|
|
responses, and have them displayed.</p>
|
|
|
|
<p>The user agents should apply the <a href="#content-type-sniffing:-image" title="Content-Type
|
|
sniffing: image">image sniffing rules</a> to determine the type
|
|
of the image, with the image's <a href="#content-type" title="Content-Type">associated
|
|
Content-Type headers</a> giving the <var title="">official
|
|
type</var>. If these rules are not applied, then the type of the
|
|
image must be the type given by the image's <a href="#content-type" title="Content-Type">associated Content-Type headers</a>.</p>
|
|
|
|
<p>User agents must not support non-image resources with the
|
|
<code><a href="#the-img-element">img</a></code> element (e.g. XML files whose root element is an
|
|
HTML element). User agents must not run executable code
|
|
(e.g. scripts) embedded in the image resource. User agents must only
|
|
display the first page of a multipage resource (e.g. a PDF
|
|
file). User agents must not allow the resource to act in an
|
|
interactive fashion, but should honor any animation in the
|
|
resource.</p>
|
|
|
|
<p>This specification does not specify which image types are to be
|
|
supported.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <a href="#dom-manipulation-task-source">DOM manipulation
|
|
task source</a>.</p>
|
|
|
|
<hr><p>What an <code><a href="#the-img-element">img</a></code> element represents depends on the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute and the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute.</p>
|
|
|
|
<dl class="switch"><dt>If the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute is set
|
|
and the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute is set to
|
|
the empty string</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The image is either decorative or supplemental to the rest of
|
|
the content, redundant with some other information in the
|
|
document.</p>
|
|
|
|
<p>If the image is <a href="#img-yes" title="img-yes">available</a> and the
|
|
user agent is configured to display that image, then the element
|
|
<a href="#represents">represents</a> the element's image data.</p>
|
|
|
|
<p>Otherwise, the element <a href="#represents">represents</a> nothing, and may
|
|
be omitted completely from the rendering. User agents may provide
|
|
the user with a notification that an image is present but has been
|
|
omitted from the rendering.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute is set
|
|
and the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute is set to a
|
|
value that isn't empty</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The image is a key part of the content; the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute gives a textual
|
|
equivalent or replacement for the image.</p>
|
|
|
|
<p>If the image is <a href="#img-yes" title="img-yes">available</a> and the
|
|
user agent is configured to display that image, then the element
|
|
<a href="#represents">represents</a> the element's image data.</p>
|
|
|
|
<p>Otherwise, the element <a href="#represents">represents</a> the text given
|
|
by the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute. User
|
|
agents may provide the user with a notification that an image is
|
|
present but has been omitted from the rendering.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute is set
|
|
and the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute is not</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The image might be a key part of the content, and there is no
|
|
textual equivalent of the image available.</p>
|
|
|
|
<p class="note">In a conforming document, the absence of the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute indicates that the image
|
|
is a key part of the content but that a textual replacement for
|
|
the image was not available when the image was generated.</p>
|
|
|
|
<p>If the image is <a href="#img-yes" title="img-yes">available</a> and the
|
|
user agent is configured to display that image, then the element
|
|
<a href="#represents">represents</a> the element's image data.</p>
|
|
|
|
<p>Otherwise, the user agent should display some sort of indicator
|
|
that there is an image that is not being rendered, and may, if
|
|
requested by the user, or if so configured, or when required to
|
|
provide contextual information in response to navigation, provide
|
|
caption information for the image, derived as follows:</p>
|
|
|
|
<ol><li><p>If the image has a <code title="attr-title"><a href="#the-title-attribute">title</a></code>
|
|
attribute whose value is not the empty string, then the value of
|
|
that attribute is the caption information; abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the image is a descendant of a <code><a href="#the-figure-element">figure</a></code>
|
|
element that has a child <code><a href="#the-figcaption-element">figcaption</a></code> element, and,
|
|
ignoring the <code><a href="#the-figcaption-element">figcaption</a></code> element and its descendants,
|
|
the <code><a href="#the-figure-element">figure</a></code> element has no text node descendants
|
|
other than <a href="#inter-element-whitespace">inter-element whitespace</a>, and no
|
|
<a href="#embedded-content">embedded content</a> descendant other than the
|
|
<code><a href="#the-img-element">img</a></code> element, then the contents of the first such
|
|
<code><a href="#the-figcaption-element">figcaption</a></code> element are the caption information;
|
|
abort these steps.</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>If the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute is not
|
|
set and either the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute
|
|
is set to the empty string or the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute is not set at all</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The element <a href="#represents">represents</a> nothing.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The element <a href="#represents">represents</a> the text given by the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The <code title="attr-img-alt"><a href="#attr-img-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="#attr-img-alt">alt</a></code> attribute in
|
|
the same way as content of the <code title="attr-title"><a href="#the-title-attribute">title</a></code>
|
|
attribute.</p>
|
|
|
|
<p>User agents may always provide the user with the option to
|
|
display any image, or to prevent any image from being
|
|
displayed.
|
|
|
|
|
|
</p>
|
|
|
|
<p class="warning">While user agents are encouraged to repair cases
|
|
of missing <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attributes, authors
|
|
must not rely on such behavior. <a href="#alt">Requirements for
|
|
providing text to act as an alternative for images</a> are described
|
|
in detail below.</p>
|
|
|
|
<p>The <em>contents</em> of <code><a href="#the-img-element">img</a></code> elements, if any, are
|
|
ignored for the purposes of rendering.</p>
|
|
|
|
</div><hr><p>The <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute,
|
|
if present, can indicate that the image has an associated
|
|
<a href="#image-map">image map</a>.<p>The <dfn id="attr-img-ismap" title="attr-img-ismap"><code>ismap</code></dfn>
|
|
attribute, when used on an element that is a descendant of an
|
|
<code><a href="#the-a-element">a</a></code> element with an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">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="#the-a-element">a</a></code> element.<p>The <code title="attr-img-ismap"><a href="#attr-img-ismap">ismap</a></code> attribute is a
|
|
<a href="#boolean-attribute">boolean attribute</a>. The attribute must not be specified
|
|
on an element that does not have an ancestor <code><a href="#the-a-element">a</a></code> element
|
|
with an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute.<p>The <code><a href="#the-img-element">img</a></code> element supports <a href="#dimension-attributes">dimension
|
|
attributes</a>.<div class="impl">
|
|
|
|
<p>The IDL attributes <dfn id="dom-img-alt" title="dom-img-alt"><code>alt</code></dfn>, <dfn id="dom-img-src" title="dom-img-src"><code>src</code></dfn>, <dfn id="dom-img-usemap" title="dom-img-useMap"><code>useMap</code></dfn>, and <dfn id="dom-img-ismap" title="dom-img-isMap"><code>isMap</code></dfn> each must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">image</var> . <code title="dom-img-width"><a href="#dom-img-width">width</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dt><var title="">image</var> . <code title="dom-img-height"><a href="#dom-img-height">height</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>These attributes return the actual rendered dimensions of the
|
|
image, or zero if the dimensions are not known.</p>
|
|
|
|
<p>They can be set, to change the corresponding content
|
|
attributes.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">image</var> . <code title="dom-img-naturalWidth"><a href="#dom-img-naturalwidth">naturalWidth</a></code></dt>
|
|
<dt><var title="">image</var> . <code title="dom-img-naturalHeight"><a href="#dom-img-naturalheight">naturalHeight</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>These attributes return the intrinsic dimensions of the image,
|
|
or zero if the dimensions are not known.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">image</var> . <code title="dom-img-complete"><a href="#dom-img-complete">complete</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the image has been completely downloaded or if
|
|
no image is specified; otherwise, returns false.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">image</var> = new <code title="dom-image"><a href="#dom-image">Image</a></code>( [ <var title="">width</var> [, <var title="">height</var> ] ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a new <code><a href="#the-img-element">img</a></code> element, with the <code title="attr-dim-width"><a href="#attr-dim-width">width</a></code> and <code title="attr-dim-height"><a href="#attr-dim-height">height</a></code> attributes set to the values
|
|
passed in the relevant arguments, if applicable.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The IDL attributes <dfn id="dom-img-width" title="dom-img-width"><code>width</code></dfn> and <dfn id="dom-img-height" title="dom-img-height"><code>height</code></dfn> must return the
|
|
rendered width and height of the image, in CSS pixels, if the image
|
|
is <a href="#being-rendered">being rendered</a>, and is being rendered to a visual
|
|
medium; or else the intrinsic width and height of the image, in CSS
|
|
pixels, if the image is <i title="img-available">available</i> but
|
|
not being rendered to a visual medium; or else 0, if the image is
|
|
not <i title="img-available">available</i>. <a href="#refsCSS">[CSS]</a></p>
|
|
|
|
<p>On setting, they must act as if they <a href="#reflect" title="reflect">reflected</a> the respective content attributes
|
|
of the same name.</p>
|
|
|
|
<p>The IDL attributes <dfn id="dom-img-naturalwidth" title="dom-img-naturalWidth"><code>naturalWidth</code></dfn> and
|
|
<dfn id="dom-img-naturalheight" title="dom-img-naturalHeight"><code>naturalHeight</code></dfn>
|
|
must return the intrinsic width and height of the image, in CSS
|
|
pixels, if the image is <i title="img-available">available</i>, or
|
|
else 0. <a href="#refsCSS">[CSS]</a></p>
|
|
|
|
<p>The IDL attribute <dfn id="dom-img-complete" title="dom-img-complete"><code>complete</code></dfn> must return
|
|
true if any of the following conditions is true:</p>
|
|
<ul class="brief"><li>The <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute is omitted.
|
|
<li>The <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute's value is the empty string.
|
|
<li>The final <a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue a task">queued</a> by the <a href="#networking-task-source">networking task source</a> once the resource has been <a href="#fetch" title="fetch">fetched</a> has been <a href="#queue-a-task" title="queue a task">queued</a>, but has not yet been run, and the <code><a href="#the-img-element">img</a></code> element is not in the <a href="#img-error" title="img-error">broken</a> state.
|
|
<li>The <code><a href="#the-img-element">img</a></code> element is <a href="#img-all" title="img-all">completely available</a>.
|
|
</ul><p>Otherwise, the attribute must return false.</p>
|
|
|
|
<p class="note">The value of <code title="dom-img-complete"><a href="#dom-img-complete">complete</a></code> can thus change while a
|
|
<a href="#concept-script" title="concept-script">script</a> is executing.</p>
|
|
|
|
<p>Three constructors are provided for creating
|
|
<code><a href="#htmlimageelement">HTMLImageElement</a></code> objects (in addition to the factory
|
|
methods from DOM Core such as <code title="">createElement()</code>): <dfn id="dom-image" title="dom-image"><code>Image()</code></dfn>, <dfn id="dom-image-w" title="dom-image-w"><code>Image(<var title="">width</var>)</code></dfn>, and <dfn id="dom-image-wh" title="dom-image-wh"><code>Image(<var title="">width</var>, <var title="">height</var>)</code></dfn>. When invoked as constructors,
|
|
these must return a new <code><a href="#htmlimageelement">HTMLImageElement</a></code> object (a new
|
|
<code><a href="#the-img-element">img</a></code> element). If the <var title="">width</var> argument
|
|
is present, the new object's <code title="attr-dim-width"><a href="#attr-dim-width">width</a></code> content attribute must be set to
|
|
<var title="">width</var>. If the <var title="">height</var>
|
|
argument is also present, the new object's <code title="attr-dim-height"><a href="#attr-dim-height">height</a></code> content attribute must be set
|
|
to <var title="">height</var>. The element's document must be the
|
|
<a href="#active-document">active document</a> of the <a href="#browsing-context">browsing context</a> of
|
|
the <code><a href="#window">Window</a></code> object on which the interface object of the
|
|
invoked constructor is found.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>A single image can have different appropriate alternative text
|
|
depending on the context.</p>
|
|
|
|
<p>In each of the following cases, the same image is used, yet the
|
|
<code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> text is different each
|
|
time. The image is the coat of arms of the Carouge municipality in
|
|
the canton Geneva in Switzerland.</p>
|
|
|
|
<p>Here it is used as a supplementary icon:</p>
|
|
<pre><p>I lived in <img src="carouge.svg" alt=""> Carouge.</p></pre>
|
|
|
|
<p>Here it is used as an icon representing the town:</p>
|
|
<pre><p>Home town: <img src="carouge.svg" alt="Carouge"></p></pre>
|
|
|
|
<p>Here it is used as part of a text on the town:</p>
|
|
|
|
<pre><p>Carouge has a coat of arms.</p>
|
|
<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></pre>
|
|
|
|
<p>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:</p>
|
|
|
|
<pre><p>Carouge has a coat of arms.</p>
|
|
<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></pre>
|
|
|
|
<p>Here it is used as part of a story:</p>
|
|
|
|
<pre><p>He picked up the folder and a piece of paper fell out.</p>
|
|
<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></pre>
|
|
|
|
<p>Here it is not known at the time of publication what the image
|
|
will be, only that it will be a coat of arms of some kind, and thus
|
|
no replacement text can be provided, and instead only a brief
|
|
caption for the image is provided, in the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute:</p>
|
|
|
|
<pre><p>The last user to have uploaded a coat of arms uploaded this one:</p>
|
|
<p><img src="last-uploaded-coat-of-arms.cgi" title="User-uploaded coat of arms."></p></pre>
|
|
|
|
<p>Ideally, the author would find a way to provide real replacement
|
|
text even in this case, e.g. by asking the previous user. Not
|
|
providing replacement text makes the document more difficult to use
|
|
for people who are unable to view images, e.g. blind users, or
|
|
users or very low-bandwidth connections or who pay by the byte, or
|
|
users who are forced to use a text-only Web browser.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here are some more examples showing the same picture used in
|
|
different contexts, with different appropriate alternate texts each
|
|
time.</p>
|
|
|
|
<pre><article>
|
|
<h1>My cats</h1>
|
|
<h2>Fluffy</h2>
|
|
<p>Fluffy is my favorite.</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></pre>
|
|
|
|
<pre><article>
|
|
<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></pre>
|
|
|
|
<pre><article>
|
|
<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></pre>
|
|
|
|
<pre><article>
|
|
<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></pre>
|
|
|
|
</div><h5 id="alt"><span class="secno">4.8.1.1 </span>Requirements for providing text to act as an alternative for images</h5><h6 id="general-guidelines"><span class="secno">4.8.1.1.1 </span>General guidelines</h6><p>Except where otherwise specified, the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute must be specified and its
|
|
value must not be empty; the value must be an appropriate
|
|
replacement for the image. The specific requirements for the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute depend on what the image
|
|
is intended to represent, as described in the following
|
|
sections.<p>The most general rule to consider when writing alternative text
|
|
is the following: <strong>the intent is that replacing every image
|
|
with the text of its <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute
|
|
not change the meaning of the page</strong>.<p>So, in general, alternative text can be written by considering
|
|
what one would have written had one not been able to include the
|
|
image.<p>A corollary to this is that the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute's value should never
|
|
contain text that could be considered the image's <em>caption</em>,
|
|
<em>title</em>, or <em>legend</em>. It is supposed to contain
|
|
replacement text that could be used by users <em>instead</em> of the
|
|
image; it is not meant to supplement the image. The <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute can be used for
|
|
supplemental information.<p class="note">One way to think of alternative text is to think
|
|
about how you would read the page containing the image to someone
|
|
over the phone, without mentioning that there is an image
|
|
present. Whatever you say instead of the image is typically a good
|
|
start for writing the alternative text.<h6 id="a-link-or-button-containing-nothing-but-the-image"><span class="secno">4.8.1.1.2 </span>A link or button containing nothing but the image</h6><p>When an <a href="#the-a-element">a</a> element that creates a
|
|
<a href="#hyperlink">hyperlink</a>, or a <code><a href="#the-button-element">button</a></code> element, has no
|
|
textual content but contains one or more images, the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attributes must contain text that
|
|
together convey the purpose of the link or button.<div class="example">
|
|
|
|
<p>In this example, a user is asked to pick his preferred color
|
|
from a list of three. Each color is given by an image, but for
|
|
users who have configured their user agent not to display images,
|
|
the color names are used instead:</p>
|
|
|
|
<pre><h1>Pick your color</h1>
|
|
<ul>
|
|
<li><a href="green.html"><strong><img src="green.jpeg" alt="Green"></strong></a></li>
|
|
<li><a href="blue.html"><strong><img src="blue.jpeg" alt="Blue"></strong></a></li>
|
|
<li><a href="red.html"><strong><img src="red.jpeg" alt="Red"></strong></a></li>
|
|
</ul></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this example, each button has a set of images to indicate the
|
|
kind of color output desired by the user. The first image is used
|
|
in each case to give the alternative text.</p>
|
|
|
|
<pre><button name="rgb"><strong><img src="red" alt="RGB"><img src="green" alt=""><img src="blue" alt=""></strong></button>
|
|
<button name="cmyk"><strong><img src="cyan" alt="CMYK"><img src="magenta" alt=""><img src="yellow" alt=""><img src="black" alt=""></strong></button></pre>
|
|
|
|
<p>Since each image represents one part of the text, it could also
|
|
be written like this:</p>
|
|
|
|
<pre><button name="rgb"><strong><img src="red" alt="R"><img src="green" alt="G"><img src="blue" alt="B"></strong></button>
|
|
<button name="cmyk"><strong><img src="cyan" alt="C"><img src="magenta" alt="M"><img src="yellow" alt="Y"><img src="black" alt="K"></strong></button></pre>
|
|
|
|
<p>However, with other alternative text, this might not work, and
|
|
putting all the alternative text into one image in each case might
|
|
make more sense:</p>
|
|
|
|
<pre><button name="rgb"><strong><img src="red" alt="sRGB profile"><img src="green" alt=""><img src="blue" alt=""></strong></button>
|
|
<button name="cmyk"><strong><img src="cyan" alt="CMYK profile"><img src="magenta" alt=""><img src="yellow" alt=""><img src="black" alt=""></strong></button></pre>
|
|
|
|
</div><h6 id="a-phrase-or-paragraph-with-an-alternative-graphical-representation:-charts-diagrams-graphs-maps-illustrations"><span class="secno">4.8.1.1.3 </span>A phrase or paragraph with an alternative graphical representation: charts, diagrams, graphs, maps, illustrations</h6><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="#the-img-element">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>The text must be given in the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute, and must convey the
|
|
same message as the image specified in the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute.<p>It is important to realize that the alternative text is a
|
|
<em>replacement</em> for the image, not a description of the
|
|
image.<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="#attr-img-alt">alt</a></code>
|
|
attribute rephrasing the flowchart in prose form:</p>
|
|
|
|
<pre><p>In the common case, the data handled by the tokenization stage
|
|
comes from the network, but it can also come from script.</p>
|
|
<p><strong><img src="parsing-model-overview.png" alt="The network
|
|
passes data to the Tokenizer 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 Tokenizer."></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>
|
|
|
|
<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>
|
|
|
|
<p>Text such as "Photo of white house with boarded door" would be
|
|
equally bad alternative text (though it could be suitable for the
|
|
<code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute or in the
|
|
<code><a href="#the-figcaption-element">figcaption</a></code> element of a <code><a href="#the-figure-element">figure</a></code> with this
|
|
image).</p>
|
|
|
|
</div><h6 id="a-short-phrase-or-label-with-an-alternative-graphical-representation:-icons-logos"><span class="secno">4.8.1.1.4 </span>A short phrase or label with an alternative graphical representation: icons, logos</h6><p>A document can contain information in iconic form. The icon is
|
|
intended to help users of visual browsers to recognize features at
|
|
a glance.<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="#attr-img-alt">alt</a></code> attribute must be present but must
|
|
be empty.<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="#attr-img-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="#attr-img-alt">alt</a></code> attribute.<div class="example">
|
|
|
|
<p>Here, posts on a news site are labeled 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, organization,
|
|
project, band, software package, country, or some such.<p>If the logo is being used to represent the entity, e.g. as a page
|
|
heading, the <code title="attr-img-alt"><a href="#attr-img-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="#attr-img-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>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="#attr-img-alt">alt</a></code> attribute must instead be
|
|
empty.<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.<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:
|
|
|
|
<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
|
|
specializing 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 <i title="img-available">available</i>, 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><h6 id="text-that-has-been-rendered-to-a-graphic-for-typographical-effect"><span class="secno">4.8.1.1.5 </span>Text that has been rendered to a graphic for typographical effect</h6><p>Sometimes, an image just consists of text, and the purpose of the
|
|
image is not to highlight the actual typographic effects used to
|
|
render the text, but just to convey the text itself.<p>In such cases, the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code>
|
|
attribute must be present but must consist of the same text as
|
|
written in the image itself.<div class="example">
|
|
|
|
<p>Consider a graphic containing the text "Earth Day", but with the
|
|
letters all decorated with flowers and plants. If the text is
|
|
merely being used as a heading, to spice up the page for graphical
|
|
users, then the correct alternative text is just the same text
|
|
"Earth Day", and no mention need be made of the decorations:</p>
|
|
|
|
<pre><h1><strong><img src="earthdayheading.png" alt="Earth Day"></strong></h1></pre>
|
|
|
|
</div><h6 id="a-graphical-representation-of-some-of-the-surrounding-text"><span class="secno">4.8.1.1.6 </span>A graphical representation of some of the surrounding text</h6><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="#attr-img-alt">alt</a></code> attribute must be
|
|
present but its value must be the empty string.<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.<div class="example">
|
|
|
|
<p>A flowchart that repeats the previous paragraph in graphical form:</p>
|
|
|
|
<pre><p>The network passes data to the Tokenizer 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 Tokenizer.</p>
|
|
<strong><p><img src="parsing-model-overview.png" alt=""></p></strong></pre>
|
|
|
|
<p>In these cases, it would be wrong to include alternative text
|
|
that consists of just a caption. If a caption is to be included,
|
|
then either the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute can
|
|
be used, or the <code><a href="#the-figure-element">figure</a></code> and <code><a href="#the-figcaption-element">figcaption</a></code>
|
|
elements can be used. In the latter case, the image would in fact
|
|
be a phrase or paragraph with an alternative graphical
|
|
representation, and would thus require alternative text.</p>
|
|
|
|
<pre><!-- Using the title="" attribute -->
|
|
<p>The network passes data to the Tokenizer 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 Tokenizer.</p>
|
|
<p><strong><img src="parsing-model-overview.png" alt=""
|
|
title="Flowchart representation of the parsing model."></strong></p></pre>
|
|
|
|
<pre><!-- Using <figure> and <figcaption> -->
|
|
<p>The network passes data to the Tokenizer 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 Tokenizer.</p>
|
|
<figure>
|
|
<strong><img src="parsing-model-overview.png" alt="The Network leads
|
|
to the Tokenizer, which leads to the Tree Construction. The Tree
|
|
Construction leads to two items. The first is Script Execution, which
|
|
leads via document.write() back to the Tokenizer. The second item
|
|
from which Tree Construction leads is the DOM. The DOM is related to
|
|
the Script Execution."></strong>
|
|
<figcaption>Flowchart representation of the parsing model.</figcaption>
|
|
</figure></pre>
|
|
|
|
<pre class="bad"><!-- This is WRONG. Do not do this. Instead, do what the above examples do. -->
|
|
<p>The network passes data to the Tokenizer 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 Tokenizer.</p>
|
|
<p><img src="parsing-model-overview.png"
|
|
alt="Flowchart representation of the parsing model."></p>
|
|
<!-- Never put the image's caption in the alt="" attribute! --></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><h6 id="a-purely-decorative-image-that-doesn-t-add-any-information"><span class="secno">4.8.1.1.7 </span>A purely decorative image that doesn't add any information</h6><p>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><p>Exceptions to this rule, in cases where CSS cannot be used to
|
|
display an entirely decorative image, are covered by the HTML5:
|
|
Techniques for providing useful text alternatives. <a href="#refsHTMLALTTECHS">[HTMLALTTECHS]</a>
|
|
Authors are also encouraged to consult the Web Content Accessibility
|
|
Guidelines 2.0 for more detailed information and acceptable
|
|
techniques. <a href="#refsWCAG">[WCAG]</a></p><h6 id="a-group-of-images-that-form-a-single-larger-picture-with-no-links"><span class="secno">4.8.1.1.8 </span>A group of images that form a single larger picture with no links</h6><p>When a picture has been sliced into smaller image files that are
|
|
then displayed together to form the complete picture again, one of
|
|
the images must have its <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code>
|
|
attribute set as per the relevant rules that would be appropriate
|
|
for the picture as a whole, and then all the remaining images must
|
|
have their <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute set to
|
|
the empty string.<div class="example">
|
|
|
|
<p>In the following example, a picture representing a company logo
|
|
for <span title="">XYZ Corp</span> has been split into two pieces,
|
|
the first containing the letters "XYZ" and the second with the word
|
|
"Corp". The alternative text ("XYZ Corp") is all in the first
|
|
image.</p>
|
|
|
|
<pre><h1><strong><img src="logo1.png" alt="XYZ Corp"><img src="logo2.png" alt=""></strong></h1></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, a rating is shown as three filled
|
|
stars and two empty stars. While the alternative text could have
|
|
been "★★★☆☆", the author has
|
|
instead decided to more helpfully give the rating in the form "3
|
|
out of 5". That is the alternative text of the first image, and the
|
|
rest have blank alternative text.</p>
|
|
|
|
<pre><p>Rating: <meter max=5 value=3><strong><img src="1" alt="3 out of 5"
|
|
><img src="1" alt=""><img src="1" alt=""><img src="0" alt=""
|
|
><img src="0" alt=""></strong></meter></p></pre>
|
|
|
|
</div><h6 id="a-group-of-images-that-form-a-single-larger-picture-with-links"><span class="secno">4.8.1.1.9 </span>A group of images that form a single larger picture with links</h6><p>Generally, <a href="#image-map" title="image map">image maps</a> should be
|
|
used instead of slicing an image for links.<p>However, if an image is indeed sliced and any of the components
|
|
of the sliced picture are the sole contents of links, then one image
|
|
per link must have alternative text in its <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute representing the purpose
|
|
of the link.<div class="example">
|
|
|
|
<p>In the following example, a picture representing the flying
|
|
spaghetti monster emblem, with each of the left noodly appendages
|
|
and the right noodly appendages in different images, so that the
|
|
user can pick the left side or the right side in an adventure.</p>
|
|
|
|
<pre><h1>The Church</h1>
|
|
<p>You come across a flying spaghetti monster. Which side of His
|
|
Noodliness do you wish to reach out for?</p>
|
|
<strong><p><a href="?go=left" ><img src="fsm-left.png" alt="Left side. "></a
|
|
><img src="fsm-middle.png" alt=""
|
|
><a href="?go=right"><img src="fsm-right.png" alt="Right side."></a></p></strong></pre>
|
|
|
|
</div><h6 id="a-key-part-of-the-content"><span class="secno">4.8.1.1.10 </span>A key part of the content</h6><p>In some cases, the image is a critical part of the
|
|
content. This could be the case, for instance, on a page that is
|
|
part of a photo gallery. The image is the whole <em>point</em> of
|
|
the page containing it.<p>How to provide alternative text for an image that is a key part
|
|
of the content depends on the image's provenance.<dl><dt>The general case</dt>
|
|
|
|
<dd>
|
|
|
|
<p>When it is possible for detailed 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 can
|
|
serve as a substitute for the image must be given as the contents
|
|
of the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>A screenshot in a gallery of screenshots for a new OS, with
|
|
some alternative text:</p>
|
|
|
|
<pre><figure>
|
|
<strong><img src="KDE%20Light%20desktop.png"
|
|
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."></strong>
|
|
<figcaption>Screenshot of a KDE desktop.</figcaption>
|
|
</figure></pre>
|
|
|
|
</div>
|
|
|
|
<div class="example">
|
|
|
|
<p>A graph in a financial report:</p>
|
|
|
|
<pre><strong><img src="sales.gif"
|
|
title="Sales graph"
|
|
alt="From 1998 to 2005, sales increased by the following percentages
|
|
with each year: 624%, 75%, 138%, 40%, 35%, 9%, 21%"></strong></pre>
|
|
|
|
<p>Note that "sales graph" would be inadequate alternative text
|
|
for a sales graph. Text that would be a good <em>caption</em> is
|
|
not generally suitable as replacement text.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Images that defy a complete description</dt>
|
|
|
|
<dd>
|
|
|
|
<p>In certain cases, the nature of the image might be such that
|
|
providing thorough alternative text is impractical. For example,
|
|
the image could be indistinct, or could be a complex fractal, or
|
|
could be a detailed topographical map.</p>
|
|
|
|
<p>In these cases, the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code>
|
|
attribute must contain some suitable alternative text, but it may
|
|
be somewhat brief.</p>
|
|
|
|
<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. However, a description, even
|
|
if brief, is still better than nothing:</p>
|
|
|
|
<pre><figure>
|
|
<strong><img src="/commons/a/a7/Rorschach1.jpg" alt="A shape with left-right
|
|
symmetry with indistinct edges, with a small gap in the center, two
|
|
larger gaps offset slightly from the center, with two similar gaps
|
|
under them. The outline is wider in the top half than the bottom
|
|
half, with the sides extending upwards higher than the center, and
|
|
the center extending below the sides."></strong>
|
|
<figcaption>A black outline of the first of the ten cards
|
|
in the Rorschach inkblot test.</figcaption>
|
|
</figure></pre>
|
|
|
|
<p>Note that the following would be a very bad use of alternative
|
|
text:</p>
|
|
|
|
<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.">
|
|
<figcaption>A black outline of the first of the ten cards
|
|
in the Rorschach inkblot test.</figcaption>
|
|
</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>
|
|
|
|
<div class="example">
|
|
|
|
<p>Another example of an image that defies full description is a
|
|
fractal, which, by definition, is infinite in detail.</p>
|
|
|
|
<p>The following example shows one possible way of providing
|
|
alternative text for the full view of an image of the Mandelbrot
|
|
set.</p>
|
|
|
|
<pre><strong><img src="ms1.jpeg" alt="The Mandelbrot set appears as a cardioid with
|
|
its cusp on the real axis in the positive direction, with a smaller
|
|
bulb aligned along the same center line, touching it in the negative
|
|
direction, and with these two shapes being surrounded by smaller bulbs
|
|
of various sizes."></strong></pre>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt id="unknown-images">Images whose contents are not known</dt>
|
|
|
|
<dd>
|
|
|
|
<p>In some unfortunate cases, there might be no alternative text
|
|
available at all, either because the image is obtained in some
|
|
automated fashion without any associated alternative text (e.g. a
|
|
Webcam), or because the page is being generated by a script using
|
|
user-provided images where the user did not provide suitable or
|
|
usable alternative text (e.g. photograph sharing sites), or
|
|
because the author does not himself know what the images represent
|
|
(e.g. a blind photographer sharing an image on his blog).</p>
|
|
|
|
<p>In such cases, the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code>
|
|
attribute may be omitted, but one of the following conditions must
|
|
be met as well:</p>
|
|
|
|
<ul><li>The <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute is
|
|
present and has a non-empty value.</li>
|
|
|
|
<li id="figcaption-as-alt-condition">The <code><a href="#the-img-element">img</a></code> element
|
|
is in a <code><a href="#the-figure-element">figure</a></code> element that contains a
|
|
<code><a href="#the-figcaption-element">figcaption</a></code> element that contains content other than
|
|
<a href="#inter-element-whitespace">inter-element whitespace</a>, and, ignoring the
|
|
<code><a href="#the-figcaption-element">figcaption</a></code> element and its descendants, the
|
|
<code><a href="#the-figure-element">figure</a></code> element has no text node descendants other
|
|
than <a href="#inter-element-whitespace">inter-element whitespace</a>, and no <a href="#embedded-content">embedded
|
|
content</a> descendant other than the <code><a href="#the-img-element">img</a></code>
|
|
element.</li>
|
|
|
|
</ul><p class="note">Such cases are to be kept to an absolute
|
|
minimum. If there is even the slightest possibility of the author
|
|
having the ability to provide real alternative text, then it would
|
|
not be acceptable to omit the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code>
|
|
attribute.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>A photo on a photo-sharing site, if the site received the
|
|
image with no metadata other than the caption, could be marked up
|
|
as follows:</p>
|
|
|
|
<pre><figure>
|
|
<strong><img src="1100670787_6a7c664aef.jpg"></strong>
|
|
<figcaption>Bubbles traveled everywhere with us.</figcaption>
|
|
</figure></pre>
|
|
|
|
<p>It would be better, however, if a detailed description of the
|
|
important parts of the image obtained from the user and included
|
|
on the page.</p>
|
|
|
|
</div>
|
|
|
|
<div class="example">
|
|
|
|
<p>A blind user's blog in which a photo taken by the user is
|
|
shown. Initially, the user might not have any idea what the photo
|
|
he took shows:</p>
|
|
|
|
<pre><article>
|
|
<h1>I took a photo</h1>
|
|
<p>I went out today and took a photo!</p>
|
|
<figure>
|
|
<strong><img src="photo2.jpeg"></strong>
|
|
<figcaption>A photograph taken blindly from my front porch.</figcaption>
|
|
</figure>
|
|
</article></pre>
|
|
|
|
<p>Eventually though, the user might obtain a description of the
|
|
image from his friends and could then include alternative text:</p>
|
|
|
|
<pre><article>
|
|
<h1>I took a photo</h1>
|
|
<p>I went out today and took a photo!</p>
|
|
<figure>
|
|
<strong><img src="photo2.jpeg" alt="The photograph shows my hummingbird
|
|
feeder hanging from the edge of my roof. It is half full, but there
|
|
are no birds around. In the background, out-of-focus trees fill the
|
|
shot. The feeder is made of wood with a metal grate, and it contains
|
|
peanuts. The edge of the roof is wooden too, and is painted white
|
|
with light blue streaks."></strong>
|
|
<figcaption>A photograph taken blindly from my front porch.</figcaption>
|
|
</figure>
|
|
</article></pre>
|
|
|
|
</div>
|
|
|
|
<div class="example">
|
|
|
|
<p>Sometimes the entire point of the image is that a textual
|
|
description is not available, and the user is to provide the
|
|
description. For instance, the point of a CAPTCHA image is to see
|
|
if the user can literally read the graphic. Here is one way to
|
|
mark up a CAPTCHA (note the <code title="attr-title"><a href="#the-title-attribute">title</a></code>
|
|
attribute):</p>
|
|
|
|
<pre><p><label>What does this image say?
|
|
<strong><img src="captcha.cgi?id=8934" title="CAPTCHA"></strong>
|
|
<input type=text name=captcha></label>
|
|
(If you cannot see the image, you can use an <a
|
|
href="?audio">audio</a> test instead.)</p></pre>
|
|
|
|
<p>Another example would be software that displays images and
|
|
asks for alternative text precisely for the purpose of then
|
|
writing a page with correct alternative text. Such a page could
|
|
have a table of images, like this:</p>
|
|
|
|
<pre><table>
|
|
<thead>
|
|
<tr> <th> Image <th> Description
|
|
<tbody>
|
|
<tr>
|
|
<td> <strong><img src="2421.png" title="Image 640 by 100, filename 'banner.gif'"></strong>
|
|
<td> <input name="alt2421">
|
|
<tr>
|
|
<td> <strong><img src="2422.png" title="Image 200 by 480, filename 'ad3.gif'"></strong>
|
|
<td> <input name="alt2422">
|
|
</table></pre>
|
|
|
|
<p>Notice that even in this example, as much useful information
|
|
as possible is still included in the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute.</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="#attr-img-alt">alt</a></code> attribute is only allowed to be
|
|
omitted rather than being provided with replacement text when no
|
|
alternative text is available and none can be made available, as
|
|
in the above examples. Lack of effort from the part of the author
|
|
is not an acceptable reason for omitting the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h6 id="an-image-not-intended-for-the-user"><span class="secno">4.8.1.1.11 </span>An image not intended for the user</h6><p>Generally authors should avoid using <code><a href="#the-img-element">img</a></code> elements
|
|
for purposes other than showing images.<p>If an <code><a href="#the-img-element">img</a></code> element is being used for purposes other
|
|
than showing an image, e.g. as part of a service to count page
|
|
views, then the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute must
|
|
be the empty string.<p>In such cases, the <code title="attr-dim-width"><a href="#attr-dim-width">width</a></code> and
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">height</a></code> attributes should both
|
|
be set to zero.<div class="impl">
|
|
|
|
<h6 id="guidance-for-markup-generators"><span class="secno">4.8.1.1.12 </span>Guidance for markup generators</h6>
|
|
|
|
<p>Markup generators (such as WYSIWYG authoring tools) should,
|
|
wherever possible, obtain alternative text from their
|
|
users. However, it is recognized that in many cases, this will not
|
|
be possible.</p>
|
|
|
|
<p>For images that are the sole contents of links, markup generators
|
|
should examine the link target to determine the title of the target,
|
|
or the URL of the target, and use information obtained in this
|
|
manner as the alternative text.</p>
|
|
|
|
<p>As a last resort, implementors should either set the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute to the empty string, under
|
|
the assumption that the image is a purely decorative image that
|
|
doesn't add any information but is still specific to the surrounding
|
|
content, or omit the <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute
|
|
altogether, under the assumption that the image is a key part of the
|
|
content.</p>
|
|
|
|
<p>Markup generators should generally avoid using the image's own
|
|
file name as the alternative text. Similarly, markup generators
|
|
should avoid generating alternative text from any content that will
|
|
be equally available to presentation user agents (e.g. Web
|
|
browsers).</p>
|
|
|
|
<p class="note">This is because once a page is generated, it will
|
|
typically not be updated, whereas the browsers that later read the
|
|
page can be updated by the user, therefore the browser is likely to
|
|
have more up-to-date and finely-tuned heuristics than the markup
|
|
generator did when generating the page.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h6 id="guidance-for-conformance-checkers"><span class="secno">4.8.1.1.13 </span>Guidance for conformance checkers</h6>
|
|
|
|
<p>A conformance checker must report the lack of an <code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code> attribute as an error unless one of
|
|
the conditions listed below applies:</p>
|
|
|
|
<ul><li>The <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute is present
|
|
and has a non-empty value (as <a href="#unknown-images">described
|
|
above</a>).</li>
|
|
|
|
<li>The <code><a href="#the-img-element">img</a></code> element is in a <code><a href="#the-figure-element">figure</a></code>
|
|
element that satisfies <a href="#figcaption-as-alt-condition">the
|
|
conditions described above</a>.</li>
|
|
|
|
|
|
|
|
<li>The document has a <code><a href="#the-meta-element">meta</a></code> element with a <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute whose value is an
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="meta-generator"><a href="#meta-generator">generator</a></code>". (This case does not
|
|
represent a case where the document is conforming, only that the
|
|
generator could not determine appropriate alternative text —
|
|
validators are required to not show an error in this case to
|
|
discourage markup generators from including bogus alternative text
|
|
purely in an attempt to silence validators.)</li>
|
|
|
|
</ul></div><h4 id="the-iframe-element"><span class="secno">4.8.2 </span>The <dfn><code>iframe</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#embedded-content">Embedded content</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#embedded-content">embedded content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Text that conforms to <a href="#iframe-content-model">the requirements given in the prose</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code></dd>
|
|
<dd><code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code></dd>
|
|
<dd><code title="attr-iframe-name"><a href="#attr-iframe-name">name</a></code></dd>
|
|
<dd><code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code></dd>
|
|
<dd><code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">seamless</a></code></dd>
|
|
<dd><code title="attr-dim-width"><a href="#attr-dim-width">width</a></code></dd>
|
|
<dd><code title="attr-dim-height"><a href="#attr-dim-height">height</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="#dom-iframe-src" title="dom-iframe-src">src</a>;
|
|
attribute DOMString <a href="#dom-iframe-srcdoc" title="dom-iframe-srcdoc">srcdoc</a>;
|
|
attribute DOMString <a href="#dom-iframe-name" title="dom-iframe-name">name</a>;
|
|
[PutForwards=<a href="#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</a>] readonly attribute <a href="#domsettabletokenlist">DOMSettableTokenList</a> <a href="#dom-iframe-sandbox" title="dom-iframe-sandbox">sandbox</a>;
|
|
attribute boolean <a href="#dom-iframe-seamless" title="dom-iframe-seamless">seamless</a>;
|
|
attribute DOMString <a href="#dom-dim-width" title="dom-dim-width">width</a>;
|
|
attribute DOMString <a href="#dom-dim-height" title="dom-dim-height">height</a>;
|
|
readonly attribute Document <a href="#dom-iframe-contentdocument" title="dom-iframe-contentDocument">contentDocument</a>;
|
|
readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-iframe-contentwindow" title="dom-iframe-contentWindow">contentWindow</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-iframe-element">iframe</a></code> element <a href="#represents">represents</a> a
|
|
<a href="#nested-browsing-context">nested browsing context</a>.<p>The <dfn id="attr-iframe-src" title="attr-iframe-src"><code>src</code></dfn> attribute
|
|
gives the address of a page that the <a href="#nested-browsing-context">nested browsing
|
|
context</a> is to contain. The attribute, if present, must be a
|
|
<a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</a>.<p>The <dfn id="attr-iframe-srcdoc" title="attr-iframe-srcdoc"><code>srcdoc</code></dfn>
|
|
attribute gives the content of the page that the <a href="#nested-browsing-context">nested
|
|
browsing context</a> is to contain. The value of the attribute is
|
|
the source of <dfn id="an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</dfn>.<p>For <code><a href="#the-iframe-element">iframe</a></code> elements in <a href="#html-documents">HTML documents</a>,
|
|
the attribute, if present, must have a value using <a href="#syntax">the HTML
|
|
syntax</a> that consists of the following syntactic components,
|
|
in the given order:<ol><li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
|
|
<a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
<li>Optionally, a <a href="#syntax-doctype" title="syntax-doctype">DOCTYPE</a>.
|
|
|
|
<li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
|
|
<a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
<li>The root element, in the form of an <code><a href="#the-html-element">html</a></code> <a href="#syntax-elements" title="syntax-elements">element</a>.</li>
|
|
|
|
<li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
|
|
<a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
</ol><p>For <code><a href="#the-iframe-element">iframe</a></code> elements in <a href="#xml-documents">XML documents</a>,
|
|
the attribute, if present, must have a value that matches the
|
|
production labeled <code><a href="#document">document</a></code> in the XML
|
|
specification. <a href="#refsXML">[XML]</a><p>If the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute and the
|
|
<code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute are both
|
|
specified together, the <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code>
|
|
attribute takes priority. This allows authors to provide a fallback
|
|
<a href="#url">URL</a> for legacy user agents that do not support the
|
|
<code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute.<div class="impl">
|
|
|
|
<p>When an <code><a href="#the-iframe-element">iframe</a></code> element is first <a href="#insert-an-element-into-a-document" title="insert
|
|
an element into a document">inserted into a document</a>, the
|
|
user agent must create a <a href="#nested-browsing-context">nested browsing context</a>, and
|
|
then <a href="#process-the-iframe-attributes">process the <code>iframe</code> attributes</a> for the
|
|
first time.</p>
|
|
|
|
<p>Whenever an <code><a href="#the-iframe-element">iframe</a></code> element with a <a href="#nested-browsing-context">nested
|
|
browsing context</a> has its <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute set, changed, or
|
|
removed, the user agent must <a href="#process-the-iframe-attributes">process the <code>iframe</code>
|
|
attributes</a>.</p>
|
|
|
|
<p>Similarly, whenever an <code><a href="#the-iframe-element">iframe</a></code> element with a
|
|
<a href="#nested-browsing-context">nested browsing context</a> but with no <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute specified has its
|
|
<code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute set, changed, or
|
|
removed, the user agent must <a href="#process-the-iframe-attributes">process the <code>iframe</code>
|
|
attributes</a>.</p>
|
|
<p>When the user agent is to <dfn id="process-the-iframe-attributes">process the <code>iframe</code>
|
|
attributes</dfn>, it must run the first appropriate steps from the
|
|
following list:</p>
|
|
|
|
<dl class="switch"><dt>If the <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute
|
|
is specified</dt>
|
|
|
|
<dd><p><a href="#navigate">Navigate</a> the element's
|
|
<a href="#browsing-context">browsing context</a> to a resource whose
|
|
<a href="#content-type">Content-Type</a> is <code><a href="#text-html">text/html</a></code>, whose
|
|
<a href="#url">URL</a> is <code><a href="#about:srcdoc">about:srcdoc</a></code>, and whose data
|
|
consists of the value of the attribute. The resulting
|
|
<code><a href="#document">Document</a></code> must be considered <a href="#an-iframe-srcdoc-document">an
|
|
<code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code>
|
|
document</a>.</dd>
|
|
|
|
<dt>If the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code>
|
|
attribute is specified but the <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute is not</dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li><p>If the value of the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute is the empty string,
|
|
jump to the <i title="">empty</i> step below.</li>
|
|
|
|
<li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the value of
|
|
the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute, relative
|
|
to the <code><a href="#the-iframe-element">iframe</a></code> element.</li>
|
|
|
|
<li><p>If that is not successful, then jump to the <i title="">empty</i> step below.</li>
|
|
|
|
<li><p>If the resulting <a href="#absolute-url">absolute URL</a> is an
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string
|
|
"<code><a href="#about:blank">about:blank</a></code>", and the user agent is processing this
|
|
<code><a href="#the-iframe-element">iframe</a></code>'s attributes for the first time, then jump to
|
|
the <i title="">empty</i> step below. (In cases other than the
|
|
first time, <code><a href="#about:blank">about:blank</a></code> is loaded
|
|
normally.)</li>
|
|
|
|
<li><p><a href="#navigate">Navigate</a> the element's
|
|
<a href="#browsing-context">browsing context</a> to the resulting <a href="#absolute-url">absolute
|
|
URL</a>.</li>
|
|
|
|
</ol><p><i>Empty</i>: When the steps above require the user agent to
|
|
jump to the <i title="">empty</i> step, if the user agent is
|
|
processing this <code><a href="#the-iframe-element">iframe</a></code>'s attributes for the first
|
|
time, then the user agent must <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-load">load</code> at the <code><a href="#the-iframe-element">iframe</a></code>
|
|
element. (After jumping to this step, the above steps are not
|
|
resumed.)</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-load">load</code> at the
|
|
<code><a href="#the-iframe-element">iframe</a></code> element.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>Any <a href="#navigate" title="navigate">navigation</a> required of the user
|
|
agent in the <a href="#process-the-iframe-attributes">process the <code>iframe</code> attributes</a>
|
|
algorithm must be completed with the <code><a href="#the-iframe-element">iframe</a></code> element's
|
|
document's <a href="#browsing-context">browsing context</a> as the <a href="#source-browsing-context">source
|
|
browsing context</a>.</p>
|
|
|
|
<p>Furthermore, if the <a href="#browsing-context">browsing context</a>'s <a href="#session-history">session
|
|
history</a> contained only one <code><a href="#document">Document</a></code> when the
|
|
<a href="#process-the-iframe-attributes">process the <code>iframe</code> attributes</a> algorithm
|
|
was invoked, and that was the <code><a href="#about:blank">about:blank</a></code>
|
|
<code><a href="#document">Document</a></code> created when the <a href="#browsing-context">browsing context</a>
|
|
was created, then any <a href="#navigate" title="navigate">navigation</a>
|
|
required of the user agent in that algorithm must be completed with
|
|
<a href="#replacement-enabled">replacement enabled</a>.</p>
|
|
</div><p class="note">If, when the element is created, the <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute is not set, and
|
|
the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute is either
|
|
also not set or set but its value cannot be <a href="#resolve-a-url" title="resolve a
|
|
url">resolved</a>, the browsing context will remain at the
|
|
initial <code><a href="#about:blank">about:blank</a></code> page.<p class="note">If the user <a href="#navigate" title="navigate">navigates</a>
|
|
away from this page, the <code><a href="#the-iframe-element">iframe</a></code>'s corresponding
|
|
<code><a href="#windowproxy">WindowProxy</a></code> object will proxy new <code><a href="#window">Window</a></code>
|
|
objects for new <code><a href="#document">Document</a></code> objects, but the <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute will not change.<div class="impl">
|
|
|
|
<div class="note">
|
|
|
|
<p><a href="#remove-an-element-from-a-document" title="remove an element from a document">Removing</a>
|
|
an <code><a href="#the-iframe-element">iframe</a></code> from a <code><a href="#document">Document</a></code> does not cause
|
|
its <a href="#browsing-context">browsing context</a> to be discarded. Indeed, an
|
|
<code><a href="#the-iframe-element">iframe</a></code>'s <a href="#browsing-context">browsing context</a> can survive its
|
|
original parent <code><a href="#document">Document</a></code> if its <code><a href="#the-iframe-element">iframe</a></code> is
|
|
moved to another <code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p>On the other hand, if an <code><a href="#the-iframe-element">iframe</a></code> is <a href="#remove-an-element-from-a-document" title="remove an element from a document">removed</a> from a
|
|
<code><a href="#document">Document</a></code> and is then subsequently garbage collected,
|
|
this will likely mean (in the absence of other references) that the
|
|
<a href="#child-browsing-context">child browsing context</a>'s <code><a href="#windowproxy">WindowProxy</a></code>
|
|
object will become eligble for garbage collection, which will then
|
|
lead to that <a href="#browsing-context">browsing context</a> being <a href="#a-browsing-context-is-discarded" title="a
|
|
browsing context is discarded">discarded</a>, which will then
|
|
lead to its <code><a href="#document">Document</a></code> being <a href="#discard-a-document" title="discard a
|
|
document">discarded</a> also. This happens without notice to any
|
|
scripts running in that <code><a href="#document">Document</a></code>; for example, no
|
|
<code title="event-unload">unload</code> events are fired (the
|
|
"<a href="#unload-a-document">unload a document</a>" steps are not run).</p>
|
|
|
|
</div>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here a blog uses the <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code> attribute in conjunction
|
|
with the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> and <code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">seamless</a></code> attributes described
|
|
below to provide users of user agents that support this feature
|
|
with an extra layer of protection from script injection in the blog
|
|
post comments:</p>
|
|
|
|
<pre><article>
|
|
<h1>I got my own magazine!</h1>
|
|
<p>After much effort, I've finally found a publisher, and so now I
|
|
have my own magazine! Isn't that awesome?! The first issue will come
|
|
out in September, and we have articles about getting food, and about
|
|
getting in boxes, it's going to be great!</p>
|
|
<footer>
|
|
<p>Written by <a href="/users/cap">cap</a>.
|
|
<time pubdate>2009-08-21T23:32Z</time></p>
|
|
</footer>
|
|
<article>
|
|
<footer> At <time pubdate>2009-08-21T23:35Z</time>, <a href="/users/ch">ch</a> writes: </footer>
|
|
<iframe seamless sandbox srcdoc="<p>did you get a cover picture yet?"></iframe>
|
|
</article>
|
|
<article>
|
|
<footer> At <time pubdate>2009-08-21T23:44Z</time>, <a href="/users/cap">cap</a> writes: </footer>
|
|
<iframe seamless sandbox srcdoc="<p>Yeah, you can see it <a href=&quot;/gallery?mode=cover&amp;amp;page=1&quot;>in my gallery</a>."></iframe>
|
|
</article>
|
|
<article>
|
|
<footer> At <time pubdate>2009-08-21T23:58Z</time>, <a href="/users/ch">ch</a> writes: </footer>
|
|
<iframe seamless sandbox srcdoc="<p>hey that's earl's table.
|
|
<p>you should get earl&amp;amp;me on the next cover."></iframe>
|
|
</article></pre>
|
|
|
|
<p>Notice the way that quotes have to be escaped (otherwise the
|
|
<code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute would
|
|
end prematurely), and the way raw ampersands (e.g. in URLs or in
|
|
prose) mentioned in the sandboxed content have to be
|
|
<em>doubly</em> escaped — once so that the ampersand is
|
|
preserved when originally parsing the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute, and once more
|
|
to prevent the ampersand from being misinterpreted when parsing the
|
|
sandboxed content.</p>
|
|
|
|
</div><p class="note">In <a href="#syntax">the HTML syntax</a>, authors need only
|
|
remember to use U+0022 QUOTATION MARK characters (") to wrap the
|
|
attribute contents and then to escape all U+0022 QUOTATION MARK (")
|
|
and U+0026 AMPERSAND (&) characters, and to specify the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute, to ensure safe
|
|
embedding of content.<p class="note">Due to restrictions of <span>the XML syntax</span>,
|
|
in XML the U+003C LESS-THAN SIGN character (<) needs to be
|
|
escaped as well. In order to prevent <a href="http://www.w3.org/TR/REC-xml/#AVNormalize">attribute-value
|
|
normalization</a>, some of XML's whitespace characters —
|
|
specifically U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED
|
|
(LF), and U+000D CARRIAGE RETURN (CR) — also need to be
|
|
escaped. <a href="#refsXML">[XML]</a><hr><p>The <dfn id="attr-iframe-name" title="attr-iframe-name"><code>name</code></dfn>
|
|
attribute, if present, must be a <a href="#valid-browsing-context-name">valid browsing context
|
|
name</a>. The given value is used to name the <a href="#nested-browsing-context">nested
|
|
browsing context</a>. <span class="impl">When the browsing
|
|
context is created, if the attribute is present, the <a href="#browsing-context-name">browsing
|
|
context name</a> must be set to the value of this attribute;
|
|
otherwise, the <a href="#browsing-context-name">browsing context name</a> must be set to the
|
|
empty string.</span><div class="impl">
|
|
|
|
<p>Whenever the <code title="attr-iframe-name"><a href="#attr-iframe-name">name</a></code> attribute
|
|
is set, the nested <a href="#browsing-context">browsing context</a>'s <a href="#browsing-context-name" title="browsing context name">name</a> must be changed to the new
|
|
value. If the attribute is removed, the <a href="#browsing-context-name">browsing context
|
|
name</a> must be set to the empty string.</p>
|
|
|
|
<p>When content loads in an <code><a href="#the-iframe-element">iframe</a></code>, after any <code title="event-load">load</code> events are fired within the content
|
|
itself, the user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire
|
|
a simple event</a> named <code title="event-load">load</code> at
|
|
the <code><a href="#the-iframe-element">iframe</a></code> element. When content whose <a href="#url">URL</a>
|
|
has the <a href="#same-origin">same origin</a> as the <code><a href="#the-iframe-element">iframe</a></code>
|
|
element's <code><a href="#document">Document</a></code> fails to load (e.g. due to a DNS
|
|
error, network error, or if the server returned a 4xx or 5xx status
|
|
code <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or
|
|
equivalent</a>), then the user agent must <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-error">error</code> at the element instead. (This event
|
|
does not fire for <a href="#parse-error" title="parse error">parse errors</a>,
|
|
script errors, or any errors for cross-origin resources.)</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <a href="#dom-manipulation-task-source">DOM manipulation
|
|
task source</a>.</p>
|
|
|
|
<p class="note">A <code title="event-load">load</code> event is also
|
|
fired at the <code><a href="#the-iframe-element">iframe</a></code> element when it is created if no
|
|
other data is loaded in it.</p>
|
|
|
|
<p>When there is an <a href="#active-parser">active parser</a> in the
|
|
<code><a href="#the-iframe-element">iframe</a></code>, and when anything in the <code><a href="#the-iframe-element">iframe</a></code> is
|
|
<a href="#delay-the-load-event" title="delay the load event">delaying the load event</a> of
|
|
the <code><a href="#the-iframe-element">iframe</a></code>'s <a href="#browsing-context">browsing context</a>'s
|
|
<a href="#active-document">active document</a>, the <code><a href="#the-iframe-element">iframe</a></code> must
|
|
<a href="#delay-the-load-event">delay the load event</a> of its document.</p>
|
|
|
|
<p class="note">If, during the handling of the <code title="event-load">load</code> event, the <a href="#browsing-context">browsing
|
|
context</a> in the <code><a href="#the-iframe-element">iframe</a></code> is again <a href="#navigate" title="navigate">navigated</a>, that will further <a href="#delay-the-load-event">delay the
|
|
load event</a>.</p>
|
|
|
|
</div><hr><p>The <dfn id="attr-iframe-sandbox" title="attr-iframe-sandbox"><code>sandbox</code></dfn>
|
|
attribute, when specified, enables a set of extra restrictions on
|
|
any content hosted by the <code><a href="#the-iframe-element">iframe</a></code>. Its value must be an
|
|
<a href="#unordered-set-of-unique-space-separated-tokens">unordered set of unique space-separated tokens</a> that are
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a>. The allowed values are <code title="attr-iframe-sandbox-allow-same-origin"><a href="#attr-iframe-sandbox-allow-same-origin">allow-same-origin</a></code>,
|
|
<code title="attr-iframe-sandbox-allow-top-navigation"><a href="#attr-iframe-sandbox-allow-top-navigation">allow-top-navigation</a></code>,
|
|
<code title="attr-iframe-sandbox-allow-forms"><a href="#attr-iframe-sandbox-allow-forms">allow-forms</a></code>,
|
|
and <code title="attr-iframe-sandbox-allow-scripts"><a href="#attr-iframe-sandbox-allow-scripts">allow-scripts</a></code>. When
|
|
the attribute is set, the content is treated as being from a unique
|
|
<a href="#origin">origin</a>, forms and scripts are disabled, links are
|
|
prevented from targeting other <a href="#browsing-context" title="browsing
|
|
context">browsing contexts</a>, and plugins are disabled. The
|
|
<code title="attr-iframe-sandbox-allow-same-origin"><a href="#attr-iframe-sandbox-allow-same-origin">allow-same-origin</a></code>
|
|
keyword allows the content to be treated as being from the same
|
|
origin instead of forcing it into a unique origin, the <code title="attr-iframe-sandbox-allow-top-navigation"><a href="#attr-iframe-sandbox-allow-top-navigation">allow-top-navigation</a></code>
|
|
keyword allows the content to <a href="#navigate">navigate</a> its
|
|
<a href="#top-level-browsing-context">top-level browsing context</a>, and the <code title="attr-iframe-sandbox-allow-forms"><a href="#attr-iframe-sandbox-allow-forms">allow-forms</a></code> and <code title="attr-iframe-sandbox-allow-scripts"><a href="#attr-iframe-sandbox-allow-scripts">allow-scripts</a></code>
|
|
keywords re-enable forms and scripts respectively (though scripts
|
|
are still prevented from creating popups).<p class="warning">Setting both the <code title="attr-iframe-sandbox-allow-scripts"><a href="#attr-iframe-sandbox-allow-scripts">allow-scripts</a></code> and
|
|
<code title="attr-iframe-sandbox-allow-same-origin"><a href="#attr-iframe-sandbox-allow-same-origin">allow-same-origin</a></code>
|
|
keywords together when the embedded page has the <a href="#same-origin">same
|
|
origin</a> as the page containing the <code><a href="#the-iframe-element">iframe</a></code> allows
|
|
the embedded page to simply remove the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute.<p class="warning">Sandboxing hostile content is of minimal help if
|
|
an attacker can convince the user to just visit the hostile content
|
|
directly, rather than in the <code><a href="#the-iframe-element">iframe</a></code>. To limit the
|
|
damage that can be caused by hostile HTML content, it should be
|
|
served using the <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> MIME type.<div class="impl">
|
|
|
|
|
|
<p>While the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code>
|
|
attribute is specified, the <code><a href="#the-iframe-element">iframe</a></code> element's
|
|
<a href="#nested-browsing-context">nested browsing context</a> must have the flags given in
|
|
the following list set. In addition, any browsing contexts <a href="#nested-browsing-context" title="nested browsing context">nested</a> within an
|
|
<code><a href="#the-iframe-element">iframe</a></code>, either directly or indirectly, must have all
|
|
the flags set on them as were set on the <code><a href="#the-iframe-element">iframe</a></code>'s
|
|
<code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> when the
|
|
<code><a href="#the-iframe-element">iframe</a></code>'s <code><a href="#document">Document</a></code> was created.</p>
|
|
|
|
<dl><dt>The <dfn id="sandboxed-navigation-browsing-context-flag">sandboxed navigation browsing context flag</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>This flag <a href="#sandboxLinks">prevents content from
|
|
navigating browsing contexts other than the sandboxed browsing
|
|
context itself</a> (or browsing contexts further nested inside
|
|
it), and the <a href="#top-level-browsing-context">top-level browsing context</a> (which is
|
|
protected by the <a href="#sandboxed-top-level-navigation-browsing-context-flag">sandboxed top-level navigation browsing
|
|
context flag</a> defined next).</p>
|
|
|
|
<p>This flag also <a href="#sandboxWindowOpen">prevents content
|
|
from creating new auxiliary browsing contexts</a>, e.g. using the
|
|
<code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code> attribute or the
|
|
<code title="dom-open"><a href="#dom-open">window.open()</a></code> method.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>The <dfn id="sandboxed-top-level-navigation-browsing-context-flag">sandboxed top-level navigation browsing context
|
|
flag</dfn>, unless the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute's value, when
|
|
<a href="#split-a-string-on-spaces" title="split a string on spaces">split on spaces</a>, is
|
|
found to have the <dfn id="attr-iframe-sandbox-allow-top-navigation" title="attr-iframe-sandbox-allow-top-navigation"><code>allow-top-navigation</code></dfn>
|
|
keyword set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>This flag <a href="#sandboxLinks">prevents content from
|
|
navigating their <span>top-level browsing context</span></a>.</p>
|
|
|
|
<p>When the <code title="attr-iframe-sandbox-allow-top-navigation"><a href="#attr-iframe-sandbox-allow-top-navigation">allow-top-navigation</a></code>
|
|
is set, content can navigate its <a href="#top-level-browsing-context">top-level browsing
|
|
context</a>, but other <a href="#browsing-context" title="browsing context">browsing
|
|
contexts</a> are still protected by the <a href="#sandboxed-navigation-browsing-context-flag">sandboxed
|
|
navigation browsing context flag</a> defined above.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>The <dfn id="sandboxed-plugins-browsing-context-flag">sandboxed plugins browsing context flag</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>This flag prevents content from instantiating <a href="#plugin" title="plugin">plugins</a>, whether using <a href="#sandboxPluginEmbed">the <code>embed</code> element</a>, <a href="#sandboxPluginObject">the <code>object</code> element</a>,
|
|
<a href="#sandboxPluginApplet">the <code>applet</code>
|
|
element</a>, or through <a href="#sandboxPluginNavigate">navigation</a> of a <a href="#nested-browsing-context">nested
|
|
browsing context</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>The <dfn id="sandboxed-seamless-iframes-flag">sandboxed seamless iframes flag</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>This flag prevents content from using the <code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">seamless</a></code> attribute on
|
|
descendant <code><a href="#the-iframe-element">iframe</a></code> elements.</p>
|
|
|
|
<p class="note">This prevents a page inserted using the <code title="attr-iframe-sandbox-allow-same-origin"><a href="#attr-iframe-sandbox-allow-same-origin">allow-same-origin</a></code>
|
|
keyword from using a CSS-selector-based method of probing the DOM
|
|
of other pages on the same site (in particular, pages that contain
|
|
user-sensitive information).</p>
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>The <dfn id="sandboxed-origin-browsing-context-flag">sandboxed origin browsing context flag</dfn>, unless
|
|
the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute's
|
|
value, when <a href="#split-a-string-on-spaces" title="split a string on spaces">split on
|
|
spaces</a>, is found to have the <dfn id="attr-iframe-sandbox-allow-same-origin" title="attr-iframe-sandbox-allow-same-origin"><code>allow-same-origin</code></dfn>
|
|
keyword set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>This flag <a href="#sandboxOrigin">forces content into a unique
|
|
origin</a>, thus preventing it from accessing other content from
|
|
the same <a href="#origin">origin</a>.</p>
|
|
|
|
<p>This flag also <a href="#sandboxCookies">prevents script from
|
|
reading from or writing to the <code title="dom-document-cookie">document.cookie</code> IDL
|
|
attribute</a>, and blocks access to <code title="dom-localStorage">localStorage</code>.
|
|
|
|
<a href="#refsWEBSTORAGE">[WEBSTORAGE]</a>
|
|
|
|
</p>
|
|
|
|
<div class="note">
|
|
|
|
<p>The <code title="attr-iframe-sandbox-allow-same-origin"><a href="#attr-iframe-sandbox-allow-same-origin">allow-same-origin</a></code>
|
|
attribute is intended for two cases.</p>
|
|
|
|
<p>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.</p>
|
|
|
|
<p>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.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>The <dfn id="sandboxed-forms-browsing-context-flag">sandboxed forms browsing context flag</dfn>, unless
|
|
the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute's
|
|
value, when <a href="#split-a-string-on-spaces" title="split a string on spaces">split on
|
|
spaces</a>, is found to have the <dfn id="attr-iframe-sandbox-allow-forms" title="attr-iframe-sandbox-allow-forms"><code>allow-forms</code></dfn>
|
|
keyword set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>This flag <a href="#sandboxSubmitBlocked">blocks form
|
|
submission</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>The <dfn id="sandboxed-scripts-browsing-context-flag">sandboxed scripts browsing context flag</dfn>, unless
|
|
the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute's
|
|
value, when <a href="#split-a-string-on-spaces" title="split a string on spaces">split on
|
|
spaces</a>, is found to have the <dfn id="attr-iframe-sandbox-allow-scripts" title="attr-iframe-sandbox-allow-scripts"><code>allow-scripts</code></dfn>
|
|
keyword set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>This flag <a href="#sandboxScriptBlocked">blocks script
|
|
execution</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>The <dfn id="sandboxed-automatic-features-browsing-context-flag">sandboxed automatic features browsing context
|
|
flag</dfn>, unless the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute's value, when
|
|
<a href="#split-a-string-on-spaces" title="split a string on spaces">split on spaces</a>, is
|
|
found to have the <code title="attr-iframe-sandbox-allow-scripts"><a href="#attr-iframe-sandbox-allow-scripts">allow-scripts</a></code>
|
|
keyword (defined above) set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>This flag blocks features that trigger automatically, such as
|
|
<a href="#attr-media-autoplay" title="attr-media-autoplay">automatically playing a
|
|
video</a> or <a href="#attr-fe-autofocus" title="attr-fe-autofocus">automatically
|
|
focusing a form control</a>. It is relaxed by the same flag as
|
|
scripts, because when scripts are enabled these features are
|
|
trivially possible anyway, and it would be unfortunate to force
|
|
authors to use script to do them when sandboxed rather than
|
|
allowing them to use the declarative features.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>These flags must not be set unless the conditions listed above
|
|
define them as being set.</p>
|
|
|
|
<p class="warning">These flags only take effect when the
|
|
<a href="#nested-browsing-context">nested browsing context</a> of the <code><a href="#the-iframe-element">iframe</a></code> is
|
|
<a href="#navigate" title="navigate">navigated</a>. Removing them, or removing
|
|
the entire <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code>
|
|
attribute, has no effect on an already-loaded page.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>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).</p>
|
|
|
|
<pre><p>We're not scared of you! Here is your content, unedited:</p>
|
|
<iframe sandbox src="getusercontent.cgi?id=12193"></iframe></pre>
|
|
|
|
<p>Note that cookies are still sent to the server in the <code title="">getusercontent.cgi</code> request, though they are not
|
|
visible in the <code title="dom-document-cookie"><a href="#dom-document-cookie">document.cookie</a></code> IDL
|
|
attribute.</p>
|
|
|
|
<p class="warning">It is important that the server serve the
|
|
user-provided HTML using the <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> MIME
|
|
type so that if the attacker convinces the user to visit that page
|
|
directly, the page doesn't run in the context of the site's origin,
|
|
which would make the user vulnerable to any attack found in the
|
|
page.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>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.</p>
|
|
|
|
<pre><iframe sandbox="allow-same-origin allow-forms allow-scripts"
|
|
src="http://maps.example.com/embedded.html"></iframe></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Suppose a file A contained the following fragment:</p>
|
|
|
|
<pre><iframe sandbox="allow-same-origin allow-forms" src=B></iframe></pre>
|
|
|
|
<p>Suppose that file B contained an iframe also:</p>
|
|
|
|
<pre><iframe sandbox="allow-scripts" src=C></iframe></pre>
|
|
|
|
<p>Further, suppose that file C contained a link:</p>
|
|
|
|
<pre><a href=D>Link</a></pre>
|
|
|
|
<p>For this example, suppose all the files were served as
|
|
<code><a href="#text-html">text/html</a></code>.</p>
|
|
|
|
<p>Page C in this scenario has all the sandboxing flags
|
|
set. Scripts are disabled, because the <code><a href="#the-iframe-element">iframe</a></code> in A has
|
|
scripts disabled, and this overrides the <code title="attr-iframe-sandbox-allow-scripts"><a href="#attr-iframe-sandbox-allow-scripts">allow-scripts</a></code>
|
|
keyword set on the <code><a href="#the-iframe-element">iframe</a></code> in B. Forms are also
|
|
disabled, because the inner <code><a href="#the-iframe-element">iframe</a></code> (in B) does not
|
|
have the <code title="attr-iframe-sandbox-allow-forms"><a href="#attr-iframe-sandbox-allow-forms">allow-forms</a></code> keyword
|
|
set.</p>
|
|
|
|
<p>Suppose now that a script in A removes all the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attributes in A and
|
|
B. This would change nothing immediately. If the user clicked the
|
|
link in C, loading page D into the <code><a href="#the-iframe-element">iframe</a></code> in B, page D
|
|
would now act as if the <code><a href="#the-iframe-element">iframe</a></code> in B had the <code title="attr-iframe-sandbox-allow-same-origin"><a href="#attr-iframe-sandbox-allow-same-origin">allow-same-origin</a></code>
|
|
and <code title="attr-iframe-sandbox-allow-forms"><a href="#attr-iframe-sandbox-allow-forms">allow-forms</a></code> keywords
|
|
set, because that was the state of the <a href="#nested-browsing-context">nested browsing
|
|
context</a> in the <code><a href="#the-iframe-element">iframe</a></code> in A when page B was
|
|
loaded.</p>
|
|
|
|
<p>Generally speaking, dynamically removing or changing the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute is
|
|
ill-advised, because it can make it quite hard to reason about what
|
|
will be allowed and what will not.</p>
|
|
|
|
</div><p class="note">Potentially hostile files can be served from the
|
|
same server as the file containing the <code><a href="#the-iframe-element">iframe</a></code> element
|
|
by labeling them as <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> instead of
|
|
<code><a href="#text-html">text/html</a></code>. This ensures that scripts in the files are
|
|
unable to attack the site (as if they were actually served from
|
|
another server), even if the user is tricked into visiting those
|
|
pages directly, without the protection of the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute.<p class="warning">If the <code title="attr-iframe-sandbox-allow-scripts"><a href="#attr-iframe-sandbox-allow-scripts">allow-scripts</a></code>
|
|
keyword is set along with <code title="attr-iframe-sandbox-allow-same-origin"><a href="#attr-iframe-sandbox-allow-same-origin">allow-same-origin</a></code>
|
|
keyword, and the file is from the <a href="#same-origin">same origin</a> as the
|
|
<code><a href="#the-iframe-element">iframe</a></code>'s <code><a href="#document">Document</a></code>, then a script in the
|
|
"sandboxed" iframe could just reach out, remove the <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code> attribute, and then
|
|
reload itself, effectively breaking out of the sandbox
|
|
altogether.<hr><p>The <dfn id="attr-iframe-seamless" title="attr-iframe-seamless"><code>seamless</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. When specified, it
|
|
indicates that the <code><a href="#the-iframe-element">iframe</a></code> element's <a href="#browsing-context">browsing
|
|
context</a> is to be rendered in a manner that makes it appear to
|
|
be part of the containing document (seamlessly included in the
|
|
parent document). <span class="impl">Specifically, when the
|
|
attribute is set on an <code><a href="#the-iframe-element">iframe</a></code> element whose owner
|
|
<code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> did not have
|
|
the <a href="#sandboxed-seamless-iframes-flag">sandboxed seamless iframes flag</a> set when that
|
|
<code><a href="#document">Document</a></code> was created, and while either the
|
|
<a href="#browsing-context">browsing context</a>'s <a href="#active-document">active document</a> has the
|
|
<a href="#same-origin">same origin</a> as the <code><a href="#the-iframe-element">iframe</a></code> element's
|
|
document, or the <a href="#browsing-context">browsing context</a>'s <a href="#active-document">active
|
|
document</a>'s <em><a href="#the-document-s-address" title="the document's
|
|
address">address</a></em> has the <a href="#same-origin">same origin</a> as the
|
|
<code><a href="#the-iframe-element">iframe</a></code> element's document, or the <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#active-document">active document</a> is <a href="#an-iframe-srcdoc-document">an
|
|
<code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code>
|
|
document</a>, the following requirements apply:</span><div class="impl">
|
|
|
|
<ul><li><p>The user agent must set the <dfn id="seamless-browsing-context-flag">seamless browsing context
|
|
flag</dfn> to true for that <a href="#browsing-context">browsing context</a>. This
|
|
will <a href="#seamlessLinks">cause links to open in the parent
|
|
browsing context</a> unless an <a href="#explicit-self-navigation-override">explicit self-navigation
|
|
override</a> is used (<code title="">target="_self"</code>).</li>
|
|
|
|
<li><p>In a CSS-supporting user agent: the user agent must add all
|
|
the style sheets that apply to the <code><a href="#the-iframe-element">iframe</a></code> element to
|
|
the cascade of the <a href="#active-document">active document</a> of the
|
|
<code><a href="#the-iframe-element">iframe</a></code> element's <a href="#nested-browsing-context">nested browsing context</a>,
|
|
at the appropriate cascade levels, before any style sheets
|
|
specified by the document itself.</li>
|
|
|
|
<li><p>In a CSS-supporting user agent: the user agent must, for the
|
|
purpose of CSS property inheritance only, treat the root element of
|
|
the <a href="#active-document">active document</a> of the <code><a href="#the-iframe-element">iframe</a></code>
|
|
element's <a href="#nested-browsing-context">nested browsing context</a> as being a child of
|
|
the <code><a href="#the-iframe-element">iframe</a></code> element. (Thus inherited properties on the
|
|
root element of the document in the <code><a href="#the-iframe-element">iframe</a></code> will
|
|
inherit the computed values of those properties on the
|
|
<code><a href="#the-iframe-element">iframe</a></code> element instead of taking their initial
|
|
values.)</li>
|
|
|
|
<li><p>In visual media, in a CSS-supporting user agent: the user agent
|
|
should set the intrinsic width of the <code><a href="#the-iframe-element">iframe</a></code> to the
|
|
width that the element would have if it was a non-replaced
|
|
block-level element with 'width: auto'.</li>
|
|
|
|
<li><p>In visual media, in a CSS-supporting user agent: the user
|
|
agent should set the intrinsic height of the <code><a href="#the-iframe-element">iframe</a></code> to
|
|
the height of the bounding box around the content rendered in the
|
|
<code><a href="#the-iframe-element">iframe</a></code> at its current width (as given in the previous
|
|
bullet point), as it would be if the scrolling position was such
|
|
that the top of the viewport for the content rendered in the
|
|
<code><a href="#the-iframe-element">iframe</a></code> was aligned with the origin of that content's
|
|
canvas.</li>
|
|
|
|
<li>
|
|
|
|
<p>In visual media, in a CSS-supporting user agent: the user agent
|
|
must force the height of the initial containing block of the
|
|
<a href="#active-document">active document</a> of the <a href="#nested-browsing-context">nested browsing
|
|
context</a> of the <code><a href="#the-iframe-element">iframe</a></code> to zero.</p>
|
|
|
|
<p class="note">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.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>In speech media, the user agent should render the <a href="#nested-browsing-context">nested
|
|
browsing context</a> without announcing that it is a separate
|
|
document.</li>
|
|
|
|
<li>
|
|
|
|
<p>User agents should, in general, act as if the <a href="#active-document">active
|
|
document</a> of the <code><a href="#the-iframe-element">iframe</a></code>'s <a href="#nested-browsing-context">nested browsing
|
|
context</a> was part of the document that the
|
|
<code><a href="#the-iframe-element">iframe</a></code> is in, if any.</p>
|
|
|
|
<p class="example">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.</p>
|
|
|
|
</li>
|
|
|
|
</ul><p>If the attribute is not specified, or if the <a href="#origin">origin</a>
|
|
conditions listed above are not met, then the user agent should
|
|
render the <a href="#nested-browsing-context">nested browsing context</a> in a manner that is
|
|
clearly distinguishable as a separate <a href="#browsing-context">browsing context</a>,
|
|
and the <a href="#seamless-browsing-context-flag">seamless browsing context flag</a> must be set to
|
|
false for that <a href="#browsing-context">browsing context</a>.</p>
|
|
|
|
<p class="warning">It is important that user agents recheck the
|
|
above conditions whenever the <a href="#active-document">active document</a> of the
|
|
<a href="#nested-browsing-context">nested browsing context</a> of the <code><a href="#the-iframe-element">iframe</a></code>
|
|
changes, such that the <a href="#seamless-browsing-context-flag">seamless browsing context flag</a>
|
|
gets unset if the <a href="#nested-browsing-context">nested browsing context</a> is <a href="#navigate" title="navigate">navigated</a> to another origin.</p>
|
|
|
|
</div><p class="note">The attribute can be set or removed dynamically,
|
|
with the rendering updating in tandem.<div class="example">
|
|
|
|
<p>In this example, the site's navigation is embedded using a
|
|
client-side include using an <code><a href="#the-iframe-element">iframe</a></code>. Any links in the
|
|
<code><a href="#the-iframe-element">iframe</a></code> will, in new user agents, be automatically
|
|
opened in the <code><a href="#the-iframe-element">iframe</a></code>'s parent browsing context; for
|
|
legacy user agents, the site could also include a <code><a href="#the-base-element">base</a></code>
|
|
element with a <code title="attr-base-target"><a href="#attr-base-target">target</a></code>
|
|
attribute with the value <code title="">_parent</code>. 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.</p>
|
|
|
|
<pre><nav><iframe seamless src="nav.include.html"></iframe></nav></pre>
|
|
|
|
</div><hr><p>The <code><a href="#the-iframe-element">iframe</a></code> element supports <a href="#dimension-attributes">dimension
|
|
attributes</a> for cases where the embedded content has specific
|
|
dimensions (e.g. ad units have well-defined dimensions).<p>An <code><a href="#the-iframe-element">iframe</a></code> element never has <a href="#fallback-content">fallback
|
|
content</a>, as it will always create a nested <a href="#browsing-context">browsing
|
|
context</a>, regardless of whether the specified initial contents
|
|
are successfully used.<p>Descendants of <code><a href="#the-iframe-element">iframe</a></code> elements represent
|
|
nothing. (In legacy user agents that do not support
|
|
<code><a href="#the-iframe-element">iframe</a></code> elements, the contents would be parsed as markup
|
|
that could act as fallback content.)<p id="iframe-content-model">When used in <a href="#html-documents">HTML
|
|
documents</a>, the allowed content model of <code><a href="#the-iframe-element">iframe</a></code>
|
|
elements is text, except that invoking the <a href="#html-fragment-parsing-algorithm">HTML fragment
|
|
parsing algorithm</a> with the <code><a href="#the-iframe-element">iframe</a></code> element as the
|
|
<var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element and
|
|
the text contents as the <var title="">input</var> must result in a
|
|
list of nodes that are all <a href="#phrasing-content">phrasing content</a>, with no
|
|
<a href="#parse-error" title="parse error">parse errors</a> having occurred, with
|
|
no <code><a href="#the-script-element">script</a></code> elements being anywhere in the list or as
|
|
descendants of elements in the list, and with all the elements in
|
|
the list (including their descendants) being themselves
|
|
conforming.<p>The <code><a href="#the-iframe-element">iframe</a></code> element must be empty in <a href="#xml-documents">XML
|
|
documents</a>.<p class="note">The <a href="#html-parser">HTML parser</a> treats markup inside
|
|
<code><a href="#the-iframe-element">iframe</a></code> elements as text.<div class="impl">
|
|
|
|
<p>The IDL attributes <dfn id="dom-iframe-src" title="dom-iframe-src"><code>src</code></dfn>, <dfn id="dom-iframe-srcdoc" title="dom-iframe-srcdoc"><code>srcdoc</code></dfn>, <dfn id="dom-iframe-name" title="dom-iframe-name"><code>name</code></dfn>, <dfn id="dom-iframe-sandbox" title="dom-iframe-sandbox"><code>sandbox</code></dfn>, and <dfn id="dom-iframe-seamless" title="dom-iframe-seamless"><code>seamless</code></dfn> must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
<p>The <dfn id="dom-iframe-contentdocument" title="dom-iframe-contentDocument"><code>contentDocument</code></dfn>
|
|
IDL attribute must return the <code><a href="#document">Document</a></code> object of the
|
|
<a href="#active-document">active document</a> of the <code><a href="#the-iframe-element">iframe</a></code> element's
|
|
<a href="#nested-browsing-context">nested browsing context</a>.</p>
|
|
|
|
<p>The <dfn id="dom-iframe-contentwindow" title="dom-iframe-contentWindow"><code>contentWindow</code></dfn>
|
|
IDL attribute must return the <code><a href="#windowproxy">WindowProxy</a></code> object of the
|
|
<code><a href="#the-iframe-element">iframe</a></code> element's <a href="#nested-browsing-context">nested browsing
|
|
context</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is an example of a page using an <code><a href="#the-iframe-element">iframe</a></code> to
|
|
include advertising from an advertising broker:</p>
|
|
|
|
<pre><iframe src="http://ads.example.com/?customerid=923513721&amp;format=banner"
|
|
width="468" height="60"></iframe></pre>
|
|
|
|
</div><h4 id="the-embed-element"><span class="secno">4.8.3 </span>The <dfn><code>embed</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#embedded-content">Embedded content</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#embedded-content">embedded content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-embed-src"><a href="#attr-embed-src">src</a></code></dd>
|
|
<dd><code title="attr-embed-type"><a href="#attr-embed-type">type</a></code></dd>
|
|
<dd><code title="attr-dim-width"><a href="#attr-dim-width">width</a></code></dd>
|
|
<dd><code title="attr-dim-height"><a href="#attr-dim-height">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="#dom-embed-src" title="dom-embed-src">src</a>;
|
|
attribute DOMString <a href="#dom-embed-type" title="dom-embed-type">type</a>;
|
|
attribute DOMString <a href="#dom-dim-width" title="dom-dim-width">width</a>;
|
|
attribute DOMString <a href="#dom-dim-height" title="dom-dim-height">height</a>;
|
|
};</pre>
|
|
<div class="impl">
|
|
<p>Depending on the type of content instantiated by the
|
|
<code><a href="#the-embed-element">embed</a></code> element, the node may also support other
|
|
interfaces.</p>
|
|
</div>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-embed-element">embed</a></code> element <a href="#represents">represents</a> an
|
|
integration point for an external (typically non-HTML) application
|
|
or interactive content.<p>The <dfn id="attr-embed-src" title="attr-embed-src"><code>src</code></dfn> attribute
|
|
gives the address of the resource being embedded. The attribute, if
|
|
present, must contain a <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially
|
|
surrounded by spaces</a>.<p>The <dfn id="attr-embed-type" title="attr-embed-type"><code>type</code></dfn>
|
|
attribute, if present, gives the <a href="#mime-type">MIME type</a> by which the
|
|
plugin to instantiate is selected. The value must be a <a href="#valid-mime-type">valid
|
|
MIME type</a>. If both the <code title="attr-embed-type"><a href="#attr-embed-type">type</a></code> attribute and the <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code> attribute are present, then the
|
|
<code title="attr-embed-type"><a href="#attr-embed-type">type</a></code> attribute must specify the
|
|
same type as the <a href="#content-type" title="Content-Type">explicit Content-Type
|
|
metadata</a> of the resource given by the <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code> attribute.<div class="impl">
|
|
|
|
<p>When the element is created with neither a <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code> attribute nor a <code title="attr-embed-type"><a href="#attr-embed-type">type</a></code> attribute, and when attributes
|
|
are removed such that neither attribute is present on the element
|
|
anymore, and when the element has a <a href="#media-element">media element</a>
|
|
ancestor, and when the element has an ancestor <code><a href="#the-object-element">object</a></code>
|
|
element that is <em>not</em> showing its <a href="#fallback-content">fallback
|
|
content</a>, any plugins instantiated for the element must be
|
|
removed, and the <code><a href="#the-embed-element">embed</a></code> element represents nothing.</p>
|
|
|
|
<p id="sandboxPluginEmbed">If either:
|
|
|
|
<ul><li>the <a href="#sandboxed-plugins-browsing-context-flag">sandboxed plugins browsing context flag</a> was
|
|
set on the <a href="#browsing-context">browsing context</a> for which the
|
|
<code><a href="#the-embed-element">embed</a></code> element's <code><a href="#document">Document</a></code> is the
|
|
<a href="#active-document">active document</a> when that <code><a href="#document">Document</a></code> was
|
|
created, or</li>
|
|
|
|
<li>the <code><a href="#the-embed-element">embed</a></code> element's <code><a href="#document">Document</a></code> was
|
|
parsed from a resource whose <a href="#content-type-sniffing-0" title="Content-Type
|
|
sniffing">sniffed type</a> as determined during <a href="#navigate" title="navigate">navigation</a> is
|
|
<code><a href="#text-html-sandboxed">text/html-sandboxed</a></code></li>
|
|
|
|
</ul><p>...then the user agent must render the <code><a href="#the-embed-element">embed</a></code> element
|
|
in a manner that conveys that the <a href="#plugin">plugin</a> was
|
|
disabled. The user agent may offer the user the option to override
|
|
the sandbox and instantiate the <a href="#plugin">plugin</a> anyway; if the
|
|
user invokes such an option, the user agent must act as if the
|
|
conditions above did not apply for the purposes of this element.</p>
|
|
|
|
<p class="warning">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.</p>
|
|
|
|
<p>An <code><a href="#the-embed-element">embed</a></code> element is said to be <dfn id="concept-embed-active" title="concept-embed-active">potentially active</dfn> when the
|
|
following conditions are all met simultaneously:</p>
|
|
|
|
<ul class="brief"><li>The element is <a href="#in-a-document" title="in a document">in a <code>Document</code></a>.</li>
|
|
<li>The element's <code><a href="#document">Document</a></code> is <a href="#fully-active">fully active</a>.</li>
|
|
<li>The element has either a <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code> attribute set or a <code title="attr-embed-type"><a href="#attr-embed-type">type</a></code> attribute set (or both).</li>
|
|
<li>The element's <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code> attribute is either absent or its value is the empty string.</li>
|
|
<li>The element is not in a <code><a href="#document">Document</a></code> whose <a href="#browsing-context">browsing context</a> had the <a href="#sandboxed-plugins-browsing-context-flag">sandboxed plugins browsing context flag</a> set when the <code><a href="#document">Document</a></code> was created (unless this has been overridden as described above).</li>
|
|
<li>The element's <code><a href="#document">Document</a></code> was not parsed from a resource whose <a href="#content-type-sniffing-0" title="Content-Type sniffing">sniffed type</a> as determined during <a href="#navigate" title="navigate">navigation</a> is <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> (unless this has been overridden as described above).</li>
|
|
<li>The element is not a descendant of a <a href="#media-element">media element</a>.</li>
|
|
<li>The element is not a descendant of an <code><a href="#the-object-element">object</a></code> element that is not showing its <a href="#fallback-content">fallback content</a>.</li>
|
|
</ul><p>Whenever an <code><a href="#the-embed-element">embed</a></code> element that was not <a href="#concept-embed-active" title="concept-embed-active">potentially active</a> becomes <a href="#concept-embed-active" title="concept-embed-active">potentially active</a>, and whenever
|
|
a <a href="#concept-embed-active" title="concept-embed-active">potentially active</a>
|
|
<code><a href="#the-embed-element">embed</a></code> element's <code title="attr-embed-type"><a href="#attr-embed-type">src</a></code> attribute is set, changed, or
|
|
removed, and whenever a <a href="#concept-embed-active" title="concept-embed-active">potentially active</a>
|
|
<code><a href="#the-embed-element">embed</a></code> element's <code title="attr-embed-type"><a href="#attr-embed-type">type</a></code> attribute is set, changed, or
|
|
removed, the appropriate set of steps from the following is then
|
|
applied:</p>
|
|
|
|
<dl class="switch"><dt>If the element has a <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code>
|
|
attribute set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The user agent must <a href="#resolve-a-url" title="resolve a url">resolve</a>
|
|
the value of the element's <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code>
|
|
attribute, relative to the element. If that is successful, the
|
|
user agent should <a href="#fetch">fetch</a> the resulting <a href="#absolute-url">absolute
|
|
URL</a>, from the element's <a href="#browsing-context-scope-origin">browsing context scope
|
|
origin</a> if it has one. The <a href="#concept-task" title="concept-task">task</a> that is
|
|
<a href="#queue-a-task" title="queue a task">queued</a> by the <a href="#networking-task-source">networking
|
|
task source</a> once the resource has been <a href="#fetch" title="fetch">fetched</a> must find and instantiate an
|
|
appropriate <a href="#plugin">plugin</a> based on the <a href="#concept-embed-type" title="concept-embed-type">content's type</a>, and hand that
|
|
<a href="#plugin">plugin</a> the content of the resource, replacing any
|
|
previously instantiated plugin for the element.</p>
|
|
<p>Fetching the resource must <a href="#delay-the-load-event">delay the load event</a> of
|
|
the element's document.</p>
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>If the element has no <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code>
|
|
attribute set</dt>
|
|
|
|
<dd><p>The user agent should find and instantiate an appropriate
|
|
<a href="#plugin">plugin</a> based on the value of the <code title="attr-embed-type"><a href="#attr-embed-type">type</a></code> attribute.</p>
|
|
|
|
</dl><p>Whenever an <code><a href="#the-embed-element">embed</a></code> element that was <a href="#concept-embed-active" title="concept-embed-active">potentially active</a> stops being
|
|
<a href="#concept-embed-active" title="concept-embed-active">potentially active</a>, any
|
|
<a href="#plugin">plugin</a> that had been instantiated for that element must
|
|
be unloaded.</p>
|
|
|
|
<p class="note">The <code><a href="#the-embed-element">embed</a></code> element is unaffected by the
|
|
CSS 'display' property. The selected plugin is instantiated even if
|
|
the element is hidden with a 'display:none' CSS style.</p>
|
|
|
|
<p>The <dfn id="concept-embed-type" title="concept-embed-type">type of the content</dfn>
|
|
being embedded is defined as follows:</p>
|
|
|
|
<ol><li><p>If the element has a <code title="attr-embed-type"><a href="#attr-embed-type">type</a></code> attribute, and that attribute's
|
|
value is a type that a <a href="#plugin">plugin</a> supports, then the value
|
|
of the <code title="attr-embed-type"><a href="#attr-embed-type">type</a></code> attribute is the
|
|
<a href="#concept-embed-type" title="concept-embed-type">content's type</a>.</li>
|
|
|
|
<li>
|
|
|
|
|
|
<p>Otherwise, if the <a href="#url-path" title="url-path"><path></a>
|
|
component of the <a href="#url">URL</a> of the specified resource (after
|
|
any redirects) matches a pattern that a <a href="#plugin">plugin</a>
|
|
supports, then the <a href="#concept-embed-type" title="concept-embed-type">content's
|
|
type</a> is the type that that plugin can handle.</p>
|
|
|
|
<p class="example">For example, a plugin might say that it can
|
|
handle resources with <a href="#url-path" title="url-path"><path></a>
|
|
components that end with the four character string "<code title="">.swf</code>".</p>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li><p>Otherwise, if the specified resource has <a href="#content-type" title="Content-Type">explicit Content-Type metadata</a>, then
|
|
that is the <a href="#concept-embed-type" title="concept-embed-type">content's
|
|
type</a>.</li>
|
|
|
|
<li><p>Otherwise, the content has no type and there can be no
|
|
appropriate <a href="#plugin">plugin</a> for it.</li>
|
|
|
|
|
|
|
|
</ol><p>The <code><a href="#the-embed-element">embed</a></code> element has no <a href="#fallback-content">fallback
|
|
content</a>. If the user agent can't find a suitable plugin, then
|
|
the user agent must use a default plugin. (This default could be as
|
|
simple as saying "Unsupported Format".)</p>
|
|
|
|
<p>Whether the resource is fetched successfully or not (e.g. whether
|
|
the response code was a 2xx code <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a>) must be
|
|
ignored when determining the resource's type and when handing the
|
|
resource to the plugin.</p>
|
|
|
|
<p class="note">This allows servers to return data for plugins even
|
|
with error responses (e.g. HTTP 500 Internal Server Error codes can
|
|
still contain plugin data).</p>
|
|
|
|
</div><p>Any namespace-less attribute other than <code title="attr-embed-name"><a href="#attr-embed-name">name</a></code>, <code title="attr-embed-align"><a href="#attr-embed-align">align</a></code>, <code title="attr-embed-hspace"><a href="#attr-embed-hspace">hspace</a></code>, and <code title="attr-embed-vspace"><a href="#attr-embed-vspace">vspace</a></code> may be specified on the <code><a href="#the-embed-element">embed</a></code> element,
|
|
so long as its name is <a href="#xml-compatible">XML-compatible</a> and contains no
|
|
characters in the range U+0041 to U+005A (LATIN CAPITAL LETTER A to
|
|
LATIN CAPITAL LETTER Z). These attributes are then passed as
|
|
parameters to the <a href="#plugin">plugin</a>.<p class="note">All attributes in <a href="#html-documents">HTML documents</a> get
|
|
lowercased automatically, so the restriction on uppercase letters
|
|
doesn't affect such documents.<p class="note">The four exceptions are to exclude legacy attributes
|
|
that have side-effects beyond just sending parameters to the
|
|
<a href="#plugin">plugin</a>.<div class="impl">
|
|
|
|
<p>The user agent should pass the names and values of all the
|
|
attributes of the <code><a href="#the-embed-element">embed</a></code> element that have no namespace
|
|
to the <a href="#plugin">plugin</a> used, when it is instantiated.</p>
|
|
|
|
<p>If the <a href="#plugin">plugin</a> instantiated for the
|
|
<code><a href="#the-embed-element">embed</a></code> element supports a scriptable interface, the
|
|
<code><a href="#htmlembedelement">HTMLEmbedElement</a></code> object representing the element should
|
|
expose that interface while the element is instantiated.</p>
|
|
|
|
</div><p>The <code><a href="#the-embed-element">embed</a></code> element supports <a href="#dimension-attributes">dimension
|
|
attributes</a>.<div class="impl">
|
|
|
|
<p>The IDL attributes <dfn id="dom-embed-src" title="dom-embed-src"><code>src</code></dfn> and <dfn id="dom-embed-type" title="dom-embed-type"><code>type</code></dfn> each must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here's a way to embed a resource that requires a proprietary
|
|
plug-in, like Flash:</p>
|
|
|
|
<pre><embed src="catgame.swf"></pre>
|
|
|
|
<p>If the user does not have the plug-in (for example if the
|
|
plug-in vendor doesn't support the user's platform), then the user
|
|
will be unable to use the resource.</p>
|
|
|
|
<p>To pass the plugin a parameter "quality" with the value "high",
|
|
an attribute can be specified:</p>
|
|
|
|
<pre><embed src="catgame.swf" quality="high"></pre>
|
|
|
|
<p>This would be equivalent to the following, when using an
|
|
<code><a href="#the-object-element">object</a></code> element instead:</p>
|
|
|
|
<pre><object data="catgame.swf">
|
|
<param name="quality" value="high">
|
|
</object></pre>
|
|
|
|
</div><h4 id="the-object-element"><span class="secno">4.8.4 </span>The <dfn><code>object</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#embedded-content">Embedded content</a>.</dd>
|
|
<dd>If the element has a <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute: <a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dd><a href="#category-listed" title="category-listed">Listed</a>, <a href="#category-submit" title="category-submit">submittable</a>, <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#embedded-content">embedded content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-param-element">param</a></code> elements, then, <a href="#transparent">transparent</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-object-data"><a href="#attr-object-data">data</a></code></dd>
|
|
<dd><code title="attr-object-type"><a href="#attr-object-type">type</a></code></dd>
|
|
<dd><code title="attr-object-name"><a href="#attr-object-name">name</a></code></dd>
|
|
<dd><code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-dim-width"><a href="#attr-dim-width">width</a></code></dd>
|
|
<dd><code title="attr-dim-height"><a href="#attr-dim-height">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="#dom-object-data" title="dom-object-data">data</a>;
|
|
attribute DOMString <a href="#dom-object-type" title="dom-object-type">type</a>;
|
|
attribute DOMString <a href="#dom-object-name" title="dom-object-name">name</a>;
|
|
attribute DOMString <a href="#dom-object-usemap" title="dom-object-useMap">useMap</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
attribute DOMString <a href="#dom-dim-width" title="dom-dim-width">width</a>;
|
|
attribute DOMString <a href="#dom-dim-height" title="dom-dim-height">height</a>;
|
|
readonly attribute Document <a href="#dom-object-contentdocument" title="dom-object-contentDocument">contentDocument</a>;
|
|
readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-object-contentwindow" title="dom-object-contentWindow">contentWindow</a>;
|
|
|
|
readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
|
|
readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
|
|
readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
|
|
boolean <a href="#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
|
|
void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
|
|
};</pre>
|
|
<div class="impl">
|
|
<p>Depending on the type of content instantiated by the
|
|
<code><a href="#the-object-element">object</a></code> element, the node also supports other
|
|
interfaces.</p>
|
|
</div>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-object-element">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 <a href="#nested-browsing-context">nested browsing context</a>,
|
|
or as an external resource to be processed by a
|
|
<a href="#plugin">plugin</a>.<p>The <dfn id="attr-object-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 <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty
|
|
URL potentially surrounded by spaces</a>.<p>The <dfn id="attr-object-type" title="attr-object-type"><code>type</code></dfn>
|
|
attribute, if present, specifies the type of the resource. If
|
|
present, the attribute must be a <a href="#valid-mime-type">valid MIME type</a>.<p>At least one of either the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute or the <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute must be present.<p>The <dfn id="attr-object-name" title="attr-object-name"><code>name</code></dfn>
|
|
attribute, if present, must be a <a href="#valid-browsing-context-name">valid browsing context
|
|
name</a>. The given value is used to name the <a href="#nested-browsing-context">nested
|
|
browsing context</a>, if applicable.<div class="impl">
|
|
|
|
<p>When the element is created, when it is popped off the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> of an <a href="#html-parser">HTML parser</a>
|
|
or <a href="#xml-parser">XML parser</a>, and subsequently whenever the element is
|
|
<a href="#insert-an-element-into-a-document" title="insert an element into a document">inserted into a
|
|
document</a> or <a href="#remove-an-element-from-a-document" title="remove an element from a
|
|
document">removed from a document</a>; and whenever the element's
|
|
<code><a href="#document">Document</a></code> changes whether it is <a href="#fully-active">fully
|
|
active</a>; and whenever an ancestor <code><a href="#the-object-element">object</a></code> element
|
|
changes to or from showing its <a href="#fallback-content">fallback content</a>; and
|
|
whenever the element's <code title="attr-object-classid"><a href="#attr-object-classid">classid</a></code> attribute is set,
|
|
changed, or removed; and, when its <code title="attr-object-classid"><a href="#attr-object-classid">classid</a></code> attribute is not present,
|
|
whenever its <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute is
|
|
set, changed, or removed; and, when neither its <code title="attr-object-classid"><a href="#attr-object-classid">classid</a></code> attribute nor its <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute are present, whenever
|
|
its <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute is set,
|
|
changed, or removed: the user agent must <a href="#queue-a-task">queue a task</a>
|
|
to run the following steps to (re)determine what the
|
|
<code><a href="#the-object-element">object</a></code> element represents. The <a href="#task-source">task source</a>
|
|
for this <a href="#concept-task" title="concept-task">task</a> is the <a href="#dom-manipulation-task-source">DOM
|
|
manipulation task source</a>.</p>
|
|
<ol><li>
|
|
|
|
<p>If the user has indicated a preference that this
|
|
<code><a href="#the-object-element">object</a></code> element's <a href="#fallback-content">fallback content</a> be
|
|
shown instead of the element's usual behavior, then jump to the
|
|
last step in the overall set of steps (fallback).</p>
|
|
|
|
<p class="note">For example, a user could ask for the element's
|
|
<a href="#fallback-content">fallback content</a> to be shown because that content
|
|
uses a format that the user finds more accessible.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the element has an ancestor <a href="#media-element">media element</a>, or
|
|
has an ancestor <code><a href="#the-object-element">object</a></code> element that is <em>not</em>
|
|
showing its <a href="#fallback-content">fallback content</a>, or if the element is
|
|
not <a href="#in-a-document" title="in a document">in a <code>Document</code></a>
|
|
with a <a href="#browsing-context">browsing context</a>, or if the element's
|
|
<code><a href="#document">Document</a></code> is not <a href="#fully-active">fully active</a>, or if the
|
|
element is still in the <a href="#stack-of-open-elements">stack of open elements</a> of an
|
|
<a href="#html-parser">HTML parser</a> or <a href="#xml-parser">XML parser</a>, then jump to
|
|
the last step in the overall set of steps (fallback).</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
|
|
<p>If the <code title="attr-object-classid"><a href="#attr-object-classid">classid</a></code>
|
|
attribute is present, and has a value that isn't the empty string,
|
|
then: if the user agent can find a <a href="#plugin">plugin</a> suitable
|
|
according to the value of the <code title="attr-object-classid"><a href="#attr-object-classid">classid</a></code> attribute, and <a href="#sandboxPluginObject">plugins aren't being sandboxed</a>,
|
|
then that <a href="#plugin">plugin</a> <a href="#object-plugin">should be
|
|
used</a>, and the value of the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute, if any, should be
|
|
passed to the <a href="#plugin">plugin</a>. If no suitable
|
|
<a href="#plugin">plugin</a> can be found, or if the <a href="#plugin">plugin</a>
|
|
reports an error, jump to the last step in the overall set of
|
|
steps (fallback).</p>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<li><p>If the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute
|
|
is present and its value is not the empty string, then:</p>
|
|
|
|
<ol><li><p>If the <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
|
|
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
|
|
<a href="#plugin">plugin</a> for, then the user agent may jump to the last
|
|
step in the overall set of steps (fallback) without fetching the
|
|
content to examine its real type.</li>
|
|
|
|
<li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the
|
|
<a href="#url">URL</a> specified by the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute, relative to the
|
|
element.</li>
|
|
|
|
<li><p>If that failed, <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-error">error</code> at the element, then jump
|
|
to the last step in the overall set of steps (fallback).</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#fetch">Fetch</a> the resulting <a href="#absolute-url">absolute URL</a>,
|
|
from the element's <a href="#browsing-context-scope-origin">browsing context scope origin</a> if
|
|
it has one.</p>
|
|
|
|
<p>Fetching the resource
|
|
must <a href="#delay-the-load-event">delay the load event</a> of the element's document
|
|
until the <a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue a task">queued</a> by the <a href="#networking-task-source">networking task
|
|
source</a> once the resource has been <a href="#fetch" title="fetch">fetched</a> (defined next) has been run.</p>
|
|
|
|
<p>For the purposes of the <a href="#application-cache">application cache</a>
|
|
networking model, this <a href="#fetch">fetch</a> operation is not for a
|
|
<a href="#child-browsing-context">child browsing context</a> (though it might end up
|
|
being used for one after all, as defined below).</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 the last step in the overall set of steps (fallback). The
|
|
<a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue
|
|
a task">queued</a> by the <a href="#networking-task-source">networking task source</a>
|
|
once the resource is available must 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.</li>
|
|
|
|
<li><p>If the load failed (e.g. there was an HTTP 404 error,
|
|
there was a DNS error), <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-error">error</code> at the element, then jump
|
|
to the last step in the overall set of steps (fallback).</li>
|
|
|
|
<li id="object-type-detection">
|
|
|
|
<p>Determine the <var title="">resource type</var>, as follows:</p>
|
|
|
|
|
|
<ol><li>
|
|
|
|
<p>Let the <var title="">resource type</var> be unknown.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<p>If the user agent is configured to strictly obey
|
|
Content-Type headers for this resource, and the resource has
|
|
<a href="#content-type" title="Content-Type">associated Content-Type
|
|
metadata</a>, then let the <var title="">resource
|
|
type</var> be the type specified in <a href="#content-type" title="Content-Type">the resource's Content-Type
|
|
metadata</a>, and jump to the step below labeled
|
|
<i>handler</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is a <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
|
|
attribute present on the <code><a href="#the-object-element">object</a></code> element, and that
|
|
attribute's value is not a type that the user agent supports,
|
|
but it <em>is</em> a type that a <a href="#plugin">plugin</a> supports,
|
|
then let the <var title="">resource type</var> be the type
|
|
specified in that <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
|
|
attribute, and jump to the step below labeled
|
|
<i>handler</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Run the approprate set of steps from the following
|
|
list:</p>
|
|
|
|
<dl class="switch"><dt>The resource has <a href="#content-type" title="Content-Type">associated
|
|
Content-Type metadata</a></dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">binary</var> be false.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the type specified in <a href="#content-type" title="Content-Type">the
|
|
resource's Content-Type metadata</a> is
|
|
"<code>text/plain</code>", and the result of applying the
|
|
<a href="#content-type-sniffing:-text-or-binary" title="Content-Type sniffing: text or binary">rules
|
|
for distinguishing if a resource is text or binary</a>
|
|
to the resource is that the resource is not
|
|
<code>text/plain</code>, then set <var title="">binary</var> to true.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the type specified in <a href="#content-type" title="Content-Type">the
|
|
resource's Content-Type metadata</a> is
|
|
"<code>application/octet-stream</code>", then set <var title="">binary</var> to true.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">binary</var> is false, then let the
|
|
<var title="">resource type</var> be the type specified in
|
|
<a href="#content-type" title="Content-Type">the resource's Content-Type
|
|
metadata</a>, and jump to the step below labeled
|
|
<i>handler</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is a <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute present on
|
|
the <code><a href="#the-object-element">object</a></code> element, and its value is not
|
|
<code>application/octet-stream</code>, then run the
|
|
following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the attribute's value is a type that a <a href="#plugin">plugin</a> supports, or
|
|
the attribute's value is a type that starts with "<code>image/</code>" that is not also an <a href="#xml-mime-type">XML MIME type</a>,
|
|
then let the <var title="">resource type</var> be the type specified in that <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Jump to the step below labeled <i>handler</i>.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>The resource does not have <a href="#content-type" title="Content-Type">associated Content-Type
|
|
metadata</a></dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li>
|
|
|
|
<p>If there is a <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute present on
|
|
the <code><a href="#the-object-element">object</a></code> element, then let the <var title="">tentative type</var> be the type specified in that
|
|
<code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute.</p>
|
|
|
|
<p>Otherwise, let <var title="">tentative type</var> be the
|
|
<a href="#content-type-sniffing-0" title="content-type sniffing">sniffed type of the
|
|
resource</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">tentative type</var> is <em>not</em>
|
|
<code>application/octet-stream</code>, then let <var title="">resource type</var> be <var title="">tentative
|
|
type</var> and jump to the step below labeled
|
|
<i>handler</i>.</p>
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
|
|
<p>If the <a href="#url-path" title="url-path"><path></a> component
|
|
of the <a href="#url">URL</a> of the specified resource (after any
|
|
redirects) matches a pattern that a <a href="#plugin">plugin</a>
|
|
supports, then let <var title="">resource type</var> be the
|
|
type that that plugin can handle.</p>
|
|
|
|
<p class="example">For example, a plugin might say that it can
|
|
handle resources with <a href="#url-path" title="url-path"><path></a> components that end with
|
|
the four character string "<code title="">.swf</code>".</p>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ol><p class="note">It is possible for this step to finish with <var title="">resource type</var> still being unknown, or for one of
|
|
the substeps above to jump straight to the next step. In both
|
|
cases, the next step will trigger fallback.</p>
|
|
|
|
</li>
|
|
|
|
<li><p><i>Handler</i>: Handle the content as given by the first
|
|
of the following cases that matches:</p>
|
|
|
|
<dl class="switch"><dt>If the <var title="">resource type</var> is not a type that
|
|
the user agent supports, but it <em>is</em> a type that a
|
|
<a href="#plugin">plugin</a> supports</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If <a href="#sandboxPluginObject">plugins are being
|
|
sandboxed</a>, jump to the last step in the overall set of
|
|
steps (fallback).</p>
|
|
|
|
<p>Otherwise, the user agent should <a href="#object-plugin">use the plugin that supports <var title="">resource type</var></a> and pass the content of the
|
|
resource to that <a href="#plugin">plugin</a>. If the
|
|
<a href="#plugin">plugin</a> reports an error, then jump to the last
|
|
step in the overall set of steps (fallback).</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the <var title="">resource type</var> is an <a href="#xml-mime-type">XML MIME
|
|
type</a>, or
|
|
|
|
if the <var title="">resource type</var> does not start with
|
|
"<code>image/</code>"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code><a href="#the-object-element">object</a></code> element must be associated with a
|
|
newly created <a href="#nested-browsing-context">nested browsing context</a>, if it does
|
|
not already have one.</p>
|
|
|
|
<p>If the <a href="#url">URL</a> of the given resource is not
|
|
<code><a href="#about:blank">about:blank</a></code>, the element's <a href="#nested-browsing-context">nested browsing
|
|
context</a> must then be <a href="#navigate" title="navigate">navigated</a> to that
|
|
resource, with <a href="#replacement-enabled">replacement enabled</a>, and with the
|
|
<code><a href="#the-object-element">object</a></code> element's document's <a href="#browsing-context">browsing
|
|
context</a> as the <a href="#source-browsing-context">source browsing context</a>.
|
|
(The <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute of
|
|
the <code><a href="#the-object-element">object</a></code> element doesn't get updated if the
|
|
browsing context gets further navigated to other
|
|
locations.)</p>
|
|
|
|
<p>If the <a href="#url">URL</a> of the given resource <em>is</em>
|
|
<code><a href="#about:blank">about:blank</a></code>, then, instead, the user agent must
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-load">load</code> at the
|
|
<code><a href="#the-object-element">object</a></code> element.</p>
|
|
|
|
<p>The <code><a href="#the-object-element">object</a></code> element <a href="#represents">represents</a> the
|
|
<a href="#nested-browsing-context">nested browsing context</a>.</p>
|
|
|
|
<p>If the <code title="attr-object-name"><a href="#attr-object-name">name</a></code> attribute
|
|
is present, the <a href="#browsing-context-name">browsing context name</a> must be set
|
|
to the value of this attribute; otherwise, the <a href="#browsing-context-name">browsing
|
|
context name</a> must be set to the empty string.</p>
|
|
|
|
<p class="note">In certain situations, e.g. if the resource
|
|
was <a href="#fetch" title="fetch">fetched</a> from an
|
|
<a href="#application-cache">application cache</a> but it is an HTML file with a
|
|
<code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attribute
|
|
that points to a different <a href="#concept-appcache-manifest" title="concept-appcache-manifest">application cache
|
|
manifest</a>, the <a href="#navigate" title="navigate">navigation</a>
|
|
of the <a href="#browsing-context">browsing context</a> will be restarted so as
|
|
to load the resource afresh from the network or a different
|
|
<a href="#application-cache">application cache</a>. Even if the resource is then
|
|
found to have a different type, it is still used as part of a
|
|
<a href="#nested-browsing-context">nested browsing context</a>: only the
|
|
<a href="#navigate">navigate</a> algorithm is restarted, not this
|
|
<code><a href="#the-object-element">object</a></code> algorithm.</p>
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the <var title="">resource type</var> starts with
|
|
"<code>image/</code>", and support for images has not been
|
|
disabled</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Apply the <a href="#content-type-sniffing:-image" title="content-type sniffing: image">image
|
|
sniffing</a> rules to determine the type of the image.</p>
|
|
|
|
<p>The <code><a href="#the-object-element">object</a></code> element <a href="#represents">represents</a> the
|
|
specified image. The image is not a <a href="#nested-browsing-context">nested browsing
|
|
context</a>.</p>
|
|
|
|
<p>If the 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).</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The given <var title="">resource type</var> is not
|
|
supported. Jump to the last step in the overall set of steps
|
|
(fallback).</p>
|
|
|
|
<p class="note">If the previous step ended with the <var title="">resource type</var> being unknown, this is the case
|
|
that is triggered.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>The element's contents are not part of what the
|
|
<code><a href="#the-object-element">object</a></code> element represents.</p>
|
|
|
|
<li>
|
|
|
|
<p>Once the resource is completely loaded, <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-load">load</code> at the element.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for this task is the <a href="#dom-manipulation-task-source">DOM manipulation task
|
|
source</a>.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>If the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> attribute
|
|
is absent but the <code title="attr-object-type"><a href="#attr-object-type">type</a></code>
|
|
attribute is present, <a href="#sandboxPluginObject">plugins aren't
|
|
being sandboxed</a>, and the user agent can find a
|
|
<a href="#plugin">plugin</a> suitable according to the value of the <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attribute, then that
|
|
<a href="#plugin">plugin</a> <a href="#object-plugin">should be used</a>. If
|
|
no suitable <a href="#plugin">plugin</a> can be found, or if the
|
|
<a href="#plugin">plugin</a> reports an error, jump to the next step
|
|
(fallback).</li>
|
|
|
|
<li><p>(Fallback.) The <code><a href="#the-object-element">object</a></code> element
|
|
<a href="#represents">represents</a> the element's children, ignoring any
|
|
leading <code><a href="#the-param-element">param</a></code> element children. This is the element's
|
|
<a href="#fallback-content">fallback content</a>. If the element has an instantiated
|
|
<a href="#plugin">plugin</a>, then unload it.</li>
|
|
|
|
</ol><p id="object-plugin">When the algorithm above instantiates a
|
|
<a href="#plugin">plugin</a>, the user agent should pass to the
|
|
<a href="#plugin">plugin</a> used the names and values of all the attributes
|
|
on the element, in the order they were added to the element, with
|
|
the attributes added by the parser being ordered in source order,
|
|
followed by a parameter named "PARAM" whose value is null,
|
|
followed by all the names and values of <a href="#concept-param-parameter" title="concept-param-parameter">parameters</a> given by
|
|
<code><a href="#the-param-element">param</a></code> elements that are children of the
|
|
<code><a href="#the-object-element">object</a></code> element, in <a href="#tree-order">tree order</a>. If the
|
|
<a href="#plugin">plugin</a> supports a scriptable interface, the
|
|
<code><a href="#htmlobjectelement">HTMLObjectElement</a></code> object representing the element
|
|
should expose that interface. The <code><a href="#the-object-element">object</a></code> element
|
|
<a href="#represents">represents</a> the <a href="#plugin">plugin</a>. The
|
|
<a href="#plugin">plugin</a> is not a nested <a href="#browsing-context">browsing
|
|
context</a>.</p>
|
|
|
|
<p id="sandboxPluginObject">If either:</p>
|
|
|
|
<ul><li>the <a href="#sandboxed-plugins-browsing-context-flag">sandboxed plugins browsing context flag</a> was
|
|
set on the <code><a href="#the-object-element">object</a></code> element's <code><a href="#document">Document</a></code>'s
|
|
<a href="#browsing-context">browsing context</a> when the <code><a href="#document">Document</a></code> was
|
|
created, or</li>
|
|
|
|
<li>the <code><a href="#the-object-element">object</a></code> element's <code><a href="#document">Document</a></code> was
|
|
parsed from a resource whose <a href="#content-type-sniffing-0" title="Content-Type
|
|
sniffing">sniffed type</a> as determined during <a href="#navigate" title="navigate">navigation</a> is
|
|
<code><a href="#text-html-sandboxed">text/html-sandboxed</a></code></li>
|
|
|
|
</ul><p>...then the steps above must always act as if they had failed to
|
|
find a <a href="#plugin">plugin</a>, even if one would otherwise have been
|
|
used.</p>
|
|
|
|
<p class="note">The above algorithm is independent of CSS properties
|
|
(including 'display', 'overflow', and 'visibility'). For example, it
|
|
runs even if the element is hidden with a 'display:none' CSS style,
|
|
and does not run <em>again</em> if the element's visibility
|
|
changes.</p>
|
|
|
|
<p>Due to the algorithm above, the contents of <code><a href="#the-object-element">object</a></code>
|
|
elements act as <a href="#fallback-content">fallback content</a>, used only when
|
|
referenced resources can't be shown (e.g. because it returned a 404
|
|
error). This allows multiple <code><a href="#the-object-element">object</a></code> elements to be
|
|
nested inside each other, targeting multiple user agents with
|
|
different capabilities, with the user agent picking the first one it
|
|
supports.</p>
|
|
|
|
<p>Whenever the <code title="attr-object-name"><a href="#attr-object-name">name</a></code> attribute
|
|
is set, if the <code><a href="#the-object-element">object</a></code> element has a nested
|
|
<a href="#browsing-context">browsing context</a>, its <a href="#browsing-context-name" title="browsing context
|
|
name">name</a> must be changed to the new value. If the attribute
|
|
is removed, if the <code><a href="#the-object-element">object</a></code> element has a <a href="#browsing-context">browsing
|
|
context</a>, the <a href="#browsing-context-name">browsing context name</a> must be set
|
|
to the empty string.</p>
|
|
|
|
</div><p>The <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute,
|
|
if present while the <code><a href="#the-object-element">object</a></code> element represents an
|
|
image, can indicate that the object has an associated <a href="#image-map">image
|
|
map</a>. <span class="impl">The attribute must be ignored if the
|
|
<code><a href="#the-object-element">object</a></code> element doesn't represent an image.</span><p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-object-element">object</a></code> element with its
|
|
<a href="#form-owner">form owner</a>.<div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: <code><a href="#the-object-element">object</a></code>
|
|
elements are always <a href="#barred-from-constraint-validation">barred from constraint
|
|
validation</a>.</p>
|
|
|
|
</div><p>The <code><a href="#the-object-element">object</a></code> element supports <a href="#dimension-attributes">dimension
|
|
attributes</a>.<div class="impl">
|
|
|
|
<p>The IDL attributes <dfn id="dom-object-data" title="dom-object-data"><code>data</code></dfn>, <dfn id="dom-object-type" title="dom-object-type"><code>type</code></dfn>, <dfn id="dom-object-name" title="dom-object-name"><code>name</code></dfn>, and <dfn id="dom-object-usemap" title="dom-object-useMap"><code>useMap</code></dfn> each must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
<p>The <dfn id="dom-object-contentdocument" title="dom-object-contentDocument"><code>contentDocument</code></dfn>
|
|
IDL attribute must return the <code><a href="#document">Document</a></code> object of the
|
|
<a href="#active-document">active document</a> of the <code><a href="#the-object-element">object</a></code> element's
|
|
<a href="#nested-browsing-context">nested browsing context</a>, if it has one; otherwise, it
|
|
must return null.</p>
|
|
|
|
<p>The <dfn id="dom-object-contentwindow" title="dom-object-contentWindow"><code>contentWindow</code></dfn>
|
|
IDL attribute must return the <code><a href="#windowproxy">WindowProxy</a></code> object of the
|
|
<code><a href="#the-object-element">object</a></code> element's <a href="#nested-browsing-context">nested browsing context</a>,
|
|
if it has one; otherwise, it must return null.</p>
|
|
|
|
<p>The <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code>
|
|
attributes, and the <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
methods, are part of the <a href="#the-constraint-validation-api">constraint validation API</a>. The
|
|
<code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> IDL attribute is part of the
|
|
element's forms API.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, a Java applet is embedded in a page
|
|
using the <code><a href="#the-object-element">object</a></code> 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.)</p>
|
|
|
|
<pre><figure>
|
|
<object type="application/x-java-applet">
|
|
<param name="code" value="MyJavaClass">
|
|
<p>You do not have Java available, or it is disabled.</p>
|
|
</object>
|
|
<figcaption>My Java Clock</figcaption>
|
|
</figure></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this example, an HTML page is embedded in another using the
|
|
<code><a href="#the-object-element">object</a></code> element.</p>
|
|
|
|
<pre><figure>
|
|
<object data="clock.html"></object>
|
|
<figcaption>My HTML Clock</figcaption>
|
|
</figure></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows how a plugin can be used in HTML (in
|
|
this case the Flash plugin, to show a video file). Fallback is
|
|
provided for users who do not have Flash enabled, in this case
|
|
using the <code><a href="#the-video-element">video</a></code> element to show the video for those
|
|
using user agents that support <code><a href="#the-video-element">video</a></code>, and finally
|
|
providing a link to the video for those who have neither Flash nor
|
|
a <code><a href="#the-video-element">video</a></code>-capable browser.</p>
|
|
|
|
<pre><p>Look at my video:
|
|
<object type="application/x-shockwave-flash">
|
|
<param name=movie value="http://video.example.com/library/watch.swf">
|
|
<param name=allowfullscreen value=true>
|
|
<param name=flashvars value="http://video.example.com/vids/315981">
|
|
<video controls src="http://video.example.com/vids/315981">
|
|
<a href="http://video.example.com/vids/315981">View video</a>.
|
|
</video>
|
|
</object>
|
|
</p></pre>
|
|
|
|
</div><h4 id="the-param-element"><span class="secno">4.8.5 </span>The <dfn><code>param</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of an <code><a href="#the-object-element">object</a></code> element, before any <a href="#flow-content">flow content</a>.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-param-name"><a href="#attr-param-name">name</a></code></dd>
|
|
<dd><code title="attr-param-value"><a href="#attr-param-value">value</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlparamelement">HTMLParamElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-param-name" title="dom-param-name">name</a>;
|
|
attribute DOMString <a href="#dom-param-value" title="dom-param-value">value</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-param-element">param</a></code> element defines parameters for plugins
|
|
invoked by <code><a href="#the-object-element">object</a></code> elements. It does not <a href="#represents" title="represents">represent</a> anything on its own.<p>The <dfn id="attr-param-name" title="attr-param-name"><code>name</code></dfn>
|
|
attribute gives the name of the parameter.<p>The <dfn id="attr-param-value" title="attr-param-value"><code>value</code></dfn>
|
|
attribute gives the value of the parameter.<p>Both attributes must be present. They may have any value.<div class="impl">
|
|
|
|
<p>If both attributes are present, and if the parent element of the
|
|
<code><a href="#the-param-element">param</a></code> is an <code><a href="#the-object-element">object</a></code> element, then the
|
|
element defines a <dfn id="concept-param-parameter" title="concept-param-parameter">parameter</dfn> with the given
|
|
name/value pair.</p>
|
|
|
|
<p>If either the name or value of a <a href="#concept-param-parameter" title="concept-param-parameter">parameter</a> defined by a
|
|
<code><a href="#the-param-element">param</a></code> element that is the child of an
|
|
<code><a href="#the-object-element">object</a></code> element that <a href="#represents">represents</a> an
|
|
instantiated <a href="#plugin">plugin</a> changes, and if that
|
|
<a href="#plugin">plugin</a> is communicating with the user agent using an
|
|
API that features the ability to update the <a href="#plugin">plugin</a> when
|
|
the name or value of a <a href="#concept-param-parameter" title="concept-param-parameter">parameter</a> so changes, then
|
|
the user agent must appropriately exercise that ability to notify
|
|
the <a href="#plugin">plugin</a> of the change.</p>
|
|
|
|
<p>The IDL attributes <dfn id="dom-param-name" title="dom-param-name"><code>name</code></dfn> and <dfn id="dom-param-value" title="dom-param-value"><code>value</code></dfn> must both
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows how the <code><a href="#the-param-element">param</a></code> element
|
|
can be used to pass a parameter to a plugin, in this case the O3D
|
|
plugin.</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html lang="en">
|
|
<head>
|
|
<title>O3D Utah Teapot</title>
|
|
</head>
|
|
<body>
|
|
<p>
|
|
<object type="application/vnd.o3d.auto">
|
|
<strong><param name="o3d_features" value="FloatingPointTextures"></strong>
|
|
<img src="o3d-teapot.png"
|
|
title="3D Utah Teapot illustration rendered using O3D."
|
|
alt="When O3D renders the Utah Teapot, it appears as a squat
|
|
teapot with a shiny metallic finish on which the
|
|
surroundings are reflected, with a faint shadow caused by
|
|
the lighting.">
|
|
<p>To see the teapot actually rendered by O3D on your
|
|
computer, please download and install the <a
|
|
href="http://code.google.com/apis/o3d/docs/gettingstarted.html#install">O3D plugin</a>.</p>
|
|
</object>
|
|
<script src="o3d-teapot.js"></script>
|
|
</p>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><h4 id="the-video-element"><span class="secno">4.8.6 </span>The <dfn id="video"><code>video</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#embedded-content">Embedded content</a>.</dd>
|
|
<dd>If the element has a <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code> attribute: <a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#embedded-content">embedded content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>If the element has a <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute:
|
|
zero or more <code><a href="#the-track-element">track</a></code> elements, then
|
|
<a href="#transparent">transparent</a>, but with no <a href="#media-element">media element</a> descendants.</dd>
|
|
<dd>If the element does not have a <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute: zero or more <code><a href="#the-source-element">source</a></code> elements, then
|
|
zero or more <code><a href="#the-track-element">track</a></code> elements, then
|
|
<a href="#transparent">transparent</a>, but with no <a href="#media-element">media element</a> descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-media-src"><a href="#attr-media-src">src</a></code></dd>
|
|
<dd><code title="attr-video-poster"><a href="#attr-video-poster">poster</a></code></dd>
|
|
<dd><code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code></dd>
|
|
<dd><code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code></dd>
|
|
<dd><code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code></dd>
|
|
<dd><code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code></dd>
|
|
<dd><code title="attr-media-muted"><a href="#attr-media-muted">muted</a></code></dd>
|
|
<dd><code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code></dd>
|
|
<dd><code title="attr-dim-width"><a href="#attr-dim-width">width</a></code></dd>
|
|
<dd><code title="attr-dim-height"><a href="#attr-dim-height">height</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlvideoelement">HTMLVideoElement</dfn> : <a href="#htmlmediaelement">HTMLMediaElement</a> {
|
|
attribute unsigned long <a href="#dom-dim-width" title="dom-dim-width">width</a>;
|
|
attribute unsigned long <a href="#dom-dim-height" title="dom-dim-height">height</a>;
|
|
readonly attribute unsigned long <a href="#dom-video-videowidth" title="dom-video-videoWidth">videoWidth</a>;
|
|
readonly attribute unsigned long <a href="#dom-video-videoheight" title="dom-video-videoHeight">videoHeight</a>;
|
|
attribute DOMString <a href="#dom-video-poster" title="dom-video-poster">poster</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>A <code><a href="#the-video-element">video</a></code> element is used for playing videos or
|
|
movies, and audio files with captions.<p>Content may be provided inside the <code><a href="#the-video-element">video</a></code>
|
|
element<span class="impl">. User agents should not show this content
|
|
to the user</span>; it is intended for older Web browsers which do
|
|
not support <code><a href="#the-video-element">video</a></code>, so that legacy video plugins can be
|
|
tried, or to show text to the users of these older browsers informing
|
|
them of how to access the video contents.<p class="note">In particular, this content is not 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, audio description tracks, or sign-language
|
|
overlays) into their media streams.<p>The <code><a href="#the-video-element">video</a></code> element is a <a href="#media-element">media element</a>
|
|
whose <a href="#media-data">media data</a> is ostensibly video data, possibly
|
|
with associated audio data.<p>The <code title="attr-media-src"><a href="#attr-media-src">src</a></code>, <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code>, <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code>,
|
|
<code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code>,
|
|
<code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code>,
|
|
<code title="attr-media-muted"><a href="#attr-media-muted">muted</a></code>, and <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code> attributes are <a href="#media-element-attributes" title="media element attributes">the attributes common to all media
|
|
elements</a>.<p>The <dfn id="attr-video-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 <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</a>.<div class="impl">
|
|
|
|
<p>If the specified resource is to be used, then, when the element
|
|
is created or when the <code title="attr-video-poster"><a href="#attr-video-poster">poster</a></code>
|
|
attribute is set, changed, or removed, the user agent must run the
|
|
following steps to determine the element's <dfn id="poster-frame">poster
|
|
frame</dfn>:</p>
|
|
<ol><li><p>If there is an existing instance of this algorithm running
|
|
for this <code><a href="#the-video-element">video</a></code> element, abort that instance of this
|
|
algorithm without changing the <a href="#poster-frame">poster frame</a>.</li>
|
|
|
|
<li><p>If the <code title="attr-video-poster"><a href="#attr-video-poster">poster</a></code>
|
|
attribute's value is the empty string or if the attribute is
|
|
absent, then there is no <a href="#poster-frame">poster frame</a>; abort these
|
|
steps.</li>
|
|
|
|
<li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the <code title="attr-video-poster"><a href="#attr-video-poster">poster</a></code> attribute's value relative
|
|
to the element. If this fails, then there is no <a href="#poster-frame">poster
|
|
frame</a>; abort these steps.</li>
|
|
|
|
<li><p><a href="#fetch">Fetch</a> the resulting <a href="#absolute-url">absolute URL</a>,
|
|
from the element's <code><a href="#document">Document</a></code>'s <a href="#origin">origin</a>.
|
|
This must <a href="#delay-the-load-event">delay the load event</a> of the element's
|
|
document.</li>
|
|
|
|
|
|
|
|
<li><p>If an image is thus obtained, the <a href="#poster-frame">poster frame</a>
|
|
is that image. Otherwise, there is no <a href="#poster-frame">poster
|
|
frame</a>.</li>
|
|
|
|
</ol></div><p class="note">The image given by the <code title="attr-video-poster"><a href="#attr-video-poster">poster</a></code> attribute, the <i><a href="#poster-frame">poster
|
|
frame</a></i>, is intended to be a representative frame of the video
|
|
(typically one of the first non-blank frames) that gives the user an
|
|
idea of what the video is like.<div class="impl">
|
|
|
|
<hr><p>When no video data is available (the element's <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute is either
|
|
<code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, or <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code> but no video
|
|
data has yet been obtained at all, or the element's <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute is any
|
|
subsequent value but the <a href="#media-resource">media resource</a> does not have a
|
|
video channel), the <code><a href="#the-video-element">video</a></code> element
|
|
<a href="#represents">represents</a> either the <a href="#poster-frame">poster frame</a>, or
|
|
nothing.</p>
|
|
|
|
<p>When a <code><a href="#the-video-element">video</a></code> element is <a href="#dom-media-paused" title="dom-media-paused">paused</a> and the <a href="#current-playback-position" title="current
|
|
playback position">current playback position</a> is the first
|
|
frame of video, the element <a href="#represents">represents</a> either the frame
|
|
of video corresponding to the <a href="#current-playback-position" title="current playback
|
|
position">current playback position</a> or the <a href="#poster-frame">poster
|
|
frame</a>, at the discretion of the user agent.</p>
|
|
|
|
<p>Notwithstanding the above, the <a href="#poster-frame">poster frame</a> should
|
|
be preferred over nothing, but the <a href="#poster-frame">poster frame</a> should
|
|
not be shown again after a frame of video has been shown.</p>
|
|
|
|
<p>When a <code><a href="#the-video-element">video</a></code> element is <a href="#dom-media-paused" title="dom-media-paused">paused</a> at any other position, and
|
|
the <a href="#media-resource">media resource</a> has a video channel, the element
|
|
<a href="#represents">represents</a> the frame of video corresponding to the
|
|
<a href="#current-playback-position" title="current playback position">current playback
|
|
position</a>, or, if that is not yet available (e.g. because the
|
|
video is seeking or buffering), the last frame of the video to have
|
|
been rendered.</p>
|
|
|
|
<p>When a <code><a href="#the-video-element">video</a></code> element whose <a href="#media-resource">media
|
|
resource</a> has a video channel is <a href="#potentially-playing">potentially
|
|
playing</a>, it <a href="#represents">represents</a> the frame of video at the
|
|
continuously increasing <a href="#current-playback-position" title="current playback
|
|
position">"current" position</a>. When the <a href="#current-playback-position">current playback
|
|
position</a> changes such that the last frame rendered is no
|
|
longer the frame corresponding to the <a href="#current-playback-position">current playback
|
|
position</a> in the video, the new frame must be rendered.
|
|
|
|
Similarly, any audio associated with the <a href="#media-resource">media resource</a>
|
|
must, if played, be played synchronized with the <a href="#current-playback-position">current
|
|
playback position</a>, at the element's <a href="#effective-media-volume">effective media
|
|
volume</a>.</p>
|
|
|
|
<p>When a <code><a href="#the-video-element">video</a></code> element whose <a href="#media-resource">media
|
|
resource</a> has a video channel is neither <a href="#potentially-playing">potentially
|
|
playing</a> nor <a href="#dom-media-paused" title="dom-media-paused">paused</a>
|
|
(e.g. when seeking or stalled), the element <a href="#represents">represents</a>
|
|
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>The <code><a href="#the-video-element">video</a></code> element also <a href="#represents">represents</a> any
|
|
<a href="#text-track-cue" title="text track cue">text track cues</a> whose
|
|
<a href="#text-track-cue-active-flag">text track cue active flag</a> is set and whose
|
|
<a href="#text-track">text track</a> is in the <a href="#text-track-showing" title="text track
|
|
showing">showing</a> or <a href="#text-track-showing-by-default" title="text track showing by
|
|
default">showing by default</a> modes.</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 <a href="#represents" title="represents">represent</a> a link to an
|
|
external video playback utility or to the video data itself.</p>
|
|
|
|
<hr></div><dl class="domintro"><dt><var title="">video</var> . <code title="dom-video-videoWidth"><a href="#dom-video-videowidth">videoWidth</a></code></dt>
|
|
<dt><var title="">video</var> . <code title="dom-video-videoHeight"><a href="#dom-video-videoheight">videoHeight</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>These attributes return the intrinsic dimensions of the video,
|
|
or zero if the dimensions are not known.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="concept-video-intrinsic-width" title="concept-video-intrinsic-width">intrinsic
|
|
width</dfn> and <dfn id="concept-video-intrinsic-height" title="concept-video-intrinsic-height">intrinsic height</dfn> of the
|
|
<a href="#media-resource">media resource</a> are the dimensions of the resource in
|
|
CSS pixels after taking into account the resource's dimensions,
|
|
aspect ratio, clean aperture, resolution, and so forth, as defined
|
|
for the format used by the resource. If an anamorphic format does
|
|
not define how to apply the aspect ratio to the video data's
|
|
dimensions to obtain the "correct" dimensions, then the user agent
|
|
must apply the ratio by increasing one dimension and leaving the
|
|
other unchanged.</p>
|
|
|
|
<p>The <dfn id="dom-video-videowidth" title="dom-video-videoWidth"><code>videoWidth</code></dfn> IDL
|
|
attribute must return the <a href="#concept-video-intrinsic-width" title="concept-video-intrinsic-width">intrinsic width</a> of the
|
|
video in CSS pixels. The <dfn id="dom-video-videoheight" title="dom-video-videoHeight"><code>videoHeight</code></dfn> IDL
|
|
attribute must return the <a href="#concept-video-intrinsic-height" title="concept-video-intrinsic-height">intrinsic height</a> of
|
|
the video in CSS pixels. If the element's <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute is <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, then the
|
|
attributes must return 0.</p>
|
|
|
|
</div><p>The <code><a href="#the-video-element">video</a></code> element supports <a href="#dimension-attributes">dimension
|
|
attributes</a>.<div class="impl">
|
|
|
|
<p>In the absence of style rules to the contrary, 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 aspect ratio being preserved. Thus, if the aspect ratio of
|
|
the playback area does not match the aspect ratio of the video, the
|
|
video will be shown letterboxed or pillarboxed. Areas of the
|
|
element's playback area that do not contain the video represent
|
|
nothing.</p>
|
|
|
|
<p class="note">In user agents that implement CSS, the above
|
|
requirement can be implemented by using the <a href="#video-object-fit">style rule suggested in the rendering
|
|
section</a>.</p>
|
|
|
|
<p>The intrinsic width of a <code><a href="#the-video-element">video</a></code> element's playback
|
|
area is the <a href="#concept-video-intrinsic-width" title="concept-video-intrinsic-width">intrinsic
|
|
width</a> of the video resource, if that is available; otherwise
|
|
it is the intrinsic width of the <a href="#poster-frame">poster frame</a>, if that
|
|
is available; otherwise it is 300 CSS pixels.</p>
|
|
|
|
<p>The intrinsic height of a <code><a href="#the-video-element">video</a></code> element's playback
|
|
area is the <a href="#concept-video-intrinsic-height" title="concept-video-intrinsic-height">intrinsic
|
|
height</a> of the video resource, if that is available; otherwise
|
|
it is the intrinsic height of the <a href="#poster-frame">poster frame</a>, if that
|
|
is available; otherwise it is 150 CSS pixels.</p>
|
|
|
|
<hr><p>User agents should provide controls to enable or disable the
|
|
display of closed captions, audio description tracks, and other
|
|
additional data 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-a-user-interface-to-the-user" 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="#attr-media-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>
|
|
|
|
<hr><p>The <dfn id="dom-video-poster" title="dom-video-poster"><code>poster</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-video-poster"><a href="#attr-video-poster">poster</a></code> content attribute.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This example shows how to detect when a video has failed to play
|
|
correctly:</p>
|
|
|
|
<pre><script>
|
|
function failed(e) {
|
|
// video playback failed - show a message saying why
|
|
switch (e.target.error.code) {
|
|
case e.target.error.MEDIA_ERR_ABORTED:
|
|
alert('You aborted the video playback.');
|
|
break;
|
|
case e.target.error.MEDIA_ERR_NETWORK:
|
|
alert('A network error caused the video download to fail part-way.');
|
|
break;
|
|
case e.target.error.MEDIA_ERR_DECODE:
|
|
alert('The video playback was aborted due to a corruption problem or because the video used features your browser did not support.');
|
|
break;
|
|
case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
|
|
alert('The video could not be loaded, either because the server or network failed or because the format is not supported.');
|
|
break;
|
|
default:
|
|
alert('An unknown error occurred.');
|
|
break;
|
|
}
|
|
}
|
|
</script>
|
|
<p><video src="tgif.vid" autoplay controls onerror="failed(event)"></video></p>
|
|
<p><a href="tgif.vid">Download the video file</a>.</p></pre>
|
|
|
|
</div><h4 id="the-audio-element"><span class="secno">4.8.7 </span>The <dfn id="audio"><code>audio</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#embedded-content">Embedded content</a>.</dd>
|
|
<dd>If the element has a <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code> attribute: <a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#embedded-content">embedded content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>If the element has a <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute:
|
|
zero or more <code><a href="#the-track-element">track</a></code> elements, then
|
|
<a href="#transparent">transparent</a>, but with no <a href="#media-element">media element</a> descendants.</dd>
|
|
<dd>If the element does not have a <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute: one or more <code><a href="#the-source-element">source</a></code> elements, then
|
|
zero or more <code><a href="#the-track-element">track</a></code> elements, then
|
|
<a href="#transparent">transparent</a>, but with no <a href="#media-element">media element</a> descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-media-src"><a href="#attr-media-src">src</a></code></dd>
|
|
<dd><code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code></dd>
|
|
<dd><code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code></dd>
|
|
<dd><code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code></dd>
|
|
<dd><code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code></dd>
|
|
<dd><code title="attr-media-muted"><a href="#attr-media-muted">muted</a></code></dd>
|
|
<dd><code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">[NamedConstructor=<a href="#dom-audio" title="dom-Audio">Audio</a>(),
|
|
NamedConstructor=<a href="#dom-audio-s" title="dom-Audio-s">Audio</a>(in DOMString src)]
|
|
interface <dfn id="htmlaudioelement">HTMLAudioElement</dfn> : <a href="#htmlmediaelement">HTMLMediaElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>An <code><a href="#the-audio-element">audio</a></code> element <a href="#represents">represents</a> a sound or
|
|
audio stream.</p><p>Content may be provided inside the <code><a href="#the-audio-element">audio</a></code>
|
|
element<span class="impl">. User agents should not show this content
|
|
to the user</span>; it is intended for older Web browsers which do
|
|
not support <code><a href="#the-audio-element">audio</a></code>, so that legacy audio plugins can be
|
|
tried, or to show text to the users of these older browsers informing
|
|
them of how to access the audio contents.<p class="note">In particular, this content is not 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>The <code><a href="#the-audio-element">audio</a></code> element is a <a href="#media-element">media element</a>
|
|
whose <a href="#media-data">media data</a> is ostensibly audio data.<p>The <code title="attr-media-src"><a href="#attr-media-src">src</a></code>, <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code>, <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code>,
|
|
<code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code>,
|
|
<code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code>,
|
|
<code title="attr-media-muted"><a href="#attr-media-muted">muted</a></code>, and <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code> attributes are <a href="#media-element-attributes" title="media element attributes">the attributes common to all media
|
|
elements</a>.<div class="impl">
|
|
|
|
<p>When an <code><a href="#the-audio-element">audio</a></code> element is <a href="#potentially-playing">potentially
|
|
playing</a>, it must have its audio data played synchronized with
|
|
the <a href="#current-playback-position">current playback position</a>, at the element's
|
|
<a href="#effective-media-volume">effective media volume</a>.</p>
|
|
|
|
<p>When an <code><a href="#the-audio-element">audio</a></code> element is not <a href="#potentially-playing">potentially
|
|
playing</a>, audio must not play for the element.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">audio</var> = new <code title="dom-Audio"><a href="#dom-audio">Audio</a></code>( [ <var title="">url</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a new <code><a href="#the-audio-element">audio</a></code> element, with the <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute set to the value
|
|
passed in the argument, if applicable.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>Two constructors are provided for creating
|
|
<code><a href="#htmlaudioelement">HTMLAudioElement</a></code> objects (in addition to the factory
|
|
methods from DOM Core such as <code title="">createElement()</code>): <dfn id="dom-audio" title="dom-Audio"><code>Audio()</code></dfn> and <dfn id="dom-audio-s" title="dom-Audio-s"><code>Audio(<var title="">src</var>)</code></dfn>. When invoked as constructors,
|
|
these must return a new <code><a href="#htmlaudioelement">HTMLAudioElement</a></code> object (a new
|
|
<code><a href="#the-audio-element">audio</a></code> element). The element must have its <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code> attribute set to the
|
|
literal value "<code title="attr-media-preload-auto"><a href="#attr-media-preload-auto">auto</a></code>". If the <var title="">src</var> argument is present, the object created must have
|
|
its <code title="attr-media-src"><a href="#attr-media-src">src</a></code> content attribute set to
|
|
the provided value, and the user agent must invoke the object's
|
|
<a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a> before returning. The element's document must be
|
|
the <a href="#active-document">active document</a> of the <a href="#browsing-context">browsing
|
|
context</a> of the <code><a href="#window">Window</a></code> object on which the
|
|
interface object of the invoked constructor is found.</p>
|
|
|
|
</div><h4 id="the-source-element"><span class="secno">4.8.8 </span>The <dfn><code>source</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <a href="#media-element">media element</a>, before any <a href="#flow-content">flow content</a>
|
|
or <code><a href="#the-track-element">track</a></code> elements.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-source-src"><a href="#attr-source-src">src</a></code></dd>
|
|
<dd><code title="attr-source-type"><a href="#attr-source-type">type</a></code></dd>
|
|
<dd><code title="attr-source-media"><a href="#attr-source-media">media</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlsourceelement">HTMLSourceElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-source-src" title="dom-source-src">src</a>;
|
|
attribute DOMString <a href="#dom-source-type" title="dom-source-type">type</a>;
|
|
attribute DOMString <a href="#dom-source-media" title="dom-source-media">media</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-source-element">source</a></code> element allows authors to specify
|
|
multiple alternative <a href="#media-resource" title="media resource">media
|
|
resources</a> for <a href="#media-element" title="media element">media
|
|
elements</a>. It does not <a href="#represents" title="represents">represent</a> anything on its own.<p>The <dfn id="attr-source-src" title="attr-source-src"><code>src</code></dfn> attribute
|
|
gives the address of the <a href="#media-resource">media resource</a>. The value must
|
|
be a <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</a>. This attribute must be present.<p class="note">Dynamically modifying a <code><a href="#the-source-element">source</a></code> element
|
|
and its attribute when the element is already inserted in a
|
|
<code><a href="#the-video-element">video</a></code> or <code><a href="#the-audio-element">audio</a></code> element will have no
|
|
effect. To change what is playing, either just use the <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute on the <a href="#media-element">media
|
|
element</a> directly, or call the <code title="dom-media-load"><a href="#dom-media-load">load()</a></code> method on the <a href="#media-element">media
|
|
element</a> after manipulating the <code><a href="#the-source-element">source</a></code>
|
|
elements.<p>The <dfn id="attr-source-type" title="attr-source-type"><code>type</code></dfn>
|
|
attribute gives the type of the <a href="#media-resource">media resource</a>, to help
|
|
the user agent determine if it can play this <a href="#media-resource">media
|
|
resource</a> before fetching it. If specified, its value must be
|
|
a <a href="#valid-mime-type">valid MIME type</a>. The <code title="">codecs</code>
|
|
parameter, which certain MIME types define, might be necessary to
|
|
specify exactly how the resource is encoded. <a href="#refsRFC4281">[RFC4281]</a><div class="example">
|
|
|
|
<p>The following list shows some examples of how to use the <code title="">codecs=</code> MIME parameter in the <code title="attr-source-type"><a href="#attr-source-type">type</a></code> attribute.</p>
|
|
|
|
<dl><dt>H.264 Constrained baseline profile video (main and extended video compatible) level 3 and Low-Complexity AAC audio in MP4 container</dt>
|
|
<dd><pre><source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'></pre></dd>
|
|
|
|
<dt>H.264 Extended profile video (baseline-compatible) level 3 and Low-Complexity AAC audio in MP4 container</dt>
|
|
<dd><pre><source src='video.mp4' type='video/mp4; codecs="avc1.58A01E, mp4a.40.2"'></pre></dd>
|
|
|
|
<dt>H.264 Main profile video level 3 and Low-Complexity AAC audio in MP4 container</dt>
|
|
<dd><pre><source src='video.mp4' type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"'></pre></dd>
|
|
|
|
<dt>H.264 'High' profile video (incompatible with main, baseline, or extended profiles) level 3 and Low-Complexity AAC audio in MP4 container</dt>
|
|
<dd><pre><source src='video.mp4' type='video/mp4; codecs="avc1.64001E, mp4a.40.2"'></pre></dd>
|
|
|
|
|
|
<dt>MPEG-4 Visual Simple Profile Level 0 video and Low-Complexity AAC audio in MP4 container</dt>
|
|
<dd><pre><source src='video.mp4' type='video/mp4; codecs="mp4v.20.8, mp4a.40.2"'></pre></dd>
|
|
|
|
<dt>MPEG-4 Advanced Simple Profile Level 0 video and Low-Complexity AAC audio in MP4 container</dt>
|
|
<dd><pre><source src='video.mp4' type='video/mp4; codecs="mp4v.20.240, mp4a.40.2"'></pre></dd>
|
|
|
|
<dt>MPEG-4 Visual Simple Profile Level 0 video and AMR audio in 3GPP container</dt>
|
|
<dd><pre><source src='video.3gp' type='video/3gpp; codecs="mp4v.20.8, samr"'></pre></dd>
|
|
|
|
|
|
<dt>Theora video and Vorbis audio in Ogg container</dt>
|
|
<dd><pre><source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'></pre></dd>
|
|
|
|
<dt>Theora video and Speex audio in Ogg container</dt>
|
|
<dd><pre><source src='video.ogv' type='video/ogg; codecs="theora, speex"'></pre></dd>
|
|
|
|
<dt>Vorbis audio alone in Ogg container</dt>
|
|
<dd><pre><source src='audio.ogg' type='audio/ogg; codecs=vorbis'></pre></dd>
|
|
|
|
<dt>Speex audio alone in Ogg container</dt>
|
|
<dd><pre><source src='audio.spx' type='audio/ogg; codecs=speex'></pre></dd>
|
|
|
|
<dt>FLAC audio alone in Ogg container</dt>
|
|
<dd><pre><source src='audio.oga' type='audio/ogg; codecs=flac'></pre></dd>
|
|
|
|
<dt>Dirac video and Vorbis audio in Ogg container</dt>
|
|
<dd><pre><source src='video.ogv' type='video/ogg; codecs="dirac, vorbis"'></pre></dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dl></div><p>The <dfn id="attr-source-media" title="attr-source-media"><code>media</code></dfn>
|
|
attribute gives the intended media type of the <a href="#media-resource">media
|
|
resource</a>, to help the user agent determine if this
|
|
<a href="#media-resource">media resource</a> is useful to the user before fetching
|
|
it. Its value must be a <a href="#valid-media-query">valid media query</a>.<p id="source-default-media">The default, if the <code title="attr-srouce-media">media</code> attribute is omitted, is
|
|
"<code title="">all</code>", meaning that by default the <a href="#media-resource">media
|
|
resource</a> is suitable for all media.<div class="impl">
|
|
|
|
<p>If a <code><a href="#the-source-element">source</a></code> element is inserted as a child of a
|
|
<a href="#media-element">media element</a> that has no <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute and whose <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> has the value
|
|
<code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>, the user
|
|
agent must invoke the <a href="#media-element">media element</a>'s <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</p>
|
|
|
|
<p>The IDL attributes <dfn id="dom-source-src" title="dom-source-src"><code>src</code></dfn>, <dfn id="dom-source-type" title="dom-source-type"><code>type</code></dfn>, and <dfn id="dom-source-media" title="dom-source-media"><code>media</code></dfn> must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>If the author isn't sure if the user agents will all be able to
|
|
render the media resources provided, the author can listen to the
|
|
<code title="event-error">error</code> event on the last
|
|
<code><a href="#the-source-element">source</a></code> element and trigger fallback behavior:</p>
|
|
|
|
<pre><script>
|
|
function fallback(video) {
|
|
// replace <video> with its contents
|
|
while (video.hasChildNodes()) {
|
|
if (video.firstChild instanceof HTMLSourceElement)
|
|
video.removeChild(video.firstChild);
|
|
else
|
|
video.parentNode.insertBefore(video.firstChild, video);
|
|
}
|
|
video.parentNode.removeChild(video);
|
|
}
|
|
</script>
|
|
<video controls autoplay>
|
|
<source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
|
|
<source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'
|
|
onerror="fallback(parentNode)">
|
|
...
|
|
</video></pre>
|
|
|
|
</div><h4 id="the-track-element"><span class="secno">4.8.9 </span>The <dfn><code>track</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <a href="#media-element">media element</a>, before any <a href="#flow-content">flow content</a>.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-track-kind"><a href="#attr-track-kind">kind</a></code></dd>
|
|
<dd><code title="attr-track-src"><a href="#attr-track-src">src</a></code></dd>
|
|
<dd><code title="attr-track-srclang"><a href="#attr-track-srclang">srclang</a></code></dd>
|
|
<dd><code title="attr-track-label"><a href="#attr-track-label">label</a></code></dd>
|
|
<dd><code title="attr-track-default"><a href="#attr-track-default">default</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmltrackelement">HTMLTrackElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-track-kind" title="dom-track-kind">kind</a>;
|
|
attribute DOMString <a href="#dom-track-src" title="dom-track-src">src</a>;
|
|
attribute DOMString <a href="#dom-track-srclang" title="dom-track-srclang">srclang</a>;
|
|
attribute DOMString <a href="#dom-track-label" title="dom-track-label">label</a>;
|
|
attribute boolean <a href="#dom-track-default" title="dom-track-default">default</a>;
|
|
|
|
readonly attribute <a href="#texttrack">TextTrack</a> <a href="#dom-track-track" title="dom-track-track">track</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-track-element">track</a></code> element allows authors to specify explicit
|
|
external timed <a href="#text-track" title="text track">text tracks</a> for <a href="#media-element" title="media element">media elements</a>. It does not <a href="#represents" title="represents">represent</a> anything on its own.<p>The <dfn id="attr-track-kind" title="attr-track-kind"><code>kind</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">enumerated attribute</a>. The following
|
|
table lists the keywords defined for this attribute. The keyword
|
|
given in the first cell of each row maps to the state given in the
|
|
second cell.<table><thead><tr><th>Keyword
|
|
<th>State
|
|
<th>Brief description
|
|
<tbody><tr><td><dfn id="attr-track-kind-keyword-subtitles" title="attr-track-kind-keyword-subtitles"><code>subtitles</code></dfn>
|
|
<td><dfn id="attr-track-kind-subtitles" title="attr-track-kind-subtitles">Subtitles</dfn>
|
|
<td>
|
|
Transcription or translation of the dialogue, suitable for when the sound is available but not understood (e.g. because the user does not understand the language of the <a href="#media-resource">media resource</a>'s soundtrack).
|
|
Displayed over the video.
|
|
<tr><td><dfn id="attr-track-kind-keyword-captions" title="attr-track-kind-keyword-captions"><code>captions</code></dfn>
|
|
<td><dfn id="attr-track-kind-captions" title="attr-track-kind-captions">Captions</dfn>
|
|
<td>
|
|
Transcription or translation of the dialogue, sound effects, relevant musical cues, and other relevant audio information, suitable for when the soundtrack is unavailable (e.g. because it is muted or because the user is deaf).
|
|
Displayed over the video; labeled as appropriate for the hard-of-hearing.
|
|
<tr><td><dfn id="attr-track-kind-keyword-descriptions" title="attr-track-kind-keyword-descriptions"><code>descriptions</code></dfn>
|
|
<td><dfn id="attr-track-kind-descriptions" title="attr-track-kind-descriptions">Descriptions</dfn>
|
|
<td>
|
|
Textual descriptions of the video component of the <a href="#media-resource">media resource</a>, intended for audio synthesis when the visual component is unavailable (e.g. because the user is interacting with the application without a screen while driving, or because the user is blind).
|
|
Synthesized as separate audio track.
|
|
<tr><td><dfn id="attr-track-kind-keyword-chapters" title="attr-track-kind-keyword-chapters"><code>chapters</code></dfn>
|
|
<td><dfn id="attr-track-kind-chapters" title="attr-track-kind-chapters">Chapters</dfn>
|
|
<td>
|
|
Chapter titles, intended to be used for navigating the <a href="#media-resource">media resource</a>.
|
|
Displayed as an interactive list in the user agent's interface.
|
|
<tr><td><dfn id="attr-track-kind-keyword-metadata" title="attr-track-kind-keyword-metadata"><code>metadata</code></dfn>
|
|
<td><dfn id="attr-track-kind-metadata" title="attr-track-kind-metadata">Metadata</dfn>
|
|
<td>
|
|
Tracks intended for use from script.
|
|
Not displayed by the user agent.
|
|
</table><p>The attribute may be omitted. The <i>missing value default</i> is
|
|
the <a href="#attr-track-kind-subtitles" title="attr-track-kind-subtitles">subtitles</a> state.<p>The <dfn id="attr-track-src" title="attr-track-src"><code>src</code></dfn> attribute
|
|
gives the address of the text track data. The value must be a
|
|
<a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</a>. This attribute must be present.<div class="impl">
|
|
|
|
<p>If the element has a <code title="attr-track-src"><a href="#attr-track-src">src</a></code>
|
|
attribute whose value is not the empty string and whose value, when
|
|
the attribute was set, could be successfully <a href="#resolve-a-url" title="resolve a
|
|
url">resolved</a> relative to the element, then the element's
|
|
<dfn id="track-url">track URL</dfn> is the resulting <a href="#absolute-url">absolute
|
|
URL</a>. Otherwise, the element's <a href="#track-url">track URL</a> is the
|
|
empty string.</p>
|
|
|
|
</div><p>The <dfn id="attr-track-srclang" title="attr-track-srclang"><code>srclang</code></dfn>
|
|
attribute gives the language of the text track data. The value must
|
|
be a valid BCP 47 language tag. This attribute must be present if
|
|
the element's <code title="attr-track-kind"><a href="#attr-track-kind">kind</a></code> attribute is
|
|
in the <a href="#attr-track-kind-subtitles" title="attr-track-kind-subtitles">subtitles</a>
|
|
state. <a href="#refsBCP47">[BCP47]</a><div class="impl">
|
|
|
|
<p>If the element has a <code title="attr-track-srclang"><a href="#attr-track-srclang">srclang</a></code> attribute whose value is
|
|
not the empty string, then the element's <dfn id="track-language">track language</dfn>
|
|
is the value of the attribute. Otherwise, the element has no
|
|
<a href="#track-language">track language</a>.</p>
|
|
|
|
</div><p>The <dfn id="attr-track-label" title="attr-track-label"><code>label</code></dfn>
|
|
attribute gives a user-readable title for the track. This title is
|
|
used by user agents when listing <a href="#attr-track-kind-subtitles" title="attr-track-kind-subtitles">subtitle</a>, <a href="#attr-track-kind-captions" title="attr-track-kind-captions">caption</a>, and <a href="#attr-track-kind-descriptions" title="attr-track-kind-descriptions">audio description</a> tracks
|
|
in their user interface.<p>The value of the <code title="attr-track-label"><a href="#attr-track-label">label</a></code>
|
|
attribute, if the attribute is present, must not be the empty
|
|
string. Furthermore, there must not be two <code><a href="#the-track-element">track</a></code>
|
|
element children of the same <a href="#media-element">media element</a> whose <code title="attr-track-kind"><a href="#attr-track-kind">kind</a></code> attributes are in the same
|
|
state, whose <code title="attr-track-srclang"><a href="#attr-track-srclang">srclang</a></code>
|
|
attributes are both missing or have values that represent the same
|
|
language, and whose <code title="attr-track-label"><a href="#attr-track-label">label</a></code>
|
|
attributes are again both missing or both have the same value.<div class="impl">
|
|
|
|
<p>If the element has a <code title="attr-track-label"><a href="#attr-track-label">label</a></code>
|
|
attribute whose value is not the empty string, then the element's
|
|
<dfn id="track-label">track label</dfn> is the value of the attribute. Otherwise, the
|
|
element's <a href="#track-label">track label</a> is a user-agent defined string
|
|
(e.g. the string "untitled" in the user's locale, or a value
|
|
automatically generated from the other attributes).</p>
|
|
|
|
</div><p>The <dfn id="attr-track-default" title="attr-track-default"><code>default</code></dfn>
|
|
attribute, if specified, indicates that the track is to be enabled
|
|
if the user's preferences do not indicate that another track would
|
|
be more appropriate. There must not be more than one
|
|
<code><a href="#the-track-element">track</a></code> element with the same parent node with the <code title="attr-track-default"><a href="#attr-track-default">default</a></code> attribute specified.<dl class="domintro"><dt><var title="">track</var> . <code title="dom-track-track"><a href="#dom-track-track">track</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#texttrack">TextTrack</a></code> object corresponding to the <a href="#text-track">text track</a> of the <code><a href="#the-track-element">track</a></code> element.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-track-track" title="dom-track-track"><code>track</code></dfn> IDL
|
|
attribute must, on getting, return the <code><a href="#the-track-element">track</a></code> element's
|
|
<a href="#text-track">text track</a>'s corresponding <code><a href="#texttrack">TextTrack</a></code>
|
|
object.</p>
|
|
|
|
<p>The <dfn id="dom-track-src" title="dom-track-src"><code>src</code></dfn>, <dfn id="dom-track-srclang" title="dom-track-srclang"><code>srclang</code></dfn>, <dfn id="dom-track-label" title="dom-track-label"><code>label</code></dfn>, and <dfn id="dom-track-default" title="dom-track-default"><code>default</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name. The <dfn id="dom-track-kind" title="dom-track-kind"><code>kind</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This video has subtitles in several languages:</p>
|
|
|
|
<pre><video src="brave.webm">
|
|
<track kind=subtitles src=brave.en.vtt srclang=en label="English">
|
|
<track kind=captions src=brave.en.vtt srclang=en label="English for the Hard of Hearing">
|
|
<track kind=subtitles src=brave.fr.vtt srclang=fr label="Français">
|
|
<track kind=subtitles src=brave.de.vtt srclang=de label="Deutsch">
|
|
</video></pre>
|
|
|
|
</div><h4 id="media-elements"><span class="secno">4.8.10 </span>Media elements</h4><p><dfn id="media-element" title="media element">Media elements</dfn>
|
|
(<code><a href="#the-audio-element">audio</a></code> and <code><a href="#the-video-element">video</a></code>, in this specification)
|
|
implement the following interface:<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="#dom-media-error" title="dom-media-error">error</a>;
|
|
|
|
// network state
|
|
attribute DOMString <a href="#dom-media-src" title="dom-media-src">src</a>;
|
|
readonly attribute DOMString <a href="#dom-media-currentsrc" title="dom-media-currentSrc">currentSrc</a>;
|
|
const unsigned short <a href="#dom-media-network_empty" title="dom-media-NETWORK_EMPTY">NETWORK_EMPTY</a> = 0;
|
|
const unsigned short <a href="#dom-media-network_idle" title="dom-media-NETWORK_IDLE">NETWORK_IDLE</a> = 1;
|
|
const unsigned short <a href="#dom-media-network_loading" title="dom-media-NETWORK_LOADING">NETWORK_LOADING</a> = 2;
|
|
const unsigned short <a href="#dom-media-network_no_source" title="dom-media-NETWORK_NO_SOURCE">NETWORK_NO_SOURCE</a> = 3;
|
|
readonly attribute unsigned short <a href="#dom-media-networkstate" title="dom-media-networkState">networkState</a>;
|
|
attribute DOMString <a href="#dom-media-preload" title="dom-media-preload">preload</a>;
|
|
readonly attribute <a href="#timeranges">TimeRanges</a> <a href="#dom-media-buffered" title="dom-media-buffered">buffered</a>;
|
|
void <a href="#dom-media-load" title="dom-media-load">load</a>();
|
|
DOMString <a href="#dom-navigator-canplaytype" title="dom-navigator-canPlayType">canPlayType</a>(in DOMString type);
|
|
|
|
// ready state
|
|
const unsigned short <a href="#dom-media-have_nothing" title="dom-media-HAVE_NOTHING">HAVE_NOTHING</a> = 0;
|
|
const unsigned short <a href="#dom-media-have_metadata" title="dom-media-HAVE_METADATA">HAVE_METADATA</a> = 1;
|
|
const unsigned short <a href="#dom-media-have_current_data" title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</a> = 2;
|
|
const unsigned short <a href="#dom-media-have_future_data" title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</a> = 3;
|
|
const unsigned short <a href="#dom-media-have_enough_data" title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</a> = 4;
|
|
readonly attribute unsigned short <a href="#dom-media-readystate" title="dom-media-readyState">readyState</a>;
|
|
readonly attribute boolean <a href="#dom-media-seeking" title="dom-media-seeking">seeking</a>;
|
|
|
|
// playback state
|
|
attribute double <a href="#dom-media-currenttime" title="dom-media-currentTime">currentTime</a>;
|
|
readonly attribute double <a href="#dom-media-initialtime" title="dom-media-initialTime">initialTime</a>;
|
|
readonly attribute double <a href="#dom-media-duration" title="dom-media-duration">duration</a>;
|
|
readonly attribute <span>Date</span> <a href="#dom-media-startoffsettime" title="dom-media-startOffsetTime">startOffsetTime</a>;
|
|
readonly attribute boolean <a href="#dom-media-paused" title="dom-media-paused">paused</a>;
|
|
attribute double <a href="#dom-media-defaultplaybackrate" title="dom-media-defaultPlaybackRate">defaultPlaybackRate</a>;
|
|
attribute double <a href="#dom-media-playbackrate" title="dom-media-playbackRate">playbackRate</a>;
|
|
readonly attribute <a href="#timeranges">TimeRanges</a> <a href="#dom-media-played" title="dom-media-played">played</a>;
|
|
readonly attribute <a href="#timeranges">TimeRanges</a> <a href="#dom-media-seekable" title="dom-media-seekable">seekable</a>;
|
|
readonly attribute boolean <a href="#dom-media-ended" title="dom-media-ended">ended</a>;
|
|
attribute boolean <a href="#dom-media-autoplay" title="dom-media-autoplay">autoplay</a>;
|
|
attribute boolean <a href="#dom-media-loop" title="dom-media-loop">loop</a>;
|
|
void <a href="#dom-media-play" title="dom-media-play">play</a>();
|
|
void <a href="#dom-media-pause" title="dom-media-pause">pause</a>();
|
|
|
|
// media controller
|
|
attribute <span>DOMString</span> <a href="#dom-media-mediagroup" title="dom-media-mediaGroup">mediaGroup</a>;
|
|
attribute <a href="#mediacontroller">MediaController</a> <a href="#dom-media-controller" title="dom-media-controller">controller</a>;
|
|
|
|
// controls
|
|
attribute boolean <a href="#dom-media-controls" title="dom-media-controls">controls</a>;
|
|
attribute double <a href="#dom-media-volume" title="dom-media-volume">volume</a>;
|
|
attribute boolean <a href="#dom-media-muted" title="dom-media-muted">muted</a>;
|
|
attribute boolean <a href="#dom-media-defaultmuted" title="dom-media-defaultMuted">defaultMuted</a>;
|
|
|
|
// tracks
|
|
readonly attribute <a href="#multipletracklist">MultipleTrackList</a> <a href="#dom-media-audiotracks" title="dom-media-audioTracks">audioTracks</a>;
|
|
readonly attribute <a href="#exclusivetracklist">ExclusiveTrackList</a> <a href="#dom-media-videotracks" title="dom-media-videoTracks">videoTracks</a>;
|
|
readonly attribute <a href="#texttrack">TextTrack</a>[] <a href="#dom-media-texttracks" title="dom-media-textTracks">textTracks</a>;
|
|
<a href="#mutabletexttrack">MutableTextTrack</a> <a href="#dom-media-addtexttrack" title="dom-media-addTextTrack">addTextTrack</a>(in DOMString kind, in optional DOMString label, in optional DOMString language);
|
|
};</pre><p>The <dfn id="media-element-attributes">media element attributes</dfn>, <code title="attr-media-src"><a href="#attr-media-src">src</a></code>, <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code>, <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code>,
|
|
<code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code>,
|
|
<code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code>,
|
|
<code title="attr-media-muted"><a href="#attr-media-muted">muted</a></code>, and <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code>, apply to all <a href="#media-element" title="media element">media elements</a>. They are defined in
|
|
this section.</p><p><a href="#media-element" 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="media-data">media data</dfn> in this section, since this
|
|
section applies equally to <a href="#media-element" title="media element">media
|
|
elements</a> for audio or for video.
|
|
The term <dfn id="media-resource">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>A <a href="#media-resource">media resource</a> can have multiple audio and video
|
|
tracks. For the purposes of a <a href="#media-element">media element</a>, the video
|
|
data of the <a href="#media-resource">media resource</a> is only that of the
|
|
currently selected track (if any) given by the element's <code title="dom-media-videoTracks"><a href="#dom-media-videotracks">videoTracks</a></code> attribute, and the
|
|
audio data of the <a href="#media-resource">media resource</a> is the result of
|
|
mixing all the currently enabled tracks (if any) given by the
|
|
element's <code title="dom-media-audioTracks"><a href="#dom-media-audiotracks">audioTracks</a></code>
|
|
attribute.<p class="note">Both <code><a href="#the-audio-element">audio</a></code> and <code><a href="#the-video-element">video</a></code>
|
|
elements can be used for both audio and video. The main difference
|
|
between the two is simply that the <code><a href="#the-audio-element">audio</a></code> element has no
|
|
playback area for visual content (such as video or captions),
|
|
whereas the <code><a href="#the-video-element">video</a></code> element does.<div class="impl">
|
|
|
|
<p>Except where otherwise specified, the <a href="#task-source">task source</a>
|
|
for all the tasks <a href="#queue-a-task" title="queue a task">queued</a> in this
|
|
section and its subsections is the <dfn id="media-element-event-task-source">media element event task
|
|
source</dfn>.</p>
|
|
|
|
</div><h5 id="error-codes"><span class="secno">4.8.10.1 </span>Error codes</h5><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-error"><a href="#dom-media-error">error</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#mediaerror">MediaError</a></code> object representing the
|
|
current error state of the element.</p>
|
|
|
|
<p>Returns null if there is no error.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>All <a href="#media-element" title="media element">media elements</a> have an
|
|
associated error status, which records the last error the element
|
|
encountered since its <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a> was last invoked. The <dfn id="dom-media-error" 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>
|
|
|
|
</div><pre class="idl">interface <dfn id="mediaerror">MediaError</dfn> {
|
|
const unsigned short <a href="#dom-mediaerror-media_err_aborted" title="dom-MediaError-MEDIA_ERR_ABORTED">MEDIA_ERR_ABORTED</a> = 1;
|
|
const unsigned short <a href="#dom-mediaerror-media_err_network" title="dom-MediaError-MEDIA_ERR_NETWORK">MEDIA_ERR_NETWORK</a> = 2;
|
|
const unsigned short <a href="#dom-mediaerror-media_err_decode" title="dom-MediaError-MEDIA_ERR_DECODE">MEDIA_ERR_DECODE</a> = 3;
|
|
const unsigned short <a href="#dom-mediaerror-media_err_src_not_supported" title="dom-MediaError-MEDIA_ERR_SRC_NOT_SUPPORTED">MEDIA_ERR_SRC_NOT_SUPPORTED</a> = 4;
|
|
readonly attribute unsigned short <a href="#dom-mediaerror-code" title="dom-MediaError-code">code</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-error"><a href="#dom-media-error">error</a></code> . <code title="dom-MediaError-code"><a href="#dom-mediaerror-code">code</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current error's error code, from the list below.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-mediaerror-code" 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>
|
|
|
|
</div><dl><dt><dfn id="dom-mediaerror-media_err_aborted" title="dom-MediaError-MEDIA_ERR_ABORTED"><code>MEDIA_ERR_ABORTED</code></dfn> (numeric value 1)</dt>
|
|
|
|
<dd>The fetching process for the <a href="#media-resource">media resource</a> was
|
|
aborted by the user agent at the user's request.</dd>
|
|
|
|
<dt><dfn id="dom-mediaerror-media_err_network" 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 fetching the <a href="#media-resource">media resource</a>, after the resource
|
|
was established to be usable.</dd>
|
|
|
|
<dt><dfn id="dom-mediaerror-media_err_decode" 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="#media-resource">media resource</a>, after the resource was established to
|
|
be usable.</dd>
|
|
|
|
<dt><dfn id="dom-mediaerror-media_err_src_not_supported" title="dom-MediaError-MEDIA_ERR_SRC_NOT_SUPPORTED"><code>MEDIA_ERR_SRC_NOT_SUPPORTED</code></dfn> (numeric value 4)</dt>
|
|
|
|
<dd>The <a href="#media-resource">media resource</a> indicated by the <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute was not suitable.</dd>
|
|
|
|
</dl><h5 id="location-of-the-media-resource"><span class="secno">4.8.10.2 </span>Location of the media resource</h5><p>The <dfn id="attr-media-src" title="attr-media-src"><code>src</code></dfn> content
|
|
attribute on <a href="#media-element" title="media element">media elements</a> gives
|
|
the address of the media resource (video, audio) to show. The
|
|
attribute, if present, must contain a <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty
|
|
URL potentially surrounded by spaces</a>.<div class="impl">
|
|
|
|
<p>If a <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute of a
|
|
<a href="#media-element">media element</a> is set or changed, the user agent must
|
|
invoke the <a href="#media-element">media element</a>'s <a href="#media-element-load-algorithm">media element load
|
|
algorithm</a>. (<em>Removing</em> the <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute does not do this, even
|
|
if there are <code><a href="#the-source-element">source</a></code> elements present.)</p>
|
|
|
|
<p>The <dfn id="dom-media-src" title="dom-media-src"><code>src</code></dfn> IDL
|
|
attribute on <a href="#media-element" title="media element">media elements</a> must
|
|
<a href="#reflect">reflect</a> the content attribute of the same name.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-currentSrc"><a href="#dom-media-currentsrc">currentSrc</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the address of the current <a href="#media-resource">media resource</a>.</p>
|
|
|
|
<p>Returns the empty string when there is no <a href="#media-resource">media resource</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-currentsrc" title="dom-media-currentSrc"><code>currentSrc</code></dfn> IDL
|
|
attribute is initially the empty string. Its value is changed by the
|
|
<a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a> defined below.</p>
|
|
|
|
</div><p class="note">There are two ways to specify a <a href="#media-resource">media
|
|
resource</a>, the <code title="attr-media-src"><a href="#attr-media-src">src</a></code>
|
|
attribute, or <code><a href="#the-source-element">source</a></code> elements. The attribute overrides
|
|
the elements.<h5 id="mime-types"><span class="secno">4.8.10.3 </span>MIME types</h5><p>A <a href="#media-resource">media resource</a> can be described in terms of its
|
|
<em>type</em>, specifically a <a href="#mime-type">MIME type</a>, in some cases
|
|
with a <code title="">codecs</code> parameter. (Whether the <code title="">codecs</code> parameter is allowed or not depends on the
|
|
MIME type.) <a href="#refsRFC4281">[RFC4281]</a><p>Types are usually somewhat incomplete descriptions; for example
|
|
"<code title="">video/mpeg</code>" doesn't say anything except what
|
|
the container type is, and even a type like "<code title="">video/mp4; codecs="avc1.42E01E,
|
|
mp4a.40.2"</code>" doesn't include information like the actual
|
|
bitrate (only the maximum bitrate). Thus, given a type, a user agent
|
|
can often only know whether it <em>might</em> be able to play
|
|
media of that type (with varying levels of confidence), or whether
|
|
it definitely <em>cannot</em> play media of that type.<p><dfn id="a-type-that-the-user-agent-knows-it-cannot-render">A type that the user agent knows it cannot render</dfn> is
|
|
one that describes a resource that the user agent definitely does
|
|
not support, for example because it doesn't recognize the container
|
|
type, or it doesn't support the listed codecs.<p>The <a href="#mime-type">MIME type</a>
|
|
"<code>application/octet-stream</code>" with no parameters is never
|
|
<a href="#a-type-that-the-user-agent-knows-it-cannot-render">a type that the user agent knows it cannot render</a>. User
|
|
agents must treat that type as equivalent to the lack of any
|
|
explicit <a href="#content-type" title="Content-Type">Content-Type metadata</a>
|
|
when it is used to label a potential <a href="#media-resource">media
|
|
resource</a>.<p class="note">
|
|
"<code>application/octet-stream</code>"
|
|
is special-cased here; if any parameter appears with it, it
|
|
should
|
|
|
|
be treated just like any other <a href="#mime-type">MIME type</a>.
|
|
|
|
This is a deviation from the rule that unknown <a href="#mime-type">MIME type</a> parameters
|
|
should be ignored.
|
|
|
|
|
|
<dl class="domintro"><dt><var title="">media</var> . <code title="dom-navigator-canPlayType"><a href="#dom-navigator-canplaytype">canPlayType</a></code>(<var title="">type</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the empty string (a negative response), "maybe", or
|
|
"probably" based on how confident the user agent is that it can
|
|
play media resources of the given type.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-navigator-canplaytype" title="dom-navigator-canPlayType"><code>canPlayType(<var title="">type</var>)</code></dfn> method must return the empty
|
|
string if <var title="">type</var> is <a href="#a-type-that-the-user-agent-knows-it-cannot-render">a type that the user
|
|
agent knows it cannot render</a> or is the type
|
|
"<code>application/octet-stream</code>"; it must return "<code title="">probably</code>" if the user agent is confident that the
|
|
type represents a <a href="#media-resource">media resource</a> that it can render if
|
|
used in with this <code><a href="#the-audio-element">audio</a></code> or <code><a href="#the-video-element">video</a></code> element;
|
|
and it must return "<code title="">maybe</code>" otherwise.
|
|
Implementors are encouraged to return "<code title="">maybe</code>"
|
|
unless the type can be confidently established as being supported or
|
|
not. Generally, a user agent should never return "<code title="">probably</code>" for a type that allows the <code title="">codecs</code> parameter if that parameter is not
|
|
present.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This script tests to see if the user agent supports a
|
|
(fictional) new format to dynamically decide whether to use a
|
|
<code><a href="#the-video-element">video</a></code> element or a plugin:</p>
|
|
|
|
<pre><section id="video">
|
|
<p><a href="playing-cats.nfv">Download video</a></p>
|
|
</section>
|
|
<script>
|
|
var videoSection = document.getElementById('video');
|
|
var videoElement = document.createElement('video');
|
|
var support = videoElement.canPlayType('video/x-new-fictional-format;codecs="kittens,bunnies"');
|
|
if (support != "probably" && "New Fictional Video Plug-in" in navigator.plugins) {
|
|
// not confident of browser support
|
|
// but we have a plugin
|
|
// so use plugin instead
|
|
videoElement = document.createElement("embed");
|
|
} else if (support == "") {
|
|
// no support from browser and no plugin
|
|
// do nothing
|
|
videoElement = null;
|
|
}
|
|
if (videoElement) {
|
|
while (videoSection.hasChildNodes())
|
|
videoSection.removeChild(videoSection.firstChild);
|
|
videoElement.setAttribute("src", "playing-cats.nfv");
|
|
videoSection.appendChild(videoElement);
|
|
}
|
|
</script></pre>
|
|
|
|
</div><p class="note">The <code title="attr-source-type"><a href="#attr-source-type">type</a></code>
|
|
attribute of the <code><a href="#the-source-element">source</a></code> element allows the user agent
|
|
to avoid downloading resources that use formats it cannot
|
|
render.<h5 id="network-states"><span class="secno">4.8.10.4 </span>Network states</h5><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current state of network activity for the element,
|
|
from the codes in the list below.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>As <a href="#media-element" title="media element">media elements</a> interact
|
|
with the network, their current network activity is represented by
|
|
the <dfn id="dom-media-networkstate" title="dom-media-networkState"><code>networkState</code></dfn>
|
|
attribute. On getting, it must return the current network state of
|
|
the element, which must be one of the following values:</p>
|
|
|
|
</div><dl><dt><dfn id="dom-media-network_empty" title="dom-media-NETWORK_EMPTY"><code>NETWORK_EMPTY</code></dfn> (numeric value 0)</dt>
|
|
|
|
<dd>The element has not yet been initialized. All attributes are in
|
|
their initial states.</dd>
|
|
|
|
<dt><dfn id="dom-media-network_idle" title="dom-media-NETWORK_IDLE"><code>NETWORK_IDLE</code></dfn> (numeric value 1)</dt>
|
|
|
|
<dd>The element<span class="impl">'s <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a> is active and</span> has selected a <a href="#media-resource" title="media resource">resource</a>, but it is not actually
|
|
using the network at this time.</dd>
|
|
|
|
<dt><dfn id="dom-media-network_loading" title="dom-media-NETWORK_LOADING"><code>NETWORK_LOADING</code></dfn> (numeric value 2)</dt>
|
|
|
|
<dd>The user agent is actively trying to download data.</dd>
|
|
|
|
<dt><dfn id="dom-media-network_no_source" title="dom-media-NETWORK_NO_SOURCE"><code>NETWORK_NO_SOURCE</code></dfn> (numeric value 3)</dt>
|
|
|
|
<dd>The element<span class="impl">'s <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a> is active, but it</span> has not yet found a <a href="#media-resource" title="media resource">resource</a> to use.</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a> defined below describes exactly when the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute changes
|
|
value and what events fire to indicate changes in this state.</p>
|
|
|
|
</div><h5 id="loading-the-media-resource"><span class="secno">4.8.10.5 </span>Loading the media resource</h5><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-load"><a href="#dom-media-load">load</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Causes the element to reset and start selecting and loading a
|
|
new <a href="#media-resource">media resource</a> from scratch.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>All <a href="#media-element" title="media element">media elements</a> have an
|
|
<dfn id="autoplaying-flag">autoplaying flag</dfn>, which must begin in the true state, and
|
|
a <dfn id="delaying-the-load-event-flag">delaying-the-load-event flag</dfn>, which must begin in the
|
|
false state. While the <a href="#delaying-the-load-event-flag">delaying-the-load-event flag</a> is
|
|
true, the element must <a href="#delay-the-load-event">delay the load event</a> of its
|
|
document.</p>
|
|
|
|
<p>When the <dfn id="dom-media-load" title="dom-media-load"><code>load()</code></dfn>
|
|
method on a <a href="#media-element">media element</a> is invoked, the user agent
|
|
must run the <a href="#media-element-load-algorithm">media element load algorithm</a>.</p>
|
|
|
|
<p>The <dfn id="media-element-load-algorithm">media element load algorithm</dfn> consists of the
|
|
following steps.</p>
|
|
|
|
<ol><li><p>Abort any already-running instance of the <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a> for this element.</li>
|
|
|
|
<li>
|
|
|
|
<p>If there are any <a href="#concept-task" title="concept-task">tasks</a> from
|
|
the <a href="#media-element">media element</a>'s <a href="#media-element-event-task-source">media element event task
|
|
source</a> in one of the <a href="#task-queue" title="task queue">task
|
|
queues</a>, then remove those tasks.</p>
|
|
|
|
<p class="note">Basically, pending events and callbacks for the
|
|
media element are discarded when the media element starts loading
|
|
a new resource.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> is set to <code title="dom-media-NETWORK_LOADING"><a href="#dom-media-network_loading">NETWORK_LOADING</a></code> or <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code>, <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-abort"><a href="#event-media-abort">abort</a></code> at the <a href="#media-element">media
|
|
element</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#media-element">media element</a>'s <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> is not set to
|
|
<code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>, then
|
|
run these substeps:</p>
|
|
|
|
<ol><li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-emptied"><a href="#event-media-emptied">emptied</a></code> at the <a href="#media-element">media
|
|
element</a>.</li>
|
|
|
|
<li><p>If a fetching process is in progress for the <a href="#media-element">media
|
|
element</a>, the user agent should stop it.</li>
|
|
|
|
<li><p>Set the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
<code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>.</li>
|
|
|
|
<li><p><a href="#forget-the-media-element-s-media-resource-specific-text-tracks">Forget the media element's media-resource-specific
|
|
text tracks</a>.</li>
|
|
|
|
<li><p>If <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is
|
|
not set to <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, then set it
|
|
to that state.
|
|
|
|
</li>
|
|
|
|
<li><p>If the <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code>
|
|
attribute is false, then set it to true.</li>
|
|
|
|
<li><p>If <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> is true,
|
|
set it to false.</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the <a href="#current-playback-position">current playback position</a> to 0.</p>
|
|
|
|
<p>If this changed the <a href="#current-playback-position">current playback position</a>,
|
|
then <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the
|
|
<a href="#media-element">media element</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Set the <a href="#initial-playback-position">initial playback position</a> to
|
|
0.</li>
|
|
|
|
<li><p>Set the <a href="#timeline-offset">timeline offset</a> to Not-a-Number
|
|
(NaN).</li>
|
|
|
|
<li>
|
|
|
|
<p>Update the <code title="dom-media-duration"><a href="#dom-media-duration">duration</a></code>
|
|
attribute to Not-a-Number (NaN).</p>
|
|
|
|
<p class="note">The user agent <a href="#durationChange">will
|
|
not</a> fire a <code title="event-media-durationchange"><a href="#event-media-durationchange">durationchange</a></code> event
|
|
for this particular change of the duration.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Set the <code title="dom-media-playbackRate"><a href="#dom-media-playbackrate">playbackRate</a></code> attribute to the
|
|
value of the <code title="dom-media-defaultPlaybackRate"><a href="#dom-media-defaultplaybackrate">defaultPlaybackRate</a></code>
|
|
attribute.</li>
|
|
|
|
<li><p>Set the <code title="dom-media-error"><a href="#dom-media-error">error</a></code> attribute
|
|
to null and the <a href="#autoplaying-flag">autoplaying flag</a> to true.</li>
|
|
|
|
<li><p>Invoke the <a href="#media-element">media element</a>'s <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p class="note">Playback of any previously playing <a href="#media-resource">media
|
|
resource</a> for this element stops.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The <dfn id="concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</dfn> for a <a href="#media-element">media element</a> is as follows. This
|
|
algorithm is always invoked synchronously, but one of the first
|
|
steps in the algorithm is to return and continue running the
|
|
remaining steps asynchronously, meaning that it runs in the
|
|
background with scripts and other <a href="#concept-task" title="concept-task">tasks</a> running in parallel. In addition,
|
|
this algorithm interacts closely with the <a href="#event-loop">event loop</a>
|
|
mechanism; in particular, it has <a href="#synchronous-section" title="synchronous
|
|
section">synchronous sections</a> (which are triggered as part of
|
|
the <a href="#event-loop">event loop</a> algorithm). Steps in such sections are
|
|
marked with ⌛.</p>
|
|
|
|
<ol><li><p>Set the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> to <code title="dom-media-NETWORK_NO_SOURCE"><a href="#dom-media-network_no_source">NETWORK_NO_SOURCE</a></code>.</li>
|
|
|
|
<li><p>Asynchronously <a href="#await-a-stable-state">await a stable state</a>, allowing
|
|
the <a href="#concept-task" title="concept-task">task</a> that invoked this
|
|
algorithm to continue. The <a href="#synchronous-section">synchronous section</a>
|
|
consists of all the remaining steps of this algorithm until the
|
|
algorithm says the <a href="#synchronous-section">synchronous section</a> has
|
|
ended. (Steps in <a href="#synchronous-section" title="synchronous section">synchronous
|
|
sections</a> are marked with ⌛.)</li>
|
|
|
|
<li>
|
|
|
|
<p>⌛ If the <a href="#media-element">media element</a> has a <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute, then let <var title="">mode</var> be <i title="">attribute</i>.</p>
|
|
|
|
<p>⌛ Otherwise, if the <a href="#media-element">media element</a> does not
|
|
have a <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute but has a
|
|
<code><a href="#the-source-element">source</a></code> element child, then let <var title="">mode</var> be <i title="">children</i> and let <var title="">candidate</var> be the first such <code><a href="#the-source-element">source</a></code>
|
|
element child in <a href="#tree-order">tree order</a>.</p>
|
|
|
|
<p>⌛ Otherwise the <a href="#media-element">media element</a> has neither a
|
|
<code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute nor a
|
|
<code><a href="#the-source-element">source</a></code> element child: set the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> to <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>, and abort
|
|
these steps; the <a href="#synchronous-section">synchronous section</a> ends.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>⌛ Set the <a href="#media-element">media element</a>'s
|
|
<a href="#delaying-the-load-event-flag">delaying-the-load-event flag</a> to true (this <a href="#delay-the-load-event" title="delay the load event">delays the load event</a>), and set
|
|
its <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> to
|
|
<code title="dom-media-NETWORK_LOADING"><a href="#dom-media-network_loading">NETWORK_LOADING</a></code>.</li>
|
|
|
|
<li><p>⌛ <a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-loadstart"><a href="#event-media-loadstart">loadstart</a></code> at the <a href="#media-element">media
|
|
element</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">mode</var> is <i title="">attribute</i>, then
|
|
run these substeps:</p>
|
|
|
|
<ol><li><p>⌛ <i>Process candidate</i>: If the <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute's value is the empty
|
|
string, then end the <a href="#synchronous-section">synchronous section</a>, and jump
|
|
down to the <i title="">failed</i> step below.</li>
|
|
|
|
<li><p>⌛ Let <var title="">absolute URL</var> be the
|
|
<a href="#absolute-url">absolute URL</a> that would have resulted from <a href="#resolve-a-url" title="resolve a url">resolving</a> the <a href="#url">URL</a>
|
|
specified by the <code title="attr-media-src"><a href="#attr-media-src">src</a></code>
|
|
attribute's value relative to the <a href="#media-element">media element</a> when
|
|
the <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute was last
|
|
changed.</p>
|
|
<li><p>⌛ If <var title="">absolute URL</var> was obtained
|
|
successfully, set the <code title="dom-media-currentSrc"><a href="#dom-media-currentsrc">currentSrc</a></code> attribute to <var title="">absolute URL</var>.</li>
|
|
|
|
<li><p>End the <a href="#synchronous-section">synchronous section</a>, continuing the
|
|
remaining steps asynchronously.</li>
|
|
|
|
<li><p>If <var title="">absolute URL</var> was obtained
|
|
successfully, run the <a href="#concept-media-load-resource" title="concept-media-load-resource">resource fetch
|
|
algorithm</a> with <var title="">absolute URL</var>. If that
|
|
algorithm returns without aborting <em>this</em> one, then the
|
|
load failed.</li>
|
|
|
|
<li>
|
|
|
|
<p><i>Failed</i>: Reaching this step indicates that the media
|
|
resource failed to load or that the given <a href="#url">URL</a> could
|
|
not be <a href="#resolve-a-url" title="resolve a url">resolved</a>. In one
|
|
atomic operation, run the following steps:</p>
|
|
|
|
<ol><li><p>Set the <code title="dom-media-error"><a href="#dom-media-error">error</a></code>
|
|
attribute to a new <code><a href="#mediaerror">MediaError</a></code> object whose <code title="dom-MediaError-code"><a href="#dom-mediaerror-code">code</a></code> attribute is set to
|
|
<code title="dom-MediaError-MEDIA_ERR_SRC_NOT_SUPPORTED"><a href="#dom-mediaerror-media_err_src_not_supported">MEDIA_ERR_SRC_NOT_SUPPORTED</a></code>.</li>
|
|
|
|
<li><p><a href="#forget-the-media-element-s-media-resource-specific-text-tracks">Forget the media element's media-resource-specific
|
|
text tracks</a>.</li>
|
|
|
|
<li><p>Set the element's <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
the <a href="#dom-media-network_no_source" title="dom-media-NETWORK_NO_SOURCE">NETWORK_NO_SOURCE</a>
|
|
value.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-error"><a href="#event-media-error">error</a></code>
|
|
at the <a href="#media-element">media element</a>.</li>
|
|
|
|
<li><p>Set the element's <a href="#delaying-the-load-event-flag">delaying-the-load-event flag</a>
|
|
to false. This stops <a href="#delay-the-load-event" title="delay the load event">delaying
|
|
the load event</a>.</li>
|
|
|
|
<li><p>Abort these steps. Until the <code title="dom-media-load"><a href="#dom-media-load">load()</a></code> method is invoked or the
|
|
<code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute is changed, the
|
|
element won't attempt to load another resource.</li>
|
|
|
|
|
|
</ol><p>Otherwise, the <code><a href="#the-source-element">source</a></code> elements will be used; run
|
|
these substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>⌛ Let <var title="">pointer</var> be a position
|
|
defined by two adjacent nodes in the <a href="#media-element">media
|
|
element</a>'s child list, treating the start of the list
|
|
(before the first child in the list, if any) and end of the list
|
|
(after the last child in the list, if any) as nodes in their own
|
|
right. One node is the node before <var title="">pointer</var>,
|
|
and the other node is the node after <var title="">pointer</var>. Initially, let <var title="">pointer</var> be the position between the <var title="">candidate</var> node and the next node, if there are
|
|
any, or the end of the list, if it is the last node.</p>
|
|
|
|
<p>As nodes are inserted and removed into the <a href="#media-element">media
|
|
element</a>, <var title="">pointer</var> must be updated as
|
|
follows:</p>
|
|
|
|
<dl><dt>If a new node is inserted between the two nodes that
|
|
define <var title="">pointer</var></dt>
|
|
|
|
<dd>Let <var title="">pointer</var> be the point between the
|
|
node before <var title="">pointer</var> and the new node. In
|
|
other words, insertions at <var title="">pointer</var> go after
|
|
<var title="">pointer</var>.</dd>
|
|
|
|
<dt>If the node before <var title="">pointer</var> is removed</dt>
|
|
|
|
<dd>Let <var title="">pointer</var> be the point between the
|
|
node after <var title="">pointer</var> and the node before the
|
|
node after <var title="">pointer</var>. In other words, <var title="">pointer</var> doesn't move relative to the remaining
|
|
nodes.</dd>
|
|
|
|
<dt>If the node after <var title="">pointer</var> is removed</dt>
|
|
|
|
<dd>Let <var title="">pointer</var> be the point between the
|
|
node before <var title="">pointer</var> and the node after the
|
|
node before <var title="">pointer</var>. Just as with the
|
|
previous case, <var title="">pointer</var> doesn't move
|
|
relative to the remaining nodes.</dd>
|
|
|
|
</dl><p>Other changes don't affect <var title="">pointer</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>⌛ <i>Process candidate</i>: If <var title="">candidate</var> does not have a <code title="attr-source-src"><a href="#attr-source-src">src</a></code> attribute, or if its <code title="attr-source-src"><a href="#attr-source-src">src</a></code> attribute's value is the empty
|
|
string, then end the <a href="#synchronous-section">synchronous section</a>, and jump
|
|
down to the <i title="">failed</i> step below.</li>
|
|
|
|
<li><p>⌛ Let <var title="">absolute URL</var> be the
|
|
<a href="#absolute-url">absolute URL</a> that would have resulted from <a href="#resolve-a-url" title="resolve a url">resolving</a> the <a href="#url">URL</a>
|
|
specified by <var title="">candidate</var>'s <code title="attr-source-src"><a href="#attr-source-src">src</a></code> attribute's value relative to
|
|
the <var title="">candidate</var> when the <code title="attr-source-src"><a href="#attr-source-src">src</a></code> attribute was last
|
|
changed.</p>
|
|
<li><p>⌛ If <var title="">absolute URL</var> was not
|
|
obtained successfully, then end the <a href="#synchronous-section">synchronous
|
|
section</a>, and jump down to the <i title="">failed</i> step
|
|
below.</li>
|
|
|
|
<li><p>⌛ If <var title="">candidate</var> has a <code title="attr-source-type"><a href="#attr-source-type">type</a></code> attribute whose value, when
|
|
parsed as a <a href="#mime-type">MIME type</a> (including any codecs
|
|
described by the <code title="">codecs</code> parameter, for
|
|
types that define that parameter), represents <a href="#a-type-that-the-user-agent-knows-it-cannot-render">a type that
|
|
the user agent knows it cannot render</a>, then end the
|
|
<a href="#synchronous-section">synchronous section</a>, and jump down to the <i title="">failed</i> step below.</li>
|
|
|
|
<li><p>⌛ If <var title="">candidate</var> has a <code title="attr-source-media"><a href="#attr-source-media">media</a></code> attribute whose value does
|
|
not <a href="#matches-the-environment" title="matches the environment">match the
|
|
environment</a>, then end the <a href="#synchronous-section">synchronous
|
|
section</a>, and jump down to the <i title="">failed</i> step
|
|
below.</li>
|
|
|
|
<li><p>⌛ Set the <code title="dom-media-currentSrc"><a href="#dom-media-currentsrc">currentSrc</a></code> attribute to <var title="">absolute URL</var>.</li>
|
|
|
|
<li><p>End the <a href="#synchronous-section">synchronous section</a>, continuing the
|
|
remaining steps asynchronously.</li>
|
|
|
|
<li><p>Run the <a href="#concept-media-load-resource" title="concept-media-load-resource">resource
|
|
fetch algorithm</a> with <var title="">absolute URL</var>. If
|
|
that algorithm returns without aborting <em>this</em> one, then
|
|
the load failed.</li>
|
|
|
|
<li><p><i title="">Failed</i>: <a href="#queue-a-task">Queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-error">error</code> at the <var title="">candidate</var> element, in the context of the <a href="#fetch" title="fetch">fetching process</a> that was used to try to
|
|
obtain <var title="">candidate</var>'s corresponding <a href="#media-resource">media
|
|
resource</a> in the <a href="#concept-media-load-resource" title="concept-media-load-resource">resource fetch
|
|
algorithm</a>.</li>
|
|
|
|
<li><p>Asynchronously <a href="#await-a-stable-state">await a stable state</a>. The
|
|
<a href="#synchronous-section">synchronous section</a> consists of all the remaining
|
|
steps of this algorithm until the algorithm says the
|
|
<a href="#synchronous-section">synchronous section</a> has ended. (Steps in <a href="#synchronous-section" title="synchronous section">synchronous sections</a> are
|
|
marked with ⌛.)</li>
|
|
|
|
<li><p>⌛ <a href="#forget-the-media-element-s-media-resource-specific-text-tracks">Forget the media element's
|
|
media-resource-specific text tracks</a>.</li>
|
|
|
|
<li><p>⌛ <i title="">Find next candidate</i>: Let <var title="">candidate</var> be null.</li>
|
|
|
|
<li><p>⌛ <i title="">Search loop</i>: If the node after
|
|
<var title="">pointer</var> is the end of the list, then jump to
|
|
the <i title="">waiting</i> step below.</li>
|
|
|
|
<li><p>⌛ If the node after <var title="">pointer</var> is
|
|
a <code><a href="#the-source-element">source</a></code> element, let <var title="">candidate</var>
|
|
be that element.</li>
|
|
|
|
<li><p>⌛ Advance <var title="">pointer</var> so that the
|
|
node before <var title="">pointer</var> is now the node that was
|
|
after <var title="">pointer</var>, and the node after <var title="">pointer</var> is the node after the node that used to be
|
|
after <var title="">pointer</var>, if any.</li>
|
|
|
|
<li><p>⌛ If <var title="">candidate</var> is null, jump
|
|
back to the <i title="">search loop</i> step. Otherwise, jump
|
|
back to the <i title="">process candidate</i> step.</li>
|
|
|
|
<li><p>⌛ <i title="">Waiting</i>: Set the element's <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
the <a href="#dom-media-network_no_source" title="dom-media-NETWORK_NO_SOURCE">NETWORK_NO_SOURCE</a>
|
|
value.</li>
|
|
|
|
<li><p>⌛ Set the element's <a href="#delaying-the-load-event-flag">delaying-the-load-event
|
|
flag</a> to false. This stops <a href="#delay-the-load-event" title="delay the load
|
|
event">delaying the load event</a>.</li>
|
|
|
|
<li><p>End the <a href="#synchronous-section">synchronous section</a>, continuing the
|
|
remaining steps asynchronously.</li>
|
|
|
|
<li><p>Wait until the node after <var title="">pointer</var> is a
|
|
node other than the end of the list. (This step might wait
|
|
forever.)</li>
|
|
|
|
<li><p>Asynchronously <a href="#await-a-stable-state">await a stable state</a>. The
|
|
<a href="#synchronous-section">synchronous section</a> consists of all the remaining
|
|
steps of this algorithm until the algorithm says the
|
|
<a href="#synchronous-section">synchronous section</a> has ended. (Steps in <a href="#synchronous-section" title="synchronous section">synchronous sections</a> are
|
|
marked with ⌛.)</li>
|
|
|
|
<li><p>⌛ Set the element's <a href="#delaying-the-load-event-flag">delaying-the-load-event
|
|
flag</a> back to true (this <a href="#delay-the-load-event" title="delay the load
|
|
event">delays the load event</a> again, in case it hasn't been
|
|
fired yet).</p>
|
|
|
|
<li><p>⌛ Set the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> back to <code title="dom-media-NETWORK_LOADING"><a href="#dom-media-network_loading">NETWORK_LOADING</a></code>.</li>
|
|
|
|
<li><p>⌛ Jump back to the <i title="">find next
|
|
candidate</i> step above.</li>
|
|
|
|
</ol></li>
|
|
|
|
</ol><p>The <dfn id="concept-media-load-resource" title="concept-media-load-resource">resource fetch
|
|
algorithm</dfn> for a <a href="#media-element">media element</a> and a given
|
|
<a href="#absolute-url">absolute URL</a> is as follows:</p>
|
|
|
|
<ol><li><p>Let the <var title="">current media resource</var> be the
|
|
resource given by the <a href="#absolute-url">absolute URL</a> passed to this
|
|
algorithm. This is now the element's <a href="#media-resource">media
|
|
resource</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Begin to <a href="#fetch">fetch</a> the <var title="">current media
|
|
resource</var>, from the <a href="#media-element">media element</a>'s
|
|
<code><a href="#document">Document</a></code>'s <a href="#origin">origin</a>, with the <i>force
|
|
same-origin flag</i> set.</p>
|
|
<p>Every 350ms (±200ms) or for every byte received, whichever
|
|
is <em>least</em> frequent, <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-progress"><a href="#event-media-progress">progress</a></code> at the element.</p>
|
|
|
|
<p>The <dfn id="stall-timeout">stall timeout</dfn> is a user-agent defined length of
|
|
time, which should be about three seconds. When a <a href="#media-element">media
|
|
element</a> that is actively attempting to obtain <a href="#media-data">media
|
|
data</a> has failed to receive any data for a duration equal to
|
|
the <a href="#stall-timeout">stall timeout</a>, the user agent must <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-stalled"><a href="#event-media-stalled">stalled</a></code> at the element.</p>
|
|
|
|
<p>User agents may allow users to selectively block or slow
|
|
<a href="#media-data">media data</a> downloads. When a <a href="#media-element">media
|
|
element</a>'s download has been blocked altogether, the user
|
|
agent must act as if it was stalled (as opposed to acting as if
|
|
the connection was closed). The rate of the download may also be
|
|
throttled automatically by the user agent, e.g. to balance the
|
|
download with other connections sharing the same bandwidth.</p>
|
|
|
|
<p>User agents may decide to not download more content at any
|
|
time, e.g. after buffering five minutes of a one hour media
|
|
resource, while waiting for the user to decide whether to play the
|
|
resource or not, or while waiting for user input in an interactive
|
|
resource. When a <a href="#media-element">media element</a>'s download has been
|
|
suspended, the user agent must set the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> to <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code> and <a href="#queue-a-task">queue
|
|
a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-suspend"><a href="#event-media-suspend">suspend</a></code> at the element. If and
|
|
when downloading of the resource resumes, the user agent must set
|
|
the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> to
|
|
<code title="dom-media-NETWORK_LOADING"><a href="#dom-media-network_loading">NETWORK_LOADING</a></code>.</p>
|
|
|
|
<p class="note">The <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code> attribute provides a
|
|
hint regarding how much buffering the author thinks is advisable,
|
|
even in the absence of the <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code> attribute.</p>
|
|
|
|
<p>When a user agent decides to completely stall a download,
|
|
e.g. if it is waiting until the user starts playback before
|
|
downloading any further content, the element's
|
|
<a href="#delaying-the-load-event-flag">delaying-the-load-event flag</a> must be set to
|
|
false. This stops <a href="#delay-the-load-event" title="delay the load event">delaying the
|
|
load event</a>.</p>
|
|
|
|
<p>The user agent may use whatever means necessary to fetch 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 range retrieval requests, or
|
|
switching to a streaming protocol. The user agent must consider a
|
|
resource erroneous only if it has given up trying to fetch it.</p>
|
|
|
|
<p>The <a href="#networking-task-source">networking task source</a> <a href="#concept-task" title="concept-task">tasks</a> to process the data as it is
|
|
being fetched must, when appropriate, include the relevant
|
|
substeps from the following list:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#media-data">media data</a> cannot be fetched at all, due
|
|
to network errors, causing the user agent to give up trying to
|
|
fetch the resource</dt>
|
|
|
|
<dt>If the <a href="#media-resource">media resource</a> is found to have <a href="#content-type" title="Content-Type">Content-Type metadata</a> that, when
|
|
parsed as a <a href="#mime-type">MIME type</a> (including any codecs
|
|
described by the <code title="">codecs</code> parameter, if the
|
|
parameter is defined for that type), represents <a href="#a-type-that-the-user-agent-knows-it-cannot-render">a type that
|
|
the user agent knows it cannot render</a> (even if the actual
|
|
<a href="#media-data">media data</a> is in a supported format)</dt>
|
|
|
|
<dt>If the <a href="#media-data">media data</a> can be fetched but is found by
|
|
inspection to be in an unsupported format, or can otherwise not
|
|
be rendered at all</dt>
|
|
|
|
<dd>
|
|
|
|
<p>DNS errors, HTTP 4xx and 5xx errors (and equivalents in
|
|
other protocols), and other fatal network errors that occur
|
|
before the user agent has established whether the <var title="">current media resource</var> is usable, as well as
|
|
the file using an unsupported container format, or using
|
|
unsupported codecs for all the data, must cause the user agent
|
|
to execute the following steps:</p>
|
|
|
|
<ol><li><p>The user agent should cancel the fetching
|
|
process.</li>
|
|
|
|
<li><p>Abort this subalgorithm, returning to the <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</p>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
|
|
|
|
|
|
<dt id="getting-media-metadata">Once enough of the <a href="#media-data">media
|
|
data</a> has been fetched to determine the duration of the
|
|
<a href="#media-resource">media resource</a>, its dimensions, and other
|
|
metadata,
|
|
and once <a href="#the-text-tracks-are-ready">the text tracks are ready</a>
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
<p>This indicates that the resource is usable. The user agent
|
|
must follow these substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p><a href="#defineTimeline">Establish the media timeline</a> for the purposes
|
|
of the <a href="#current-playback-position">current playback position</a>, the
|
|
<a href="#earliest-possible-position">earliest possible position</a>, and the <a href="#initial-playback-position">initial
|
|
playback position</a>, based on the <a href="#media-data">media
|
|
data</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Update the <a href="#timeline-offset">timeline offset</a> to the date and
|
|
time that corresponds to the zero time in the <a href="#media-timeline">media
|
|
timeline</a> established in the previous step, if any. If
|
|
no explicit time and date is given by the <a href="#media-resource">media
|
|
resource</a>, the <a href="#timeline-offset">timeline offset</a> must be set
|
|
to Not-a-Number (NaN).</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Set the <a href="#current-playback-position">current playback position</a> to the
|
|
<a href="#earliest-possible-position">earliest possible position</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Update the <code title="dom-media-duration"><a href="#dom-media-duration">duration</a></code>
|
|
attribute with the time of the last frame of the resource, if
|
|
known, on the <a href="#media-timeline">media timeline</a> established above.
|
|
If it is not known (e.g. a stream that is in principle
|
|
infinite), update the <code title="dom-media-duration"><a href="#dom-media-duration">duration</a></code> attribute to the
|
|
value positive Infinity.</p>
|
|
|
|
<p class="note">The user agent <a href="#durationChange">will</a> <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-durationchange"><a href="#event-media-durationchange">durationchange</a></code> at the
|
|
element at this point.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>For <code><a href="#the-video-element">video</a></code> elements, set the <code title="dom-video-videoWidth"><a href="#dom-video-videowidth">videoWidth</a></code> and <code title="dom-video-videoHeight"><a href="#dom-video-videoheight">videoHeight</a></code>
|
|
attributes.</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute to
|
|
<code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code>.</p>
|
|
|
|
<p class="note">A <code title="event-media-loadedmetadata"><a href="#event-media-loadedmetadata">loadedmetadata</a></code> DOM
|
|
event <a href="#fire-loadedmetadata">will be fired</a> as part
|
|
of setting the <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute to a
|
|
new value.</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">jumped</var> be false.</li>
|
|
|
|
<li>
|
|
|
|
<p>If either the <a href="#media-resource">media resource</a> or the address of
|
|
the <var title="">current media resource</var> indicate a
|
|
particular start time, then set the <a href="#initial-playback-position">initial playback
|
|
position</a> to that time, <a href="#dom-media-seek" title="dom-media-seek">seek</a> to that time, and let <var title="">jumped</var> be true. Ignore any resulting exceptions
|
|
(if the position is out of range, it is effectively
|
|
ignored).</p>
|
|
|
|
<p class="example">For example, with media formats that
|
|
support the <cite>Media Fragments URI</cite> fragment
|
|
identifier syntax, the fragment identifier can be used to
|
|
indicate a start position. <a href="#refsMEDIAFRAG">[MEDIAFRAG]</a></p>
|
|
|
|
</li>
|
|
|
|
<li><p>If either the <a href="#media-resource">media resource</a> or the address
|
|
of the <var title="">current media resource</var> indicate a
|
|
particular set of audio or video tracks to enable, then the
|
|
selected audio tracks must be enabled in the element's <code title="dom-media-audioTracks"><a href="#dom-media-audiotracks">audioTracks</a></code> object, and
|
|
the first selected video track must be selected in the
|
|
element's <code title="dom-media-videoTracks"><a href="#dom-media-videotracks">videoTracks</a></code>
|
|
object.</li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current
|
|
media controller</a>, then: if <var title="">jumped</var> is
|
|
true and the <a href="#initial-playback-position">initial playback position</a>, relative
|
|
to the <a href="#current-media-controller">current media controller</a>'s timeline, is
|
|
greater than the <a href="#current-media-controller">current media controller</a>'s
|
|
<a href="#media-controller-position">media controller position</a>, then <a href="#seek-the-media-controller">seek the
|
|
media controller</a> to the <a href="#media-element">media element</a>'s
|
|
<a href="#initial-playback-position">initial playback position</a>, relative to the
|
|
<a href="#current-media-controller">current media controller</a>'s timeline; otherwise,
|
|
<a href="#dom-media-seek" title="dom-media-seek">seek</a> the <a href="#media-element">media
|
|
element</a> to the <a href="#media-controller-position">media controller position</a>,
|
|
relative to the <a href="#media-element">media element</a>'s timeline,
|
|
discarding any resulting exceptions.</li>
|
|
<li>
|
|
|
|
<p>Once the <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute
|
|
reaches <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code>,
|
|
<a href="#fire-loadeddata">after the <code title="event-media-loadeddata">loadeddata</code> event has been
|
|
fired</a>, set the element's <a href="#delaying-the-load-event-flag">delaying-the-load-event
|
|
flag</a> to false. This stops <a href="#delay-the-load-event" title="delay the load
|
|
event">delaying the load event</a>.</p>
|
|
|
|
<p class="note">A user agent that is attempting to reduce
|
|
network usage while still fetching the metadata for each
|
|
<a href="#media-resource">media resource</a> would also stop buffering at this
|
|
point, causing the <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute
|
|
to switch to the <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code> value.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p class="note">The user agent is <em>required</em> to
|
|
determine the duration of the <a href="#media-resource">media resource</a> and
|
|
go through this step before playing.</p>
|
|
</dd>
|
|
|
|
|
|
<dt>Once the entire <a href="#media-resource">media resource</a> has been <a href="#fetch" title="fetch">fetched</a> (but potentially before any of it
|
|
has been decoded)</dt>
|
|
|
|
<dd>
|
|
|
|
<p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-media-progress"><a href="#event-media-progress">progress</a></code> at the
|
|
<a href="#media-element">media element</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the connection is interrupted, causing the user agent to
|
|
give up trying to fetch the resource</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Fatal network errors that occur after the user agent has
|
|
established whether the <var title="">current media
|
|
resource</var> is usable must cause the user agent to execute
|
|
the following steps:</p>
|
|
|
|
<ol><li><p>The user agent should cancel the fetching
|
|
process.</li>
|
|
|
|
<li><p>Set the <code title="dom-media-error"><a href="#dom-media-error">error</a></code>
|
|
attribute to a new <code><a href="#mediaerror">MediaError</a></code> object whose <code title="dom-MediaError-code"><a href="#dom-mediaerror-code">code</a></code> attribute is set to
|
|
<code title="dom-MediaError-MEDIA_ERR_NETWORK"><a href="#dom-mediaerror-media_err_network">MEDIA_ERR_NETWORK</a></code>.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-error"><a href="#event-media-error">error</a></code>
|
|
at the <a href="#media-element">media element</a>.</li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute has a
|
|
value equal to <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, set the
|
|
element's <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
the <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>
|
|
value and <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-emptied"><a href="#event-media-emptied">emptied</a></code>
|
|
at the element. Otherwise, set the element's <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
the <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code>
|
|
value.</li>
|
|
|
|
<li><p>Set the element's <a href="#delaying-the-load-event-flag">delaying-the-load-event
|
|
flag</a> to false. This stops <a href="#delay-the-load-event" title="delay the load
|
|
event">delaying the load event</a>.</li>
|
|
|
|
<li><p>Abort the overall <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt id="fatal-decode-error">If the <a href="#media-data">media data</a> is
|
|
corrupted</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Fatal errors in decoding the <a href="#media-data">media data</a> that
|
|
occur after the user agent has established whether the <var title="">current media resource</var> is usable must cause the
|
|
user agent to execute the following steps:</p>
|
|
|
|
<ol><li><p>The user agent should cancel the fetching
|
|
process.</li>
|
|
|
|
<li><p>Set the <code title="dom-media-error"><a href="#dom-media-error">error</a></code>
|
|
attribute to a new <code><a href="#mediaerror">MediaError</a></code> object whose <code title="dom-MediaError-code"><a href="#dom-mediaerror-code">code</a></code> attribute is set to
|
|
<code title="dom-MediaError-MEDIA_ERR_DECODE"><a href="#dom-mediaerror-media_err_decode">MEDIA_ERR_DECODE</a></code>.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-error"><a href="#event-media-error">error</a></code>
|
|
at the <a href="#media-element">media element</a>.</li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute has a
|
|
value equal to <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, set the
|
|
element's <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
the <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>
|
|
value and <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-emptied"><a href="#event-media-emptied">emptied</a></code>
|
|
at the element. Otherwise, set the element's <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
the <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code>
|
|
value.</li>
|
|
|
|
<li><p>Set the element's <a href="#delaying-the-load-event-flag">delaying-the-load-event
|
|
flag</a> to false. This stops <a href="#delay-the-load-event" title="delay the load
|
|
event">delaying the load event</a>.</li>
|
|
|
|
<li><p>Abort the overall <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>If the <a href="#media-data">media data</a> fetching process is aborted by
|
|
the user</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The fetching process 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="#dom-media-load">load()</a></code>
|
|
method itself is invoked while these steps are running, as the
|
|
steps above handle that particular kind of abort.</p>
|
|
|
|
<ol><li><p>The user agent should cancel the fetching
|
|
process.</li>
|
|
|
|
<li><p>Set the <code title="dom-media-error"><a href="#dom-media-error">error</a></code>
|
|
attribute to a new <code><a href="#mediaerror">MediaError</a></code> object whose <code title="dom-MediaError-code"><a href="#dom-mediaerror-code">code</a></code> attribute is set to
|
|
<code title="dom-MediaError-MEDIA_ERR_ABORTED"><a href="#dom-mediaerror-media_err_aborted">MEDIA_ERR_ABORTED</a></code>.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-abort"><a href="#event-media-abort">abort</a></code>
|
|
at the <a href="#media-element">media element</a>.</li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute has a
|
|
value equal to <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, set the
|
|
element's <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
the <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>
|
|
value and <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-emptied"><a href="#event-media-emptied">emptied</a></code>
|
|
at the element. Otherwise, set the element's <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute to
|
|
the <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code>
|
|
value.</li>
|
|
|
|
<li><p>Set the element's <a href="#delaying-the-load-event-flag">delaying-the-load-event
|
|
flag</a> to false. This stops <a href="#delay-the-load-event" title="delay the load
|
|
event">delaying the load event</a>.</li>
|
|
|
|
<li><p>Abort the overall <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt id="non-fatal-media-error">If the <a href="#media-data">media data</a> can
|
|
be fetched 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 render just
|
|
the bits it can handle, and ignore the rest.</p>
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
<dt id="found-a-media-resource-specific-timed-track">If the <a href="#media-resource">media resource</a> is found to declare a <a href="#media-resource-specific-text-track">media-resource-specific text track</a> that the user agent supports</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <a href="#media-resource">media resource</a>'s <a href="#origin">origin</a> is
|
|
the <a href="#same-origin">same origin</a> as the <a href="#media-element">media element</a>'s
|
|
<code><a href="#document">Document</a></code>'s <a href="#origin">origin</a>, <a href="#queue-a-task">queue a
|
|
task</a> to run the <a href="#steps-to-expose-a-media-resource-specific-text-track">steps to expose a
|
|
media-resource-specific text track</a> with the relevant
|
|
data.</p> <!-- CORS -->
|
|
|
|
<p class="note">Cross-origin files do not expose their subtitles
|
|
in the DOM, for security reasons. However, user agents may still
|
|
provide the user with access to such data in their user
|
|
interface.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>When the <a href="#networking-task-source">networking task source</a> has <a href="#queue-a-task" title="queue a task">queued</a> the last <a href="#concept-task" title="concept-task">task</a> as part of <a href="#fetch" title="fetch">fetching</a> the <a href="#media-resource">media resource</a>
|
|
(i.e. once the download has completed), if the fetching process
|
|
completes without errors, including decoding the media data, and
|
|
if all of the data is available to the user agent without network
|
|
access, then, the user agent must move on to the next step. This
|
|
might never happen, e.g. when streaming an infinite resource such
|
|
as Web radio, or if the resource is longer than the user agent's
|
|
ability to cache data.</p>
|
|
|
|
<p>While the user agent might still need network access to obtain
|
|
parts of the <a href="#media-resource">media resource</a>, the user agent must
|
|
remain on this step.</p>
|
|
|
|
<p class="example">For example, if the user agent has discarded
|
|
the first half of a video, the user agent will remain at this step
|
|
even once the <a href="#ended-playback" title="ended playback">playback has
|
|
ended</a>, because there is always the chance the user will
|
|
seek back to the start. In fact, in this situation, once <a href="#ended-playback" title="ended playback">playback has ended</a>, the user agent
|
|
will end up dispatching a <code title="event-media-stalled"><a href="#event-media-stalled">stalled</a></code> event, as described
|
|
earlier.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the user agent ever reaches this step (which can only
|
|
happen if the entire resource gets loaded and kept available):
|
|
abort the overall <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</li>
|
|
|
|
</ol></div><hr><p>The <dfn id="attr-media-preload" title="attr-media-preload"><code>preload</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">enumerated attribute</a>. The following table
|
|
lists the keywords and states for the attribute — the keywords
|
|
in the left column map to the states in the cell in the second
|
|
column on the same row as the keyword.<table><thead><tr><th> Keyword
|
|
<th> State
|
|
<th> Brief description
|
|
<tbody><tr><td><dfn id="attr-media-preload-none" title="attr-media-preload-none"><code>none</code></dfn>
|
|
<td><dfn id="attr-media-preload-none-state" title="attr-media-preload-none-state">None</dfn>
|
|
<td>Hints to the user agent that either the author does not expect the user to need the media resource, or that the server wants to minimise unnecessary traffic.
|
|
<tr><td><dfn id="attr-media-preload-metadata" title="attr-media-preload-metadata"><code>metadata</code></dfn>
|
|
<td><dfn id="attr-media-preload-metadata-state" title="attr-media-preload-metadata-state">Metadata</dfn>
|
|
<td>Hints to the user agent that the author does not expect the user to need the media resource, but that fetching the resource metadata (dimensions, first frame, track list, duration, etc) is reasonable.
|
|
<tr><td><dfn id="attr-media-preload-auto" title="attr-media-preload-auto"><code>auto</code></dfn>
|
|
<td><dfn id="attr-media-preload-auto-state" title="attr-media-preload-auto-state">Automatic</dfn>
|
|
<td>Hints to the user agent that the user agent can put the user's needs first without risk to the server, up to and including optimistically downloading the entire resource.
|
|
</table><p>The empty string is also a valid keyword, and maps to the <a href="#attr-media-preload-auto-state" title="attr-media-preload-auto-state">Automatic</a> state. The
|
|
attribute's <i>missing value default</i> is user-agent defined,
|
|
though the <a href="#attr-media-preload-metadata-state" title="attr-media-preload-metadata-state">Metadata</a> state is
|
|
suggested as a compromise between reducing server load and providing
|
|
an optimal user experience.<div class="impl">
|
|
|
|
<p>The <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code> attribute is
|
|
intended to provide a hint to the user agent about what the author
|
|
thinks will lead to the best user experience. The attribute may be
|
|
ignored altogether, for example based on explicit user preferences
|
|
or based on the available connectivity.</p>
|
|
|
|
<p>The <dfn id="dom-media-preload" title="dom-media-preload"><code>preload</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>.</p>
|
|
|
|
</div><p class="note">The <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code> attribute can override
|
|
the <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code> attribute (since
|
|
if the media plays, it naturally has to buffer first, regardless of
|
|
the hint given by the <code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code> attribute). Including
|
|
both is not an error, however.<hr><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-buffered"><a href="#dom-media-buffered">buffered</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#timeranges">TimeRanges</a></code> object that represents the
|
|
ranges of the <a href="#media-resource">media resource</a> that the user agent has
|
|
buffered.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-buffered" title="dom-media-buffered"><code>buffered</code></dfn>
|
|
attribute must return a new static <a href="#normalized-timeranges-object">normalized
|
|
<code>TimeRanges</code> object</a> that represents the ranges of
|
|
the <a href="#media-resource">media resource</a>, if any, that the user agent has
|
|
buffered, at the time the attribute is evaluated. Users agents must
|
|
accurately determine the ranges available, even for media streams
|
|
where this can only be determined by tedious inspection.</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>User agents may discard previously buffered data.</p>
|
|
|
|
<p class="note">Thus, a time position included within a range of the
|
|
objects return by the <code title="dom-media-buffered"><a href="#dom-media-buffered">buffered</a></code> attribute at one time can
|
|
end up being not included in the range(s) of objects returned by the
|
|
same attribute at later times.</p>
|
|
|
|
</div><h5 id="offsets-into-the-media-resource"><span class="secno">4.8.10.6 </span>Offsets into the media resource</h5><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-duration"><a href="#dom-media-duration">duration</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the length of the <a href="#media-resource">media resource</a>, in
|
|
seconds, assuming that the start of the <a href="#media-resource">media
|
|
resource</a> is at time zero.</p>
|
|
|
|
<p>Returns NaN if the duration isn't available.<p>
|
|
|
|
<p>Returns Infinity for unbounded streams.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-currentTime"><a href="#dom-media-currenttime">currentTime</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <a href="#current-playback-position">current playback position</a>, in seconds.</p>
|
|
|
|
<p>Can be set, to seek to the given time.<p>
|
|
|
|
<p>Will throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception if there
|
|
is no selected <a href="#media-resource">media resource</a>
|
|
or if there is a <a href="#current-media-controller">current media controller</a>.
|
|
Will throw an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception if the given time is not
|
|
within the ranges to which the user agent can seek.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-initialTime"><a href="#dom-media-initialtime">initialTime</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <a href="#initial-playback-position">initial playback position</a>, that is, time
|
|
to which the <a href="#media-resource">media resource</a> was automatically seeked
|
|
when it was loaded. Returns zero if the <a href="#initial-playback-position">initial playback
|
|
position</a> is still unknown.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>A <a href="#media-resource">media resource</a> has a <dfn id="media-timeline">media timeline</dfn>
|
|
that maps times (in seconds) to positions in the <a href="#media-resource">media
|
|
resource</a>. The origin of a timeline is its earliest defined
|
|
position. The duration of a timeline is its last defined
|
|
position.</p>
|
|
|
|
<p><dfn id="defineTimeline" title="establish the media
|
|
timeline">Establishing the media timeline</dfn>: If the <a href="#media-resource">media
|
|
resource</a> somehow specifies an explicit timeline whose origin
|
|
is not negative, then the <a href="#media-timeline">media timeline</a> should be that
|
|
timeline. (Whether the <a href="#media-resource">media resource</a> can specify a
|
|
timeline or not depends on the <a href="#media-resource" title="media resource">media
|
|
resource's</a> format.) If the <a href="#media-resource">media resource</a>
|
|
specifies an explicit start time <em>and date</em>, then that time
|
|
and date should be considered the zero point in the <a href="#media-timeline">media
|
|
timeline</a>; the <a href="#timeline-offset">timeline offset</a> will be the time
|
|
and date, exposed using the <code title="dom-media-startOffsetTime"><a href="#dom-media-startoffsettime">startOffsetTime</a></code>
|
|
attribute.</p>
|
|
|
|
<p>If the <a href="#media-resource">media resource</a> has a discontinuous timeline,
|
|
the user agent must extend the timeline used at the start of the
|
|
resource across the entire resource, so that the <a href="#media-timeline">media
|
|
timeline</a> of the <a href="#media-resource">media resource</a> increases
|
|
linearly starting from the <a href="#earliest-possible-position">earliest possible position</a>
|
|
(as defined below), even if the underlying <a href="#media-data">media data</a>
|
|
has out-of-order or even overlapping time codes.</p>
|
|
|
|
<p class="example">For example, if two clips have been concatenated
|
|
into one video file, but the video format exposes the original times
|
|
for the two clips, the video data might expose a timeline that goes,
|
|
say, 00:15..00:29 and then 00:05..00:38. However, the user agent
|
|
would not expose those times; it would instead expose the times as
|
|
00:15..00:29 and 00:29..01:02, as a single video.</p>
|
|
|
|
<p>In the absence of an explicit timeline, the zero time on the
|
|
<a href="#media-timeline">media timeline</a> should correspond to the first frame of
|
|
the <a href="#media-resource">media resource</a>. For static audio and video files
|
|
this is generally trivial. For streaming resources, if the user
|
|
agent will be able to seek to an earlier point than the first frame
|
|
originally provided by the server, then the zero time should
|
|
correspond to the earliest seekable time of the <a href="#media-resource">media
|
|
resource</a>; otherwise, it should correspond to the first frame
|
|
received from the server (the point in the <a href="#media-resource">media
|
|
resource</a> at which the user agent began receiving the
|
|
stream).</p>
|
|
|
|
<p class="example">Another example would be a stream that carries a
|
|
video with several concatenated fragments, broadcast by a server
|
|
that does not allow user agents to request specific times but
|
|
instead just streams the video data in a predetermined order. If a
|
|
user agent connects to this stream and receives fragments defined as
|
|
covering timestamps 2010-03-20 23:15:00 UTC to 2010-03-21 00:05:00
|
|
UTC and 2010-02-12 14:25:00 UTC to 2010-02-12 14:35:00 UTC, it would
|
|
expose this with a <a href="#media-timeline">media timeline</a> starting at 0s and
|
|
extending to 3,600s (one hour). Assuming the streaming server
|
|
disconnected at the end of the second clip, the <code title="dom-media-duration"><a href="#dom-media-duration">duration</a></code> attribute would then
|
|
return 3,600. The <code title="dom-media-startOffsetTime"><a href="#dom-media-startoffsettime">startOffsetTime</a></code> attribute
|
|
would return a <code>Date</code> object with a time corresponding to
|
|
2010-03-20 23:15:00 UTC. However, if a different user agent
|
|
connected five minutes later, <em>it</em> would (presumably) receive
|
|
fragments covering timestamps 2010-03-20 23:20:00 UTC to 2010-03-21
|
|
00:05:00 UTC and 2010-02-12 14:25:00 UTC to 2010-02-12 14:35:00 UTC,
|
|
and would expose this with a <a href="#media-timeline">media timeline</a> starting at
|
|
0s and extending to 3,300s (fifty five minutes). In this case, the
|
|
<code title="dom-media-startOffsetTime"><a href="#dom-media-startoffsettime">startOffsetTime</a></code>
|
|
attribute would return a <code>Date</code> object with a time
|
|
corresponding to 2010-03-20 23:20:00 UTC.</p>
|
|
|
|
<p>In any case, the user agent must ensure that the <a href="#earliest-possible-position">earliest
|
|
possible position</a> (as defined below) using the established
|
|
<a href="#media-timeline">media timeline</a>, is greater than or equal to zero.</p>
|
|
|
|
<p>The <a href="#media-timeline">media timeline</a> also has an associated clock.
|
|
Which clock is used is user-agent defined, and may be <a href="#media-resource">media
|
|
resource</a>-dependent, but it should approximate the user's wall
|
|
clock.</p>
|
|
|
|
<p class="note">All the <a href="#media-element" title="media element">media
|
|
elements</a> that share <a href="#current-media-controller">current media controller</a> use
|
|
the same clock for their <a href="#media-timeline">media timeline</a>.</p>
|
|
|
|
<p><a href="#media-element" title="media element">Media elements</a> have a
|
|
<dfn id="current-playback-position">current playback position</dfn>, which must initially (i.e. in
|
|
the absence of <a href="#media-data">media data</a>) be zero seconds. The
|
|
<a href="#current-playback-position">current playback position</a> is a time on the <a href="#media-timeline">media
|
|
timeline</a>.</p>
|
|
|
|
<p>The <dfn id="dom-media-currenttime" title="dom-media-currentTime"><code>currentTime</code></dfn>
|
|
attribute must, on getting, return the <a href="#current-playback-position">current playback
|
|
position</a>, expressed in seconds. On setting,
|
|
if the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, then it must throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception; otherwise,
|
|
the user agent
|
|
must <a href="#dom-media-seek" title="dom-media-seek">seek</a> to the new value
|
|
(which might raise an exception).</p>
|
|
|
|
<p><a href="#media-element" title="media element">Media elements</a> have an
|
|
<dfn id="initial-playback-position">initial playback position</dfn>, which must initially (i.e. in
|
|
the absence of <a href="#media-data">media data</a>) be zero seconds. The
|
|
<a href="#initial-playback-position">initial playback position</a> is updated when a <a href="#media-resource">media
|
|
resource</a> is loaded. The <a href="#initial-playback-position">initial playback
|
|
position</a> is a time on the <a href="#media-timeline">media timeline</a>.</p>
|
|
|
|
<p>The <dfn id="dom-media-initialtime" title="dom-media-initialTime"><code>initialTime</code></dfn>
|
|
attribute must, on getting, return the <a href="#initial-playback-position">initial playback
|
|
position</a>, expressed in seconds.</p>
|
|
|
|
<p>If the <a href="#media-resource">media resource</a> is a streaming resource, then
|
|
the user agent might be unable to obtain certain parts of the
|
|
resource after it has expired from its buffer. Similarly, some <a href="#media-resource" title="media resource">media resources</a> might have a
|
|
<a href="#media-timeline">media timeline</a> that doesn't start at zero. The
|
|
<dfn id="earliest-possible-position">earliest possible position</dfn> is the earliest position in
|
|
the stream or resource that the user agent can ever obtain
|
|
again. It is also a time on the <a href="#media-timeline">media timeline</a>.</p>
|
|
|
|
<p class="note">The <a href="#earliest-possible-position">earliest possible position</a> is not
|
|
explicitly exposed in the API; it corresponds to the start time of
|
|
the first range in the <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute's
|
|
<code><a href="#timeranges">TimeRanges</a></code> object, if any, or the <a href="#current-playback-position">current
|
|
playback position</a> otherwise.</p>
|
|
|
|
<p>When the <a href="#earliest-possible-position">earliest possible position</a> changes, then:
|
|
if the <a href="#current-playback-position">current playback position</a> is before the
|
|
<a href="#earliest-possible-position">earliest possible position</a>, the user agent must <a href="#dom-media-seek" title="dom-media-seek">seek</a> to the <a href="#earliest-possible-position">earliest possible
|
|
position</a>; otherwise, if the user agent has not fired a <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> event at the
|
|
element in the past 15 to 250ms and is not still running event
|
|
handlers for such an event, then the user agent must <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the element.</p>
|
|
|
|
<p class="note">Because of the above requirement and the requirement
|
|
in the <a href="#concept-media-load-resource" title="concept-media-load-resource">resource fetch
|
|
algorithm</a> that kicks in <a href="#getting-media-metadata">when the metadata of the clip becomes
|
|
known</a>, the <a href="#current-playback-position">current playback position</a> can never be
|
|
less than the <a href="#earliest-possible-position">earliest possible position</a>.</p>
|
|
|
|
<p>The <dfn id="dom-media-duration" title="dom-media-duration"><code>duration</code></dfn>
|
|
attribute must return the time of the end of the <a href="#media-resource">media
|
|
resource</a>, in seconds, on the <a href="#media-timeline">media timeline</a>. If
|
|
no <a href="#media-data">media data</a> is available, then the attributes must
|
|
return the Not-a-Number (NaN) value. If the <a href="#media-resource">media
|
|
resource</a> is known to be unbounded (e.g. a streaming radio),
|
|
then the attribute must return the positive Infinity value.</p>
|
|
|
|
<p>The user agent must determine the duration of the <a href="#media-resource">media
|
|
resource</a> before playing any part of the <a href="#media-data">media
|
|
data</a> and before setting <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> to a value equal to
|
|
or greater than <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code>, even if doing
|
|
so requires fetching multiple parts of the resource.</p>
|
|
|
|
<p id="durationChange">When the length of the <a href="#media-resource">media
|
|
resource</a> changes to a known value (e.g. from being unknown to
|
|
known, or from a previously established length to a new length) the
|
|
user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-durationchange"><a href="#event-media-durationchange">durationchange</a></code> at the
|
|
<a href="#media-element">media element</a>. (The event is not fired when the
|
|
duration is reset as part of loading a new media resource.)</p>
|
|
|
|
<p class="example">If an "infinite" stream ends for some reason,
|
|
then the duration would change from positive Infinity to the time of
|
|
the last frame or sample in the stream, and the <code title="event-media-durationchange"><a href="#event-media-durationchange">durationchange</a></code> event would
|
|
be fired. Similarly, if the user agent initially estimated the
|
|
<a href="#media-resource">media resource</a>'s duration instead of determining it
|
|
precisely, and later revises the estimate based on new information,
|
|
then the duration would change and the <code title="event-media-durationchange"><a href="#event-media-durationchange">durationchange</a></code> event would
|
|
be fired.</p>
|
|
|
|
<p>Some video files also have an explicit date and time
|
|
corresponding to the zero time in the <a href="#media-timeline">media timeline</a>,
|
|
known as the <dfn id="timeline-offset">timeline offset</dfn>. Initially, the
|
|
<a href="#timeline-offset">timeline offset</a> must be set to Not-a-Number (NaN).</p>
|
|
|
|
<p>The <dfn id="dom-media-startoffsettime" title="dom-media-startOffsetTime"><code>startOffsetTime</code></dfn>
|
|
attribute must return a new <code>Date</code> object representing
|
|
the current <a href="#timeline-offset">timeline offset</a>.</p>
|
|
|
|
</div><hr><p>The <dfn id="attr-media-loop" title="attr-media-loop"><code>loop</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a> that, if specified,
|
|
indicates that the <a href="#media-element">media element</a> is to seek back to the
|
|
start of the <a href="#media-resource">media resource</a> upon reaching the end.<p>The <code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code> attribute has no
|
|
effect while the element has a <a href="#current-media-controller">current media
|
|
controller</a>.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-loop" title="dom-media-loop"><code>loop</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
</div><h5 id="the-ready-states"><span class="secno">4.8.10.7 </span>The ready states</h5><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a value that expresses the current state of the element
|
|
with respect to rendering the <a href="#current-playback-position">current playback
|
|
position</a>, from the codes in the list below.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p><a href="#media-element" title="media element">Media elements</a> have a
|
|
<i>ready state</i>, which describes to what degree they are ready
|
|
to be rendered at the <a href="#current-playback-position">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>
|
|
|
|
</div><dl><dt><dfn id="dom-media-have_nothing" title="dom-media-HAVE_NOTHING"><code>HAVE_NOTHING</code></dfn> (numeric value 0)</dt>
|
|
|
|
<dd>No information regarding the <a href="#media-resource">media resource</a> is
|
|
available. No data for the <a href="#current-playback-position">current playback position</a>
|
|
is available. <a href="#media-element" title="media element">Media elements</a>
|
|
whose <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code>
|
|
attribute are set to <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code> are always in
|
|
the <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>
|
|
state.</dd>
|
|
|
|
<dt><dfn id="dom-media-have_metadata" title="dom-media-HAVE_METADATA"><code>HAVE_METADATA</code></dfn> (numeric value 1)</dt>
|
|
|
|
<dd>Enough of the resource has been obtained that the duration of
|
|
the resource is available. In the case of a <code><a href="#the-video-element">video</a></code>
|
|
element, the dimensions of the video are also available. The API
|
|
will no longer raise an exception when seeking. No <a href="#media-data">media
|
|
data</a> is available for the immediate <a href="#current-playback-position">current playback
|
|
position</a>.
|
|
The <a href="#text-track" title="text track">text tracks</a>
|
|
are <a href="#the-text-tracks-are-ready" title="the text tracks are ready">ready</a>.
|
|
</dd>
|
|
|
|
<dt><dfn id="dom-media-have_current_data" title="dom-media-HAVE_CURRENT_DATA"><code>HAVE_CURRENT_DATA</code></dfn> (numeric value 2)</dt>
|
|
|
|
<dd>Data for the immediate <a href="#current-playback-position">current playback position</a>
|
|
is available, but either not enough data is available that the user
|
|
agent could successfully advance the <a href="#current-playback-position">current playback
|
|
position</a> in the <a href="#direction-of-playback">direction of playback</a> at all
|
|
without immediately reverting to the <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code> state, or
|
|
there is no more data to obtain in the <a href="#direction-of-playback">direction of
|
|
playback</a>. For example, in video this corresponds to the user
|
|
agent having data from the current frame, but not the next frame;
|
|
and to when <a href="#ended-playback" title="ended playback">playback has
|
|
ended</a>.</dd>
|
|
|
|
<dt><dfn id="dom-media-have_future_data" title="dom-media-HAVE_FUTURE_DATA"><code>HAVE_FUTURE_DATA</code></dfn> (numeric value 3)</dt>
|
|
|
|
<dd>Data for the immediate <a href="#current-playback-position">current playback position</a>
|
|
is available, as well as enough data for the user agent to advance
|
|
the <a href="#current-playback-position">current playback position</a> in the <a href="#direction-of-playback">direction
|
|
of playback</a> at least a little without immediately reverting
|
|
to the <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code>
|
|
state. For example, in video this corresponds to the user agent
|
|
having data for at least the current frame and the next frame. The
|
|
user agent cannot be in this state if <a href="#ended-playback" title="ended
|
|
playback">playback has ended</a>, as the <a href="#current-playback-position">current playback
|
|
position</a> can never advance in this case.</dd>
|
|
|
|
<dt><dfn id="dom-media-have_enough_data" title="dom-media-HAVE_ENOUGH_DATA"><code>HAVE_ENOUGH_DATA</code></dfn> (numeric value 4)</dt>
|
|
|
|
<dd>All the conditions described for the <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> state
|
|
are met, and, in addition, the user agent estimates that data is
|
|
being fetched at a rate where the <a href="#current-playback-position">current playback
|
|
position</a>, if it were to advance at the <a href="#effective-playback-rate">effective
|
|
playback rate</a>, would not overtake the available data before
|
|
playback reaches the end of the <a href="#media-resource">media resource</a>.</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>When the ready state of a <a href="#media-element">media element</a> whose <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> is not <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code> changes, the
|
|
user agent must follow the steps given below:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Apply the first applicable set of substeps from the following
|
|
list:</p>
|
|
|
|
|
|
<dl class="switch"><dt>If the previous ready state was <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, and the new
|
|
ready state is <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code></dt>
|
|
|
|
<dd id="fire-loadedmetadata">
|
|
|
|
<p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-media-loadedmetadata"><a href="#event-media-loadedmetadata">loadedmetadata</a></code> at the
|
|
element.</p>
|
|
|
|
<p class="note">Before this task is run, as part of the event
|
|
loop mechanism, the rendering will have been updated to resize
|
|
the <code><a href="#the-video-element">video</a></code> element if appropriate.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
<dt id="handling-first-frame-available">If the previous ready state
|
|
was <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code> and
|
|
the new ready state is <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code> or
|
|
greater</dt>
|
|
|
|
<dd>
|
|
|
|
<p id="fire-loadeddata">If this is the first time this occurs for
|
|
this <a href="#media-element">media element</a> since the <code title="dom-media-load"><a href="#dom-media-load">load()</a></code> algorithm was last invoked,
|
|
the user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-media-loadeddata"><a href="#event-media-loadeddata">loadeddata</a></code> at the element.</p>
|
|
|
|
<p>If the new ready state is <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> or
|
|
<code title="dom-media-HAVE_ENOUGH_DATA"><a href="#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code>,
|
|
then the relevant steps below must then be run also.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the previous ready state was <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> or more,
|
|
and the new ready state is <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code> or
|
|
less</dt>
|
|
|
|
<dd>
|
|
|
|
<p id="fire-waiting-when-waiting">If the <a href="#media-element">media
|
|
element</a> was <a href="#potentially-playing">potentially playing</a> before its
|
|
<code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute
|
|
changed to a value lower than <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code>, and
|
|
the element has not <a href="#ended-playback">ended playback</a>, and playback
|
|
has not <a href="#stopped-due-to-errors">stopped due to errors</a>, and playback has not
|
|
<a href="#paused-for-user-interaction">paused for user interaction</a>, the user agent must
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at
|
|
the element, and <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-media-waiting"><a href="#event-media-waiting">waiting</a></code> at the element.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the previous ready state was <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code> or
|
|
less, and the new ready state is <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-media-canplay"><a href="#event-media-canplay">canplay</a></code>.</p>
|
|
|
|
<p>If the element's <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code>
|
|
attribute is false, the user agent must <a href="#queue-a-task">queue a task</a>
|
|
to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-playing"><a href="#event-media-playing">playing</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the new ready state is <code title="dom-media-HAVE_ENOUGH_DATA"><a href="#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the previous ready state was <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code> or
|
|
less, the user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire
|
|
a simple event</a> named <code title="event-media-canplay"><a href="#event-media-canplay">canplay</a></code>, and, if the element's
|
|
<code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute is false,
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-media-playing"><a href="#event-media-playing">playing</a></code>.</p>
|
|
|
|
<p>If the <a href="#autoplaying-flag">autoplaying flag</a> is true, and the <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute is true, and the
|
|
<a href="#media-element">media element</a> has an <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code> attribute specified,
|
|
and the <a href="#media-element">media element</a>'s <code><a href="#document">Document</a></code>'s
|
|
<a href="#browsing-context">browsing context</a> did not have the <a href="#sandboxed-automatic-features-browsing-context-flag">sandboxed
|
|
automatic features browsing context flag</a> set when the
|
|
<code><a href="#document">Document</a></code> was created, then the user agent may also
|
|
set the <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute to
|
|
false, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-play"><a href="#event-media-play">play</a></code>, and
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-media-playing"><a href="#event-media-playing">playing</a></code>.</p>
|
|
|
|
<p class="note">User agents do not need to support autoplay,
|
|
and it is suggested that user agents honor user preferences on the
|
|
matter. Authors are urged to use the <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code> attribute rather than
|
|
using script to force the video to play, so as to allow the user
|
|
to override the behavior if so desired.</p>
|
|
|
|
<p>In any case, the user agent must finally <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-canplaythrough"><a href="#event-media-canplaythrough">canplaythrough</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, then <a href="#report-the-controller-state">report the controller state</a>
|
|
for the <a href="#media-element">media element</a>'s <a href="#current-media-controller">current media
|
|
controller</a>.</li>
|
|
|
|
</ol></div><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 can jump straight from <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code> to <code title="dom-media-HAVE_ENOUGH_DATA"><a href="#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code> without
|
|
passing through the <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code> and
|
|
<code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code>
|
|
states.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-readystate" title="dom-media-readyState"><code>readyState</code></dfn> IDL
|
|
attribute must, on getting, return the value described above that
|
|
describes the current ready state of the <a href="#media-element">media
|
|
element</a>.</p>
|
|
|
|
</div><p>The <dfn id="attr-media-autoplay" title="attr-media-autoplay"><code>autoplay</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. When present, the
|
|
user agent <span class="impl">(as described in the algorithm
|
|
described herein)</span> will automatically begin playback of the
|
|
<a href="#media-resource">media resource</a> as soon as it can do so without
|
|
stopping.<p class="note">Authors are urged to use the <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code> attribute rather than
|
|
using script to trigger automatic playback, as this allows the user
|
|
to override the automatic playback when it is not desired, e.g. when
|
|
using a screen reader. Authors are also encouraged to consider not
|
|
using the automatic playback behavior at all, and instead to let the
|
|
user agent wait for the user to start playback explicitly.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-autoplay" title="dom-media-autoplay"><code>autoplay</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
</div><h5 id="playing-the-media-resource"><span class="secno">4.8.10.8 </span>Playing the media resource</h5><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if playback is paused; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-ended"><a href="#dom-media-ended">ended</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if playback has reached the end of the <a href="#media-resource">media resource</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-defaultPlaybackRate"><a href="#dom-media-defaultplaybackrate">defaultPlaybackRate</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the default rate of playback, for when the user is not
|
|
fast-forwarding or reversing through the <a href="#media-resource">media
|
|
resource</a>.</p>
|
|
|
|
<p>Can be set, to change the default rate of playback.</p>
|
|
|
|
<p>The default rate has no direct effect on playback, but if the
|
|
user switches to a fast-forward mode, when they return to the
|
|
normal playback mode, it is expected that the rate of playback
|
|
will be returned to the default rate of playback.</p>
|
|
|
|
<p>When the element has a <a href="#current-media-controller">current media controller</a>,
|
|
the <code title="dom-media-defaultPlaybackRate"><a href="#dom-media-defaultplaybackrate">defaultPlaybackRate</a></code>
|
|
attribute is ignored and the <a href="#current-media-controller">current media
|
|
controller</a>'s <code title="dom-MediaController-defaultPlaybackRate"><a href="#dom-mediacontroller-defaultplaybackrate">defaultPlaybackRate</a></code>
|
|
is used instead.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-playbackRate"><a href="#dom-media-playbackrate">playbackRate</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current rate playback, where 1.0 is normal speed.</p>
|
|
|
|
<p>Can be set, to change the rate of playback.</p>
|
|
|
|
<p>When the element has a <a href="#current-media-controller">current media controller</a>,
|
|
the <code title="dom-media-playbackRate"><a href="#dom-media-playbackrate">playbackRate</a></code>
|
|
attribute is ignored and the <a href="#current-media-controller">current media
|
|
controller</a>'s <code title="dom-MediaController-playbackRate"><a href="#dom-mediacontroller-playbackrate">playbackRate</a></code> is
|
|
used instead.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-played"><a href="#dom-media-played">played</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#timeranges">TimeRanges</a></code> object that represents the
|
|
ranges of the <a href="#media-resource">media resource</a> that the user agent has
|
|
played.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-play"><a href="#dom-media-play">play</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Sets the <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute
|
|
to false, loading the <a href="#media-resource">media resource</a> and beginning
|
|
playback if necessary. If the playback had ended, will restart it
|
|
from the start.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-pause"><a href="#dom-media-pause">pause</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Sets the <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute
|
|
to true, loading the <a href="#media-resource">media resource</a> if necessary.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-paused" title="dom-media-paused"><code>paused</code></dfn>
|
|
attribute represents whether the <a href="#media-element">media element</a> is
|
|
paused or not. The attribute must initially be true.</p>
|
|
|
|
<p>A <a href="#media-element">media element</a> is a <dfn id="blocked-media-element">blocked media
|
|
element</dfn> if its <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute is in the
|
|
<code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code> state or
|
|
the <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code>
|
|
state, or if the element has <a href="#paused-for-user-interaction">paused for user
|
|
interaction</a>.</p>
|
|
|
|
<p>A <a href="#media-element">media element</a> is said to be <dfn id="potentially-playing">potentially
|
|
playing</dfn> when its <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code>
|
|
attribute is false, the element has not <a href="#ended-playback">ended playback</a>,
|
|
playback has not <a href="#stopped-due-to-errors">stopped due to errors</a>,
|
|
the element either has no <a href="#current-media-controller">current media controller</a> or
|
|
has a <a href="#current-media-controller">current media controller</a> but is not <a href="#blocked-on-its-media-controller">blocked
|
|
on its media controller</a>,
|
|
and the element is not a <a href="#blocked-media-element">blocked media element</a>.</p>
|
|
|
|
<p>A <a href="#media-element">media element</a> is said to have <dfn id="ended-playback">ended
|
|
playback</dfn> when:</p>
|
|
|
|
<ul><li>The element's <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute is <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code> or greater,
|
|
and
|
|
|
|
<li>
|
|
|
|
<p>Either:
|
|
|
|
<ul><li>The <a href="#current-playback-position">current playback position</a> is the end of the
|
|
<a href="#media-resource">media resource</a>, and
|
|
|
|
<li>The <a href="#direction-of-playback">direction of playback</a> is forwards, and
|
|
|
|
<li>
|
|
Either
|
|
the <a href="#media-element">media element</a> does not have a <code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code> attribute specified,
|
|
or the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>.
|
|
|
|
</ul><p>Or:
|
|
|
|
<ul><li>The <a href="#current-playback-position">current playback position</a> is the
|
|
<a href="#earliest-possible-position">earliest possible position</a>, and
|
|
|
|
<li>The <a href="#direction-of-playback">direction of playback</a> is backwards.
|
|
|
|
</ul></li>
|
|
|
|
</ul><p>The <dfn id="dom-media-ended" title="dom-media-ended"><code>ended</code></dfn>
|
|
attribute must return true if the <a href="#media-element">media element</a> has
|
|
<a href="#ended-playback">ended playback</a> and the <a href="#direction-of-playback">direction of
|
|
playback</a> is forwards, and false otherwise.</p>
|
|
|
|
<p>A <a href="#media-element">media element</a> is said to have <dfn id="stopped-due-to-errors">stopped due to
|
|
errors</dfn> when the element's <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute is <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_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="#media-data">media
|
|
data</a>, and due to that error, is not able to play the content
|
|
at the <a href="#current-playback-position">current playback position</a>.</p>
|
|
|
|
<p>A <a href="#media-element">media element</a> is said to have <dfn id="paused-for-user-interaction">paused for user
|
|
interaction</dfn> when its <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute is false, the <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute is either
|
|
<code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> or
|
|
<code title="dom-media-HAVE_ENOUGH_DATA"><a href="#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code> and
|
|
the user agent has reached a point in the <a href="#media-resource">media
|
|
resource</a> where the user has to make a selection for the
|
|
resource to continue.
|
|
If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a> when this happens, then the user agent must
|
|
<a href="#report-the-controller-state">report the controller state</a> for the <a href="#media-element">media
|
|
element</a>'s <a href="#current-media-controller">current media controller</a>. If If the
|
|
<a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a> when the user makes a selection, allowing playback
|
|
to resume, the user agent must similarly <a href="#report-the-controller-state">report the controller
|
|
state</a> for the <a href="#media-element">media element</a>'s <a href="#current-media-controller">current
|
|
media controller</a>.
|
|
</p>
|
|
|
|
<p>It is possible for a <a href="#media-element">media element</a> to have both
|
|
<a href="#ended-playback">ended playback</a> and <a href="#paused-for-user-interaction">paused for user
|
|
interaction</a> at the same time.</p>
|
|
|
|
<p>When a <a href="#media-element">media element</a> that is <a href="#potentially-playing">potentially
|
|
playing</a> stops playing because it has <a href="#paused-for-user-interaction">paused for user
|
|
interaction</a>, the user agent must <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the element.</p>
|
|
|
|
<p class="note">A <code title="event-media-waiting"><a href="#event-media-waiting">waiting</a></code>
|
|
DOM event <a href="#fire-waiting-when-waiting">can be fired</a> as a
|
|
result of an element that is <a href="#potentially-playing">potentially playing</a>
|
|
stopping playback due to its <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute changing to
|
|
a value lower than <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code>.</p>
|
|
|
|
<p>When the <a href="#current-playback-position">current playback position</a> reaches the end
|
|
of the <a href="#media-resource">media resource</a> when the <a href="#direction-of-playback">direction of
|
|
playback</a> is forwards, then the user agent must follow these
|
|
steps:</p>
|
|
|
|
<ol><li><p>If the <a href="#media-element">media element</a> has a <code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code> attribute specified
|
|
and does not have a <a href="#current-media-controller">current media controller</a>,
|
|
then <a href="#dom-media-seek" title="dom-media-seek">seek</a> to the <a href="#earliest-possible-position">earliest
|
|
possible position</a> of the <a href="#media-resource">media resource</a> and
|
|
abort these steps.</li>
|
|
<li><p>Stop playback.<p class="note">The <code title="dom-media-ended"><a href="#dom-media-ended">ended</a></code> attribute becomes
|
|
true.</li>
|
|
|
|
<li><p>The user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire
|
|
a simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the element.</li>
|
|
|
|
<li><p>The user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire
|
|
a simple event</a> named <code title="event-media-ended"><a href="#event-media-ended">ended</a></code>
|
|
at the element.</li>
|
|
|
|
</ol><p>When the <a href="#current-playback-position">current playback position</a> reaches the
|
|
<a href="#earliest-possible-position">earliest possible position</a> of the <a href="#media-resource">media
|
|
resource</a> when the <a href="#direction-of-playback">direction of playback</a> is
|
|
backwards, then the user agent must follow these steps:</p>
|
|
|
|
<ol><li><p>Stop playback.</li>
|
|
|
|
<li><p>The user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire
|
|
a simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the element.</li>
|
|
|
|
</ol><hr><p>The <dfn id="dom-media-defaultplaybackrate" title="dom-media-defaultPlaybackRate"><code>defaultPlaybackRate</code></dfn>
|
|
attribute gives the desired speed at which the <a href="#media-resource">media
|
|
resource</a> is to play, as a multiple of its intrinsic
|
|
speed. The attribute is mutable: on getting it must return the last
|
|
value it was set to, or 1.0 if it hasn't yet been set; on setting
|
|
the attribute must be set to the new value.</p>
|
|
|
|
<p class="note">The <code title="dom-media-defaultPlaybackRate"><a href="#dom-media-defaultplaybackrate">defaultPlaybackRate</a></code> is
|
|
used by the user agent when it <a href="#expose-a-user-interface-to-the-user" title="expose a user interface
|
|
to the user">exposes a user interface to the user</a>.</p>
|
|
|
|
<p>The <dfn id="dom-media-playbackrate" title="dom-media-playbackRate"><code>playbackRate</code></dfn>
|
|
attribute gives the <a href="#effective-playback-rate">effective playback rate</a>
|
|
(assuming there is no <a href="#current-media-controller">current media controller</a> overriding it),
|
|
which is the speed at which the <a href="#media-resource">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="#dom-media-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: on
|
|
getting it must return the last value it was set to, or 1.0 if it
|
|
hasn't yet been set; on setting the attribute must be set to the new
|
|
value, and the playback will change speed
|
|
(if the element is <a href="#potentially-playing">potentially playing</a> and there is no
|
|
<a href="#current-media-controller">current media controller</a>).</p>
|
|
|
|
<p id="rateUpdate">When the <code title="dom-media-defaultPlaybackRate"><a href="#dom-media-defaultplaybackrate">defaultPlaybackRate</a></code> or
|
|
<code title="dom-media-playbackRate"><a href="#dom-media-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 <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-ratechange"><a href="#event-media-ratechange">ratechange</a></code> at the <a href="#media-element">media
|
|
element</a>.</p>
|
|
|
|
<p class="note">The <code title="dom-media-defaultPlaybackRate"><a href="#dom-media-defaultplaybackrate">defaultPlaybackRate</a></code> and
|
|
<code title="dom-media-playbackRate"><a href="#dom-media-playbackrate">playbackRate</a></code> attributes
|
|
have no effect when the <a href="#media-element">media element</a> has a
|
|
<a href="#current-media-controller">current media controller</a>; the namesake attributes on
|
|
the <code><a href="#mediacontroller">MediaController</a></code> object are used instead in that
|
|
situation.</p>
|
|
|
|
<hr><p>The <dfn id="dom-media-played" title="dom-media-played"><code>played</code></dfn>
|
|
attribute must return a new static <a href="#normalized-timeranges-object">normalized
|
|
<code>TimeRanges</code> object</a> that represents the ranges of
|
|
the <a href="#media-resource">media resource</a>, if any, that the user agent has so
|
|
far rendered, at the time the attribute is evaluated.</p>
|
|
|
|
<hr><p>When the <dfn id="dom-media-play" title="dom-media-play"><code>play()</code></dfn>
|
|
method on a <a href="#media-element">media element</a> is invoked, the user agent
|
|
must run the following steps.</p>
|
|
|
|
<ol><li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute has
|
|
the value <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>, invoke the
|
|
<a href="#media-element">media element</a>'s <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#ended-playback" title="ended playback">playback has ended</a>
|
|
and the <a href="#direction-of-playback">direction of playback</a> is forwards,
|
|
and the <a href="#media-element">media element</a> does not have a <a href="#current-media-controller">current
|
|
media controller</a>,
|
|
<a href="#dom-media-seek" title="dom-media-seek">seek</a> to the <a href="#earliest-possible-position">earliest
|
|
possible position</a> of the <a href="#media-resource">media resource</a>.</p>
|
|
|
|
<p class="note">This <a href="#seekUpdate">will cause</a> the user
|
|
agent to <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the <a href="#media-element">media
|
|
element</a>.</p>
|
|
</li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current
|
|
media controller</a>, then <a href="#bring-the-media-element-up-to-speed-with-its-new-media-controller">bring the media element up
|
|
to speed with its new media controller</a>.</p>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#media-element">media element</a>'s <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute is true, run
|
|
the following substeps:</p>
|
|
|
|
<ol><li><p>Change the value of <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> to false.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-media-play"><a href="#event-media-play">play</a></code> at the element.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#media-element">media element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute has the
|
|
value <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>,
|
|
<code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code>, or
|
|
<code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code>,
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-media-waiting"><a href="#event-media-waiting">waiting</a></code> at the
|
|
element.</p>
|
|
|
|
<p>Otherwise, the <a href="#media-element">media element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute has the
|
|
value <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> or
|
|
<code title="dom-media-HAVE_ENOUGH_DATA"><a href="#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code>:
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-media-playing"><a href="#event-media-playing">playing</a></code> at the
|
|
element.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Set the <a href="#media-element">media element</a>'s <a href="#autoplaying-flag">autoplaying
|
|
flag</a> to false.</li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, then <a href="#report-the-controller-state">report the controller state</a>
|
|
for the <a href="#media-element">media element</a>'s <a href="#current-media-controller">current media
|
|
controller</a>.</li>
|
|
|
|
</ol><hr><p>When the <dfn id="dom-media-pause" title="dom-media-pause"><code>pause()</code></dfn>
|
|
method is invoked, and when the user agent is required to pause the
|
|
<a href="#media-element">media element</a>, the user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute has
|
|
the value <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>, invoke the
|
|
<a href="#media-element">media element</a>'s <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a>.</li>
|
|
|
|
<li><p>Set the <a href="#media-element">media element</a>'s <a href="#autoplaying-flag">autoplaying
|
|
flag</a> to false.</li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute is false, run the
|
|
following steps:</p>
|
|
|
|
<ol><li><p>Change the value of <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> to true.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the
|
|
element.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-pause"><a href="#event-media-pause">pause</a></code>
|
|
at the element.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, then <a href="#report-the-controller-state">report the controller state</a>
|
|
for the <a href="#media-element">media element</a>'s <a href="#current-media-controller">current media
|
|
controller</a>.</li>
|
|
|
|
</ol><hr><p>The
|
|
<dfn id="effective-playback-rate">effective playback rate</dfn> is not necessarily the element's
|
|
<code title="dom-media-playbackRate"><a href="#dom-media-playbackrate">playbackRate</a></code>. When a
|
|
<a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, its <a href="#effective-playback-rate">effective playback rate</a> is the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-playback-rate">media controller playback
|
|
rate</a>. Otherwise, the
|
|
<a href="#effective-playback-rate">effective playback rate</a> is just the element's <code title="dom-media-playbackRate"><a href="#dom-media-playbackrate">playbackRate</a></code>.
|
|
Thus, the <a href="#current-media-controller">current media controller</a> overrides the
|
|
<a href="#media-element">media element</a>.
|
|
</p>
|
|
|
|
<p>If the <a href="#effective-playback-rate">effective playback rate</a> is positive or zero,
|
|
then the <dfn id="direction-of-playback">direction of playback</dfn> is forwards. Otherwise, it
|
|
is backwards.</p>
|
|
|
|
<p id="media-playback">When a <a href="#media-element">media element</a> is
|
|
<a href="#potentially-playing">potentially playing</a> and its <code><a href="#document">Document</a></code> is a
|
|
<a href="#fully-active">fully active</a> <code><a href="#document">Document</a></code>, its <a href="#current-playback-position">current
|
|
playback position</a> must increase monotonically at
|
|
<a href="#effective-playback-rate">effective playback rate</a> units of media time per unit time
|
|
of the <a href="#media-timeline">media timeline</a>'s clock.</p>
|
|
|
|
<p class="note">The <a href="#effective-playback-rate">effective playback rate</a> can be 0.0,
|
|
in which case the <a href="#current-playback-position">current playback position</a> doesn't
|
|
move, despite playback not being paused (<code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> doesn't become true, and the
|
|
<code title="event-media-pause"><a href="#event-media-pause">pause</a></code> event doesn't
|
|
fire).</p>
|
|
|
|
<p class="note">This specification doesn't define how the user agent
|
|
achieves the appropriate playback rate — depending on the
|
|
protocol and media available, it is plausible that the user agent
|
|
could negotiate with the server to have the server provide the media
|
|
data at the appropriate rate, so that (except for the period between
|
|
when the rate is changed and when the server updates the stream's
|
|
playback rate) the client doesn't actually have to drop or
|
|
interpolate any frames.</p>
|
|
|
|
<p>When the <a href="#direction-of-playback">direction of playback</a> is backwards, any
|
|
corresponding audio must be muted. When the <a href="#effective-playback-rate">effective playback
|
|
rate</a> is so low or so high that the user agent cannot play
|
|
audio usefully, the corresponding audio must also be muted. If the
|
|
<a href="#effective-playback-rate">effective playback rate</a> is not 1.0, the user agent may
|
|
apply pitch adjustments to the audio as necessary to render it
|
|
faithfully.</p>
|
|
|
|
<p><a href="#media-element" title="media element">Media elements</a> that are
|
|
<a href="#potentially-playing">potentially playing</a> while not <a href="#in-a-document">in a
|
|
<code>Document</code></a> 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 is in a state where no further audio could ever be played by
|
|
that element may the element be garbage collected.</p>
|
|
|
|
<p class="note">It is possible for an element to which no explicit
|
|
references exist to play audio, even if such an element is not still
|
|
actively playing: for instance, it could have a <a href="#current-media-controller">current media
|
|
controller</a> that still has references and can still be
|
|
unpaused, or it could be unpaused but stalled waiting for content to
|
|
buffer.</p>
|
|
|
|
<hr><p>When the <a href="#current-playback-position">current playback position</a> of a <a href="#media-element">media
|
|
element</a> changes (e.g. due to playback or seeking), the user
|
|
agent must run the following steps. If the <a href="#current-playback-position">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 <a href="#text-track-cue" title="text track cue">cues</a> to be skipped over as the user
|
|
agent rushes ahead to "catch up".)
|
|
</p>
|
|
|
|
<ol><li><p>Let <var title="">current cues</var> be an ordered list of
|
|
<a href="#text-track-cue" title="text track cue">cues</a>, initialized to contain
|
|
all the <a href="#text-track-cue" title="text track cue">cues</a> of all the <a href="#text-track-hidden" title="text track hidden">hidden</a>, <a href="#text-track-showing" title="text track
|
|
showing">showing</a>, or <a href="#text-track-showing-by-default" title="text track showing by
|
|
default">showing by default</a> <a href="#text-track" title="text track">text
|
|
tracks</a> of the <a href="#media-element">media element</a> (not the <a href="#text-track-disabled" title="text track disabled">disabled</a> ones) whose <a href="#text-track-cue-start-time" title="text track cue start time">start times</a> are less than
|
|
or equal to the <a href="#current-playback-position">current playback position</a> and whose
|
|
<a href="#text-track-cue-end-time" title="text track cue end time">end times</a> are greater
|
|
than the <a href="#current-playback-position">current playback position</a>, in <a href="#text-track-cue-order">text
|
|
track cue order</a>.</li>
|
|
|
|
<li><p>Let <var title="">other cues</var> be an ordered list of
|
|
<a href="#text-track-cue" title="text track cue">cues</a>, initialized to contain
|
|
all the <a href="#text-track-cue" title="text track cue">cues</a> of <a href="#text-track-hidden" title="text track hidden">hidden</a>, <a href="#text-track-showing" title="text track
|
|
showing">showing</a>, and <a href="#text-track-showing-by-default" title="text track showing by
|
|
default">showing by default</a> <a href="#text-track" title="text track">text
|
|
tracks</a> of the <a href="#media-element">media element</a> that are not
|
|
present in <var title="">current cues</var>, also in <a href="#text-track-cue-order">text
|
|
track cue order</a>.</li>
|
|
|
|
<li><p>If the time was reached through the usual monotonic increase
|
|
of the <a href="#current-playback-position">current playback position</a> during normal
|
|
playback, and if the user agent has not fired a <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> event at the
|
|
element in the past 15 to 250ms and is not still running event
|
|
handlers for such an event, then the user agent must <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-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 <a href="#current-playback-position">current
|
|
playback position</a>.)</p>
|
|
|
|
<p class="note">The event thus is not to be fired faster than about
|
|
66Hz or slower than 4Hz (assuming the event handlers don't take
|
|
longer than 250ms to run). User agents are encouraged to vary the
|
|
frequency of the event based on the system load and the average
|
|
cost of processing the event each time, so that the UI updates are
|
|
not any more frequent than the user agent can comfortably handle
|
|
while decoding the video.</li>
|
|
|
|
<li><p>If all of the <a href="#text-track-cue" title="text track cue">cues</a> in
|
|
<var title="">current cues</var> have their <a href="#text-track-cue-active-flag">text track cue
|
|
active flag</a> set, and none of the <a href="#text-track-cue" title="text track
|
|
cue">cues</a> in <var title="">other cues</var> have their
|
|
<a href="#text-track-cue-active-flag">text track cue active flag</a> set, then abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the time was reached through the usual monotonic increase
|
|
of the <a href="#current-playback-position">current playback position</a> during normal
|
|
playback, and there are <a href="#text-track-cue" title="text track cue">cues</a> in
|
|
<var title="">other cues</var> that have both their <a href="#text-track-cue-active-flag">text
|
|
track cue active flag</a> set and their <a href="#text-track-cue-pause-on-exit-flag">text track cue
|
|
pause-on-exit flag</a> set, then immediately <a href="#dom-media-pause" title="dom-media-pause">pause</a> the <a href="#media-element">media
|
|
element</a>. (In the other cases, such as explicit
|
|
seeks, playback is not paused by going past the end time of a <a href="#text-track-cue" title="text track cue">cue</a>, even if that <a href="#text-track-cue" title="text
|
|
track cue">cue</a> has its <a href="#text-track-cue-pause-on-exit-flag">text track cue pause-on-exit
|
|
flag</a> set.)</li>
|
|
|
|
<li><p>Let <var title="">affected tracks</var> be a list of <a href="#text-track" title="text track">text tracks</a>, initially empty.</li>
|
|
|
|
<li><p>For each <a href="#text-track-cue" title="text track cue">text track
|
|
cue</a> in <var title="">other cues</var> that has its
|
|
<a href="#text-track-cue-active-flag">text track cue active flag</a> set, in list order,
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-exit">exit</code> at the
|
|
<code><a href="#texttrackcue">TextTrackCue</a></code> object, and add the <a href="#text-track-cue" title="text
|
|
track cue">cue</a>'s <a href="#text-track">text track</a> to <var title="">affected tracks</var>, if it's not already in the
|
|
list.</li>
|
|
|
|
<li><p>For each <a href="#text-track-cue" title="text track cue">text track
|
|
cue</a> in <var title="">current cues</var> that does not have
|
|
its <a href="#text-track-cue-active-flag">text track cue active flag</a> set, in list order,
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-enter">enter</code> at the
|
|
<code><a href="#texttrackcue">TextTrackCue</a></code> object, and add the <a href="#text-track-cue" title="text
|
|
track cue">cue</a>'s <a href="#text-track">text track</a> to <var title="">affected tracks</var>, if it's not already in the
|
|
list.</li>
|
|
|
|
<li><p>For each <a href="#text-track">text track</a> in <var title="">affected
|
|
tracks</var>, in the order they were added to the list (which will
|
|
match the relative order of the <a href="#text-track" title="text track">text
|
|
tracks</a> in the <a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list of
|
|
text tracks</a>), <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-cuechange">cuechange</code> at the
|
|
<code><a href="#texttrack">TextTrack</a></code> object, and, if the <a href="#text-track">text
|
|
track</a> has a corresponding <code><a href="#the-track-element">track</a></code> element, to
|
|
then <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-cuechange">cuechange</code> at the <code><a href="#the-track-element">track</a></code>
|
|
element as well.</li>
|
|
|
|
<li><p>Set the <a href="#text-track-cue-active-flag">text track cue active flag</a> of all the
|
|
<a href="#text-track-cue" title="text track cue">cues</a> in the <var title="">current cues</var>, and unset the <a href="#text-track-cue-active-flag">text track cue
|
|
active flag</a> of all the <a href="#text-track-cue" title="text track
|
|
cue">cues</a> in the <var title="">other cues</var>.</li>
|
|
|
|
<li><p>Run the <a href="#rules-for-updating-the-text-track-rendering">rules for updating the text track
|
|
rendering</a> of each of the <a href="#text-track" title="text track">text
|
|
tracks</a> in <var title="">affected tracks</var> that are <a href="#text-track-showing" title="text track showing">showing</a> or <a href="#text-track-showing-by-default" title="text
|
|
track showing by default">showing by default</a>.
|
|
</li>
|
|
|
|
</ol><p>For the purposes of the algorithm above, a <a href="#text-track-cue">text track
|
|
cue</a> is considered to be part of a <a href="#text-track">text track</a>
|
|
only if it is listed in the <a href="#text-track-list-of-cues">text track list of cues</a>,
|
|
not merely if it is associated with the <a href="#text-track">text
|
|
track</a>.</p>
|
|
|
|
<p class="note">If the <a href="#media-element">media element</a>'s
|
|
<code><a href="#document">Document</a></code> stops being a <a href="#fully-active">fully active</a>
|
|
document, then the playback will <a href="#media-playback">stop</a>
|
|
until the document is active again.</p>
|
|
|
|
<p>When a <a href="#media-element">media element</a> is <a href="#remove-an-element-from-a-document" title="remove an
|
|
element from a document">removed from a
|
|
<code>Document</code></a>, the user agent must run
|
|
the following steps:</p>
|
|
|
|
<ol><li><p>Asynchronously <a href="#await-a-stable-state">await a stable state</a>, allowing
|
|
the <a href="#concept-task" title="concept-task">task</a> that removed the
|
|
<a href="#media-element">media element</a> from the <code><a href="#document">Document</a></code> to
|
|
continue. The <a href="#synchronous-section">synchronous section</a> consists of all the
|
|
remaining steps of this algorithm. (Steps in the <a href="#synchronous-section">synchronous
|
|
section</a> are marked with ⌛.)</li>
|
|
|
|
<li><p>⌛ If the <a href="#media-element">media element</a> is <a href="#in-a-document">in a
|
|
<code>Document</code></a>, abort these steps.</li>
|
|
|
|
<li><p>⌛ If the <a href="#media-element">media element</a>'s <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> attribute has
|
|
the value <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>, abort these
|
|
steps.</li>
|
|
|
|
<li><p>⌛ <a href="#dom-media-pause" title="dom-media-pause">Pause</a> the
|
|
<a href="#media-element">media element</a>.</p>
|
|
|
|
</ol></div><h5 id="seeking"><span class="secno">4.8.10.9 </span>Seeking</h5><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the user agent is currently seeking.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#timeranges">TimeRanges</a></code> object that represents the
|
|
ranges of the <a href="#media-resource">media resource</a> to which it is possible
|
|
for the user agent to seek.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-seeking" 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="dom-media-seek" title="dom-media-seek">seek</dfn> to a particular <var title="">new
|
|
playback position</var> in the <a href="#media-resource">media resource</a>, it means
|
|
that the user agent must run the following steps. This algorithm
|
|
interacts closely with the <a href="#event-loop">event loop</a> mechanism; in
|
|
particular, it has a <a href="#synchronous-section">synchronous
|
|
section</a> (which is triggered as part of the <a href="#event-loop">event
|
|
loop</a> algorithm). Steps in that section are marked with
|
|
⌛.</p>
|
|
|
|
<ol><li><p>If the <a href="#media-element">media element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>, then raise an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception (if the seek was in
|
|
response to a DOM method call or setting of an IDL attribute), and
|
|
abort these steps.</li>
|
|
|
|
<li><p>If the element's <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL attribute is true,
|
|
then another instance of this algorithm is already running. Abort
|
|
that other instance of the algorithm without waiting for the step
|
|
that it is running to complete.</li>
|
|
|
|
<li><p>Set the <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL
|
|
attribute to true.</li>
|
|
|
|
<li><p>If the seek was in response to a DOM method call or setting
|
|
of an IDL attribute, then continue the script. The remainder of
|
|
these steps must be run asynchronously. With the exception of the
|
|
steps marked with ⌛, they could be aborted at any time by
|
|
another instance of this algorithm being invoked.</li>
|
|
|
|
<li><p>If the <var title="">new playback position</var> is later
|
|
than the end of the <a href="#media-resource">media resource</a>, then let it be the
|
|
end of the <a href="#media-resource">media resource</a> instead.</li>
|
|
|
|
<li><p>If the <var title="">new playback position</var> is less
|
|
than the <a href="#earliest-possible-position">earliest possible position</a>, let it be that
|
|
position instead.</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="#dom-media-seekable">seekable</a></code> attribute, then let it
|
|
be the position in one of the ranges given in the <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute that is the
|
|
nearest to the <var title="">new playback position</var>. If two
|
|
positions both satisfy that constraint (i.e. the <var title="">new
|
|
playback position</var> is exactly in the middle between two ranges
|
|
in the <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute)
|
|
then use the position that is closest to the <a href="#current-playback-position">current playback
|
|
position</a>. If there are no ranges given in the <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> attribute then set the
|
|
<code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL attribute to
|
|
false and abort these steps.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-seeking"><a href="#event-media-seeking">seeking</a></code>
|
|
at the element.</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the <a href="#current-playback-position">current playback position</a> to the given
|
|
<var title="">new playback position</var>.</p>
|
|
|
|
<p class="note">If the <a href="#media-element">media element</a> was
|
|
<a href="#potentially-playing">potentially playing</a> immediately before it started
|
|
seeking, but seeking caused its <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> attribute to change
|
|
to a value lower than <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code>, then a
|
|
<code title="event-media-waiting"><a href="#event-media-waiting">waiting</a></code> <a href="#fire-waiting-when-waiting">will be fired</a> at the
|
|
element.</p>
|
|
|
|
|
|
</li>
|
|
|
|
<li><p>Wait until the user agent has established whether or not the
|
|
<a href="#media-data">media data</a> for the <var title="">new playback
|
|
position</var> is available, and, if it is, until it has decoded
|
|
enough data to play back that position.</p>
|
|
</li>
|
|
|
|
<li><p><a href="#await-a-stable-state">Await a stable state</a>. The <a href="#synchronous-section">synchronous
|
|
section</a> consists of all the remaining steps of this
|
|
algorithm. (Steps in the <a href="#synchronous-section">synchronous section</a> are
|
|
marked with ⌛.)</li>
|
|
|
|
<li><p>⌛ Set the <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL attribute to
|
|
false.</li>
|
|
|
|
<li id="seekUpdate"><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> at the
|
|
element.</li>
|
|
|
|
<li><p>⌛ <a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-seeked"><a href="#event-media-seeked">seeked</a></code>
|
|
at the element.</li>
|
|
|
|
</ol><p>The <dfn id="dom-media-seekable" title="dom-media-seekable"><code>seekable</code></dfn>
|
|
attribute must return a new static <a href="#normalized-timeranges-object">normalized
|
|
<code>TimeRanges</code> object</a> that represents the ranges of
|
|
the <a href="#media-resource">media resource</a>, if any, that the user agent is able
|
|
to seek to, at the time the attribute is evaluated.</p>
|
|
|
|
<p class="note">If the user agent can seek to anywhere in the
|
|
<a href="#media-resource">media resource</a>, e.g. because it is 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 (the <a href="#earliest-possible-position">earliest possible
|
|
position</a>, typically zero), and whose end is the same as the
|
|
time of the first frame plus the <code title="dom-media-duration"><a href="#dom-media-duration">duration</a></code> attribute's value (which
|
|
would equal the time of the last frame, and might be positive
|
|
Infinity).</p>
|
|
|
|
<p class="note">The range might be continuously changing, e.g. if
|
|
the user agent is buffering a sliding window on an infinite
|
|
stream. This is the behavior seen with DVRs viewing live TV, for
|
|
instance.</p>
|
|
|
|
<p><a href="#media-resource" title="media resource">Media resources</a> might be
|
|
internally scripted or interactive. Thus, a <a href="#media-element">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="#dom-media-seek" title="dom-media-seek">seeking</a> was used whenever the
|
|
<a href="#current-playback-position">current playback position</a> changes in a discontinuous
|
|
fashion (so that the relevant events fire).
|
|
If the <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, then the user agent must <a href="#seek-the-media-controller">seek the media
|
|
controller</a> appropriately instead.
|
|
</p>
|
|
|
|
</div><h5 id="media-resources-with-multiple-media-tracks"><span class="secno">4.8.10.10 </span>Media resources with multiple media tracks</h5><p>A <a href="#media-resource">media resource</a> can have multiple embedded audio
|
|
and video tracks. For example, in addition to the primary video and
|
|
audio tracks, a <a href="#media-resource">media resource</a> could have
|
|
foreign-language dubbed dialogues, director's commentaries, audio
|
|
descriptions, alternative angles, or sign-language overlays.<dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-audioTracks"><a href="#dom-media-audiotracks">audioTracks</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#multipletracklist">MultipleTrackList</a></code> object representing
|
|
the audio tracks available in the <a href="#media-resource">media resource</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-videoTracks"><a href="#dom-media-videotracks">videoTracks</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns an <code><a href="#exclusivetracklist">ExclusiveTrackList</a></code> object representing
|
|
the video tracks available in the <a href="#media-resource">media resource</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-audiotracks" title="dom-media-audioTracks"><code>audioTracks</code></dfn>
|
|
attribute of a <a href="#media-element">media element</a> must return a
|
|
<a href="#live">live</a> <code><a href="#multipletracklist">MultipleTrackList</a></code> object representing
|
|
the audio tracks available in the <a href="#media-element">media element</a>'s
|
|
<a href="#media-resource">media resource</a>. The same object must be returned each
|
|
time.</p>
|
|
|
|
<p>The <dfn id="dom-media-videotracks" title="dom-media-videoTracks"><code>videoTracks</code></dfn>
|
|
attribute of a <a href="#media-element">media element</a> must return a
|
|
<a href="#live">live</a> <code><a href="#exclusivetracklist">ExclusiveTrackList</a></code> object
|
|
representing the video tracks available in the <a href="#media-element">media
|
|
element</a>'s <a href="#media-resource">media resource</a>. The same object must
|
|
be returned each time.</p>
|
|
|
|
<p class="note">There are only ever two <code><a href="#tracklist">TrackList</a></code>
|
|
objects (one <code><a href="#multipletracklist">MultipleTrackList</a></code> object and one
|
|
<code><a href="#exclusivetracklist">ExclusiveTrackList</a></code> object) per <a href="#media-element">media
|
|
element</a>, even if another <a href="#media-resource">media resource</a> is
|
|
loaded into the element: the objects are reused.</p>
|
|
|
|
</div><h6 id="tracklist-objects"><span class="secno">4.8.10.10.1 </span><code><a href="#tracklist">TrackList</a></code> objects</h6><p>The <code><a href="#multipletracklist">MultipleTrackList</a></code> and
|
|
<code><a href="#exclusivetracklist">ExclusiveTrackList</a></code> interfaces, used by the attributes
|
|
defined in the previous section, are substantially similar. Their
|
|
common features are defined in the <code><a href="#tracklist">TrackList</a></code> interface,
|
|
from which they both inherit.</p><pre class="idl">interface <dfn id="tracklist">TrackList</dfn> {
|
|
readonly attribute unsigned long <a href="#dom-tracklist-length" title="dom-TrackList-length">length</a>;
|
|
DOMString <a href="#dom-tracklist-getid" title="dom-TrackList-getID">getID</a>(in unsigned long index);
|
|
DOMString <a href="#dom-tracklist-getkind" title="dom-TrackList-getKind">getKind</a>(in unsigned long index);
|
|
DOMString <a href="#dom-tracklist-getlabel" title="dom-TrackList-getLabel">getLabel</a>(in unsigned long index);
|
|
DOMString <a href="#dom-tracklist-getlanguage" title="dom-TrackList-getLanguage">getLanguage</a>(in unsigned long index);
|
|
|
|
attribute <a href="#function">Function</a> <a href="#handler-tracklist-onchange" title="handler-TrackList-onchange">onchange</a>;
|
|
};
|
|
|
|
interface <dfn id="multipletracklist">MultipleTrackList</dfn> : <a href="#tracklist">TrackList</a> {
|
|
boolean <a href="#dom-tracklist-isenabled" title="dom-TrackList-isEnabled">isEnabled</a>(in unsigned long index);
|
|
void <a href="#dom-tracklist-enable" title="dom-TrackList-enable">enable</a>(in unsigned long index);
|
|
void <a href="#dom-tracklist-disable" title="dom-TrackList-disable">disable</a>(in unsigned long index);
|
|
};
|
|
|
|
interface <dfn id="exclusivetracklist">ExclusiveTrackList</dfn> : <a href="#tracklist">TrackList</a> {
|
|
readonly attribute unsigned long <a href="#dom-tracklist-selectedindex" title="dom-TrackList-selectedIndex">selectedIndex</a>;
|
|
void <a href="#dom-tracklist-select" title="dom-TrackList-select">select</a>(in unsigned long index);
|
|
};</pre><dl class="domintro"><dt><var title="">tracks</var> . <code title="dom-TrackList-length"><a href="#dom-tracklist-length">length</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the number of tracks in the list.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">id</var> = <var title="">tracks</var> . <code title="dom-TrackList-getID"><a href="#dom-tracklist-getid">getID</a></code>( <var title="">index</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the ID of the given track. This is the ID that can be
|
|
used with a fragment identifier if the format supports the
|
|
<cite>Media Fragments URI</cite> syntax. <a href="#refsMEDIAFRAG">[MEDIAFRAG]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">kind</var> = <var title="">tracks</var> . <code title="dom-TrackList-getKind"><a href="#dom-tracklist-getkind">getKind</a></code>( <var title="">index</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the category the given track falls into. The <a href="#dom-TrackList-getKind-categories">possible track categories</a> are given below.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">label</var> = <var title="">tracks</var> . <code title="dom-TrackList-getLabel"><a href="#dom-tracklist-getlabel">getLabel</a></code>( <var title="">index</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the label of the given track, if known, or the empty string otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">language</var> = <var title="">tracks</var> . <code title="dom-TrackList-getLanguage"><a href="#dom-tracklist-getlanguage">getLanguage</a></code>( <var title="">index</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the language of the given track, if known, or the empty string otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">enabled</var> = <var title="">audioTracks</var> . <code title="dom-TrackList-isEnabled"><a href="#dom-tracklist-isenabled">isEnabled</a></code>( <var title="">index</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the given track is active, and false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">audioTracks</var> . <code title="dom-TrackList-enable"><a href="#dom-tracklist-enable">enable</a></code>( <var title="">index</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Enables the given track.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">audioTracks</var> . <code title="dom-TrackList-disable"><a href="#dom-tracklist-disable">disable</a></code>( <var title="">index</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Disables the given track.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">videoTracks</var> . <code title="dom-TrackList-selectedIndex"><a href="#dom-tracklist-selectedindex">isEnabled</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the index of the currently selected track, if any, or −1 otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">videoTracks</var> . <code title="dom-TrackList-select"><a href="#dom-tracklist-select">select</a></code>( <var title="">index</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Selects the given track.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-tracklist-length" title="dom-TrackList-length"><code>length</code></dfn>
|
|
attribute must return the number of tracks represented by the
|
|
<code><a href="#tracklist">TrackList</a></code> object at the time of getting.</p>
|
|
|
|
<p>Tracks in a <code><a href="#tracklist">TrackList</a></code> object must be consistently
|
|
ordered. If the <a href="#media-resource">media resource</a> is in a format that
|
|
defines an order, then that order must be used; otherwise, the order
|
|
must be the relative order in which the tracks are declared in the
|
|
<a href="#media-resource">media resource</a>. Each track in a <code><a href="#tracklist">TrackList</a></code>
|
|
thus has an index; the first has the index 0, and each subsequent
|
|
track is numbered one higher than the previous one.</p>
|
|
|
|
<p>The <dfn id="dom-tracklist-getid" title="dom-TrackList-getID"><code>getID(<var title="">index</var>)</code></dfn> method must return the identifier
|
|
of the track with index <var title="">index</var>, if there is one.
|
|
If there is no such track, then the method must instead throw an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception. If the <a href="#media-resource">media
|
|
resource</a> is in a format that supports the <cite>Media
|
|
Fragments URI</cite> fragment identifier syntax, the returned
|
|
identifier must be the same identifier that would enable the track
|
|
if used as the name of a track in the track dimension of such a
|
|
fragment identifier. <a href="#refsMEDIAFRAG">[MEDIAFRAG]</a></p>
|
|
|
|
<p>The <dfn id="dom-tracklist-getkind" title="dom-TrackList-getKind"><code>getKind(<var title="">index</var>)</code></dfn> method must return the category
|
|
of the track with index <var title="">index</var>, if there is one.
|
|
If there is no such track, then the method must instead throw an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
|
|
<p>The category of a track is the string given in the first column
|
|
of the table below that is the most appropriate for the track based
|
|
on the definitions in the table's second and third columns, as
|
|
determined by the metadata included in the track in the <a href="#media-resource">media
|
|
resource</a>. For Ogg files, the Role header of the track gives
|
|
the relevant metadata. The cell in the third column of a row says
|
|
what the category given in the cell in the first column of that row
|
|
applies to; a category is only appropriate for an audio track if it
|
|
applies to audio tracks, and a category is only appropriate for
|
|
video tracks if it applies to video tracks.</p>
|
|
|
|
</div><table id="dom-TrackList-getKind-categories"><caption>Return values for <code title="dom-TrackList-getKind"><a href="#dom-tracklist-getkind">getKind()</a></code></caption>
|
|
<thead><tr><th>Category
|
|
<th>Definition
|
|
<th>Applies to...</th>
|
|
<th>Examples
|
|
<tbody><tr><td>"<dfn id="dom-tracklist-getkind-alternate" title="dom-TrackList-getKind-alternate"><code>alternative</code></dfn>"
|
|
<td>A possible alternative to the main track, e.g. a different take of a song (audio), or a different angle (video).
|
|
<td>Audio and video.
|
|
<td>Ogg: "audio/alterate" or "video/alternate".
|
|
|
|
<tr><td>"<dfn id="dom-tracklist-getkind-description" title="dom-TrackList-getKind-description"><code>description</code></dfn>"
|
|
<td>An audio description of a video track.
|
|
<td>Audio only.
|
|
<td>Ogg: "audio/audiodesc".
|
|
|
|
<tr><td>"<dfn id="dom-tracklist-getkind-main" title="dom-TrackList-getKind-main"><code>main</code></dfn>"
|
|
<td>The primary audio or video track.
|
|
<td>Audio and video.
|
|
<td>Ogg: "audio/main" or "video/main"; WebM: the "FlagDefault" element is set.
|
|
|
|
<tr><td>"<dfn id="dom-tracklist-getkind-sign" title="dom-TrackList-getKind-sign"><code>sign</code></dfn>"
|
|
<td>A sign-language interpretation of an audio track.
|
|
<td>Video only.
|
|
<td>Ogg: "video/sign".
|
|
|
|
<tr><td>"<dfn id="dom-tracklist-getkind-translation" title="dom-TrackList-getKind-translation"><code>translation</code></dfn>"
|
|
<td>A translated version of the main track.
|
|
<td>Audio only.
|
|
<td>Ogg: "audio/dub".
|
|
|
|
<tr><td>"<dfn id="dom-tracklist-getkind-none" title="dom-TrackList-getKind-none"><code></code></dfn>" (empty string)
|
|
<td>No explicit kind, or the kind given by the track's metadata is not recognised by the user agent.
|
|
<td>Audio and video.
|
|
<td>Any other track type or track role.
|
|
|
|
</table><div class="impl">
|
|
|
|
<p>The <dfn id="dom-tracklist-getlabel" title="dom-TrackList-getLabel"><code>getLabel(<var title="">index</var>)</code></dfn> method must return the label of
|
|
the track with index <var title="">index</var>, if there is one and
|
|
it has a label. If there is no such track, then the method must
|
|
instead throw an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception. If there is
|
|
a track with index <var title="">index</var>, but it has no label,
|
|
then the method must return the empty string.</p>
|
|
|
|
<p>The <dfn id="dom-tracklist-getlanguage" title="dom-TrackList-getLanguage"><code>getLanguage(<var title="">index</var>)</code></dfn> method must return the BCP 47
|
|
language tag of the language of the track with index <var title="">index</var>, if there is one and it has a language. If
|
|
there is no such track, then the method must instead throw an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception. If there is a track with
|
|
index <var title="">index</var>, but it has no language, or the user
|
|
agent is not able to express that language as a BCP 47 language tag
|
|
(for example because the language information in the <a href="#media-resource">media
|
|
resource</a>'s format is a free-form string without a defined
|
|
interpretation), then the method must return the empty string.</p>
|
|
|
|
<hr><p>A <code><a href="#multipletracklist">MultipleTrackList</a></code> object represents a track list
|
|
where multiple tracks can be enabled simultaneously. Each track is
|
|
either enabled or disabled.</p>
|
|
|
|
<p>The <dfn id="dom-tracklist-isenabled" title="dom-TrackList-isEnabled"><code>isEnabled(<var title="">index</var>)</code></dfn> method must return true if there
|
|
is a track with index <var title="">index</var>, and it is currently
|
|
enabled, false if there is a track with index <var title="">index</var>, but it is currently disabled, and must throw
|
|
an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception if there is no track with
|
|
index <var title="">index</var>.</p>
|
|
|
|
<p>The <dfn id="dom-tracklist-enable" title="dom-TrackList-enable"><code>enable(<var title="">index</var>)</code></dfn> method must enable the track with
|
|
index <var title="">index</var>, if there is one. If there is not,
|
|
it must instead throw an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
|
|
<p>The <dfn id="dom-tracklist-disable" title="dom-TrackList-disable"><code>disable(<var title="">index</var>)</code></dfn> method must disable the track with
|
|
index <var title="">index</var>, if there is one. If there is not,
|
|
it must instead throw an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
|
|
<p>Whenever a track is enabled or disabled, the user agent must
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-media-change">change</code> at the
|
|
<code><a href="#multipletracklist">MultipleTrackList</a></code> object.</p>
|
|
|
|
<hr><p>An <code><a href="#exclusivetracklist">ExclusiveTrackList</a></code> object represents a track list
|
|
where exactly one track is selected at a time.</p>
|
|
|
|
<p>The <dfn id="dom-tracklist-selectedindex" title="dom-TrackList-selectedIndex"><code>selectedIndex</code></dfn>
|
|
attribute must return the index of the currently selected track. If
|
|
the <code><a href="#exclusivetracklist">ExclusiveTrackList</a></code> object does not represent any
|
|
tracks, it must instead return −1.</p>
|
|
|
|
<p>The <dfn id="dom-tracklist-select" title="dom-TrackList-select"><code>select(<var title="">index</var>)</code></dfn> must select the track with index
|
|
<var title="">index</var>, if there is one, unselecting whichever
|
|
track was previously selected. If there is no track with index <var title="">index</var>, it must instead throw an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
|
|
<p>Whenever the selected track is changed, the user agent must
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-media-change">change</code> at the
|
|
<code><a href="#multipletracklist">MultipleTrackList</a></code> object.</p>
|
|
|
|
<hr><p>The following are the <a href="#event-handlers">event handlers</a> (and their
|
|
corresponding <a href="#event-handler-event-type" title="event handler event type">event handler
|
|
event types</a>) that must be supported, as IDL attributes, by
|
|
all objects implementing the <code><a href="#tracklist">TrackList</a></code>
|
|
interface:</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-tracklist-onchange" title="handler-TrackList-onchange"><code>onchange</code></dfn> <td> <code title="event-change">change</code>
|
|
</table><hr><p>The <a href="#task-source">task source</a> for the <a href="#concept-task" title="concept-task">tasks</a> listed in this section is the
|
|
<a href="#dom-manipulation-task-source">DOM manipulation task source</a>.</p>
|
|
|
|
|
|
|
|
</div><h6 id="selecting-specific-audio-and-video-tracks-declaratively"><span class="secno">4.8.10.10.2 </span>Selecting specific audio and video tracks declaratively</h6><p>The <code title="dom-media-audioTracks"><a href="#dom-media-audiotracks">audioTracks</a></code> and
|
|
<code title="dom-media-videoTracks"><a href="#dom-media-videotracks">videoTracks</a></code> attributes
|
|
allow scripts to select which track should play, but it is also
|
|
possible to select specific tracks declaratively, by specifying
|
|
particular tracks in the fragment identifier of the <a href="#url">URL</a>
|
|
of the <a href="#media-resource">media resource</a>. The format of the fragment
|
|
identifier depends on the <a href="#mime-type">MIME type</a> of the <a href="#media-resource">media
|
|
resource</a>. <a href="#refsRFC2046">[RFC2046]</a> <a href="#refsRFC3986">[RFC3986]</a><div class="example">
|
|
|
|
<p>In this example, a video that uses a format that supports the
|
|
<cite>Media Fragments URI</cite> fragment identifier syntax is
|
|
embedded in such a way that the alternative angles labeled
|
|
"Alternative" are enabled instead of the default video track. <a href="#refsMEDIAFRAG">[MEDIAFRAG]</a></p>
|
|
|
|
<pre><video src="myvideo#track=Alternative"></video></pre>
|
|
|
|
|
|
</div><h5 id="synchronising-multiple-media-elements"><span class="secno">4.8.10.11 </span>Synchronising multiple media elements</h5><h6 id="introduction-0"><span class="secno">4.8.10.11.1 </span>Introduction</h6><p>Each <a href="#media-element">media element</a> can have a
|
|
<code><a href="#mediacontroller">MediaController</a></code>. A <code><a href="#mediacontroller">MediaController</a></code> is an
|
|
object that coordinates the playback of multiple <a href="#media-element" title="media
|
|
element">media elements</a>, for instance so that a sign-language
|
|
interpreter track can be overlaid on a video track, with the two
|
|
being kept in sync.<p>By default, a <a href="#media-element">media element</a> has no
|
|
<code><a href="#mediacontroller">MediaController</a></code>. An implicit
|
|
<code><a href="#mediacontroller">MediaController</a></code> can be assigned using the <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> content attribute.
|
|
An explicit <code><a href="#mediacontroller">MediaController</a></code> can be assigned directly
|
|
using the <code title="dom-media-controller"><a href="#dom-media-controller">controller</a></code> IDL
|
|
attribute.<p><a href="#media-element" title="media element">Media elements</a> with a
|
|
<code><a href="#mediacontroller">MediaController</a></code> are said to be <i>slaved</i> to their
|
|
controller. The <code><a href="#mediacontroller">MediaController</a></code> modifies the playback
|
|
rate and the playback volume of each of the <a href="#media-element" title="media
|
|
element">media elements</a> slaved to it, and ensures that when
|
|
any of its slaved <a href="#media-element" title="media element">media elements</a>
|
|
unexpectedly stall, the others are stopped at the same time.<p>When a <a href="#media-element">media element</a> is slaved to a
|
|
<code><a href="#mediacontroller">MediaController</a></code>, its playback rate is fixed to that of
|
|
the other tracks in the same <code><a href="#mediacontroller">MediaController</a></code>, and any
|
|
looping is disabled.</p><h6 id="media-controllers"><span class="secno">4.8.10.11.2 </span>Media controllers</h6><pre class="idl">[<a href="#dom-mediacontroller" title="dom-MediaController">Constructor</a>]
|
|
interface <dfn id="mediacontroller">MediaController</dfn> {
|
|
readonly attribute <a href="#timeranges">TimeRanges</a> <a href="#dom-mediacontroller-buffered" title="dom-MediaController-buffered">buffered</a>;
|
|
readonly attribute <a href="#timeranges">TimeRanges</a> <a href="#dom-mediacontroller-seekable" title="dom-MediaController-seekable">seekable</a>;
|
|
readonly attribute double <a href="#dom-mediacontroller-duration" title="dom-MediaController-duration">duration</a>;
|
|
attribute double <a href="#dom-mediacontroller-currenttime" title="dom-MediaController-currentTime">currentTime</a>;
|
|
|
|
readonly attribute boolean <a href="#dom-mediacontroller-paused" title="dom-MediaController-paused">paused</a>;
|
|
readonly attribute <a href="#timeranges">TimeRanges</a> <a href="#dom-mediacontroller-played" title="dom-MediaController-played">played</a>;
|
|
void <a href="#dom-mediacontroller-play" title="dom-MediaController-play">play</a>();
|
|
void <a href="#dom-mediacontroller-pause" title="dom-MediaController-pause">pause</a>();
|
|
|
|
attribute double <a href="#dom-mediacontroller-defaultplaybackrate" title="dom-MediaController-defaultPlaybackRate">defaultPlaybackRate</a>;
|
|
attribute double <a href="#dom-mediacontroller-playbackrate" title="dom-MediaController-playbackRate">playbackRate</a>;
|
|
|
|
attribute double <a href="#dom-mediacontroller-volume" title="dom-MediaController-volume">volume</a>;
|
|
attribute boolean <a href="#dom-mediacontroller-muted" title="dom-MediaController-muted">muted</a>;
|
|
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onemptied" title="handler-MediaController-onemptied">onemptied</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onloadedmetadata" title="handler-MediaController-onloadedmetadata">onloadedmetadata</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onloadeddata" title="handler-MediaController-onloadeddata">onloadeddata</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-oncanplay" title="handler-MediaController-oncanplay">oncanplay</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-oncanplaythrough" title="handler-MediaController-oncanplaythrough">oncanplaythrough</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onplaying" title="handler-MediaController-onplaying">onplaying</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onwaiting" title="handler-MediaController-onwaiting">onwaiting</a>;
|
|
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-ondurationchange" title="handler-MediaController-ondurationchange">ondurationchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-ontimeupdate" title="handler-MediaController-ontimeupdate">ontimeupdate</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onplay" title="handler-MediaController-onplay">onplay</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onpause" title="handler-MediaController-onpause">onpause</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onratechange" title="handler-MediaController-onratechange">onratechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-mediacontroller-onvolumechange" title="handler-MediaController-onvolumechange">onvolumechange</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">controller</var> = new <code title="dom-MediaController"><a href="#dom-mediacontroller">MediaController</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a new <code><a href="#mediacontroller">MediaController</a></code> object.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-controller"><a href="#dom-media-controller">controller</a></code> [ = <var title="">controller</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current <code><a href="#mediacontroller">MediaController</a></code> for the <a href="#media-element">media element</a>, if any; returns null otherwise.</p>
|
|
|
|
<p>Can be set, to set an explicit <code><a href="#mediacontroller">MediaController</a></code>.
|
|
Doing so removes the <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute, if
|
|
any.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-buffered"><a href="#dom-mediacontroller-buffered">buffered</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#timeranges">TimeRanges</a></code> object that represents the
|
|
intersection of the time ranges for which the user agent has all
|
|
relevant media data for all the slaved <a href="#media-element" title="media
|
|
element">media elements</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-seekable"><a href="#dom-mediacontroller-seekable">seekable</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#timeranges">TimeRanges</a></code> object that represents the
|
|
intersection of the time ranges into which the user agent can seek
|
|
for all the slaved <a href="#media-element" title="media element">media
|
|
elements</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-duration"><a href="#dom-mediacontroller-duration">duration</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the difference between the earliest playable moment and
|
|
the latest playable moment (not considering whether the data in
|
|
question is actually buffered or directly seekable, but not
|
|
including time in the future for infinite streams). Will return
|
|
zero if there is no media.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-currentTime"><a href="#dom-mediacontroller-currenttime">currentTime</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <a href="#current-playback-position">current playback position</a>, in seconds,
|
|
as a position between zero time and the current <code title="dom-MediaController-duration"><a href="#dom-mediacontroller-duration">duration</a></code>.</p>
|
|
|
|
<p>Can be set, to seek to the given time.<p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-paused"><a href="#dom-mediacontroller-paused">paused</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if playback is paused; false otherwise. When this
|
|
attribute is true, any <a href="#media-element">media element</a> slaved to this
|
|
controller will be stopped.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-played"><a href="#dom-mediacontroller-played">played</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#timeranges">TimeRanges</a></code> object that represents the
|
|
union of the time ranges in all the slaved <a href="#media-element" title="media
|
|
element">media elements</a> that have been played.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-play"><a href="#dom-mediacontroller-play">play</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Sets the <code title="dom-MediaController-paused"><a href="#dom-mediacontroller-paused">paused</a></code>
|
|
attribute to false.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-pause"><a href="#dom-mediacontroller-pause">pause</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Sets the <code title="dom-MediaController-paused"><a href="#dom-mediacontroller-paused">paused</a></code>
|
|
attribute to true.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-defaultPlaybackRate"><a href="#dom-mediacontroller-defaultplaybackrate">defaultPlaybackRate</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the default rate of playback.</p>
|
|
|
|
<p>Can be set, to change the default rate of playback.</p>
|
|
|
|
<p>This default rate has no direct effect on playback, but if the
|
|
user switches to a fast-forward mode, when they return to the
|
|
normal playback mode, it is expected that rate of playback (<code title="dom-MediaController-playbackRate"><a href="#dom-mediacontroller-playbackrate">playbackRate</a></code>) will
|
|
be returned to this default rate.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-playbackRate"><a href="#dom-mediacontroller-playbackrate">playbackRate</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current rate of playback.</p>
|
|
|
|
<p>Can be set, to change the rate of playback.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-volume"><a href="#dom-mediacontroller-volume">volume</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current playback volume multiplier, as a number in
|
|
the range 0.0 to 1.0, where 0.0 is the quietest and 1.0 the
|
|
loudest.</p>
|
|
|
|
<p>Can be set, to change the volume multiplier.</p>
|
|
|
|
<p>Throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> if the new value is not
|
|
in the range 0.0 .. 1.0.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">controller</var> . <code title="dom-MediaController-muted"><a href="#dom-mediacontroller-muted">muted</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if all audio is muted (regardless of other
|
|
attributes either on the controller or on any <a href="#media-element" title="media
|
|
element">media elements</a> slaved to this controller), and
|
|
false otherwise.</p>
|
|
|
|
<p>Can be set, to change whether the audio is muted or not.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>A <a href="#media-element">media element</a> can have a <dfn id="current-media-controller">current media
|
|
controller</dfn>, which is a <code><a href="#mediacontroller">MediaController</a></code> object.
|
|
When a <a href="#media-element">media element</a> is created without a <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute, it does
|
|
not have a <a href="#current-media-controller">current media controller</a>. (If it is created
|
|
<em>with</em> such an attribute, then that attribute initializes the
|
|
<a href="#current-media-controller">current media controller</a>, as defined below.)</p>
|
|
|
|
<p>The <dfn id="slaved-media-elements">slaved media elements</dfn> of a
|
|
<code><a href="#mediacontroller">MediaController</a></code> are the <a href="#media-element" title="media
|
|
element">media elements</a> whose <a href="#current-media-controller">current media
|
|
controller</a> is that <code><a href="#mediacontroller">MediaController</a></code>. All the
|
|
<a href="#slaved-media-elements">slaved media elements</a> of a <code><a href="#mediacontroller">MediaController</a></code>
|
|
must use the same clock for their definition of their <a href="#media-timeline">media
|
|
timeline</a>'s unit time.</p>
|
|
|
|
<hr><p>The <dfn id="dom-media-controller" title="dom-media-controller"><code>controller</code></dfn> attribute
|
|
on a <a href="#media-element">media element</a>, on getting, must return the
|
|
element's <a href="#current-media-controller">current media controller</a>, if any, or null
|
|
otherwise. On setting, it must first remove the element's <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute, if any,
|
|
and then set the <a href="#current-media-controller">current media controller</a> to the given
|
|
value. If the given value is null, the element no longer has a
|
|
<a href="#current-media-controller">current media controller</a>; if it is not null, then the
|
|
user agent must <a href="#bring-the-media-element-up-to-speed-with-its-new-media-controller">bring the media element up to speed with its
|
|
new media controller</a>.</p>
|
|
|
|
<hr><p>The <dfn id="dom-mediacontroller" title="dom-MediaController"><code>MediaController()</code></dfn>
|
|
constructor, when invoked, must return a newly created
|
|
<code><a href="#mediacontroller">MediaController</a></code> object.</p>
|
|
|
|
<hr><p>The <dfn id="dom-mediacontroller-seekable" title="dom-MediaController-seekable"><code>seekable</code></dfn>
|
|
attribute must return a new static <a href="#normalized-timeranges-object">normalized
|
|
<code>TimeRanges</code> object</a> that represents the
|
|
intersection of the ranges of the <a href="#media-resource" title="media resource">media
|
|
resources</a> of the <a href="#slaved-media-elements">slaved media elements</a> that the
|
|
user agent is able to seek to, at the time the attribute is
|
|
evaluated.</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-buffered" title="dom-MediaController-buffered"><code>buffered</code></dfn>
|
|
attribute must return a new static <a href="#normalized-timeranges-object">normalized
|
|
<code>TimeRanges</code> object</a> that represents the
|
|
intersection of the ranges of the <a href="#media-resource" title="media resource">media
|
|
resources</a> of the <a href="#slaved-media-elements">slaved media elements</a> that the
|
|
user agent has buffered, at the time the attribute is evaluated.
|
|
Users agents must accurately determine the ranges available, even
|
|
for media streams where this can only be determined by tedious
|
|
inspection.</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-duration" title="dom-MediaController-duration"><code>duration</code></dfn>
|
|
attribute must return the <a href="#media-controller-duration">media controller
|
|
duration</a>.</p>
|
|
|
|
<p>Every 15 to 250ms, or whenever the <code><a href="#mediacontroller">MediaController</a></code>'s
|
|
<a href="#media-controller-duration">media controller duration</a> changes, whichever happens
|
|
least often, the user agent must <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-MediaController-durationchange"><a href="#event-mediacontroller-durationchange">durationchange</a></code>
|
|
at the <code><a href="#mediacontroller">MediaController</a></code>. If the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-duration">media controller
|
|
duration</a> decreases such that the <a href="#media-controller-position">media controller
|
|
position</a> is greater than the <a href="#media-controller-duration">media controller
|
|
duration</a>, the user agent must immediately <a href="#seek-the-media-controller">seek the
|
|
media controller</a> to <a href="#media-controller-duration">media controller
|
|
duration</a>.</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-currenttime" title="dom-MediaController-currentTime"><code>currentTime</code></dfn>
|
|
attribute must return the <a href="#media-controller-position">media controller position</a> on
|
|
getting, and on setting must <a href="#seek-the-media-controller">seek the media controller</a>
|
|
to the new value.</p>
|
|
|
|
<p>Every 15 to 250ms, or whenever the <code><a href="#mediacontroller">MediaController</a></code>'s
|
|
<a href="#media-controller-position">media controller position</a> changes, whichever happens
|
|
least often, the user agent must <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-MediaController-timeupdate"><a href="#event-mediacontroller-timeupdate">timeupdate</a></code> at the
|
|
<code><a href="#mediacontroller">MediaController</a></code>.</p>
|
|
|
|
<hr><p>When a <code><a href="#mediacontroller">MediaController</a></code> is created it is a
|
|
<dfn id="playing-media-controller">playing media controller</dfn>. It can be changed into a
|
|
<dfn id="paused-media-controller">paused media controller</dfn> and back either via the user
|
|
agent's user interface (when the element is <a href="#expose-a-user-interface-to-the-user" title="expose a
|
|
user interface to the user">exposing a user interface to the
|
|
user</a>) or by script using the APIs defined in this section
|
|
(see below).</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-paused" title="dom-MediaController-paused"><code>paused</code></dfn>
|
|
attribute must return true if the <code><a href="#mediacontroller">MediaController</a></code>
|
|
object is a <a href="#paused-media-controller">paused media controller</a>, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-played" title="dom-MediaController-played"><code>played</code></dfn>
|
|
attribute must return a new static <a href="#normalized-timeranges-object">normalized
|
|
<code>TimeRanges</code> object</a> that represents the union of
|
|
the ranges of the <a href="#media-resource" title="media resource">media
|
|
resources</a> of the <a href="#slaved-media-elements">slaved media elements</a> that the
|
|
user agent has so far rendered, at the time the attribute is
|
|
evaluated.</p>
|
|
|
|
<p>When the <dfn id="dom-mediacontroller-pause" title="dom-MediaController-pause"><code>pause()</code></dfn> method
|
|
is invoked, if the <code><a href="#mediacontroller">MediaController</a></code> is a <a href="#playing-media-controller">playing
|
|
media controller</a> then the user agent must change the
|
|
<code><a href="#mediacontroller">MediaController</a></code> into a <a href="#paused-media-controller">paused media
|
|
controller</a>, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-MediaController-pause"><a href="#event-mediacontroller-pause">pause</a></code> at the
|
|
<code><a href="#mediacontroller">MediaController</a></code>, and then <a href="#report-the-controller-state">report the controller
|
|
state</a> of the <code><a href="#mediacontroller">MediaController</a></code>.</p>
|
|
|
|
<p>When the <dfn id="dom-mediacontroller-play" title="dom-MediaController-play"><code>play()</code></dfn> method is
|
|
invoked, if the <code><a href="#mediacontroller">MediaController</a></code> is a <a href="#paused-media-controller">paused media
|
|
controller</a>, the user agent must change the
|
|
<code><a href="#mediacontroller">MediaController</a></code> into a <a href="#playing-media-controller">playing media
|
|
controller</a>, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-MediaController-play"><a href="#event-mediacontroller-play">play</a></code> at the
|
|
<code><a href="#mediacontroller">MediaController</a></code>, and then <a href="#report-the-controller-state">report the controller
|
|
state</a> of the <code><a href="#mediacontroller">MediaController</a></code>.</p>
|
|
|
|
<hr><p>A <code><a href="#mediacontroller">MediaController</a></code> has a <dfn id="media-controller-default-playback-rate">media controller
|
|
default playback rate</dfn> and a <dfn id="media-controller-playback-rate">media controller playback
|
|
rate</dfn>, which must both be set to 1.0 when the
|
|
<code><a href="#mediacontroller">MediaController</a></code> object is created.</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-defaultplaybackrate" title="dom-MediaController-defaultPlaybackRate"><code>defaultPlaybackRate</code></dfn>
|
|
attribute, on getting, must return the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-default-playback-rate">media controller default
|
|
playback rate</a>, and on setting, must set the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-default-playback-rate">media controller default
|
|
playback rate</a> to the new value, then <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-MediaController-ratechange"><a href="#event-mediacontroller-ratechange">ratechange</a></code> at the
|
|
<code><a href="#mediacontroller">MediaController</a></code>.</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-playbackrate" title="dom-MediaController-playbackRate"><code>playbackRate</code></dfn>
|
|
attribute, on getting, must return the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-playback-rate">media controller playback
|
|
rate</a>, and on setting, must set the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-playback-rate">media controller playback
|
|
rate</a> to the new value, then <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-MediaController-ratechange"><a href="#event-mediacontroller-ratechange">ratechange</a></code> at the
|
|
<code><a href="#mediacontroller">MediaController</a></code>.</p>
|
|
|
|
<hr><p>A <code><a href="#mediacontroller">MediaController</a></code> has a <dfn id="media-controller-volume-multiplier">media controller volume
|
|
multiplier</dfn>, which must be set to 1.0 when the
|
|
<code><a href="#mediacontroller">MediaController</a></code> object is created, and a <dfn id="media-controller-mute-override">media
|
|
controller mute override</dfn>, much must initially be false.</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-volume" title="dom-MediaController-volume"><code>volume</code></dfn>
|
|
attribute, on getting, must return the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-volume-multiplier">media controller volume
|
|
multiplier</a>, and on setting, if the new value is in the range
|
|
0.0 to 1.0 inclusive, must set the <code><a href="#mediacontroller">MediaController</a></code>'s
|
|
<a href="#media-controller-volume-multiplier">media controller volume multiplier</a> to the new value and
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-MediaController-volumechange"><a href="#event-mediacontroller-volumechange">volumechange</a></code>
|
|
at the <code><a href="#mediacontroller">MediaController</a></code>. If the new value is outside the
|
|
range 0.0 to 1.0 inclusive, then, on setting, an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception must be raised instead.</p>
|
|
|
|
<p>The <dfn id="dom-mediacontroller-muted" title="dom-MediaController-muted"><code>muted</code></dfn>
|
|
attribute, on getting, must return the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-mute-override">media controller mute
|
|
override</a>, and on setting, must set the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-mute-override">media controller mute
|
|
override</a> to the new value and <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-MediaController-volumechange"><a href="#event-mediacontroller-volumechange">volumechange</a></code> at
|
|
the <code><a href="#mediacontroller">MediaController</a></code>.</p>
|
|
|
|
<hr><p>The <a href="#media-resource" title="media resource">media resources</a> of all
|
|
the <a href="#slaved-media-elements">slaved media elements</a> of a
|
|
<code><a href="#mediacontroller">MediaController</a></code> have a defined temporal relationship
|
|
which provides relative offsets between the zero time of each such
|
|
<a href="#media-resource">media resource</a>: for <a href="#media-resource" title="media resource">media
|
|
resources</a> with a <a href="#timeline-offset">timeline offset</a>, their relative
|
|
offsets are the difference between their <a href="#timeline-offset">timeline
|
|
offset</a>; the zero times of all the <a href="#media-resource" title="media
|
|
resource">media resources</a> without a <a href="#timeline-offset">timeline
|
|
offset</a> are not offset from each other (i.e. the origins of
|
|
their timelines are cotemporal); and finally, the zero time of the
|
|
<a href="#media-resource">media resource</a> with the earliest <a href="#timeline-offset">timeline
|
|
offset</a> (if any) is not offset from the zero times of the
|
|
<a href="#media-resource" title="media resource">media resources</a> without a
|
|
<a href="#timeline-offset">timeline offset</a> (i.e. the origins of <a href="#media-resource" title="media
|
|
resource">media resources</a> without a <a href="#timeline-offset">timeline
|
|
offset</a> are further cotemporal with the earliest defined point
|
|
on the timeline of the <a href="#media-resource">media resource</a> with the earliest
|
|
<a href="#timeline-offset">timeline offset</a>).</p>
|
|
|
|
<p>The <dfn id="media-resource-end-position">media resource end position</dfn> of a <a href="#media-resource">media
|
|
resource</a> in a <a href="#media-element">media element</a> is defined as
|
|
follows: if the <a href="#media-resource">media resource</a> has a finite and known
|
|
duration, the <a href="#media-resource-end-position">media resource end position</a> is the
|
|
duration of the <a href="#media-resource">media resource</a>'s timeline (the last
|
|
defined position on that timeline); otherwise, the <a href="#media-resource">media
|
|
resource</a>'s duration is infinite or unknown, and the
|
|
<a href="#media-resource-end-position">media resource end position</a> is the time of the last
|
|
frame of <a href="#media-data">media data</a> currently available for that
|
|
<a href="#media-resource">media resource</a>.</p>
|
|
|
|
<p>Each <code><a href="#mediacontroller">MediaController</a></code> also has its own defined
|
|
timeline. On this timeline, all the <a href="#media-resource" title="media
|
|
resource">media resources</a> of all the <a href="#slaved-media-elements">slaved media
|
|
elements</a> of the <code><a href="#mediacontroller">MediaController</a></code> are temporally
|
|
aligned according to their defined offsets. The <dfn id="media-controller-duration">media
|
|
controller duration</dfn> of that <code><a href="#mediacontroller">MediaController</a></code> is
|
|
the time from the earliest <a href="#earliest-possible-position">earliest possible position</a>,
|
|
relative to this <code><a href="#mediacontroller">MediaController</a></code> timeline, of any of
|
|
the <a href="#media-resource" title="media resource">media resources</a> of the
|
|
<a href="#slaved-media-elements">slaved media elements</a> of the
|
|
<code><a href="#mediacontroller">MediaController</a></code>, to the time of the latest <a href="#media-resource-end-position">media
|
|
resource end position</a> of the <a href="#media-resource" title="media
|
|
resource">media resources</a> of the <a href="#slaved-media-elements">slaved media
|
|
elements</a> of the <code><a href="#mediacontroller">MediaController</a></code>, again relative
|
|
to this <code><a href="#mediacontroller">MediaController</a></code> timeline.</p>
|
|
|
|
<p>Each <code><a href="#mediacontroller">MediaController</a></code> has a <dfn id="media-controller-position">media controller
|
|
position</dfn>. This is the time on the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s timeline at which the user agent is
|
|
trying to play the <a href="#slaved-media-elements">slaved media elements</a>. When a
|
|
<code><a href="#mediacontroller">MediaController</a></code> is created, its <a href="#media-controller-position">media controller
|
|
position</a> is initially zero.</p>
|
|
|
|
<p>When the user agent is to <dfn id="bring-the-media-element-up-to-speed-with-its-new-media-controller" title="bring the media element up
|
|
to speed with its new media controller">bring a media element up to
|
|
speed with its new media controller</dfn>, it must <a href="#dom-media-seek" title="dom-media-seek">seek</a> that <a href="#media-element">media element</a>
|
|
to the <code><a href="#mediacontroller">MediaController</a></code>'s <a href="#media-controller-position">media controller
|
|
position</a> relative to the <a href="#media-element">media element</a>'s
|
|
timeline, discarding any resulting exceptions.</p>
|
|
|
|
<p>When the user agent is to <dfn id="seek-the-media-controller">seek the media controller</dfn> to
|
|
a particular <var title="">new playback position</var>, it must
|
|
follow these steps:</p>
|
|
|
|
<ol><li><p>If the <var title="">new playback position</var> is less
|
|
than zero, then set it to zero.</li>
|
|
|
|
<li><p>If the <var title="">new playback position</var> is greater
|
|
than the <a href="#media-controller-duration">media controller duration</a>, then set it to the
|
|
<a href="#media-controller-duration">media controller duration</a>.</li>
|
|
|
|
<li><p>Set the <a href="#media-controller-position">media controller position</a> to the <var title="">new playback position</var>.</li>
|
|
|
|
<li><p><a href="#dom-media-seek" title="dom-media-seek">Seek</a> each <a href="#slaved-media-elements" title="slaved media elements">slaved media element</a> to the
|
|
<var title="">new playback position</var> relative to the
|
|
<a href="#media-element">media element</a> timeline, discarding any resulting
|
|
exceptions.</li>
|
|
</ol><p>A <code><a href="#mediacontroller">MediaController</a></code> is a <dfn id="blocked-media-controller">blocked media
|
|
controller</dfn> if the <code><a href="#mediacontroller">MediaController</a></code> is a
|
|
<a href="#paused-media-controller">paused media controller</a>, or if any of its <a href="#slaved-media-elements">slaved
|
|
media elements</a> are <a href="#blocked-media-element" title="blocked media
|
|
element">blocked media elements</a>, or if any of its
|
|
<a href="#slaved-media-elements">slaved media elements</a> whose <a href="#autoplaying-flag">autoplaying
|
|
flag</a> is true still have a <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute that is true, or if
|
|
all of its <a href="#slaved-media-elements">slaved media elements</a> have their <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> attribute set to true.</p>
|
|
|
|
<p>A <a href="#media-element">media element</a> is <dfn id="blocked-on-its-media-controller">blocked on its media
|
|
controller</dfn> if the <code><a href="#mediacontroller">MediaController</a></code> is a
|
|
<a href="#blocked-media-controller">blocked media controller</a>, or if its <a href="#media-controller-position">media
|
|
controller position</a> is either before the <a href="#media-resource">media
|
|
resource</a>'s <a href="#earliest-possible-position">earliest possible position</a> relative
|
|
to the <code><a href="#mediacontroller">MediaController</a></code>'s timeline or after the end of
|
|
the <a href="#media-resource">media resource</a> relative to the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s timeline.</p>
|
|
|
|
<p id="controller-playback">When a <code><a href="#mediacontroller">MediaController</a></code> is
|
|
not a <a href="#blocked-media-controller">blocked media controller</a> and it has at least one
|
|
<a href="#slaved-media-elements" title="slaved media elements">slaved media element</a>
|
|
whose <code><a href="#document">Document</a></code> is a <a href="#fully-active">fully active</a>
|
|
<code><a href="#document">Document</a></code>, the <code><a href="#mediacontroller">MediaController</a></code>'s
|
|
<a href="#media-controller-position">media controller position</a> must increase monotonically
|
|
at <a href="#media-controller-playback-rate">media controller playback rate</a> units of time on the
|
|
<code><a href="#mediacontroller">MediaController</a></code>'s timeline per unit time of the clock
|
|
used by its <a href="#slaved-media-elements">slaved media elements</a>.</p>
|
|
|
|
<p>When the zero point on the timeline of a
|
|
<code><a href="#mediacontroller">MediaController</a></code> moves relative to the timelines of the
|
|
<a href="#slaved-media-elements">slaved media elements</a> by a time difference <var title="">ΔT</var>, the <code><a href="#mediacontroller">MediaController</a></code>'s
|
|
<a href="#media-controller-position">media controller position</a> must be decremented by <var title="">ΔT</var>.</p>
|
|
|
|
<p class="note">In some situations, e.g. when playing back a live
|
|
stream without buffering anything, the <a href="#media-controller-position">media controller
|
|
position</a> would increase motonically as described above at the
|
|
same rate as the <var title="">ΔT</var> described in the
|
|
previous paragraph decreases it, with the end result that for all
|
|
intents and purposes, the <a href="#media-controller-position">media controller position</a>
|
|
would appear to remain constant (probably with the value 0).</p>
|
|
|
|
<hr><p>A <code><a href="#mediacontroller">MediaController</a></code> has a <dfn id="most-recently-reported-readiness-state">most recently reported
|
|
readiness state</dfn>, which is a number from 0 to 4 derived from
|
|
the numbers used for the <a href="#media-element">media element</a> <code title="attr-media-readyState">readyState</code> attribute, and a
|
|
<dfn id="most-recently-reported-playback-state">most recently reported playback state</dfn>, which is either
|
|
<i>playing</i>, <i>waiting</i>, or <i>ended</i>.</p>
|
|
|
|
<p>When a <code><a href="#mediacontroller">MediaController</a></code> is created, its <a href="#most-recently-reported-readiness-state">most
|
|
recently reported readiness state</a> must be set to 0, and its
|
|
<a href="#most-recently-reported-playback-state">most recently reported playback state</a> must be set to
|
|
<i>waiting</i>.</p>
|
|
|
|
<p>When a user agent is required to <dfn id="report-the-controller-state">report the controller
|
|
state</dfn> for a <code><a href="#mediacontroller">MediaController</a></code>, the user agent must
|
|
run the following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the <code><a href="#mediacontroller">MediaController</a></code> has no <a href="#slaved-media-elements">slaved media
|
|
elements</a>, let <var title="">new readiness state</var> be
|
|
0.</p>
|
|
|
|
<p>Otherwise, let it have the lowest value of the <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> IDL attributes of
|
|
all of its <a href="#slaved-media-elements">slaved media elements</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <code><a href="#mediacontroller">MediaController</a></code>'s <a href="#most-recently-reported-readiness-state">most recently
|
|
reported readiness state</a> is not equal to <var title="">new
|
|
readiness state</var> then <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire
|
|
a simple event</a> at the <code><a href="#mediacontroller">MediaController</a></code> object,
|
|
whose name is the event name corresponding to the value of <var title="">new readiness state</var> given in the table below:</p>
|
|
|
|
|
|
<table><thead><tr><th>Value of <var title="">new readiness state</var>
|
|
<th>Event name
|
|
|
|
<tbody><tr><td> 0
|
|
<td> <code title="event-MediaController-emptied"><a href="#event-mediacontroller-emptied">emptied</a></code>
|
|
|
|
<tr><td> 1
|
|
<td> <code title="event-MediaController-loadedmetadata"><a href="#event-mediacontroller-loadedmetadata">loadedmetadata</a></code>
|
|
|
|
<tr><td> 2
|
|
<td> <code title="event-MediaController-loadeddata"><a href="#event-mediacontroller-loadeddata">loadeddata</a></code>
|
|
|
|
<tr><td> 3
|
|
<td> <code title="event-MediaController-canplay"><a href="#event-mediacontroller-canplay">canplay</a></code>
|
|
|
|
<tr><td> 4
|
|
<td> <code title="event-MediaController-canplaythrough"><a href="#event-mediacontroller-canplaythrough">canplaythrough</a></code>
|
|
|
|
</table></li>
|
|
|
|
<li><p>Let the <code><a href="#mediacontroller">MediaController</a></code>'s <a href="#most-recently-reported-readiness-state">most recently
|
|
reported readiness state</a> be <var title="">new readiness
|
|
state</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Initialize <var title="">new playback state</var> by setting it
|
|
to the state given for the first matching condition from the
|
|
following list:</p>
|
|
|
|
<dl class="switch"><dt>If the <code><a href="#mediacontroller">MediaController</a></code> has no <a href="#slaved-media-elements">slaved
|
|
media elements</a></dt>
|
|
|
|
<dd>Let <var title="">new playback state</var> be <i>waiting</i>.</dd>
|
|
|
|
<dt>If all of the <code><a href="#mediacontroller">MediaController</a></code>'s <a href="#slaved-media-elements">slaved
|
|
media elements</a> have <a href="#ended-playback">ended playback</a> and the
|
|
<a href="#media-controller-playback-rate">media controller playback rate</a> is positive or
|
|
zero</dt>
|
|
|
|
<dd>Let <var title="">new playback state</var> be <i>ended</i>.</dd>
|
|
|
|
<dt>If the <code><a href="#mediacontroller">MediaController</a></code> is a <a href="#blocked-media-controller">blocked media
|
|
controller</a></dt>
|
|
|
|
<dd>Let <var title="">new playback state</var> be <i>waiting</i>.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>Let <var title="">new playback state</var> be <i>playing</i>.</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>If the <code><a href="#mediacontroller">MediaController</a></code>'s <a href="#most-recently-reported-playback-state">most recently
|
|
reported playback state</a> is not equal to <var title="">new
|
|
playback state</var> then <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> at the <code><a href="#mediacontroller">MediaController</a></code> object,
|
|
whose name is <code title="event-MediaController-playing"><a href="#event-mediacontroller-playing">playing</a></code> if <var title="">new playback state</var> is <i>playing</i>, <code title="event-MediaController-ended">ended</code> if <var title="">new playback state</var> is <i>ended</i>, and <code title="event-MediaController-waiting"><a href="#event-mediacontroller-waiting">waiting</a></code>
|
|
otherwise.</li>
|
|
|
|
<li><p>Let the <code><a href="#mediacontroller">MediaController</a></code>'s <a href="#most-recently-reported-playback-state">most recently
|
|
reported playback state</a> be <var title="">new playback
|
|
state</var>.</li>
|
|
|
|
</ol><hr><p>The following are the <a href="#event-handlers">event handlers</a> that must be
|
|
supported, as IDL attributes, by all objects implementing the
|
|
<code><a href="#mediacontroller">MediaController</a></code> interface:</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-mediacontroller-onemptied" title="handler-MediaController-onemptied"><code>onemptied</code></dfn> <td> <code title="event-MediaController-emptied"><a href="#event-mediacontroller-emptied">emptied</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-onloadedmetadata" title="handler-MediaController-onloadedmetadata"><code>onloadedmetadata</code></dfn> <td> <code title="event-MediaController-loadedmetadata"><a href="#event-mediacontroller-loadedmetadata">loadedmetadata</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-onloadeddata" title="handler-MediaController-onloadeddata"><code>onloadeddata</code></dfn> <td> <code title="event-MediaController-loadeddata"><a href="#event-mediacontroller-loadeddata">loadeddata</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-oncanplay" title="handler-MediaController-oncanplay"><code>oncanplay</code></dfn> <td> <code title="event-MediaController-canplay"><a href="#event-mediacontroller-canplay">canplay</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-oncanplaythrough" title="handler-MediaController-oncanplaythrough"><code>oncanplaythrough</code></dfn> <td> <code title="event-MediaController-canplaythrough"><a href="#event-mediacontroller-canplaythrough">canplaythrough</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-onplaying" title="handler-MediaController-onplaying"><code>onplaying</code></dfn> <td> <code title="event-MediaController-playing"><a href="#event-mediacontroller-playing">playing</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-onwaiting" title="handler-MediaController-onwaiting"><code>onwaiting</code></dfn> <td> <code title="event-MediaController-waiting"><a href="#event-mediacontroller-waiting">waiting</a></code>
|
|
<tbody><tr><td><dfn id="handler-mediacontroller-ondurationchange" title="handler-MediaController-ondurationchange"><code>ondurationchange</code></dfn> <td> <code title="event-MediaController-durationchange"><a href="#event-mediacontroller-durationchange">durationchange</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-ontimeupdate" title="handler-MediaController-ontimeupdate"><code>ontimeupdate</code></dfn> <td> <code title="event-MediaController-durationchange"><a href="#event-mediacontroller-durationchange">durationchange</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-onplay" title="handler-MediaController-onplay"><code>onplay</code></dfn> <td> <code title="event-MediaController-play"><a href="#event-mediacontroller-play">play</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-onpause" title="handler-MediaController-onpause"><code>onpause</code></dfn> <td> <code title="event-MediaController-pause"><a href="#event-mediacontroller-pause">pause</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-onratechange" title="handler-MediaController-onratechange"><code>onratechange</code></dfn> <td> <code title="event-MediaController-ratechange"><a href="#event-mediacontroller-ratechange">ratechange</a></code>
|
|
<tr><td><dfn id="handler-mediacontroller-onvolumechange" title="handler-MediaController-onvolumechange"><code>onvolumechange</code></dfn> <td> <code title="event-MediaController-volumechange"><a href="#event-mediacontroller-volumechange">volumechange</a></code>
|
|
</table><hr><p>The <a href="#task-source">task source</a> for the <a href="#concept-task" title="concept-task">tasks</a> listed in this section is the
|
|
<a href="#dom-manipulation-task-source">DOM manipulation task source</a>.</p>
|
|
|
|
</div><h6 id="assigning-a-media-controller-declaratively"><span class="secno">4.8.10.11.3 </span>Assigning a media controller declaratively</h6><p>The <dfn id="attr-media-mediagroup" title="attr-media-mediagroup"><code>mediagroup</code></dfn> content
|
|
attribute on <a href="#media-element" title="media element">media elements</a> can
|
|
be used to link multiple <a href="#media-element" title="media element">media
|
|
elements</a> together by implicitly creating a
|
|
<code><a href="#mediacontroller">MediaController</a></code>.<div class="impl">
|
|
|
|
<p>When a <a href="#media-element">media element</a> is created with a <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute, and when
|
|
a <a href="#media-element">media element</a>'s <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute is set,
|
|
changed, or removed, the user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">m</var> be the <a href="#media-element">media element</a>
|
|
in question.</li>
|
|
|
|
<li><p>Let <var title="">m</var> have no <a href="#current-media-controller">current
|
|
media controller</a>, if it currently has one.</li>
|
|
|
|
<li><p>If <var title="">m</var>'s <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute is being
|
|
removed, then abort these steps.</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is another <a href="#media-element">media element</a> whose
|
|
<code><a href="#document">Document</a></code> is the same as <var title="">m</var>'s
|
|
<code><a href="#document">Document</a></code> (even if one or both of these elements are
|
|
not actually <a href="#in-a-document" title="in a Document"><em>in</em> the
|
|
<code>Document</code></a>), and which also has a <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute, and
|
|
whose <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code>
|
|
attribute has the same value as the new value of <var title="">m</var>'s <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute, then
|
|
let <var title="">controller</var> be that <a href="#media-element">media
|
|
element</a>'s <a href="#current-media-controller">current media controller</a>.</p>
|
|
|
|
<p>Otherwise, let <var title="">controller</var> be a newly created
|
|
<code><a href="#mediacontroller">MediaController</a></code>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">m</var>'s <a href="#current-media-controller">current media
|
|
controller</a> be <var title="">controller</var>.</li>
|
|
|
|
<li><p><a href="#bring-the-media-element-up-to-speed-with-its-new-media-controller">Bring the media element up to speed with its new media
|
|
controller</a>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-media-mediagroup" title="dom-media-mediaGroup"><code>mediaGroup</code></dfn> IDL
|
|
attribute on <a href="#media-element" title="media element">media elements</a> must
|
|
<a href="#reflect">reflect</a> the <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> content
|
|
attribute.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Multiple <a href="#media-element" title="media element">media elements</a>
|
|
referencing the same <a href="#media-resource">media resource</a> will share a
|
|
single network request. This can be used to efficiently play two
|
|
(video) tracks from the same <a href="#media-resource">media resource</a> in two
|
|
different places on the screen. Used with the <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code> attribute, these
|
|
elements can also be kept synchronised.</p>
|
|
|
|
<p>In this example, a sign-languge interpreter track from a movie
|
|
file is overlaid on the primary video track of that same video file
|
|
using two <code><a href="#the-video-element">video</a></code> elements, some CSS, and an implicit
|
|
<code><a href="#mediacontroller">MediaController</a></code>:</p>
|
|
|
|
<pre><article>
|
|
<style scoped>
|
|
div { margin: 1em auto; position: relative; width: 400px; height: 300px; }
|
|
video { position; absolute; bottom: 0; right: 0; }
|
|
video:first-child { width: 100%; height: 100%; }
|
|
video:last-child { width: 30%; }
|
|
</style>
|
|
<div>
|
|
<video src="movie.vid#track=Video&amp;track=English" autoplay controls mediagroup=movie></video>
|
|
<video src="movie.vid#track=sign" autoplay mediagroup=movie></video>
|
|
</div>
|
|
</article></pre>
|
|
|
|
</div><h5 id="timed-text-tracks"><span class="secno">4.8.10.12 </span>Timed text tracks</h5><h6 id="text-track-model"><span class="secno">4.8.10.12.1 </span>Text track model</h6><p>A <a href="#media-element">media element</a> can have a group of associated <dfn id="text-track" title="text track">text tracks</dfn>, known as the <a href="#media-element">media
|
|
element</a>'s <dfn id="list-of-text-tracks">list of text tracks</dfn>. The <a href="#text-track" title="text track">text tracks</a> are sorted as follows:<ol class="brief"><li>The <a href="#text-track" title="text track">text tracks</a> corresponding
|
|
to <code><a href="#the-track-element">track</a></code> element children of the <a href="#media-element">media
|
|
element</a>, in <a href="#tree-order">tree order</a>.</li>
|
|
|
|
<li>Any <a href="#text-track" title="text track">text tracks</a> added using
|
|
the <code title="dom-media-addTextTrack"><a href="#dom-media-addtexttrack">addTextTrack()</a></code> method, in
|
|
the order they were added, oldest first.</li>
|
|
|
|
<li>Any <a href="#media-resource-specific-text-track" title="media-resource-specific text
|
|
track">media-resource-specific text tracks</a> (<a href="#text-track" title="text track">text tracks</a> corresponding to data in
|
|
the <a href="#media-resource">media resource</a>), in the order defined by the
|
|
<a href="#media-resource">media resource</a>'s format specification.</li>
|
|
|
|
</ol><p>A <a href="#text-track">text track</a> consists of:<dl><dt><dfn id="text-track-kind" title="text track kind">The kind of text track</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>This decides how the track is handled by the user agent. The
|
|
kind is represented by a string. The possible strings are:</p>
|
|
|
|
<ul class="brief"><li><dfn id="dom-texttrack-kind-subtitles" title="dom-TextTrack-kind-subtitles"><code>subtitles</code></dfn>
|
|
<li><dfn id="dom-texttrack-kind-captions" title="dom-TextTrack-kind-captions"><code>captions</code></dfn>
|
|
<li><dfn id="dom-texttrack-kind-descriptions" title="dom-TextTrack-kind-descriptions"><code>descriptions</code></dfn>
|
|
<li><dfn id="dom-texttrack-kind-chapters" title="dom-TextTrack-kind-chapters"><code>chapters</code></dfn>
|
|
<li><dfn id="dom-texttrack-kind-metadata" title="dom-TextTrack-kind-metadata"><code>metadata</code></dfn>
|
|
</ul><p>The <a href="#text-track-kind" title="text track kind">kind of track</a> can
|
|
change dynamically, in the case of a <a href="#text-track">text track</a>
|
|
corresponding to a <code><a href="#the-track-element">track</a></code> element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-label" title="text track label">A label</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>This is a human-readable string intended to identify the track
|
|
for the user. In certain cases, the label might be generated
|
|
automatically.</p>
|
|
|
|
<p>The <a href="#text-track-label" title="text track label">label of a track</a> can
|
|
change dynamically, in the case of a <a href="#text-track">text track</a>
|
|
corresponding to a <code><a href="#the-track-element">track</a></code> element or in the case of an
|
|
automatically-generated label whose value depends on variable
|
|
factors such as the user's preferred user interface language.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-language" title="text track language">A language</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>This is a string (a BCP 47 language tag) representing the
|
|
language of the text track's cues. <a href="#refsBCP47">[BCP47]</a></p>
|
|
|
|
<p>The <a href="#text-track-language" title="text track language">language of a text
|
|
track</a> can change dynamically, in the case of a <a href="#text-track">text
|
|
track</a> corresponding to a <code><a href="#the-track-element">track</a></code> element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-readiness-state" title="text track readiness state">A readiness state</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>One of the following:</p>
|
|
|
|
<dl><dt><dfn id="text-track-not-loaded" title="text track not loaded">Not loaded</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the text track is known to exist (e.g. it has
|
|
been declared with a <code><a href="#the-track-element">track</a></code> element), but its cues
|
|
have not been obtained.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-loading" title="text track loading">Loading</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the text track is loading and there have been
|
|
no fatal errors encountered so far. Further cues might still be
|
|
added to the track.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-loaded" title="text track loaded">Loaded</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the text track has been loaded with no fatal
|
|
errors. No new cues will be added to the track except if the
|
|
<a href="#text-track">text track</a> corresponds to a
|
|
<code><a href="#mutabletexttrack">MutableTextTrack</a></code> object.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-failed-to-load" title="text track failed to load">Failed to load</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the text track was enabled, but when the user
|
|
agent attempted to obtain it, this failed in some way
|
|
(e.g. <a href="#url">URL</a> could not be <a href="#resolve-a-url" title="resolve a
|
|
url">resolved</a>, network error, unknown text track
|
|
format). Some or all of the cues are likely missing and will not
|
|
be obtained.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The <a href="#text-track-readiness-state" title="text track readiness state">readiness
|
|
state</a> of a <a href="#text-track">text track</a> changes dynamically as
|
|
the track is obtained.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-mode" title="text track mode">A mode</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>One of the following:</p>
|
|
|
|
<dl><dt><dfn id="text-track-disabled" title="text track disabled">Disabled</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the text track is not active. Other than for
|
|
the purposes of exposing the track in the DOM, the user agent is
|
|
ignoring the text track. No cues are active, no events are
|
|
fired, and the user agent will not attempt to obtain the track's
|
|
cues.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-hidden" title="text track hidden">Hidden</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>Indicates that the text track is active, but that the user
|
|
agent is not actively displaying the cues. If no attempt has yet
|
|
been made to obtain the track's cues, the user agent will
|
|
perform such an attempt momentarily. The user agent is
|
|
maintaining a list of which cues are active, and events are
|
|
being fired accordingly.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-showing" title="text track showing">Showing</dfn>
|
|
<dt><dfn id="text-track-showing-by-default" title="text track showing by default">Showing by default</dfn>
|
|
|
|
</dt><dd>
|
|
|
|
<p>Indicates that the text track is active. If no attempt has
|
|
yet been made to obtain the track's cues, the user agent will
|
|
perform such an attempt momentarily. The user agent is
|
|
maintaining a list of which cues are active, and events are
|
|
being fired accordingly. In addition, for text tracks whose
|
|
<a href="#text-track-kind" title="text track kind">kind</a> is <code title="dom-mediatrack-kind-subtitles">subtitles</code> or <code title="dom-mediatrack-kind-captions">captions</code>, the cues
|
|
are being displayed over the video as appropriate; for text
|
|
tracks whose <a href="#text-track-kind" title="text track kind">kind</a> is <code title="dom-mediatrack-kind-descriptions">descriptions</code>,
|
|
the user agent is making the cues available to the user in a
|
|
non-visual fashion; and for text tracks whose <a href="#text-track-kind" title="text track kind">kind</a> is <code title="dom-mediatrack-kind-chapters">chapters</code>, the user
|
|
agent is making available to the user a mechanism by which the
|
|
user can navigate to any point in the <a href="#media-resource">media
|
|
resource</a> by selecting a cue.</p>
|
|
|
|
<p>The <a href="#text-track-showing-by-default" title="text track showing by default">showing by
|
|
default</a> state is used in conjunction with the <code title="attr-track-default"><a href="#attr-track-default">default</a></code> attribute on
|
|
<code><a href="#the-track-element">track</a></code> elements to indicate that the text track was
|
|
enabled due to that attribute. This allows the user agent to
|
|
override the state if a later track is discovered that is more
|
|
appropriate per the user's preferences.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></dd>
|
|
|
|
<dt><dfn id="text-track-list-of-cues" title="text track list of cues">A list of zero or more cues</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>A list of <a href="#text-track-cue" title="text track cue">text track
|
|
cues</a>, along with <dfn id="rules-for-updating-the-text-track-rendering">rules for updating the text track
|
|
rendering</dfn>.
|
|
</p>
|
|
|
|
<p>The <a href="#text-track-list-of-cues" title="text track list of cues">list of cues of a
|
|
text track</a> can change dynamically, either because the
|
|
<a href="#text-track">text track</a> has <a href="#text-track-not-loaded" title="text track not
|
|
loaded">not yet been loaded</a> or is still <a href="#text-track-loading" title="text
|
|
track loading">loading</a>, or because the <a href="#text-track">text
|
|
track</a> corresponds to a <code><a href="#mutabletexttrack">MutableTextTrack</a></code>
|
|
object, whose API allows individual cues can be added or removed
|
|
dynamically.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>Each <a href="#text-track">text track</a> has a corresponding
|
|
<code><a href="#texttrack">TextTrack</a></code> object.<p>The <a href="#text-track" title="text track">text tracks</a> of a
|
|
<a href="#media-element">media element</a> are <dfn id="the-text-tracks-are-ready" title="the text tracks are
|
|
ready">ready</dfn> if all the <a href="#text-track" title="text track">text
|
|
tracks</a> whose <a href="#text-track-mode" title="text track mode">mode</a> was
|
|
not in the <a href="#text-track-disabled" title="text track disabled">disabled</a> state
|
|
when the element's <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection
|
|
algorithm</a> last started now have a <a href="#text-track-readiness-state">text track readiness
|
|
state</a> of <a href="#text-track-loaded" title="text track loaded">loaded</a> or
|
|
<a href="#text-track-failed-to-load" title="text track failed to load">failed to load</a>.<hr><p>A <dfn id="text-track-cue">text track cue</dfn> is the unit of time-sensitive data
|
|
in a <a href="#text-track">text track</a>, corresponding for instance for
|
|
subtitles and captions to the text that appears at a particular time
|
|
and disappears at another time.<p>Each <a href="#text-track-cue">text track cue</a> consists of:<dl><dt><dfn id="text-track-cue-identifier" title="text track cue identifier">An identifier</dfn>
|
|
<dd>
|
|
<p>An arbitrary string.</p>
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-cue-start-time" title="text track cue start time">A start time</dfn>
|
|
<dd>
|
|
<p>A time, in seconds and fractions of a second, at which the cue
|
|
becomes relevant.</p>
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-cue-end-time" title="text track cue end time">An end time</dfn>
|
|
<dd>
|
|
<p>A time, in seconds and fractions of a second, at which the cue
|
|
stops being relevant.</p>
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-cue-pause-on-exit-flag" title="text track cue pause-on-exit flag">A pause-on-exit flag</dfn>
|
|
<dd>
|
|
<p>A boolean indicating whether playback of the <a href="#media-resource">media
|
|
resource</a> is to pause when the cue stops being relevant.</p>
|
|
</dd>
|
|
|
|
<dt><dfn id="text-track-cue-writing-direction" title="text track cue writing direction">A writing direction</dfn>
|
|
<dd>
|
|
<p>A writing direction, either <dfn id="text-track-cue-horizontal-writing-direction" title="text track cue
|
|
horizontal writing direction">horizontal</dfn> (a line extends
|
|
horizontally and is positioned vertically, with consecutive lines
|
|
displayed below each other), <dfn id="text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical
|
|
growing left writing direction">vertical growing left</dfn> (a
|
|
line extends vertically and is positioned horizontally, with
|
|
consecutive lines displayed to the left of each other), or <dfn id="text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical
|
|
growing right writing direction">vertical growing right</dfn> (a
|
|
line extends vertically and is positioned horizontally, with
|
|
consecutive lines displayed to the right of each other).</p>
|
|
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><dfn id="text-track-cue-size" title="text track cue size">A size</dfn>
|
|
<dd>
|
|
<p>A number giving the size of the box within which the text of
|
|
each line of the cue is to be aligned, to be interpreted as a
|
|
percentage of the video, as defined by the <a href="#text-track-cue-writing-direction" title="text
|
|
track cue writing direction">writing direction</a>.</p>
|
|
</dd>
|
|
|
|
|
|
<dt><dfn id="text-track-cue-text" title="text track cue text">The text of the cue</dfn>
|
|
<dd>
|
|
<p>The raw text of the cue, and rules for its interpretation,
|
|
allowing the text to be rendered and converted to a DOM fragment.</p>
|
|
</dd>
|
|
|
|
</dl><p>A <a href="#text-track-cue">text track cue</a> is immutable.<p>Each <a href="#text-track-cue">text track cue</a> has a corresponding
|
|
<code><a href="#texttrackcue">TextTrackCue</a></code> object, and can be associated with a
|
|
particular <a href="#text-track">text track</a>. Once a <a href="#text-track-cue">text track
|
|
cue</a> is associated with a particular <a href="#text-track">text track</a>,
|
|
the association is permanent.<p>In addition, each <a href="#text-track-cue">text track cue</a> has two pieces of
|
|
dynamic information:<dl><dt>The <dfn id="text-track-cue-active-flag" title="text track cue active flag">active flag</dfn>
|
|
<dd>
|
|
|
|
<p>This flag must be initially unset. The flag is used to ensure
|
|
events are fired appropriately when the cue becomes active or
|
|
inactive, and to make sure the right cues are rendered.</p>
|
|
|
|
<p>The user agent must synchronously unset this flag whenever the
|
|
<a href="#text-track-cue">text track cue</a> is removed from its <a href="#text-track">text
|
|
track</a>'s <a href="#text-track-list-of-cues">text track list of cues</a>; whenever the
|
|
<a href="#text-track">text track</a> itself is removed from its <a href="#media-element">media
|
|
element</a>'s <a href="#list-of-text-tracks">list of text tracks</a> or has its
|
|
<a href="#text-track-mode">text track mode</a> changed to <a href="#text-track-disabled" title="text track
|
|
disabled">disabled</a>; and whenever the <a href="#media-element">media
|
|
element</a>'s <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is changed back to
|
|
<code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code>. When the
|
|
flag is unset in this way for one or more cues in <a href="#text-track" title="text track">text tracks</a> that were <a href="#text-track-showing" title="text track showing">showing</a> or <a href="#text-track-showing-by-default" title="text
|
|
track showing by default">showing by default</a> prior to the
|
|
relevant incident, the user agent must, after having unset the
|
|
flag for all the affected cues, apply the <a href="#rules-for-updating-the-text-track-rendering">rules for updating
|
|
the text track rendering</a> of those <a href="#text-track" title="text
|
|
track">text tracks</a>.
|
|
</dd>
|
|
|
|
<dt>The <dfn id="text-track-cue-display-state" title="text track cue display state">display state</dfn>
|
|
<dd>
|
|
|
|
<p>This is used as part of the rendering model, to keep cues in a
|
|
consistent position. It must initially be empty. Whenever the
|
|
<a href="#text-track-cue-active-flag">text track cue active flag</a> is unset, the user agent
|
|
must empty the <a href="#text-track-cue-display-state">text track cue display state</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The <a href="#text-track-cue" title="text track cue">text track cues</a> of a
|
|
<a href="#media-element">media element</a>'s <a href="#text-track" title="text track">text
|
|
tracks</a> are ordered relative to each other in the <dfn id="text-track-cue-order">text
|
|
track cue order</dfn>, which is determined as follows: first group
|
|
the <a href="#text-track-cue" title="text track cue">cues</a> by their <a href="#text-track">text
|
|
track</a>, with the groups being sorted in the same order as
|
|
their <a href="#text-track" title="text track">text tracks</a> appear in the
|
|
<a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list of text tracks</a>;
|
|
then, within each group, <a href="#text-track-cue" title="text track cue">cues</a>
|
|
must be sorted by their <a href="#text-track-cue-start-time" title="text track cue start
|
|
time">start time</a>, earliest first; then, any <a href="#text-track-cue" title="text track cue">cues</a> with the same <a href="#text-track-cue-start-time" title="text
|
|
track cue start time">start time</a> must be sorted by their
|
|
<a href="#text-track-cue-end-time" title="text track cue end time">end time</a>, earliest
|
|
first; and finally, any <a href="#text-track-cue" title="text track cue">cues</a>
|
|
with identical <a href="#text-track-cue-end-time" title="text track cue end time">end
|
|
times</a> must be sorted in the order they were created (so
|
|
e.g. for cues from a <span>WebVTT</span> file, that would be the
|
|
order in which the cues were listed in the file).<h6 id="sourcing-in-band-text-tracks"><span class="secno">4.8.10.12.2 </span>Sourcing in-band text tracks</h6><p>A <dfn id="media-resource-specific-text-track">media-resource-specific text track</dfn> is a <a href="#text-track">text
|
|
track</a> that corresponds to data found in the <a href="#media-resource">media
|
|
resource</a>.<div class="impl">
|
|
|
|
<p>Rules for processing and rendering such data are defined by the
|
|
relevant specifications, e.g. the specification of the video format
|
|
if the <a href="#media-resource">media resource</a> is a video.</p>
|
|
|
|
<p>When a <a href="#media-resource">media resource</a> contains data that the user
|
|
agent recognises and supports as being equivalent to a <a href="#text-track">text
|
|
track</a>, the user agent <a href="#found-a-media-resource-specific-timed-track">runs</a> the
|
|
<dfn id="steps-to-expose-a-media-resource-specific-text-track">steps to expose a media-resource-specific text track</dfn>
|
|
with the relevant data, as follows:</p>
|
|
|
|
<ol><li><p>Associate the relevant data with a new <a href="#text-track">text
|
|
track</a> and its corresponding new <code><a href="#texttrack">TextTrack</a></code>
|
|
object. The <a href="#text-track">text track</a> is a
|
|
<a href="#media-resource-specific-text-track">media-resource-specific text track</a>.</li>
|
|
|
|
<li><p>Set the new <a href="#text-track">text track</a>'s <a href="#text-track-kind" title="text track
|
|
kind">kind</a>, <a href="#text-track-label" title="text track label">label</a>,
|
|
and <a href="#text-track-language" title="text track language">language</a> based on the
|
|
semantics of the relevant data, as defined by the relevant
|
|
specification.</li>
|
|
|
|
<li><p>Populate the new <a href="#text-track">text track</a>'s <a href="#text-track-list-of-cues" title="text track list of cues">list of cues</a> with the cues
|
|
parsed so far, folllowing the <span>guidelines for exposing
|
|
cues</span>, and begin updating it dynamically as
|
|
necessary.</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the new <a href="#text-track">text track</a>'s <a href="#text-track-readiness-state" title="text track
|
|
readiness state">readiness state</a> to the value that most
|
|
correctly describes the current state, and begin updating it
|
|
dynamically as necessary.</p>
|
|
|
|
<p class="example">For example, if the relevant data in the
|
|
<a href="#media-resource">media resource</a> has been fully parsed and completely
|
|
describes the cues, then the <a href="#text-track">text track</a> would be
|
|
<a href="#text-track-loaded" title="text track loaded">loaded</a>. On the other hand,
|
|
if the data for the cues is interleaved with the <a href="#media-data">media
|
|
data</a>, and the <a href="#media-resource">media resource</a> as a whole is
|
|
still being downloaded, then the <a href="#text-track-loading" title="text track
|
|
loading">loading</a> state might be more accurate.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Set the new <a href="#text-track">text track</a>'s <a href="#text-track-mode" title="text
|
|
track mode">mode</a> to the mode consistent with the user's
|
|
preferences and the requirements of the relevant specification for
|
|
the data.</li>
|
|
|
|
<li><p>Leave the <a href="#text-track-list-of-cues">text track list of cues</a> empty, and
|
|
associate with it the <a href="#rules-for-updating-the-text-track-rendering">rules for updating the text track
|
|
rendering</a> appropriate for the format in question.</p>
|
|
|
|
<li><p>Add the new <a href="#text-track">text track</a> to the <a href="#media-element">media
|
|
element</a>'s <a href="#list-of-text-tracks">list of text tracks</a>.</li>
|
|
|
|
</ol><p>When a <a href="#media-element">media element</a> is to <dfn id="forget-the-media-element-s-media-resource-specific-text-tracks">forget the media
|
|
element's media-resource-specific text tracks</dfn>, the user
|
|
agent must remove from the <a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list
|
|
of text tracks</a> all the <a href="#media-resource-specific-text-track" title="media-resource-specific
|
|
text track">media-resource-specific text tracks</a>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h6 id="sourcing-out-of-band-text-tracks"><span class="secno">4.8.10.12.3 </span>Sourcing out-of-band text tracks</h6>
|
|
|
|
<p>When a <code><a href="#the-track-element">track</a></code> element is created, it must be
|
|
associated with a new <a href="#text-track">text track</a> (with its value set
|
|
as defined below) and its corresponding new <code><a href="#texttrack">TextTrack</a></code>
|
|
object.</p>
|
|
|
|
<p>The <a href="#text-track-kind">text track kind</a> is determined from the state of
|
|
the element's <code title="attr-track-kind"><a href="#attr-track-kind">kind</a></code> attribute
|
|
according to the following table; for a state given in a cell of the
|
|
first column, the <a href="#text-track-kind" title="text track kind">kind</a> is the
|
|
string given in the second column:</p>
|
|
|
|
<table><thead><tr><th>State
|
|
<th>String
|
|
<tbody><tr><td><a href="#attr-track-kind-subtitles" title="attr-track-kind-subtitles">Subtitles</a>
|
|
<td><code title="dom-timedtrack-kind-subtitles">subtitles</code>
|
|
<tr><td><a href="#attr-track-kind-captions" title="attr-track-kind-captions">Captions</a>
|
|
<td><code title="dom-timedtrack-kind-captions">captions</code>
|
|
<tr><td><a href="#attr-track-kind-descriptions" title="attr-track-kind-descriptions">Descriptions</a>
|
|
<td><code title="dom-timedtrack-kind-descriptions">descriptions</code>
|
|
<tr><td><a href="#attr-track-kind-chapters" title="attr-track-kind-chapters">Chapters</a>
|
|
<td><code title="dom-timedtrack-kind-chapters">chapters</code>
|
|
<tr><td><a href="#attr-track-kind-metadata" title="attr-track-kind-metadata">Metadata</a>
|
|
<td><code title="dom-timedtrack-kind-metadata">metadata</code>
|
|
</table><p>The <a href="#text-track-label">text track label</a> is the element's <a href="#track-label">track
|
|
label</a>.</p>
|
|
|
|
<p>The <a href="#text-track-language">text track language</a> is the element's
|
|
<a href="#track-language">track language</a>, if any, or the empty string
|
|
otherwise.</p>
|
|
|
|
<p>As the <code title="attr-track-kind"><a href="#attr-track-kind">kind</a></code>, <code title="attr-track-label"><a href="#attr-track-label">label</a></code>, and <code title="attr-track-srclang"><a href="#attr-track-srclang">srclang</a></code> attributes are set,
|
|
changed, or removed, the <a href="#text-track">text track</a> must update
|
|
accordingly, as per the definitions above.</p>
|
|
|
|
<p class="note">Changes to the <a href="#track-url">track URL</a> are handled in
|
|
the algorithm below.</p>
|
|
|
|
<p>The <a href="#text-track-list-of-cues">text track list of cues</a> is initially empty. It
|
|
is dynamically modified when the referenced file is parsed.
|
|
Associated with the list are the <a href="#rules-for-updating-the-text-track-rendering">rules for updating the text
|
|
track rendering</a> appropriate for the format in question; for
|
|
<span>WebVTT</span>, this is the <a href="#rules-for-updating-the-display-of-webvtt-text-tracks">rules for updating the
|
|
display of WebVTT text tracks</a>.</p>
|
|
|
|
<p>When a <code><a href="#the-track-element">track</a></code> element's parent element changes and
|
|
the new parent is a <a href="#media-element">media element</a>, then the user agent
|
|
must add the <code><a href="#the-track-element">track</a></code> element's corresponding <a href="#text-track">text
|
|
track</a> to the <a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list of text
|
|
tracks</a>.</p>
|
|
|
|
<p>When a <code><a href="#the-track-element">track</a></code> element's parent element changes and
|
|
the old parent was a <a href="#media-element">media element</a>, then the user agent
|
|
must remove the <code><a href="#the-track-element">track</a></code> element's corresponding
|
|
<a href="#text-track">text track</a> from the <a href="#media-element">media element</a>'s
|
|
<a href="#list-of-text-tracks">list of text tracks</a>.</p>
|
|
|
|
<p>When a <a href="#text-track">text track</a> corresponding to a
|
|
<code><a href="#the-track-element">track</a></code> element is added to a <a href="#media-element">media
|
|
element</a>'s <a href="#list-of-text-tracks">list of text tracks</a>, the user agent
|
|
must set the <a href="#text-track-mode">text track mode</a> appropriately, as
|
|
determined by the following conditions:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#text-track-kind">text track kind</a> is <code title="dom-TextTrack-kind-subtitles"><a href="#dom-texttrack-kind-subtitles">subtitles</a></code> or <code title="dom-TextTrack-kind-captions"><a href="#dom-texttrack-kind-captions">captions</a></code> and the user
|
|
has indicated an interest in having a track with this <a href="#text-track-kind">text
|
|
track kind</a>, <a href="#text-track-language">text track language</a>, and
|
|
<a href="#text-track-label">text track label</a> enabled, and there is no other
|
|
<a href="#text-track">text track</a> in the <a href="#media-element">media element</a>'s
|
|
<a href="#list-of-text-tracks">list of text tracks</a> with a <a href="#text-track-kind">text track
|
|
kind</a> of either <code title="dom-TextTrack-kind-subtitles"><a href="#dom-texttrack-kind-subtitles">subtitles</a></code> or <code title="dom-TextTrack-kind-captions"><a href="#dom-texttrack-kind-captions">captions</a></code> whose
|
|
<a href="#text-track-mode">text track mode</a> is <a href="#text-track-showing" title="text track
|
|
showing">showing</a></dt>
|
|
|
|
<dt>If the <a href="#text-track-kind">text track kind</a> is <code title="dom-TextTrack-kind-descriptions"><a href="#dom-texttrack-kind-descriptions">descriptions</a></code> and
|
|
the user has indicated an interest in having text descriptions with
|
|
this <a href="#text-track-language">text track language</a> and <a href="#text-track-label">text track
|
|
label</a> enabled, and there is no other <a href="#text-track">text
|
|
track</a> in the <a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list of
|
|
text tracks</a> with a <a href="#text-track-kind">text track kind</a> of <code title="dom-TextTrack-kind-descriptions"><a href="#dom-texttrack-kind-descriptions">descriptions</a></code> whose
|
|
<a href="#text-track-mode">text track mode</a> is <a href="#text-track-showing" title="text track
|
|
showing">showing</a></dt>
|
|
|
|
<dt>If the <a href="#text-track-kind">text track kind</a> is <code title="dom-TextTrack-kind-chapters"><a href="#dom-texttrack-kind-chapters">chapters</a></code> and the
|
|
<a href="#text-track-language">text track language</a> is one that the user agent has
|
|
reason to believe is appropriate for the user, and there is no
|
|
other <a href="#text-track">text track</a> in the <a href="#media-element">media element</a>'s
|
|
<a href="#list-of-text-tracks">list of text tracks</a> with a <a href="#text-track-kind">text track
|
|
kind</a> of <code title="dom-TextTrack-kind-chapters"><a href="#dom-texttrack-kind-chapters">chapters</a></code> whose
|
|
<a href="#text-track-mode">text track mode</a> is <a href="#text-track-showing" title="text track
|
|
showing">showing</a></dt>
|
|
|
|
<dd>
|
|
<p>Let the <a href="#text-track-mode">text track mode</a> be <a href="#text-track-showing" title="text
|
|
track showing">showing</a>.</p>
|
|
|
|
<p>If there is a <a href="#text-track">text track</a> in the <a href="#media-element">media
|
|
element</a>'s <a href="#list-of-text-tracks">list of text tracks</a> whose
|
|
<a href="#text-track-mode">text track mode</a> is <a href="#text-track-showing-by-default" title="text track showing
|
|
by default">showing by default</a>, the user agent must
|
|
furthermore change <em>that</em> <a href="#text-track">text track</a>'s
|
|
<a href="#text-track-mode">text track mode</a> to <a href="#text-track-hidden" title="text track
|
|
hidden">hidden</a>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <code><a href="#the-track-element">track</a></code> element has a <code title="attr-track-default"><a href="#attr-track-default">default</a></code> attribute specified, and
|
|
there is no other <a href="#text-track">text track</a> in the <a href="#media-element">media
|
|
element</a>'s <a href="#list-of-text-tracks">list of text tracks</a> whose
|
|
<a href="#text-track-mode">text track mode</a> is <a href="#text-track-showing" title="text track
|
|
showing">showing</a> or <a href="#text-track-showing-by-default" title="text track
|
|
showing by default">showing by default</a></dt>
|
|
|
|
<dd>
|
|
<p>Let the <a href="#text-track-mode">text track mode</a> be <a href="#text-track-showing-by-default" title="text
|
|
track showing by default">showing by default</a>.</p>
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
<p>Let the <a href="#text-track-mode">text track mode</a> be <a href="#text-track-disabled" title="text
|
|
track disabled">disabled</a>.</p>
|
|
</dd>
|
|
|
|
</dl><p>When a <a href="#text-track">text track</a> corresponding to a
|
|
<code><a href="#the-track-element">track</a></code> element is created with <a href="#text-track-mode">text track
|
|
mode</a> set to <a href="#text-track-hidden" title="text track hidden">hidden</a>,
|
|
<a href="#text-track-showing" title="text track showing">showing</a>, or <a href="#text-track-showing-by-default" title="text track showing by default">showing by default</a>,
|
|
and when a <a href="#text-track">text track</a> corresponding to a
|
|
<code><a href="#the-track-element">track</a></code> element is created with <a href="#text-track-mode">text track
|
|
mode</a> set to <a href="#text-track-disabled" title="text track
|
|
disabled">disabled</a> and subsequently changes its <a href="#text-track-mode">text
|
|
track mode</a> to <a href="#text-track-hidden" title="text track hidden">hidden</a>,
|
|
<a href="#text-track-showing" title="text track showing">showing</a>, or <a href="#text-track-showing-by-default" title="text track showing by default">showing by default</a> for
|
|
the first time, the user agent must immediately and synchronously
|
|
run the following algorithm. This algorithm interacts closely with
|
|
the <a href="#event-loop">event loop</a> mechanism; in particular, it has a
|
|
<a href="#synchronous-section">synchronous section</a> (which is triggered as part of the
|
|
<a href="#event-loop">event loop</a> algorithm). The step in that section is
|
|
marked with ⌛.</p>
|
|
|
|
<ol><li><p>Set the <a href="#text-track-readiness-state">text track readiness state</a> to <a href="#text-track-loading" title="text track loading">loading</a>.</li>
|
|
|
|
<li><p>Let <var title="">URL</var> be the <a href="#track-url">track URL</a> of
|
|
the <code><a href="#the-track-element">track</a></code> element.</li>
|
|
|
|
<li><p>Asynchronously run the remaining steps, while continuing
|
|
with whatever task was responsible for creating the <a href="#text-track">text
|
|
track</a> or changing the <a href="#text-track-mode">text track
|
|
mode</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p><i>Download</i>: If <var title="">URL</var> is not the empty
|
|
string, and its <a href="#origin">origin</a> is the same as the <a href="#media-element">media
|
|
element</a>'s <code><a href="#document">Document</a></code>'s <a href="#origin">origin</a>, then
|
|
<a href="#fetch">fetch</a> <var title="">URL</var>, from the <a href="#media-element">media
|
|
element</a>'s <code><a href="#document">Document</a></code>'s <a href="#origin">origin</a>, with
|
|
the <i>force same-origin flag</i> set.</p>
|
|
<p>The <a href="#concept-task" title="concept-task">tasks</a> <a href="#queue-a-task" title="queue
|
|
a task">queued</a> by the <a href="#fetch" title="fetch">fetching
|
|
algorithm</a> on the <a href="#networking-task-source">networking task source</a> to
|
|
process the data as it is being fetched must examine the
|
|
resource's <a href="#content-type" title="Content-Type">Content Type
|
|
metadata</a>, once it is available, if it ever is. If no <a href="#content-type" title="Content-Type">Content Type metadata</a> is ever
|
|
available, or if the type is not recognised as a text track
|
|
format, then the resource's format must be assumed to be
|
|
unsupported (this causes the load to fail, as described below). If
|
|
a type is obtained, and represents a supported text track format,
|
|
then the resource's data must be passed to the appropriate parser
|
|
as it is received, with the <a href="#text-track-list-of-cues">text
|
|
track list of cues</a> being used for that parser's output.</p>
|
|
|
|
<p>If the <a href="#fetch" title="fetch">fetching algorithm</a> fails for
|
|
any reason (network error, the server returns an error code, a
|
|
cross-origin check fails, etc), or if <var title="">URL</var> is
|
|
the empty string or has the wrong <a href="#origin">origin</a> as
|
|
determined by the condition at the start of this step, or if the
|
|
fetched resource is not in a supported format, then <a href="#queue-a-task">queue a
|
|
task</a> to first change the <a href="#text-track-readiness-state">text track readiness
|
|
state</a> to <a href="#text-track-failed-to-load" title="text track failed to load">failed to
|
|
load</a> and then <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-error">error</code> at the <code><a href="#the-track-element">track</a></code>
|
|
element; and then, once that <a href="#concept-task" title="concept-task">task</a> is <a href="#queue-a-task" title="queue a
|
|
task">queued</a>, move on to the step below labeled
|
|
<i>monitoring</i>.</p>
|
|
|
|
<p>If the <a href="#fetch" title="fetch">fetching algorithm</a> does not
|
|
fail, then, when it completes, <a href="#queue-a-task">queue a task</a> to first
|
|
change the <a href="#text-track-readiness-state">text track readiness state</a> to <a href="#text-track-loaded" title="text track loaded">loaded</a> and then <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-load">load</code> at
|
|
the <code><a href="#the-track-element">track</a></code> element; and then, once that <a href="#concept-task" title="concept-task">task</a> is <a href="#queue-a-task" title="queue a
|
|
task">queued</a>, move on to the step below labeled
|
|
<i>monitoring</i>.</p>
|
|
|
|
<p>If, while the <a href="#fetch" title="fetch">fetching algorithm</a> is
|
|
active, either:</p>
|
|
|
|
<ul><li>the <a href="#track-url">track URL</a> changes so that it is no longer
|
|
equal to <var title="">URL</var>, while the <a href="#text-track-mode">text track
|
|
mode</a> is set to <a href="#text-track-hidden" title="text track
|
|
hidden">hidden</a>, <a href="#text-track-showing" title="text track
|
|
showing">showing</a>, or <a href="#text-track-showing-by-default" title="text track showing by
|
|
default">showing by default</a>; or</li>
|
|
|
|
<li>the <a href="#text-track-mode">text track mode</a> changes to <a href="#text-track-hidden" title="text track hidden">hidden</a>, <a href="#text-track-showing" title="text
|
|
track showing">showing</a>, or <a href="#text-track-showing-by-default" title="text track
|
|
showing by default">showing by default</a>, while the
|
|
<a href="#track-url">track URL</a> is not equal to <var title="">URL</var></li>
|
|
|
|
</ul><p>...then the user agent must run the following steps:</p>
|
|
|
|
<ol><li><p>Abort the <a href="#fetch" title="fetch">fetching
|
|
algorithm</a>.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-abort">abort</code> at
|
|
the <code><a href="#the-track-element">track</a></code> element.</li>
|
|
|
|
<li><p>Let <var title="">URL</var> be the new <a href="#track-url">track
|
|
URL</a>.</li>
|
|
|
|
<li><p>Jump back to the top of the step labeled
|
|
<i>download</i>.</li>
|
|
|
|
</ol><p>Until one of the above circumstances occurs, the user agent
|
|
must remain on this step.</p>
|
|
|
|
</li>
|
|
|
|
<li><p><i>Monitoring</i>: Wait until the <a href="#track-url">track URL</a> is
|
|
no longer equal to <var title="">URL</var>, at the same time as the
|
|
<a href="#text-track-mode">text track mode</a> is set to <a href="#text-track-hidden" title="text track
|
|
hidden">hidden</a>, <a href="#text-track-showing" title="text track
|
|
showing">showing</a>, or <a href="#text-track-showing-by-default" title="text track showing by
|
|
default">showing by default</a>.</li>
|
|
|
|
<li><p>Wait until the <a href="#text-track-readiness-state">text track readiness state</a> is
|
|
no longer set to <a href="#text-track-loading" title="text track
|
|
loading">loading</a>.</li>
|
|
|
|
<li><p><a href="#await-a-stable-state">Await a stable state</a>. The <a href="#synchronous-section">synchronous
|
|
section</a> consists of the following step. (The step in the
|
|
<a href="#synchronous-section">synchronous section</a> is marked with ⌛.)</li>
|
|
|
|
<li><p>⌛ Set the <a href="#text-track-readiness-state">text track readiness state</a> to
|
|
<a href="#text-track-loading" title="text track loading">loading</a>.</li>
|
|
|
|
|
|
<li><p>End the <a href="#synchronous-section">synchronous section</a>, continuing the
|
|
remaining steps asynchronously.</li>
|
|
|
|
<li><p>Jump to the step labeled <i>download</i>.</li>
|
|
|
|
</ol></div><h6 id="text-track-api"><span class="secno">4.8.10.12.4 </span>Text track API</h6><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-textTracks"><a href="#dom-media-texttracks">textTracks</a></code> . <code title="">length</code></dt>
|
|
<dd>
|
|
<p>Returns the number of <a href="#text-track" title="text track">text tracks</a> associated with the <a href="#media-element">media element</a> (e.g. from <code><a href="#the-track-element">track</a></code> elements). This is the number of <a href="#text-track" title="text track">text tracks</a> in the <a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list of text tracks</a>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-textTracks"><a href="#dom-media-texttracks">textTracks[</a></code> <var title="">n</var> <code title="">]</code></dt>
|
|
<dd>
|
|
<p>Returns the <code><a href="#texttrack">TextTrack</a></code> object representing the <var title="">n</var>th <a href="#text-track">text track</a> in the <a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list of text tracks</a>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">track</var> . <code title="dom-track-track"><a href="#dom-track-track">track</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <code><a href="#texttrack">TextTrack</a></code> object representing the <code><a href="#the-track-element">track</a></code> element's <a href="#text-track">text track</a>.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-texttracks" title="dom-media-textTracks"><code>textTracks</code></dfn>
|
|
attribute of <a href="#media-element" title="media element">media elements</a> must
|
|
return an <span title="array host objects">array host object</span>
|
|
for objects of type <code><a href="#texttrack">TextTrack</a></code> that is <i>fixed
|
|
length</i> and <i>read only</i>. The same object must be returned
|
|
each time the attribute is accessed. <a href="#refsWEBIDL">[WEBIDL]</a></p>
|
|
|
|
<p>The array must contain the <code><a href="#texttrack">TextTrack</a></code> objects of the
|
|
<a href="#text-track" title="text track">text tracks</a> in the <a href="#media-element">media
|
|
element</a>'s <a href="#list-of-text-tracks">list of text tracks</a>, in the same
|
|
order as in the <a href="#list-of-text-tracks">list of text tracks</a>.</p>
|
|
|
|
</div><hr><pre class="idl">interface <dfn id="texttrack">TextTrack</dfn> {
|
|
readonly attribute DOMString <a href="#dom-texttrack-kind" title="dom-TextTrack-kind">kind</a>;
|
|
readonly attribute DOMString <a href="#dom-texttrack-label" title="dom-TextTrack-label">label</a>;
|
|
readonly attribute DOMString <a href="#dom-texttrack-language" title="dom-TextTrack-language">language</a>;
|
|
|
|
const unsigned short <a href="#dom-texttrack-none" title="dom-TextTrack-NONE">NONE</a> = 0;
|
|
const unsigned short <a href="#dom-texttrack-loading" title="dom-TextTrack-LOADING">LOADING</a> = 1;
|
|
const unsigned short <a href="#dom-texttrack-loaded" title="dom-TextTrack-LOADED">LOADED</a> = 2;
|
|
const unsigned short <a href="#dom-texttrack-error" title="dom-TextTrack-ERROR">ERROR</a> = 3;
|
|
readonly attribute unsigned short <a href="#dom-texttrack-readystate" title="dom-TextTrack-readyState">readyState</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-texttrack-onload" title="handler-TextTrack-onload">onload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-texttrack-onerror" title="handler-TextTrack-onerror">onerror</a>;
|
|
|
|
const unsigned short <a href="#dom-texttrack-off" title="dom-TextTrack-OFF">OFF</a> = 0;
|
|
const unsigned short <a href="#dom-texttrack-hidden" title="dom-TextTrack-HIDDEN">HIDDEN</a> = 1;
|
|
const unsigned short <a href="#dom-texttrack-showing" title="dom-TextTrack-SHOWING">SHOWING</a> = 2;
|
|
attribute unsigned short <a href="#dom-texttrack-mode" title="dom-TextTrack-mode">mode</a>;
|
|
|
|
readonly attribute <a href="#texttrackcuelist">TextTrackCueList</a> <a href="#dom-texttrack-cues" title="dom-TextTrack-cues">cues</a>;
|
|
readonly attribute <a href="#texttrackcuelist">TextTrackCueList</a> <a href="#dom-texttrack-activecues" title="dom-TextTrack-activeCues">activeCues</a>;
|
|
|
|
attribute <a href="#function">Function</a> <a href="#handler-texttrack-oncuechange" title="handler-TextTrack-oncuechange">oncuechange</a>;
|
|
};
|
|
<a href="#texttrack">TextTrack</a> implements <a href="#eventtarget">EventTarget</a>;</pre><dl class="domintro"><dt><var title="">textTrack</var> . <code title="dom-TextTrack-kind"><a href="#dom-texttrack-kind">kind</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-kind">text track kind</a> string.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">textTrack</var> . <code title="dom-TextTrack-label"><a href="#dom-texttrack-label">label</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-label">text track label</a>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">textTrack</var> . <code title="dom-TextTrack-language"><a href="#dom-texttrack-language">language</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-language">text track language</a> string.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">textTrack</var> . <code title="dom-TextTrack-readyState"><a href="#dom-texttrack-readystate">readyState</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-readiness-state">text track readiness state</a>,
|
|
represented by a number from the following list:</p>
|
|
<dl><dt><code><a href="#texttrack">TextTrack</a></code> . <code title="dom-TextTrack-NONE"><a href="#dom-texttrack-none">NONE</a></code> (0)</dt>
|
|
<dd>
|
|
<p>The <a href="#text-track-not-loaded">text track not loaded</a> state.</p>
|
|
</dd>
|
|
<dt><code><a href="#texttrack">TextTrack</a></code> . <code title="dom-TextTrack-LOADING"><a href="#dom-texttrack-loading">LOADING</a></code> (1)</dt>
|
|
<dd>
|
|
<p>The <a href="#text-track-loading">text track loading</a> state.</p>
|
|
</dd>
|
|
<dt><code><a href="#texttrack">TextTrack</a></code> . <code title="dom-TextTrack-LOADED"><a href="#dom-texttrack-loaded">LOADED</a></code> (2)</dt>
|
|
<dd>
|
|
<p>The <a href="#text-track-loaded">text track loaded</a> state.</p>
|
|
</dd>
|
|
<dt><code><a href="#texttrack">TextTrack</a></code> . <code title="dom-TextTrack-ERROR"><a href="#dom-texttrack-error">ERROR</a></code> (3)</dt>
|
|
<dd>
|
|
<p>The <a href="#text-track-failed-to-load">text track failed to load</a> state.</p>
|
|
</dd>
|
|
</dl></dd>
|
|
|
|
<dt><var title="">textTrack</var> . <code title="dom-TextTrack-mode"><a href="#dom-texttrack-mode">mode</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-mode">text track mode</a>, represented by a
|
|
number from the following list:</p>
|
|
<dl><dt><code><a href="#texttrack">TextTrack</a></code> . <code title="dom-TextTrack-OFF"><a href="#dom-texttrack-off">OFF</a></code> (0)</dt>
|
|
<dd>
|
|
<p>The <a href="#text-track-disabled">text track disabled</a> mode.</p>
|
|
</dd>
|
|
<dt><code><a href="#texttrack">TextTrack</a></code> . <code title="dom-TextTrack-HIDDEN"><a href="#dom-texttrack-hidden">HIDDEN</a></code> (1)</dt>
|
|
<dd>
|
|
<p>The <a href="#text-track-hidden">text track hidden</a> mode.</p>
|
|
</dd>
|
|
<dt><code><a href="#texttrack">TextTrack</a></code> . <code title="dom-TextTrack-SHOWING"><a href="#dom-texttrack-showing">SHOWING</a></code> (2)</dt>
|
|
<dd>
|
|
<p>The <a href="#text-track-showing">text track showing</a> and <a href="#text-track-showing-by-default" title="text track showing by default">showing by default</a> modes.</p>
|
|
</dd>
|
|
</dl><p>Can be set, to change the mode.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">textTrack</var> . <code title="dom-TextTrack-cues"><a href="#dom-texttrack-cues">cues</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-list-of-cues">text track list of cues</a>, as a <code><a href="#texttrackcuelist">TextTrackCueList</a></code> object.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">textTrack</var> . <code title="dom-TextTrack-activeCues"><a href="#dom-texttrack-activecues">activeCues</a></code></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-cue" title="text track cue">text track cues</a> from the <a href="#text-track-list-of-cues">text track list of cues</a> that are currently active (i.e. that start before the <a href="#current-playback-position">current playback position</a> and end after it), as a <code><a href="#texttrackcuelist">TextTrackCueList</a></code> object.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-texttrack-kind" title="dom-TextTrack-kind"><code>kind</code></dfn>
|
|
attribute must return the <a href="#text-track-kind">text track kind</a> of the
|
|
<a href="#text-track">text track</a> that the <code><a href="#texttrack">TextTrack</a></code> object
|
|
represents.</p>
|
|
|
|
<p>The <dfn id="dom-texttrack-label" title="dom-TextTrack-label"><code>label</code></dfn>
|
|
attribute must return the <a href="#text-track-label">text track label</a> of the
|
|
<a href="#text-track">text track</a> that the <code><a href="#texttrack">TextTrack</a></code> object
|
|
represents.</p>
|
|
|
|
<p>The <dfn id="dom-texttrack-language" title="dom-TextTrack-language"><code>language</code></dfn>
|
|
attribute must return the <a href="#text-track-language">text track language</a> of the
|
|
<a href="#text-track">text track</a> that the <code><a href="#texttrack">TextTrack</a></code> object
|
|
represents.</p>
|
|
|
|
<p>The <dfn id="dom-texttrack-readystate" title="dom-TextTrack-readyState"><code>readyState</code></dfn>
|
|
attribute must return the numeric value corresponding to the
|
|
<a href="#text-track-readiness-state">text track readiness state</a> of the <a href="#text-track">text
|
|
track</a> that the <code><a href="#texttrack">TextTrack</a></code> object represents, as
|
|
defined by the following list:</p>
|
|
|
|
<dl><dt><dfn id="dom-texttrack-none" title="dom-TextTrack-NONE"><code>NONE</code></dfn> (numeric value 0)</dt>
|
|
<dd>The <a href="#text-track-not-loaded">text track not loaded</a> state.</dd>
|
|
<dt><dfn id="dom-texttrack-loading" title="dom-TextTrack-LOADING"><code>LOADING</code></dfn> (numeric value 1)</dt>
|
|
<dd>The <a href="#text-track-loading">text track loading</a> state.</dd>
|
|
<dt><dfn id="dom-texttrack-loaded" title="dom-TextTrack-LOADED"><code>LOADED</code></dfn> (numeric value 2)</dt>
|
|
<dd>The <a href="#text-track-loaded">text track loaded</a> state.</dd>
|
|
<dt><dfn id="dom-texttrack-error" title="dom-TextTrack-ERROR"><code>ERROR</code></dfn> (numeric value 3)</dt>
|
|
<dd>The <a href="#text-track-failed-to-load">text track failed to load</a> state.</dd>
|
|
</dl><p>The <dfn id="dom-texttrack-mode" title="dom-TextTrack-mode"><code>mode</code></dfn>
|
|
attribute, on getting, must return the numeric value corresponding
|
|
to the <a href="#text-track-mode">text track mode</a> of the <a href="#text-track">text track</a>
|
|
that the <code><a href="#texttrack">TextTrack</a></code> object represents, as defined by
|
|
the following list:</p>
|
|
|
|
<dl><dt><dfn id="dom-texttrack-off" title="dom-TextTrack-OFF"><code>OFF</code></dfn> (numeric value 0)</dt>
|
|
<dd>The <a href="#text-track-disabled">text track disabled</a> mode.</dd>
|
|
<dt><dfn id="dom-texttrack-hidden" title="dom-TextTrack-HIDDEN"><code>HIDDEN</code></dfn> (numeric value 1)</dt>
|
|
<dd>The <a href="#text-track-hidden">text track hidden</a> mode.</dd>
|
|
<dt><dfn id="dom-texttrack-showing" title="dom-TextTrack-SHOWING"><code>SHOWING</code></dfn> (numeric value 2)</dt>
|
|
<dd>The <a href="#text-track-showing">text track showing</a> and <a href="#text-track-showing-by-default" title="text track showing by default">showing by default</a> modes.</dd>
|
|
</dl><p>On setting, if the new value is not either 0, 1, or 2, the user
|
|
agent must throw an <code><a href="#invalid_access_err">INVALID_ACCESS_ERR</a></code>
|
|
exception. Otherwise, if the new value isn't equal to what the
|
|
attribute would currently return, the new value must be processed as
|
|
follows:</p>
|
|
|
|
<dl class="switch"><dt>If the new value is 0</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Set the <a href="#text-track-mode">text track mode</a> of the <a href="#text-track">text
|
|
track</a> that the <code><a href="#texttrack">TextTrack</a></code> object represents to
|
|
the <a href="#text-track-disabled">text track disabled</a> mode.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the new value is 1</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Set the <a href="#text-track-mode">text track mode</a> of the <a href="#text-track">text
|
|
track</a> that the <code><a href="#texttrack">TextTrack</a></code> object represents to
|
|
the <a href="#text-track-hidden">text track hidden</a> mode.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the new value is 2</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Set the <a href="#text-track-mode">text track mode</a> of the <a href="#text-track">text
|
|
track</a> that the <code><a href="#texttrack">TextTrack</a></code> object represents to
|
|
the <a href="#text-track-showing">text track showing</a> mode.</p>
|
|
|
|
<p class="note">If the mode had been <a href="#text-track-showing-by-default" title="text track
|
|
showing by default">showing by default</a>, this will change it
|
|
to <a href="#text-track-showing" title="text track showing">showing</a>, even though
|
|
the value of <code title="dom-TextTrack-mode"><a href="#dom-texttrack-mode">mode</a></code> would
|
|
appear not to change.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>If the <a href="#text-track-mode">text track mode</a> of the <a href="#text-track">text
|
|
track</a> that the <code><a href="#texttrack">TextTrack</a></code> object represents is
|
|
not the <a href="#text-track-disabled">text track disabled</a> mode, then the <dfn id="dom-texttrack-cues" title="dom-TextTrack-cues"><code>cues</code></dfn> attribute must
|
|
return a <a href="#live">live</a> <code><a href="#texttrackcuelist">TextTrackCueList</a></code> object
|
|
that represents the subset of the <a href="#text-track-list-of-cues">text track list of
|
|
cues</a> of the <a href="#text-track">text track</a> that the
|
|
<code><a href="#texttrack">TextTrack</a></code> object represents whose <a href="#text-track-cue-start-time" title="text
|
|
track cue start time">start times</a> occur before the
|
|
<a href="#earliest-possible-position-when-the-script-started">earliest possible position when the script started</a>, in
|
|
<a href="#text-track-cue-order">text track cue order</a>. Otherwise, it must return
|
|
null. When an object is returned, the same object must be returned
|
|
each time.</p>
|
|
|
|
<p>The <dfn id="earliest-possible-position-when-the-script-started">earliest possible position when the script started</dfn>
|
|
is whatever the <a href="#earliest-possible-position">earliest possible position</a> was the last
|
|
time the <a href="#event-loop">event loop</a> reached step 1.</p>
|
|
|
|
<p>If the <a href="#text-track-mode">text track mode</a> of the <a href="#text-track">text
|
|
track</a> that the <code><a href="#texttrack">TextTrack</a></code> object represents is
|
|
not the <a href="#text-track-disabled">text track disabled</a> mode, then the <dfn id="dom-texttrack-activecues" title="dom-TextTrack-activeCues"><code>activeCues</code></dfn>
|
|
attribute must return a <a href="#live">live</a>
|
|
<code><a href="#texttrackcuelist">TextTrackCueList</a></code> object that represents the subset of
|
|
the <a href="#text-track-list-of-cues">text track list of cues</a> of the <a href="#text-track">text
|
|
track</a> that the <code><a href="#texttrack">TextTrack</a></code> object represents
|
|
whose <a href="#active-flag-was-set-when-the-script-started">active flag was set when the script started</a>, in
|
|
<a href="#text-track-cue-order">text track cue order</a>. Otherwise, it must return
|
|
null. When an object is returned, the same object must be returned
|
|
each time.</p>
|
|
|
|
<p>A <a href="#text-track-cue">text track cue</a>'s <dfn id="active-flag-was-set-when-the-script-started">active flag was set when
|
|
the script started</dfn> if its <a href="#text-track-cue-active-flag">text track cue active
|
|
flag</a> was set the last time the <a href="#event-loop">event loop</a>
|
|
reached step 1.</p>
|
|
|
|
</div><hr><pre class="idl">interface <dfn id="mutabletexttrack">MutableTextTrack</dfn> : <a href="#texttrack">TextTrack</a> {
|
|
void <a href="#dom-mutabletexttrack-addcue" title="dom-MutableTextTrack-addCue">addCue</a>(in <a href="#texttrackcue">TextTrackCue</a> cue);
|
|
void <a href="#dom-mutabletexttrack-removecue" title="dom-MutableTextTrack-removeCue">removeCue</a>(in <a href="#texttrackcue">TextTrackCue</a> cue);
|
|
};</pre><dl class="domintro"><dt><var title="">mutableTextTrack</var> = <var title="">media</var> . <code title="dom-media-addTextTrack"><a href="#dom-media-addtexttrack">addTextTrack</a></code>( <var title="">kind</var> [, <var title="">label</var> [, <var title="">language</var> ] ] )</dt>
|
|
|
|
<dd>
|
|
<p>Creates and returns a new <code><a href="#mutabletexttrack">MutableTextTrack</a></code> object, which is also added to the <a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list of text tracks</a>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">mutableTextTrack</var> . <code title="dom-MutableTextTrack-addCue"><a href="#dom-mutabletexttrack-addcue">addCue</a></code>( <var title="">cue</var> )</dt>
|
|
<dd>
|
|
<p>Adds the given cue to <var title="">mutableTextTrack</var>'s <a href="#text-track-list-of-cues">text track list of cues</a>.</p>
|
|
<p>Raises an exception if the argument is null, associated with another <a href="#text-track">text track</a>, or already in the list of cues.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">mutableTextTrack</var> . <code title="dom-MutableTextTrack-removeCue"><a href="#dom-mutabletexttrack-removecue">removeCue</a></code>( <var title="">cue</var> )</dt>
|
|
<dd>
|
|
<p>Removes the given cue from <var title="">mutableTextTrack</var>'s <a href="#text-track-list-of-cues">text track list of cues</a>.</p>
|
|
<p>Raises an exception if the argument is null, associated with another <a href="#text-track">text track</a>, or not in the list of cues.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-addtexttrack" title="dom-media-addTextTrack"><code>addTextTrack(<var title="">kind</var>, <var title="">label</var>, <var title="">language</var>)</code></dfn> method of <a href="#media-element" title="media
|
|
element">media elements</a>, when invoked, must run the following
|
|
steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If <var title="">kind</var> is not one of the following
|
|
strings, then throw a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception and abort
|
|
these steps:</p>
|
|
|
|
<ul class="brief"><li><code title="dom-TextTrack-kind-subtitles"><a href="#dom-texttrack-kind-subtitles">subtitles</a></code>
|
|
<li><code title="dom-TextTrack-kind-captions"><a href="#dom-texttrack-kind-captions">captions</a></code>
|
|
<li><code title="dom-TextTrack-kind-descriptions"><a href="#dom-texttrack-kind-descriptions">descriptions</a></code>
|
|
<li><code title="dom-TextTrack-kind-chapters"><a href="#dom-texttrack-kind-chapters">chapters</a></code>
|
|
<li><code title="dom-TextTrack-kind-metadata"><a href="#dom-texttrack-kind-metadata">metadata</a></code>
|
|
</ul></li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">label</var> argument was omitted, let <var title="">label</var> be the empty string.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">language</var> argument was omitted, let
|
|
<var title="">language</var> be the empty string.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Create a new <a href="#text-track">text track</a>, and set its <a href="#text-track-kind">text
|
|
track kind</a> to <var title="">kind</var>, its <a href="#text-track-label">text
|
|
track label</a> to <var title="">label</var>, its <a href="#text-track-language">text
|
|
track language</a> to <var title="">language</var>, its
|
|
<a href="#text-track-readiness-state">text track readiness state</a> to the <a href="#text-track-loaded">text track
|
|
loaded</a> state, its <a href="#text-track-mode">text track mode</a> to the
|
|
<a href="#text-track-hidden">text track hidden</a> mode, and its <a href="#text-track-list-of-cues">text track
|
|
list of cues</a> to an empty list.
|
|
</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Add the new <a href="#text-track">text track</a> to the <a href="#media-element">media
|
|
element</a>'s <a href="#list-of-text-tracks">list of text tracks</a>.</p>
|
|
|
|
</ol><p>The <dfn id="dom-mutabletexttrack-addcue" title="dom-MutableTextTrack-addCue"><code>addCue(<var title="">cue</var>)</code></dfn> method of
|
|
<code><a href="#mutabletexttrack">MutableTextTrack</a></code> objects, when invoked, must run the
|
|
following steps:</p>
|
|
|
|
<ol><li><p>If <var title="">cue</var> is null, then throw an
|
|
<code><a href="#invalid_access_err">INVALID_ACCESS_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the given <var title="">cue</var> is already associated
|
|
with a <a href="#text-track">text track</a> other than the method's
|
|
<code><a href="#mutabletexttrack">MutableTextTrack</a></code> object's <a href="#text-track">text track</a>,
|
|
then throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort
|
|
these steps.</li>
|
|
|
|
<li><p>Associate <var title="">cue</var> with the method's
|
|
<code><a href="#mutabletexttrack">MutableTextTrack</a></code> object's <a href="#text-track">text track</a>,
|
|
if it is not currently associated with a <a href="#text-track">text
|
|
track</a>.</li>
|
|
|
|
<li><p>If the given <var title="">cue</var> is already listed in
|
|
the method's <code><a href="#mutabletexttrack">MutableTextTrack</a></code> object's <a href="#text-track">text
|
|
track</a>'s <a href="#text-track-list-of-cues">text track list of cues</a>, then throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception.</li>
|
|
|
|
<li><p>Add <var title="">cue</var> to the method's
|
|
<code><a href="#mutabletexttrack">MutableTextTrack</a></code> object's <a href="#text-track">text track</a>'s
|
|
<a href="#text-track-list-of-cues">text track list of cues</a>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-mutabletexttrack-removecue" title="dom-MutableTextTrack-removeCue"><code>removeCue(<var title="">cue</var>)</code></dfn> method of
|
|
<code><a href="#mutabletexttrack">MutableTextTrack</a></code> objects, when invoked, must run the
|
|
following steps:</p>
|
|
|
|
<ol><li><p>If <var title="">cue</var> is null, then throw an
|
|
<code><a href="#invalid_access_err">INVALID_ACCESS_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the given <var title="">cue</var> is not associated with
|
|
the method's <code><a href="#mutabletexttrack">MutableTextTrack</a></code> object's <a href="#text-track">text
|
|
track</a>, then throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code>
|
|
exception.</li>
|
|
|
|
<li><p>If the given <var title="">cue</var> is not currently listed
|
|
in the method's <code><a href="#mutabletexttrack">MutableTextTrack</a></code> object's <a href="#text-track">text
|
|
track</a>'s <a href="#text-track-list-of-cues">text track list of cues</a>, then throw a
|
|
<code><a href="#not_found_err">NOT_FOUND_ERR</a></code> exception.</li>
|
|
|
|
<li><p>Remove <var title="">cue</var> from the method's
|
|
<code><a href="#mutabletexttrack">MutableTextTrack</a></code> object's <a href="#text-track">text track</a>'s
|
|
<a href="#text-track-list-of-cues">text track list of cues</a>.</li>
|
|
|
|
</ol></div><div class="example">
|
|
|
|
<p>In this example, an <code><a href="#the-audio-element">audio</a></code> element is used to play a
|
|
specific sound-effect from a sound file containing many sound
|
|
effects. A cue is used to pause the audio, so that it ends exactly
|
|
at the end of the clip, even if the browser is busy running some
|
|
script. If the page had relied on script to pause the audio, then
|
|
the start of the next clip might be heard if the browser was not
|
|
able to run the script at the exact time specified.</p>
|
|
|
|
<pre>var sfx = new Audio('sfx.wav');
|
|
var sounds = a.addTextTrack('metadata');
|
|
|
|
// add sounds we care about
|
|
sounds.addCue(new TextTrackCue('dog bark', 12.783, 13.612, '', '', '', true));
|
|
sounds.addCue(new TextTrackCue('kitten mew', 13.612, 15.091, '', '', '', true));
|
|
|
|
function playSound(id) {
|
|
sfx.currentTime = sounds.getCueById(id).startTime;
|
|
sfx.play();
|
|
}
|
|
|
|
sfx.oncanplaythrough = function () {
|
|
playSound('dog bark');
|
|
}
|
|
window.onbeforeunload = function () {
|
|
playSound('kitten mew');
|
|
return 'Are you sure you want to leave this awesome page?';
|
|
}</pre>
|
|
|
|
</div><hr><pre class="idl">interface <dfn id="texttrackcuelist">TextTrackCueList</dfn> {
|
|
readonly attribute unsigned long <a href="#dom-texttrackcuelist-length" title="dom-TextTrackCueList-length">length</a>;
|
|
getter <a href="#texttrackcue">TextTrackCue</a> (in unsigned long index);
|
|
<a href="#texttrackcue">TextTrackCue</a> <a href="#dom-texttrackcuelist-getcuebyid" title="dom-TextTrackCueList-getCueById">getCueById</a>(in DOMString id);
|
|
};</pre><dl class="domintro"><dt><var title="">cuelist</var> . <code title="dom-TextTrackCueList-length"><a href="#dom-texttrackcuelist-length">length</a></code></dt>
|
|
<dd>
|
|
<p>Returns the number of <a href="#text-track-cue" title="text track cue">cues</a> in the list.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">cuelist</var>[<var title="">index</var>]</dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-cue">text track cue</a> with index <var title="">index</var> in the list. The cues are sorted in <a href="#text-track-cue-order">text track cue order</a>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">cuelist</var> . <code title="dom-TextTrackCueList-getCueById"><a href="#dom-texttrackcuelist-getcuebyid">getCueById</a></code>( <var title="">id</var> )</dt>
|
|
<dd>
|
|
<p>Returns the first <a href="#text-track-cue">text track cue</a> (in <a href="#text-track-cue-order">text track cue order</a>) with <a href="#text-track-cue-identifier">text track cue identifier</a> <var title="">id</var>.</p>
|
|
<p>Returns null if none of the cues have the given identifier or if the argument is the empty string.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>A <code><a href="#texttrackcuelist">TextTrackCueList</a></code> object represents a dynamically
|
|
updating list of <a href="#text-track-cue" title="text track cue">text track
|
|
cues</a> in a given order.</p>
|
|
|
|
<p>The <dfn id="dom-texttrackcuelist-length" title="dom-TextTrackCueList-length"><code>length</code></dfn>
|
|
attribute must return the number of <a href="#text-track-cue" title="text track
|
|
cue">cues</a> in the list represented by the
|
|
<code><a href="#texttrackcuelist">TextTrackCueList</a></code> object.</p>
|
|
|
|
<p>The <span>supported property indicies</span> of a
|
|
<code><a href="#texttrackcuelist">TextTrackCueList</a></code> object at any instant are the numbers
|
|
from zero to the number of <a href="#text-track-cue" title="text track cue">cues</a>
|
|
in the list represented by the <code><a href="#texttrackcuelist">TextTrackCueList</a></code> object
|
|
minus one, if any. If there are no <a href="#text-track-cue" title="text track
|
|
cue">cues</a> in the list, there are no <span>supported property
|
|
indicies</span>.</p>
|
|
|
|
<p>To <span>determine the value of an indexed property</span> for a
|
|
given index <var title="">index</var>, the user agent must return
|
|
the <var title="">index</var>th <a href="#text-track-cue">text track cue</a> in the
|
|
list represented by the <code><a href="#texttrackcuelist">TextTrackCueList</a></code> object.</p>
|
|
|
|
<p>The <dfn id="dom-texttrackcuelist-getcuebyid" title="dom-TextTrackCueList-getCueById"><code>getCueById(<var title="">id</var>)</code></dfn> method, when called with an argument
|
|
other than the empty string, must return the first <a href="#text-track-cue">text track
|
|
cue</a> in the list represented by the
|
|
<code><a href="#texttrackcuelist">TextTrackCueList</a></code> object whose <a href="#text-track-cue-identifier">text track cue
|
|
identifier</a> is <var title="">id</var>, if any, or null
|
|
otherwise. If the argument is the empty string, then the method must
|
|
return null.</p>
|
|
|
|
</div><hr><pre class="idl">
|
|
interface <dfn id="texttrackcue">TextTrackCue</dfn> {
|
|
readonly attribute <a href="#texttrack">TextTrack</a> <a href="#dom-texttrackcue-track" title="dom-TextTrackCue-track">track</a>;
|
|
readonly attribute DOMString <a href="#dom-texttrackcue-id" title="dom-TextTrackCue-id">id</a>;
|
|
|
|
readonly attribute double <a href="#dom-texttrackcue-starttime" title="dom-TextTrackCue-startTime">startTime</a>;
|
|
readonly attribute double <a href="#dom-texttrackcue-endtime" title="dom-TextTrackCue-endTime">endTime</a>;
|
|
readonly attribute boolean <a href="#dom-texttrackcue-pauseonexit" title="dom-TextTrackCue-pauseOnExit">pauseOnExit</a>;
|
|
|
|
|
|
DOMString <a href="#dom-texttrackcue-getcueassource" title="dom-TextTrackCue-getCueAsSource">getCueAsSource</a>();
|
|
<a href="#documentfragment">DocumentFragment</a> <a href="#dom-texttrackcue-getcueashtml" title="dom-TextTrackCue-getCueAsHTML">getCueAsHTML</a>();
|
|
|
|
attribute <a href="#function">Function</a> <a href="#handler-texttrackcue-onenter" title="handler-TextTrackCue-onenter">onenter</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-texttrackcue-onexit" title="handler-TextTrackCue-onexit">onexit</a>;
|
|
};
|
|
<a href="#texttrackcue">TextTrackCue</a> implements <a href="#eventtarget">EventTarget</a>;</pre><dl class="domintro"><dt><var title="">cue</var> . <a href="#dom-texttrackcue-track" title="dom-TextTrackCue-track">track</a></dt>
|
|
<dd>
|
|
<p>Returns the <code><a href="#texttrack">TextTrack</a></code> object to which this
|
|
<a href="#text-track-cue">text track cue</a> belongs, if any, or null
|
|
otherwise.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">cue</var> . <a href="#dom-texttrackcue-id" title="dom-TextTrackCue-id">id</a></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-cue-identifier">text track cue identifier</a>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">cue</var> . <a href="#dom-texttrackcue-starttime" title="dom-TextTrackCue-startTime">startTime</a></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-cue-start-time">text track cue start time</a>, in seconds.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">cue</var> . <a href="#dom-texttrackcue-endtime" title="dom-TextTrackCue-endTime">endTime</a></dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-cue-end-time">text track cue end time</a>, in seconds.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">cue</var> . <a href="#dom-texttrackcue-pauseonexit" title="dom-TextTrackCue-pauseOnExit">pauseOnExit</a></dt>
|
|
<dd>
|
|
<p>Returns true if the <a href="#text-track-cue-pause-on-exit-flag">text track cue pause-on-exit flag</a> is set, false otherwise.</p>
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">source</var> = <var title="">cue</var> . <a href="#dom-texttrackcue-getcueassource" title="dom-TextTrackCue-getCueAsSource">getCueAsSource</a>()</dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-cue-text">text track cue text</a> in raw unparsed form.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">fragment</var> = <var title="">cue</var> . <a href="#dom-texttrackcue-getcueashtml" title="dom-TextTrackCue-getCueAsHTML">getCueAsHTML</a>()</dt>
|
|
<dd>
|
|
<p>Returns the <a href="#text-track-cue-text">text track cue text</a> as a <code><a href="#documentfragment">DocumentFragment</a></code> of <a href="#html-elements">HTML elements</a> and other DOM nodes.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
|
|
<p>The <dfn id="dom-texttrackcue-track" title="dom-TextTrackCue-track"><code>track</code></dfn>
|
|
attribute must return the <code><a href="#texttrack">TextTrack</a></code> object of the
|
|
<a href="#text-track">text track</a> with which the <a href="#text-track-cue">text track cue</a>
|
|
that the <code><a href="#texttrackcue">TextTrackCue</a></code> object represents is associated,
|
|
if any; or null otherwise.</p>
|
|
|
|
<p>The <dfn id="dom-texttrackcue-id" title="dom-TextTrackCue-id"><code>id</code></dfn>
|
|
attribute must return the <a href="#text-track-cue-identifier">text track cue identifier</a> of
|
|
the <a href="#text-track-cue">text track cue</a> that the <code><a href="#texttrackcue">TextTrackCue</a></code>
|
|
object represents.</p>
|
|
|
|
<p>The <dfn id="dom-texttrackcue-starttime" title="dom-TextTrackCue-startTime"><code>startTime</code></dfn>
|
|
attribute must return the <a href="#text-track-cue-start-time">text track cue start time</a> of
|
|
the <a href="#text-track-cue">text track cue</a> that the <code><a href="#texttrackcue">TextTrackCue</a></code>
|
|
object represents, in seconds.</p>
|
|
|
|
<p>The <dfn id="dom-texttrackcue-endtime" title="dom-TextTrackCue-endTime"><code>endTime</code></dfn>
|
|
attribute must return the <a href="#text-track-cue-end-time">text track cue end time</a> of
|
|
the <a href="#text-track-cue">text track cue</a> that the <code><a href="#texttrackcue">TextTrackCue</a></code>
|
|
object represents, in seconds.</p>
|
|
|
|
<p>The <dfn id="dom-texttrackcue-pauseonexit" title="dom-TextTrackCue-pauseOnExit"><code>pauseOnExit</code></dfn>
|
|
attribute must return true if the <a href="#text-track-cue-pause-on-exit-flag">text track cue
|
|
pause-on-exit flag</a> of the <a href="#text-track-cue">text track cue</a> that
|
|
the <code><a href="#texttrackcue">TextTrackCue</a></code> object represents is set; or false
|
|
otherwise.</p>
|
|
|
|
<p>The <dfn id="dom-texttrackcue-direction" title="dom-TextTrackCue-direction"><code>direction</code></dfn>
|
|
attribute must return the <a href="#text-track-cue-writing-direction">text track cue writing
|
|
direction</a> of the <a href="#text-track-cue">text track cue</a> that the
|
|
<code><a href="#texttrackcue">TextTrackCue</a></code> object represents.</p>
|
|
|
|
|
|
<p>The <dfn id="dom-texttrackcue-getcueassource" title="dom-TextTrackCue-getCueAsSource"><code>getCueAsSource()</code></dfn>
|
|
method must return the raw <a href="#text-track-cue-text">text track cue text</a>.</p>
|
|
|
|
<p>The <dfn id="dom-texttrackcue-getcueashtml" title="dom-TextTrackCue-getCueAsHTML"><code>getCueAsHTML()</code></dfn>
|
|
method must convert the <a href="#text-track-cue-text">text track cue text</a> to a
|
|
<code><a href="#documentfragment">DocumentFragment</a></code> for the <a href="#media-element">media element</a>'s
|
|
<code><a href="#document">Document</a></code>, using the appropriate rules for doing
|
|
so.
|
|
</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h6 id="cue-events"><span class="secno">4.8.10.12.5 </span>Event definitions</h6>
|
|
|
|
<p>The following are the <a href="#event-handlers">event handlers</a> that must be
|
|
supported, as IDL attributes, by all objects implementing the
|
|
<code><a href="#texttrack">TextTrack</a></code> interface:</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-texttrack-onload" title="handler-TextTrack-onload"><code>onload</code></dfn> <td> <code title="event-load">load</code>
|
|
<tr><td><dfn id="handler-texttrack-onerror" title="handler-TextTrack-onerror"><code>onerror</code></dfn> <td> <code title="event-error">error</code>
|
|
<tr><td><dfn id="handler-texttrack-oncuechange" title="handler-TextTrack-oncuechange"><code>oncuechange</code></dfn> <td> <code title="event-cuechange">cuechange</code>
|
|
</table><p>The following are the <a href="#event-handlers">event handlers</a> that must be
|
|
supported, as IDL attributes, by all objects implementing the
|
|
<code><a href="#texttrackcue">TextTrackCue</a></code> interface:</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-texttrackcue-onenter" title="handler-TextTrackCue-onenter"><code>onenter</code></dfn> <td> <code title="event-enter">enter</code>
|
|
<tr><td><dfn id="handler-texttrackcue-onexit" title="handler-TextTrackCue-onexit"><code>onexit</code></dfn> <td> <code title="event-exit">exit</code>
|
|
</table></div><h5 id="user-interface"><span class="secno">4.8.10.13 </span>User interface</h5><p>The <dfn id="attr-media-controls" title="attr-media-controls"><code>controls</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. If present, it
|
|
indicates that the author has not provided a scripted controller and
|
|
would like the user agent to provide its own set of controls.<div class="impl">
|
|
|
|
<p>If the attribute is present, or if <a href="#concept-n-noscript" title="concept-n-noscript">scripting is disabled</a> for the
|
|
<a href="#media-element">media element</a>, then the user agent should <dfn id="expose-a-user-interface-to-the-user">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, change the display of closed captions or embedded
|
|
sign-language tracks, select different audio tracks or turn on audio
|
|
descriptions, 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 <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, then the user agent should expose audio tracks
|
|
from all the <a href="#slaved-media-elements">slaved media elements</a> (although avoiding
|
|
duplicates if the same <a href="#media-resource">media resource</a> is being used
|
|
several times). If a <a href="#media-resource">media resource</a>'s audio track
|
|
exposed in this way has no known name, and it is the only audio
|
|
track for a particular <a href="#media-element">media element</a>, the user agent
|
|
should use the element's <code title="attr-title"><a href="#the-title-attribute">title</a></code>
|
|
attribute, if any, as the name (or as part of the name) of that
|
|
track.</p>
|
|
|
|
<p>Even when the attribute is absent, however, 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="#media-element">media element</a>'s
|
|
context menu.</p>
|
|
|
|
<p>Where possible (specifically, for starting, stopping, pausing,
|
|
and unpausing playback, for seeking, for changing the rate of
|
|
playback, for fast-forwarding or rewinding,
|
|
for listing, enabling, and disabling text tracks,
|
|
and for muting or changing the volume of the audio), 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>When a <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, the user agent's user interface for pausing and
|
|
unpausing playback, for seeking, for changing the rate of playback,
|
|
for fast-forwarding or rewinding, and for muting or changing the
|
|
volume of audio of the entire group must be implemented in terms of
|
|
the <code><a href="#mediacontroller">MediaController</a></code> API exposed on that <a href="#current-media-controller">current
|
|
media controller</a>.</p>
|
|
|
|
<p>The "play" function in the user agent's interface must set the
|
|
<code title="">playbackRate</code> attribute to the value of the
|
|
<code title="">defaultPlaybackRate</code> attribute before invoking
|
|
the <code title="">play()</code> method.
|
|
When a <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, the attributes and method with those names on
|
|
that <code><a href="#mediacontroller">MediaController</a></code> object must be used. Otherwise,
|
|
the attributes and method with those names on the <a href="#media-element">media
|
|
element</a> itself must be used.
|
|
</p>
|
|
|
|
<p>Features such as fast-forward or rewind must be implemented by
|
|
only changing the <code title="">playbackRate</code> attribute (and
|
|
not the <code title="">defaultPlaybackRate</code> attribute).
|
|
Again, when a <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, the attributes with those names on that
|
|
<code><a href="#mediacontroller">MediaController</a></code> object must be used; otherwise, the
|
|
attributes with those names on the <a href="#media-element">media element</a> itself
|
|
must be used.
|
|
</p>
|
|
|
|
<p>When a <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, and all the <a href="#slaved-media-elements">slaved media elements</a> of
|
|
that <code><a href="#mediacontroller">MediaController</a></code> are paused, the user agent should
|
|
unpause all the <a href="#slaved-media-elements">slaved media elements</a> when the user
|
|
invokes a user agent interface control for beginning playback.</p>
|
|
|
|
<p>When a <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, seeking must be implemented in terms of the <code title="dom-MediaController-seek">seek()</code> method on that
|
|
<code><a href="#mediacontroller">MediaController</a></code> object. Otherwise, the user agent must
|
|
directly <a href="#dom-media-seek" title="dom-media-seek">seek</a> to the requested
|
|
position in the <a href="#media-element">media element</a>'s <a href="#media-timeline">media
|
|
timeline</a>.</p>
|
|
|
|
<p>When a <a href="#media-element">media element</a> has a <a href="#current-media-controller">current media
|
|
controller</a>, user agents may additionally provide the user
|
|
with controls that directly manipulate an individual <a href="#media-element">media
|
|
element</a> without affecting the <code><a href="#mediacontroller">MediaController</a></code>,
|
|
but such features are considered relatively advanced and unlikely to
|
|
be useful to most users.
|
|
|
|
<p>For the purposes of listing chapters in the <a href="#media-resource">media
|
|
resource</a>, only <a href="#text-track" title="text track">text tracks</a>
|
|
in the <a href="#media-element">media element</a>'s <a href="#list-of-text-tracks">list of text
|
|
tracks</a> <a href="#text-track-showing" title="text track showing">showing</a> or
|
|
<a href="#text-track-showing-by-default" title="text track showing by default">showing by
|
|
default</a> and whose <a href="#text-track-kind">text track kind</a> is <code title="dom-timedtrack-kind-chapters">chapters</code> should be used.
|
|
Each <a href="#text-track-cue" title="text track cue">cue</a> in such a <a href="#text-track">text
|
|
track</a> represents a chapter starting at the cue's <a href="#text-track-cue-start-time" title="text track cue start time">start time</a>. The name of
|
|
the chapter is the <a href="#text-track-cue-text">text track cue text</a>, interpreted
|
|
literally.</p>
|
|
|
|
<p>The <dfn id="dom-media-controls" title="dom-media-controls"><code>controls</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
<hr></div><dl class="domintro"><dt><var title="">media</var> . <code title="dom-media-volume"><a href="#dom-media-volume">volume</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current playback volume, as a number in the range
|
|
0.0 to 1.0, where 0.0 is the quietest and 1.0 the loudest.</p>
|
|
|
|
<p>Can be set, to change the volume.</p>
|
|
|
|
<p>Throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> if the new value is not
|
|
in the range 0.0 .. 1.0.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">media</var> . <code title="dom-media-muted"><a href="#dom-media-muted">muted</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if audio is muted, overriding the <code title="dom-media-volume"><a href="#dom-media-volume">volume</a></code> attribute, and false if the
|
|
<code title="dom-media-volume"><a href="#dom-media-volume">volume</a></code> attribute is being
|
|
honored.</p>
|
|
|
|
<p>Can be set, to change whether the audio is muted or not.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-media-volume" title="dom-media-volume"><code>volume</code></dfn>
|
|
attribute must return the playback volume of any audio portions of
|
|
the <a href="#media-element">media element</a>, in the range 0.0 (silent) to 1.0
|
|
(loudest). Initially, the volume must be 1.0, 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. If the new value is outside the range
|
|
0.0 to 1.0 inclusive, then, on setting, an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception must be raised instead.</p>
|
|
|
|
<p>The <dfn id="dom-media-muted" title="dom-media-muted"><code>muted</code></dfn>
|
|
attribute must return true if the audio channels are muted and false
|
|
otherwise. Initially, the audio channels should not be muted
|
|
(false), but user agents may remember the last set value across
|
|
sessions, on a per-site basis or otherwise, so the muted state may
|
|
start as muted (true). On setting, the attribute must be set to the
|
|
new value.</p>
|
|
|
|
<p>Whenever either the <code title="dom-media-muted"><a href="#dom-media-muted">muted</a></code> or
|
|
<code title="dom-media-volume"><a href="#dom-media-volume">volume</a></code> attributes are changed,
|
|
the user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-media-volumechange"><a href="#event-media-volumechange">volumechange</a></code> at the <a href="#media-element">media
|
|
element</a>.</p>
|
|
|
|
<p>An element's <dfn id="effective-media-volume">effective media volume</dfn> is determined as
|
|
follows:</p>
|
|
|
|
<ol><li><p>If the element's <code title="dom-media-muted"><a href="#dom-media-muted">muted</a></code>
|
|
attribute is true, the element's <a href="#effective-media-volume">effective media
|
|
volume</a> is zero. Abort these steps.</li>
|
|
|
|
<li><p>If the element has a <a href="#current-media-controller">current media controller</a>
|
|
and that <code><a href="#mediacontroller">MediaController</a></code> object's <a href="#media-controller-mute-override">media
|
|
controller mute override</a> is true, the element's
|
|
<a href="#effective-media-volume">effective media volume</a> is zero. Abort these
|
|
steps.</li>
|
|
|
|
<li><p>Let <var title="">volume</var> be the value of the element's
|
|
<code title="dom-media-volume"><a href="#dom-media-volume">volume</a></code> attribute.</li>
|
|
|
|
<li><p>If the element has a <a href="#current-media-controller">current media controller</a>,
|
|
multiply <var title="">volume</var> by that
|
|
<code><a href="#mediacontroller">MediaController</a></code> object's <a href="#media-controller-volume-multiplier">media controller volume
|
|
multiplier</a>.</li>
|
|
|
|
<li><p>The element's <a href="#effective-media-volume">effective media volume</a> is <var title="">volume</var>, interpreted relative to the range 0.0 to
|
|
1.0, 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.</li>
|
|
|
|
</ol></div><p>The <dfn id="attr-media-muted" title="attr-media-muted"><code>muted</code></dfn>
|
|
attribute on the <code><a href="#the-video-element">video</a></code> element controls the default
|
|
state of the audio channel of the <a href="#media-resource">media resource</a>,
|
|
potentially overriding user preferences.<div class="impl">
|
|
|
|
<p>When a <a href="#media-element">media element</a> is created, if it has a <code title="attr-media-muted"><a href="#attr-media-muted">muted</a></code> attribute specified, the user
|
|
agent must set the <code title="dom-media-muted"><a href="#dom-media-muted">muted</a></code> IDL
|
|
attribute to true, overriding any user preference.</p>
|
|
|
|
<p>The <dfn id="dom-media-defaultmuted" title="dom-media-defaultMuted"><code>defaultMuted</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-media-muted"><a href="#attr-media-muted">muted</a></code> content attribute.</p>
|
|
|
|
</div><p class="note">This attribute has no dynamic effect (it only
|
|
controls the default state of the element).<div class="example">
|
|
|
|
<p>This video (an advertisment) autoplays, but to avoid annoying
|
|
users, it does so without sound, and allows the user to turn the
|
|
sound on.</p>
|
|
|
|
<pre><video src="adverts.cgi?kind=video" controls autoplay loop muted></video></pre>
|
|
|
|
</div><h5 id="time-ranges"><span class="secno">4.8.10.14 </span>Time ranges</h5><p>Objects implementing the <code><a href="#timeranges">TimeRanges</a></code> interface
|
|
represent a list of ranges (periods) of time.<pre class="idl">interface <dfn id="timeranges">TimeRanges</dfn> {
|
|
readonly attribute unsigned long <a href="#dom-timeranges-length" title="dom-TimeRanges-length">length</a>;
|
|
double <a href="#dom-timeranges-start" title="dom-TimeRanges-start">start</a>(in unsigned long index);
|
|
double <a href="#dom-timeranges-end" title="dom-TimeRanges-end">end</a>(in unsigned long index);
|
|
};</pre><dl class="domintro"><dt><var title="">media</var> . <code title="dom-TimeRanges-length"><a href="#dom-timeranges-length">length</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the number of ranges in the object.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">time</var> = <var title="">media</var> . <code title="dom-TimeRanges-start"><a href="#dom-timeranges-start">start</a></code>(<var title="">index</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the time for the start of the range with the given index.</p>
|
|
|
|
<p>Throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> if the index is out of range.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">time</var> = <var title="">media</var> . <code title="dom-TimeRanges-end"><a href="#dom-timeranges-end">end</a></code>(<var title="">index</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the time for the end of the range with the given index.</p>
|
|
|
|
<p>Throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> if the index is out of range.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-timeranges-length" title="dom-TimeRanges-length"><code>length</code></dfn>
|
|
IDL attribute must return the number of ranges represented by the object.</p>
|
|
|
|
<p>The <dfn id="dom-timeranges-start" 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="dom-timeranges-end" 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><a href="#index_size_err">INDEX_SIZE_ERR</a></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
|
|
<dfn id="normalized-timeranges-object">normalized <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, aren't empty, 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="#dom-media-buffered">buffered</a></code>, <code title="dom-media-seekable"><a href="#dom-media-seekable">seekable</a></code> and <code title="dom-media-played"><a href="#dom-media-played">played</a></code> IDL attributes of <a href="#media-element" title="media element">media elements</a> must be that element's
|
|
<a href="#media-timeline">media timeline</a>.</p>
|
|
|
|
</div><h5 id="mediaevents"><span class="secno">4.8.10.15 </span>Event summary</h5><p><i>This section is non-normative.</i><p>The following events fire on <a href="#media-element" title="media element">media
|
|
elements</a> as part of the processing model described above:<table><thead><tr><th>Event name
|
|
<th>Interface
|
|
<th>Dispatched when...
|
|
<th>Preconditions
|
|
|
|
<tbody><tr><td><dfn id="event-media-loadstart" title="event-media-loadstart"><code>loadstart</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent begins looking for <a href="#media-data">media data</a>, as part of the <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection algorithm</a>.
|
|
<td><code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> equals <code title="dom-media-NETWORK_LOADING"><a href="#dom-media-network_loading">NETWORK_LOADING</a></code>
|
|
<tr><td><dfn id="event-media-progress" title="event-media-progress"><code>progress</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent is fetching <a href="#media-data">media data</a>.
|
|
<td><code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> equals <code title="dom-media-NETWORK_LOADING"><a href="#dom-media-network_loading">NETWORK_LOADING</a></code>
|
|
<tr><td><dfn id="event-media-suspend" title="event-media-suspend"><code>suspend</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent is intentionally not currently fetching <a href="#media-data">media data</a>, but does not have the entire <a href="#media-resource">media resource</a> downloaded.
|
|
<td><code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> equals <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code>
|
|
<tr><td><dfn id="event-media-abort" title="event-media-abort"><code>abort</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent stops fetching the <a href="#media-data">media data</a> before it is completely downloaded, but not due to an error.
|
|
<td><code title="dom-media-error"><a href="#dom-media-error">error</a></code> is an object with the code <code title="dom-MediaError-MEDIA_ERR_ABORTED"><a href="#dom-mediaerror-media_err_aborted">MEDIA_ERR_ABORTED</a></code>.
|
|
<code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> equals either <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code> or <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code>, depending on when the download was aborted.
|
|
<tr><td><dfn id="event-media-error" title="event-media-error"><code>error</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>An error occurs while fetching the <a href="#media-data">media data</a>.
|
|
<td><code title="dom-media-error"><a href="#dom-media-error">error</a></code> is an object with the code <code title="dom-MediaError-MEDIA_ERR_NETWORK"><a href="#dom-mediaerror-media_err_network">MEDIA_ERR_NETWORK</a></code> or higher.
|
|
<code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> equals either <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code> or <code title="dom-media-NETWORK_IDLE"><a href="#dom-media-network_idle">NETWORK_IDLE</a></code>, depending on when the download was aborted.
|
|
<tr><td><dfn id="event-media-emptied" title="event-media-emptied"><code>emptied</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>A <a href="#media-element">media element</a> whose <code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> was previously not in the <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_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="#dom-media-load">load()</a></code> method was invoked while the <a href="#concept-media-load-algorithm" title="concept-media-load-algorithm">resource selection algorithm</a> was already running).
|
|
<td><code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> is <code title="dom-media-NETWORK_EMPTY"><a href="#dom-media-network_empty">NETWORK_EMPTY</a></code>; all the IDL attributes are in their initial states.
|
|
<tr><td><dfn id="event-media-stalled" title="event-media-stalled"><code>stalled</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent is trying to fetch <a href="#media-data">media data</a>, but data is unexpectedly not forthcoming.
|
|
<td><code title="dom-media-networkState"><a href="#dom-media-networkstate">networkState</a></code> is <code title="dom-media-NETWORK_LOADING"><a href="#dom-media-network_loading">NETWORK_LOADING</a></code>.
|
|
|
|
<tbody><tr><td><dfn id="event-media-loadedmetadata" title="event-media-loadedmetadata"><code>loadedmetadata</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent has just determined the duration and dimensions of the <a href="#media-resource">media resource</a>
|
|
and <a href="#the-text-tracks-are-ready">the text tracks are ready</a>.
|
|
<td><code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is newly equal to <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code> or greater for the first time.
|
|
<tr><td><dfn id="event-media-loadeddata" title="event-media-loadeddata"><code>loadeddata</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent can render the <a href="#media-data">media data</a> at the <a href="#current-playback-position">current playback position</a> for the first time.
|
|
<td><code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> newly increased to <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code> or greater for the first time.
|
|
<tr><td><dfn id="event-media-canplay" title="event-media-canplay"><code>canplay</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent can resume playback of the <a href="#media-data">media data</a>, but estimates that if playback were to be started now, the <a href="#media-resource">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><code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> newly increased to <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> or greater.
|
|
<tr><td><dfn id="event-media-canplaythrough" title="event-media-canplaythrough"><code>canplaythrough</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The user agent estimates that if playback were to be started now, the <a href="#media-resource">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><code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is newly equal to <code title="dom-media-HAVE_ENOUGH_DATA"><a href="#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code>.
|
|
<tr><td><dfn id="event-media-playing" title="event-media-playing"><code>playing</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>Playback is ready to start after having been paused or delayed due to lack of <a href="#media-data">media data</a>.
|
|
<td><code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is newly equal to or greater than <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> and <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> is false, or <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> is newly false and <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is equal to or greater than <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code>. Even if this event fires, the element might still not be <a href="#potentially-playing">potentially playing</a>, e.g. if
|
|
the element is <a href="#blocked-on-its-media-controller">blocked on its media controller</a> (e.g. because the <a href="#current-media-controller">current media controller</a> is paused, or another <a href="#slaved-media-elements" title="slaved media elements">slaved media element</a> is stalled somehow, or because the <a href="#media-resource">media resource</a> has no data corresponding to the <a href="#media-controller-position">media controller position</a>), or
|
|
the element is <a href="#paused-for-user-interaction">paused for user interaction</a>.
|
|
<tr><td><dfn id="event-media-waiting" title="event-media-waiting"><code>waiting</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<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><code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> is equal to or less than <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code>, and <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> is false. Either <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> is true, or the <a href="#current-playback-position">current playback position</a> is not contained in any of the ranges in <code title="dom-media-buffered"><a href="#dom-media-buffered">buffered</a></code>. It is possible for playback to stop for other reasons without <code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> being false, but those reasons do not fire this event (and when those situations resolve, a separate <code title="event-media-playing"><a href="#event-media-playing">playing</a></code> event is not fired either): e.g.
|
|
the element is newly <a href="#blocked-on-its-media-controller">blocked on its media controller</a>, or
|
|
<a href="#ended-playback" title="ended playback">playback ended</a>, or playback <a href="#stopped-due-to-errors">stopped due to errors</a>, or the element has <a href="#paused-for-user-interaction">paused for user interaction</a>.
|
|
<tbody><tr><td><dfn id="event-media-seeking" title="event-media-seeking"><code>seeking</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL attribute changed to true and the seek operation is taking long enough that the user agent has time to fire the event.
|
|
<td>
|
|
<tr><td><dfn id="event-media-seeked" title="event-media-seeked"><code>seeked</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <code title="dom-media-seeking"><a href="#dom-media-seeking">seeking</a></code> IDL attribute changed to false.
|
|
<td>
|
|
<tr><td><dfn id="event-media-ended" title="event-media-ended"><code>ended</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>Playback has stopped because the end of the <a href="#media-resource">media resource</a> was reached.
|
|
<td><code title="dom-media-currentTime"><a href="#dom-media-currenttime">currentTime</a></code> equals the end of the <a href="#media-resource">media resource</a>; <code title="dom-media-ended"><a href="#dom-media-ended">ended</a></code> is true.
|
|
|
|
<tbody><tr><td><dfn id="event-media-durationchange" title="event-media-durationchange"><code>durationchange</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <code title="dom-media-duration"><a href="#dom-media-duration">duration</a></code> attribute has just been updated.
|
|
<td>
|
|
<tr><td><dfn id="event-media-timeupdate" title="event-media-timeupdate"><code>timeupdate</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <a href="#current-playback-position">current playback position</a> changed as part of normal playback or in an especially interesting way, for example discontinuously.
|
|
<td>
|
|
<tr><td><dfn id="event-media-play" title="event-media-play"><code>play</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The element is no longer paused. Fired after the <code title="dom-media-play"><a href="#dom-media-play">play()</a></code> method has returned, or when the <code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code> attribute has caused playback to begin.
|
|
<td><code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> is newly false.
|
|
<tr><td><dfn id="event-media-pause" title="event-media-pause"><code>pause</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The element has been paused. Fired after the <code title="dom-media-pause"><a href="#dom-media-pause">pause()</a></code> method has returned.
|
|
<td><code title="dom-media-paused"><a href="#dom-media-paused">paused</a></code> is newly true.
|
|
<tr><td><dfn id="event-media-ratechange" title="event-media-ratechange"><code>ratechange</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>Either the <code title="dom-media-defaultPlaybackRate"><a href="#dom-media-defaultplaybackrate">defaultPlaybackRate</a></code> or the <code title="dom-media-playbackRate"><a href="#dom-media-playbackrate">playbackRate</a></code> attribute has just been updated.
|
|
<td>
|
|
<tr><td><dfn id="event-media-volumechange" title="event-media-volumechange"><code>volumechange</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>Either the <code title="dom-media-volume"><a href="#dom-media-volume">volume</a></code> attribute or the <code title="dom-media-muted"><a href="#dom-media-muted">muted</a></code> attribute has changed. Fired after the relevant attribute's setter has returned.
|
|
<td>
|
|
</table><p>The following events fire on <code><a href="#mediacontroller">MediaController</a></code> objects:<table><thead><tr><th>Event name
|
|
<th>Interface
|
|
<th>Dispatched when...
|
|
|
|
<tbody><tr><td><dfn id="event-mediacontroller-emptied" title="event-MediaController-emptied"><code>emptied</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>All the <a href="#slaved-media-elements">slaved media elements</a> newly have <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> set to <code title="dom-media-HAVE_NOTHING"><a href="#dom-media-have_nothing">HAVE_NOTHING</a></code> or greater, or there are no longer any <a href="#slaved-media-elements">slaved media elements</a>.
|
|
<tr><td><dfn id="event-mediacontroller-loadedmetadata" title="event-MediaController-loadedmetadata"><code>loadedmetadata</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>All the <a href="#slaved-media-elements">slaved media elements</a> newly have <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> set to <code title="dom-media-HAVE_METADATA"><a href="#dom-media-have_metadata">HAVE_METADATA</a></code> or greater.
|
|
<tr><td><dfn id="event-mediacontroller-loadeddata" title="event-MediaController-loadeddata"><code>loadeddata</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>All the <a href="#slaved-media-elements">slaved media elements</a> newly have <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> set to <code title="dom-media-HAVE_CURRENT_DATA"><a href="#dom-media-have_current_data">HAVE_CURRENT_DATA</a></code> or greater.
|
|
<tr><td><dfn id="event-mediacontroller-canplay" title="event-MediaController-canplay"><code>canplay</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>All the <a href="#slaved-media-elements">slaved media elements</a> newly have <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> set to <code title="dom-media-HAVE_FUTURE_DATA"><a href="#dom-media-have_future_data">HAVE_FUTURE_DATA</a></code> or greater.
|
|
<tr><td><dfn id="event-mediacontroller-canplaythrough" title="event-MediaController-canplaythrough"><code>canplaythrough</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>All the <a href="#slaved-media-elements">slaved media elements</a> newly have <code title="dom-media-readyState"><a href="#dom-media-readystate">readyState</a></code> set to <code title="dom-media-HAVE_ENOUGH_DATA"><a href="#dom-media-have_enough_data">HAVE_ENOUGH_DATA</a></code> or greater.
|
|
<tr><td><dfn id="event-mediacontroller-playing" title="event-MediaController-playing"><code>playing</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <code><a href="#mediacontroller">MediaController</a></code> is no longer a <a href="#blocked-media-controller">blocked media controller</a>.
|
|
<tr><td><dfn id="event-mediacontroller-waiting" title="event-MediaController-waiting"><code>waiting</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <code><a href="#mediacontroller">MediaController</a></code> is now a <a href="#blocked-media-controller">blocked media controller</a>.
|
|
<tr><td><dfn id="event-mediacontcoller-ended" title="event-MediaContcoller-ended"><code>ended</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>All the <a href="#slaved-media-elements">slaved media elements</a> have newly <a href="#ended-playback">ended playback</a>.
|
|
|
|
<tbody><tr><td><dfn id="event-mediacontroller-durationchange" title="event-MediaController-durationchange"><code>durationchange</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <code title="dom-MediaController-duration"><a href="#dom-mediacontroller-duration">duration</a></code> attribute has just been updated.
|
|
<tr><td><dfn id="event-mediacontroller-timeupdate" title="event-MediaController-timeupdate"><code>timeupdate</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <a href="#media-controller-position">media controller position</a> changed.
|
|
<tr><td><dfn id="event-mediacontroller-play" title="event-MediaController-play"><code>play</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <code title="dom-MediaController-paused"><a href="#dom-mediacontroller-paused">paused</a></code> attribute is newly false.
|
|
<tr><td><dfn id="event-mediacontroller-pause" title="event-MediaController-pause"><code>pause</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>The <code title="dom-MediaController-paused"><a href="#dom-mediacontroller-paused">paused</a></code> attribute is newly true.
|
|
<tr><td><dfn id="event-mediacontroller-ratechange" title="event-MediaController-ratechange"><code>ratechange</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>Either the <code title="dom-MediaController-defaultPlaybackRate"><a href="#dom-mediacontroller-defaultplaybackrate">defaultPlaybackRate</a></code> attribute or the <code title="dom-MediaController-playbackRate"><a href="#dom-mediacontroller-playbackrate">playbackRate</a></code> attribute has just been updated.
|
|
<tr><td><dfn id="event-mediacontroller-volumechange" title="event-MediaController-volumechange"><code>volumechange</code></dfn>
|
|
<td><code><a href="#event">Event</a></code>
|
|
<td>Either the <code title="dom-MediaController-volume"><a href="#dom-mediacontroller-volume">volume</a></code> attribute or the <code title="dom-MediaController-muted"><a href="#dom-mediacontroller-muted">muted</a></code> attribute has just been updated.
|
|
</table><div class="impl">
|
|
|
|
<h5 id="security-and-privacy-considerations"><span class="secno">4.8.10.16 </span>Security and privacy considerations</h5>
|
|
|
|
<p>The main security and privacy implications of the
|
|
<code><a href="#the-video-element">video</a></code> and <code><a href="#the-audio-element">audio</a></code> elements come from the
|
|
ability to embed media cross-origin. There are two directions that
|
|
threats can flow: from hostile content to a victim page, and from a
|
|
hostile page to victim content.</p>
|
|
|
|
<hr><p>If a victim page embeds hostile content, the threat is that the
|
|
content might contain scripted code that attempts to interact with
|
|
the <code><a href="#document">Document</a></code> that embeds the content. To avoid this,
|
|
user agents must ensure that there is no access from the content to
|
|
the embedding page. In the case of media content that uses DOM
|
|
concepts, the embedded content must be treated as if it was in its
|
|
own unrelated <a href="#top-level-browsing-context">top-level browsing context</a>.</p>
|
|
|
|
<p class="example">For instance, if an SVG animation was embedded in
|
|
a <code><a href="#the-video-element">video</a></code> element, the user agent would not give it
|
|
access to the DOM of the outer page. From the perspective of scripts
|
|
in the SVG resource, the SVG file would appear to be in a lone
|
|
top-level browsing context with no parent.</p>
|
|
|
|
<hr><p>If a hostile page embeds victim content, the threat is that the
|
|
embedding page could obtain information from the content that it
|
|
would not otherwise have access to. The API does expose some
|
|
information: the existence of the media, its type, its duration, its
|
|
size, and the performance characteristics of its host. Such
|
|
information is already potentially problematic, but in practice the
|
|
same information can more or less be obtained using the
|
|
<code><a href="#the-img-element">img</a></code> element, and so it has been deemed acceptable.</p>
|
|
|
|
<p>However, significantly more sensitive information could be
|
|
obtained if the user agent further exposes metadata within the
|
|
content such as subtitles or chapter titles. This version of the API
|
|
does not expose such information. Future extensions to this API will
|
|
likely reuse a mechanism such as CORS to check that the embedded
|
|
content's site has opted in to exposing such information. <a href="#refsCORS">[CORS]</a></p>
|
|
|
|
<p class="example">An attacker could trick a user running within a
|
|
corporate network into visiting a site that attempts to load a video
|
|
from a previously leaked location on the corporation's intranet. If
|
|
such a video included confidential plans for a new product, then
|
|
being able to read the subtitles would present a confidentiality
|
|
breach.</p>
|
|
|
|
</div><h5 id="best-practices-for-authors-using-media-elements"><span class="secno">4.8.10.17 </span>Best practices for authors using media elements</h5><p><i>This section is non-normative.</i><p>Playing audio and video resources on small devices such as
|
|
set-top boxes or mobile phones is often constrained by limited
|
|
hardware resources in the device. For example, a device might only
|
|
support three simultaneous videos. For this reason, it is a good
|
|
practice to release resources held by <a href="#media-element" title="media
|
|
element">media elements</a> when they are done playing, either by
|
|
being very careful about removing all references to the element and
|
|
allowing it to be garbage collected, or, even better, by removing
|
|
the element's <code title="attr-media-src"><a href="#attr-media-src">src</a></code> attribute and
|
|
any <code><a href="#the-source-element">source</a></code> element descendants, and invoking the
|
|
element's <code title="dom-media-load"><a href="#dom-media-load">load()</a></code> method.<p>Similarly, when the playback rate is not exactly 1.0, hardware,
|
|
software, or format limitations can cause video frames to be dropped
|
|
and audio to be choppy or muted.<div class="impl">
|
|
|
|
<h5 id="best-practices-for-implementors-of-media-elements"><span class="secno">4.8.10.18 </span>Best practices for implementors of media elements</h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>How accurately various aspects of the <a href="#media-element">media element</a>
|
|
API are implemented is considered a quality-of-implementation issue.</p>
|
|
|
|
<p>For example, when implementing the <code title="attr-media-buffered">buffered</code> attribute, how precise
|
|
an implementation reports the ranges that have been buffered depends
|
|
on how carefully the user agent inspects the data. Since the API
|
|
reports ranges as times, but the data is obtained in byte streams, a
|
|
user agent receiving a variable-bit-rate stream might only be able
|
|
to determine precise times by actually decoding all of the data.
|
|
User agents aren't required to do this, however; they can instead
|
|
return estimates (e.g. based on the average bit rate seen so far)
|
|
which get revised as more information becomes available.</p>
|
|
|
|
<p>As a general rule, user agents are urged to be conservative
|
|
rather than optimistic. For example, it would be bad to report that
|
|
everything had been buffered when it had not.</p>
|
|
|
|
<p>Another quality-of-implementation issue would be playing a video
|
|
backwards when the codec is designed only for forward playback (e.g.
|
|
there aren't many key frames, and they are far apart, and the
|
|
intervening frames only have deltas from the previous frame). User
|
|
agents could do a poor job, e.g. only showing key frames; however,
|
|
better implementations would do more work and thus do a better job,
|
|
e.g. actually decoding parts of the video forwards, storing the
|
|
complete frames, and then playing the frames backwards.</p>
|
|
|
|
<p>Similarly, while implementations are allowed to drop buffered
|
|
data at any time (there is no requirement that a user agent keep all
|
|
the media data obtained for the lifetime of the media element), it
|
|
is again a quality of implementation issue: user agents with
|
|
sufficient resources to keep all the data around are encouraged to
|
|
do so, as this allows for a better user experience. For example, if
|
|
the user is watching a live stream, a user agent could allow the
|
|
user only to view the live video; however, a better user agent would
|
|
buffer everything and allow the user to seek through the earlier
|
|
material, pause it, play it forwards and backwards, etc.</p>
|
|
|
|
<p>When multiple tracks are synchronised with a
|
|
<code><a href="#mediacontroller">MediaController</a></code>, it is possible for scripts to add and
|
|
remove media elements from the <code><a href="#mediacontroller">MediaController</a></code>'s list
|
|
of <a href="#slaved-media-elements">slaved media elements</a>, even while these tracks are
|
|
playing. How smoothly the media plays back in such situations is
|
|
another quality-of-implementation issue.</p>
|
|
|
|
<hr><p>When a <a href="#media-element">media element</a> that is paused is <a href="#remove-an-element-from-a-document" title="remove an element from a document">removed from a
|
|
document</a> and not reinserted before the next time the
|
|
<a href="#event-loop">event loop</a> spins, implementations that are resource
|
|
constrained are encouraged to take that opportunity to release all
|
|
hardware resources (like video planes, networking resources, and
|
|
data buffers) used by the <a href="#media-element">media element</a>. (User agents
|
|
still have to keep track of the playback position and so forth,
|
|
though, in case playback is later restarted.)</p>
|
|
|
|
</div><h4 id="the-canvas-element"><span class="secno">4.8.11 </span>The <dfn id="canvas"><code>canvas</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#embedded-content">Embedded content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#embedded-content">embedded content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#transparent">Transparent</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-canvas-width"><a href="#attr-canvas-width">width</a></code></dd>
|
|
<dd><code title="attr-canvas-height"><a href="#attr-canvas-height">height</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlcanvaselement">HTMLCanvasElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute unsigned long <a href="#dom-canvas-width" title="dom-canvas-width">width</a>;
|
|
attribute unsigned long <a href="#dom-canvas-height" title="dom-canvas-height">height</a>;
|
|
|
|
DOMString <a href="#dom-canvas-todataurl" title="dom-canvas-toDataURL">toDataURL</a>(in optional DOMString type, in any... args);
|
|
void <a href="#dom-canvas-toblob" title="dom-canvas-toBlob">toBlob</a>(in <span>FileCallback</span>, in optional DOMString type, in any... args);
|
|
|
|
object <a href="#dom-canvas-getcontext" title="dom-canvas-getContext">getContext</a>(in DOMString contextId, in any... args);
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-canvas-element">canvas</a></code> element provides scripts with a
|
|
resolution-dependent bitmap canvas, which can be used for rendering
|
|
graphs, game graphics, or other visual images on the fly.<p>Authors should not use the <code><a href="#the-canvas-element">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="#the-canvas-element">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="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>) and then styled using CSS and
|
|
supporting technologies such as XBL.<p>When authors use the <code><a href="#the-canvas-element">canvas</a></code> element, they must 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="#the-canvas-element">canvas</a></code>
|
|
element. The contents of the <code><a href="#the-canvas-element">canvas</a></code> element, if any,
|
|
are the element's <a href="#fallback-content">fallback content</a>.<p>In interactive visual media, if <a href="#concept-n-script" title="concept-n-script">scripting is enabled</a> for the
|
|
<code><a href="#the-canvas-element">canvas</a></code> element, and if support for <code><a href="#the-canvas-element">canvas</a></code>
|
|
elements has been enabled, the <code><a href="#the-canvas-element">canvas</a></code> element
|
|
<a href="#represents">represents</a> <a href="#embedded-content">embedded content</a> consisting of
|
|
a dynamically created image.<p>In non-interactive, static, visual media, if the
|
|
<code><a href="#the-canvas-element">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="#the-canvas-element">canvas</a></code> element
|
|
<a href="#represents">represents</a> <a href="#embedded-content">embedded content</a> with the
|
|
current image and size. Otherwise, the element represents its
|
|
<a href="#fallback-content">fallback content</a> instead.<p>In non-visual media, and in visual media if <a href="#concept-n-noscript" title="concept-n-noscript">scripting is disabled</a> for the
|
|
<code><a href="#the-canvas-element">canvas</a></code> element or if support for <code><a href="#the-canvas-element">canvas</a></code>
|
|
elements has been disabled, the <code><a href="#the-canvas-element">canvas</a></code> element
|
|
<a href="#represents">represents</a> its <a href="#fallback-content">fallback content</a>
|
|
instead.</p><!-- CANVAS-FOCUS-FALLBACK --><p>When a <code><a href="#the-canvas-element">canvas</a></code> element <a href="#represents">represents</a>
|
|
<a href="#embedded-content">embedded content</a>, the user can still focus descendants
|
|
of the <code><a href="#the-canvas-element">canvas</a></code> element (in the <a href="#fallback-content">fallback
|
|
content</a>). When an element is focused, it is the target of
|
|
keyboard interaction events (even though the element itself is not
|
|
visible). This allows authors to make an interactive canvas
|
|
keyboard-accessible: authors should have a one-to-one mapping of
|
|
interactive regions to focusable elements in the <a href="#fallback-content">fallback
|
|
content</a>. (Focus has no effect on mouse interaction
|
|
events.) <a href="#refsDOMEVENTS">[DOMEVENTS]</a><p>The <code><a href="#the-canvas-element">canvas</a></code> element has two attributes to control the
|
|
size of the coordinate space: <dfn id="attr-canvas-width" title="attr-canvas-width"><code>width</code></dfn> and <dfn id="attr-canvas-height" title="attr-canvas-height"><code>height</code></dfn>. These
|
|
attributes, when specified, must have values that are <a href="#valid-non-negative-integer" title="valid non-negative integer">valid non-negative
|
|
integers</a>. <span class="impl">The <a href="#rules-for-parsing-non-negative-integers">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.</span> The
|
|
<code title="attr-canvas-width"><a href="#attr-canvas-width">width</a></code> attribute defaults to
|
|
300, and the <code title="attr-canvas-height"><a href="#attr-canvas-height">height</a></code>
|
|
attribute defaults to 150.<p>The intrinsic dimensions of the <code><a href="#the-canvas-element">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.<div class="impl">
|
|
|
|
<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>When the <code><a href="#the-canvas-element">canvas</a></code> element is created, and subsequently
|
|
whenever the <code title="attr-canvas-width"><a href="#attr-canvas-width">width</a></code> and <code title="attr-canvas-height"><a href="#attr-canvas-height">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
|
|
reinitialized with the newly specified coordinate space
|
|
dimensions.</p>
|
|
|
|
<p>When the canvas is initialized, its bitmap must be cleared to
|
|
transparent black.</p>
|
|
|
|
<p>The <dfn id="dom-canvas-width" title="dom-canvas-width"><code>width</code></dfn> and
|
|
<dfn id="dom-canvas-height" title="dom-canvas-height"><code>height</code></dfn> IDL
|
|
attributes must <a href="#reflect">reflect</a> the respective content
|
|
attributes of the same name, with the same defaults.</p>
|
|
|
|
</div><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><hr><dl class="domintro"><dt><var title="">context</var> = <var title="">canvas</var> . <code title="dom-canvas-getContext"><a href="#dom-canvas-getcontext">getContext</a></code>(<var title="">contextId</var> [, ... ])</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns an object that exposes an API for drawing on the
|
|
canvas. The first argument specifies the desired API. Subsequent
|
|
arguments are handled by that API.</p>
|
|
|
|
|
|
<p>The list of defined contexts is given on the <a href="http://wiki.whatwg.org/wiki/CanvasContexts">WHATWG Wiki
|
|
CanvasContexts page</a>. <a href="#refsWHATWGWIKI">[WHATWGWIKI]</a>
|
|
|
|
<p>Returns null if the given context ID is not supported or if the
|
|
canvas has already been initialised with some other (incompatible)
|
|
context type (e.g. trying to get a "<code title="canvas-context-2d">2d</code>" context after getting a
|
|
"<code title="canvas-context-webgl">webgl</code>" context).</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>A <code><a href="#the-canvas-element">canvas</a></code> element can have a <dfn id="primary-context">primary
|
|
context</dfn>, which is the first context to have been obtained for
|
|
that element. When created, a <code><a href="#the-canvas-element">canvas</a></code> element must not
|
|
have a <a href="#primary-context">primary context</a>.</p>
|
|
|
|
<p>The most commonly used primary context is the <a href="http://dev.w3.org/html5/2dcontext/">HTML Canvas 2D Context</a>.
|
|
|
|
<p>The <dfn id="dom-canvas-getcontext" title="dom-canvas-getContext"><code>getContext(<var title="">contextId</var>, <var title="">args...</var>)</code></dfn>
|
|
method of the <code><a href="#the-canvas-element">canvas</a></code> element, when invoked, must run
|
|
the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">contextId</var> be the first argument to
|
|
the method.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">contextId</var> is not the name of a context
|
|
supported by the user agent, return null and abort these
|
|
steps.</p>
|
|
|
|
<p class="note">An example of this would be a user agent that
|
|
theoretically supports the "<code title="canvas-context-webgl">webgl</code>" 3D context, in the case
|
|
where the platform does not have hardware support for OpenGL and
|
|
the user agent does not have a software OpenGL implementation.
|
|
Despite the user agent recognising the "<code title="canvas-context-webgl">webgl</code>" name, it would return
|
|
null at this step because that context is not, in practice,
|
|
supported at the time of the call.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the element has a <a href="#primary-context">primary context</a> and that
|
|
context's entry in the <a href="http://wiki.whatwg.org/wiki/CanvasContexts">WHATWG Wiki
|
|
CanvasContexts page</a> does not list <var title="">contextId</var>
|
|
as a context with which it is compatible, return null and abort
|
|
these steps. <a href="#refsWHATWGWIKI">[WHATWGWIKI]</a></li>
|
|
|
|
<li><p>If the element does not have a <a href="#primary-context">primary context</a>,
|
|
let the element's <a href="#primary-context">primary context</a> be <var title="">contextId</var>.</li>
|
|
|
|
<li><p>If the <code title="dom-canvas-getContext"><a href="#dom-canvas-getcontext">getContext()</a></code> method has
|
|
already been invoked on this element for the same <var title="">contextId</var>, return the same object as was returned
|
|
that time, and abort these steps. The additional arguments are
|
|
ignored.</li>
|
|
|
|
<li><p><dfn id="getcontext-return" title="getContext-return">Return a new object for <var title="">contextId</var></dfn>, as defined by the specification
|
|
given for <var title="">contextId</var>'s entry in the <a href="http://wiki.whatwg.org/wiki/CanvasContexts">WHATWG Wiki
|
|
CanvasContexts page</a>. <a href="#refsWHATWGWIKI">[WHATWGWIKI]</a></li>
|
|
|
|
</ol><p>New context types may be registered in the <a href="http://wiki.whatwg.org/wiki/CanvasContexts">WHATWG Wiki
|
|
CanvasContexts page</a>. <a href="#refsWHATWGWIKI">[WHATWGWIKI]</a></p>
|
|
|
|
<p>Anyone is free to edit the WHATWG Wiki CanvasContexts page at any
|
|
time to add a new context type. These new context types must be
|
|
specified with the following information:</p>
|
|
|
|
<dl><dt>Keyword</dt>
|
|
|
|
<dd><p>The value of <var title="">contextID</var> that will return
|
|
the object for the new API.</dd>
|
|
|
|
|
|
<dt>Specification</dt>
|
|
|
|
<dd><p>A link to a formal specification of the context type's
|
|
API. It could be another page on the Wiki, or a link to an external
|
|
page. If the type does not have a formal specification, an informal
|
|
description can be substituted until such time as a formal
|
|
specification is available.</dd>
|
|
|
|
|
|
<dt>Compatible with</dt>
|
|
|
|
<dd><p>The list of context types that are compatible with this one
|
|
(i.e. that operate on the same underlying bitmap). This list must
|
|
be transitive and symmetric; if one context type is defined as
|
|
compatible with another, then all types it is compatible with must
|
|
be compatible with all types the other is compatible with.</dd>
|
|
|
|
</dl><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>. Such contexts should be registered in the
|
|
WHATWG Wiki CanvasContexts page.</p>
|
|
|
|
</div><hr><dl class="domintro"><dt><var title="">url</var> = <var title="">canvas</var> . <code title="dom-canvas-toDataURL"><a href="#dom-canvas-todataurl">toDataURL</a></code>( [ <var title="">type</var>, ... ])</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <a href="#data-protocol" title="data protocol"><code title="">data:</code> URL</a> for the image in the canvas.</p>
|
|
|
|
<p>The first argument, if provided, controls the type of the image
|
|
to be returned (e.g. PNG or JPEG). The default is <code title="">image/png</code>; that type is also used if the given
|
|
type isn't supported. The other arguments are specific to the
|
|
type, and control the way that the image is generated, as given in
|
|
the table below.</p>
|
|
|
|
<p>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 of 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. (The one exception
|
|
to this is if the canvas has either no height or no width, in
|
|
which case the result might simply be "<code title="">data:,</code>".)</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">canvas</var> . <code title="dom-canvas-toBlob"><a href="#dom-canvas-toblob">toBlob</a></code>(<var title="">callback</var> [, <var title="">type</var>, ... ])</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Creates a <code><a href="#blob">Blob</a></code> object representing a file
|
|
containing the image in the canvas, and invokes a callback with a
|
|
handle to that object.</p>
|
|
|
|
<p>The second argument, if provided, controls the type of the
|
|
image to be returned (e.g. PNG or JPEG). The default is <code title="">image/png</code>; that type is also used if the given
|
|
type isn't supported. The other arguments are specific to the
|
|
type, and control the way that the image is generated, as given in
|
|
the table below.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-canvas-todataurl" title="dom-canvas-toDataURL"><code>toDataURL()</code></dfn> method
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>If the canvas has no pixels (i.e. either its horizontal
|
|
dimension or its vertical dimension is zero) then return the string
|
|
"<code title="">data:,</code>" and abort these steps. (This is the
|
|
shortest <a href="#data-protocol" title="data protocol"><code title="">data:</code>
|
|
URL</a>; it represents the empty string in a <code title="">text/plain</code> resource.)</li>
|
|
|
|
<li><p>Let <var title="">file</var> be <a href="#a-serialization-of-the-image-as-a-file">a serialization of the
|
|
image as a file</a>, using the method's arguments (if any) as
|
|
the <var title="">arguments</var>.</li>
|
|
|
|
<li><p>Return a <a href="#data-protocol" title="data protocol"><code title="">data:</code> URL</a> representing <var title="">file</var>. <a href="#refsRFC2397">[RFC2397]</a></p>
|
|
|
|
|
|
</ol><p>The <dfn id="dom-canvas-toblob" title="dom-canvas-toBlob"><code>toBlob()</code></dfn> method
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">callback</var> be the first
|
|
argument.</li>
|
|
|
|
<li><p>Let <var title="">arguments</var> be the second and
|
|
subsequent arguments to the method, if any.</li>
|
|
|
|
<li><p>Let <var title="">file</var> be <a href="#a-serialization-of-the-image-as-a-file">a serialization of the
|
|
image as a file</a>, using <var title="">arguments</var>.</li>
|
|
|
|
<li><p>Return, but continue running these steps
|
|
asynchronously.</li>
|
|
|
|
<li><p>If <var title="">callback</var> is null, abort these
|
|
steps.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to invoke the
|
|
<code>FileCallback</code> <var title="">callback</var> with a
|
|
<code><a href="#blob">Blob</a></code> object representing <var title="">file</var> as
|
|
its argument. The <a href="#task-source">task source</a> for this task is the
|
|
<dfn id="canvas-blob-serialization-task-source">canvas blob serialization task source</dfn>. <a href="#refsFILESYSTEMAPI">[FILESYSTEMAPI]</a> <a href="#refsFILEAPI">[FILEAPI]</a> </li>
|
|
|
|
</ol><p>When a user agent is to create <dfn id="a-serialization-of-the-image-as-a-file">a serialization of the image
|
|
as a file</dfn>, optionally with some given <var title="">arguments</var>, it must create an image file in the format
|
|
given by the first value of <var title="">arguments</var>, or, if
|
|
there are no <var title="">arguments</var>, in the PNG format. <a href="#refsPNG">[PNG]</a></p>
|
|
|
|
<p>If <var title="">arguments</var> is not empty, the first value
|
|
must be interpreted as a <a href="#mime-type" title="MIME type">MIME type</a>
|
|
giving the format to use. If the type has any parameters, it must be
|
|
treated as not supported.</p>
|
|
|
|
<p class="example">For example, the value "<code>image/png</code>" would
|
|
mean to generate a PNG image, the value "<code>image/jpeg</code>"
|
|
would mean to generate a JPEG image, and the value
|
|
"<code>image/svg+xml</code>" would mean to generate an SVG image
|
|
(which would probably require that the implementation actually keep
|
|
enough information to reliably render an SVG image from the canvas).</p>
|
|
|
|
<p>User agents must support PNG ("<code>image/png</code>"). User
|
|
agents may support other types. If the user agent does not support
|
|
the requested type, it must create the file using the PNG format. <a href="#refsPNG">[PNG]</a></p>
|
|
|
|
<p>User agents must <a href="#converted-to-ascii-lowercase" title="converted to ASCII
|
|
lowercase">convert the provided type to ASCII lowercase</a>
|
|
before establishing if they support that type.</p>
|
|
|
|
<p>For image types that do not support an alpha channel, the
|
|
serialized image must be the canvas image composited onto a solid
|
|
black background using the source-over operator.</p>
|
|
|
|
<p>If the first argument in <var title="">arguments</var> gives a
|
|
type corresponding to one of the types given in the first column of
|
|
the following table, and the user agent supports that type, then the
|
|
subsequent arguments, if any, must be treated as described in the
|
|
second cell of that row.</p>
|
|
|
|
</div><table><thead><tr><th> Type <th> Other arguments <th> Reference
|
|
<tbody><tr><td> <code>image/jpeg</code>
|
|
<td> The second argument<span class="impl">, if it</span> is a
|
|
number in the range 0.0 to 1.0 inclusive<span class="impl">, must
|
|
be</span> treated as the desired quality level. <span class="impl">If it is not a number or is outside that range, the
|
|
user agent must use its default value, as if the argument had
|
|
been omitted.</span>
|
|
<td> <a href="#refsJPEG">[JPEG]</a>
|
|
</table><div class="impl">
|
|
|
|
<p>For the purposes of these rules, an argument is considered to be
|
|
a number if it is converted to an IDL double value by the rules for
|
|
handling arguments of type <code title="">any</code> in the Web IDL
|
|
specification. <a href="#refsWEBIDL">[WEBIDL]</a></p>
|
|
|
|
<p>Other arguments must be ignored and must not cause the user agent
|
|
to raise an exception. A future version of this specification will
|
|
probably define other parameters to be passed to these methods to
|
|
allow authors to more carefully control compression settings, image
|
|
metadata, etc.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="color-spaces-and-color-correction"><span class="secno">4.8.11.1 </span>Color spaces and color correction</h5>
|
|
|
|
<p>The <code><a href="#the-canvas-element">canvas</a></code> APIs must perform color correction at
|
|
only two points: when rendering images with their own gamma
|
|
correction and color space information onto the canvas, to convert
|
|
the image to the color space used by the canvas (e.g. using the 2D
|
|
Context's <code title="dom-context-2d-drawImage">drawImage()</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">getImageData()</code>
|
|
method.</p>
|
|
|
|
<p>The <code title="dom-canvas-toDataURL"><a href="#dom-canvas-todataurl">toDataURL()</a></code> method
|
|
must not include color space information in the resource
|
|
returned. Where the output format allows it, the color of pixels in
|
|
resources created by <code title="dom-canvas-toDataURL"><a href="#dom-canvas-todataurl">toDataURL()</a></code> must match those
|
|
returned by the <code title="dom-context-2d-getImageData">getImageData()</code>
|
|
method.</p>
|
|
|
|
<p>In user agents that support CSS, the color space used by a
|
|
<code><a href="#the-canvas-element">canvas</a></code> element must match the color space used for
|
|
processing any colors for that element in CSS.</p>
|
|
|
|
<p>The gamma correction and color space information of images must
|
|
be handled in such a way that an image rendered directly using an
|
|
<code><a href="#the-img-element">img</a></code> element would use the same colors as one painted on
|
|
a <code><a href="#the-canvas-element">canvas</a></code> element that is then itself
|
|
rendered. Furthermore, the rendering of images that have no color
|
|
correction information (such as those returned by the <code title="dom-canvas-toDataURL"><a href="#dom-canvas-todataurl">toDataURL()</a></code> method) must be
|
|
rendered with no color correction.</p>
|
|
|
|
<p class="note">Thus, in the 2D context, calling the <code title="dom-context-2d-drawImage">drawImage()</code> method to render
|
|
the output of the <code title="dom-canvas-toDataURL"><a href="#dom-canvas-todataurl">toDataURL()</a></code> method to the
|
|
canvas, given the appropriate dimensions, has no visible effect.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="security-with-canvas-elements"><span class="secno">4.8.11.2 </span>Security with <code><a href="#the-canvas-element">canvas</a></code> elements</h5>
|
|
|
|
<p><strong>Information leakage</strong> can occur if scripts from
|
|
one <a href="#origin">origin</a> can access information (e.g. read pixels)
|
|
from images from another origin (one that isn't the <a href="#same-origin" title="same origin">same</a>).</p>
|
|
|
|
<p>To mitigate this, <code><a href="#the-canvas-element">canvas</a></code> elements are defined to
|
|
have a flag indicating whether they are <i>origin-clean</i>. All
|
|
<code><a href="#the-canvas-element">canvas</a></code> elements must start with their
|
|
<i>origin-clean</i> set to true. The flag must be set to false if
|
|
any of the following actions occur:</p>
|
|
|
|
<ul><li><p>The element's 2D context's <code title="dom-context-2d-drawImage">drawImage()</code> method is
|
|
called with an <code><a href="#htmlimageelement">HTMLImageElement</a></code> or an
|
|
<code><a href="#htmlvideoelement">HTMLVideoElement</a></code> whose <a href="#origin">origin</a> is not the
|
|
<a href="#same-origin" title="same origin">same</a> as that of the
|
|
<code><a href="#document">Document</a></code> object that owns the <code><a href="#the-canvas-element">canvas</a></code>
|
|
element.</li>
|
|
|
|
<li><p>The element's 2D context's <code title="dom-context-2d-drawImage">drawImage()</code> method is
|
|
called with an <code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code> whose
|
|
<i>origin-clean</i> flag is false.</li>
|
|
|
|
<li><p>The element's 2D context's <code title="dom-context-2d-fillStyle">fillStyle</code> attribute is set
|
|
to a <code>CanvasPattern</code> object that was created from an
|
|
<code><a href="#htmlimageelement">HTMLImageElement</a></code> or an <code><a href="#htmlvideoelement">HTMLVideoElement</a></code>
|
|
whose <a href="#origin">origin</a> was not the <a href="#same-origin" title="same
|
|
origin">same</a> as that of the <code><a href="#document">Document</a></code> object
|
|
that owns the <code><a href="#the-canvas-element">canvas</a></code> element when the pattern was
|
|
created.</li>
|
|
|
|
<li><p>The element's 2D context's <code title="dom-context-2d-fillStyle">fillStyle</code> attribute is set
|
|
to a <code>CanvasPattern</code> object that was created from an
|
|
<code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code> whose <i>origin-clean</i> flag was
|
|
false when the pattern was created.</li>
|
|
|
|
<li><p>The element's 2D context's <code title="dom-context-2d-strokeStyle">strokeStyle</code> attribute is
|
|
set to a <code>CanvasPattern</code> object that was created from an
|
|
<code><a href="#htmlimageelement">HTMLImageElement</a></code> or an <code><a href="#htmlvideoelement">HTMLVideoElement</a></code>
|
|
whose <a href="#origin">origin</a> was not the <a href="#same-origin" title="same
|
|
origin">same</a> as that of the <code><a href="#document">Document</a></code> object
|
|
that owns the <code><a href="#the-canvas-element">canvas</a></code> element when the pattern was
|
|
created.</li>
|
|
|
|
<li><p>The element's 2D context's <code title="dom-context-2d-strokeStyle">strokeStyle</code> attribute is
|
|
set to a <code>CanvasPattern</code> object that was created from an
|
|
<code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code> whose <i>origin-clean</i> flag was
|
|
false when the pattern was created.</li>
|
|
|
|
<li><p>The element's 2D context's <code title="dom-context-2d-fillText">fillText()</code> or <code title="dom-context-2d-fillText">strokeText()</code> methods are
|
|
invoked and consider using a font that has an <a href="#origin">origin</a>
|
|
that is not the <a href="#same-origin" title="same origin">same</a> as that of
|
|
the <code><a href="#document">Document</a></code> object that owns the <code><a href="#the-canvas-element">canvas</a></code>
|
|
element. (The font doesn't even have to be used; all that matters
|
|
is whether the font was considered for any of the glyphs
|
|
drawn.)</li>
|
|
</ul><p>Whenever the <code title="dom-canvas-toDataURL"><a href="#dom-canvas-todataurl">toDataURL()</a></code> method of a
|
|
<code><a href="#the-canvas-element">canvas</a></code> element whose <i>origin-clean</i> flag is set to
|
|
false is called, the method must raise a <code><a href="#security_err">SECURITY_ERR</a></code>
|
|
exception.</p>
|
|
|
|
<p>Whenever the <code title="dom-context-2d-getImageData">getImageData()</code> method of
|
|
the 2D context of a <code><a href="#the-canvas-element">canvas</a></code> element whose
|
|
<i>origin-clean</i> flag is set to false is called with otherwise
|
|
correct arguments, the method must raise a <code><a href="#security_err">SECURITY_ERR</a></code>
|
|
exception.</p>
|
|
|
|
<p>Whenever the <code title="dom-context-2d-measureText">measureText()</code> method of
|
|
the 2D context of a <code><a href="#the-canvas-element">canvas</a></code> element ends up using a font
|
|
that has an <a href="#origin">origin</a> that is not the <a href="#same-origin" title="same
|
|
origin">same</a> as that of the <code><a href="#document">Document</a></code> object that
|
|
owns the <code><a href="#the-canvas-element">canvas</a></code> element, the method must raise a
|
|
<code><a href="#security_err">SECURITY_ERR</a></code> exception.</p>
|
|
|
|
<p class="note">Even resetting the canvas state by changing its
|
|
<code title="attr-canvas-width"><a href="#attr-canvas-width">width</a></code> or <code title="attr-canvas-height"><a href="#attr-canvas-height">height</a></code> attributes doesn't reset
|
|
the <i>origin-clean</i> flag.</p>
|
|
|
|
</div><h4 id="the-map-element"><span class="secno">4.8.12 </span>The <dfn><code>map</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd>When the element only contains <a href="#phrasing-content">phrasing content</a>: <a href="#phrasing-content">phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>When the element only contains <a href="#phrasing-content">phrasing content</a>: where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dd>Otherwise: where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#transparent">Transparent</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-map-name"><a href="#attr-map-name">name</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlmapelement">HTMLMapElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-map-name" title="dom-map-name">name</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-map-areas" title="dom-map-areas">areas</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-map-images" title="dom-map-images">images</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-map-element">map</a></code> element, in conjunction with any
|
|
<code><a href="#the-area-element">area</a></code> element descendants, defines an <a href="#image-map">image
|
|
map</a>. The element <a href="#represents">represents</a> its children.<p>The <dfn id="attr-map-name" title="attr-map-name"><code>name</code></dfn> attribute
|
|
gives the map a name so that it can be referenced. The attribute
|
|
must be present and must have a non-empty value with no <a href="#space-character" title="space character">space characters</a>. The value of the
|
|
<code title="attr-map-name"><a href="#attr-map-name">name</a></code> attribute must not be a
|
|
<a href="#compatibility-caseless" title="compatibility caseless">compatibility-caseless</a>
|
|
match for the value of the <code title="attr-map-name"><a href="#attr-map-name">name</a></code>
|
|
attribute of another <code><a href="#the-map-element">map</a></code> element in the same
|
|
document. If the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute is also
|
|
specified, both attributes must have the same value.<dl class="domintro"><dt><var title="">map</var> . <code title="dom-map-areas"><a href="#dom-map-areas">areas</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-area-element">area</a></code> elements in the <code><a href="#the-map-element">map</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">map</var> . <code title="dom-map-images"><a href="#dom-map-images">images</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-img-element">img</a></code> and <code><a href="#the-object-element">object</a></code> elements that use the <code><a href="#the-map-element">map</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-map-areas" title="dom-map-areas"><code>areas</code></dfn> attribute
|
|
must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#the-map-element">map</a></code> element, whose filter matches only
|
|
<code><a href="#the-area-element">area</a></code> elements.</p>
|
|
|
|
<p>The <dfn id="dom-map-images" title="dom-map-images"><code>images</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only
|
|
<code><a href="#the-img-element">img</a></code> and <code><a href="#the-object-element">object</a></code> elements that are
|
|
associated with this <code><a href="#the-map-element">map</a></code> element according to the
|
|
<a href="#image-map">image map</a> processing model.</p>
|
|
|
|
<p>The IDL attribute <dfn id="dom-map-name" title="dom-map-name"><code>name</code></dfn> must
|
|
<a href="#reflect">reflect</a> the content attribute of the same name.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Image maps can be defined in conjunction with other content on
|
|
the page, to ease maintenance. This example is of a page with an
|
|
image map at the top of the page and a corresponding set of text
|
|
links at the bottom.</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<TITLE>Babies™: Toys</TITLE>
|
|
<HEADER>
|
|
<H1>Toys</H1>
|
|
<IMG SRC="/images/menu.gif"
|
|
ALT="Babies™ navigation menu. Select a department to go to its page."
|
|
USEMAP="#NAV">
|
|
</HEADER>
|
|
...
|
|
<FOOTER>
|
|
<MAP NAME="NAV">
|
|
<P>
|
|
<A HREF="/clothes/">Clothes</A>
|
|
<AREA ALT="Clothes" COORDS="0,0,100,50" HREF="/clothes/"> |
|
|
<A HREF="/toys/">Toys</A>
|
|
<AREA ALT="Toys" COORDS="0,0,100,50" HREF="/toys/"> |
|
|
<A HREF="/food/">Food</A>
|
|
<AREA ALT="Food" COORDS="0,0,100,50" HREF="/food/"> |
|
|
<A HREF="/books/">Books</A>
|
|
<AREA ALT="Books" COORDS="0,0,100,50" HREF="/books/">
|
|
</MAP>
|
|
</FOOTER></pre>
|
|
|
|
</div><h4 id="the-area-element"><span class="secno">4.8.13 </span>The <dfn><code>area</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected, but only if there is a <code><a href="#the-map-element">map</a></code> element ancestor.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-area-alt"><a href="#attr-area-alt">alt</a></code></dd>
|
|
<dd><code title="attr-area-coords"><a href="#attr-area-coords">coords</a></code></dd>
|
|
<dd><code title="attr-area-shape"><a href="#attr-area-shape">shape</a></code></dd>
|
|
<dd><code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code></dd>
|
|
<dd><code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code></dd>
|
|
<dd><code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code></dd>
|
|
<dd><code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code></dd>
|
|
<dd><code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code></dd>
|
|
<dd><code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">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="#dom-area-alt" title="dom-area-alt">alt</a>;
|
|
attribute DOMString <a href="#dom-area-coords" title="dom-area-coords">coords</a>;
|
|
attribute DOMString <a href="#dom-area-shape" title="dom-area-shape">shape</a>;
|
|
stringifier attribute DOMString <a href="#dom-area-href" title="dom-area-href">href</a>;
|
|
attribute DOMString <a href="#dom-area-target" title="dom-area-target">target</a>;
|
|
attribute DOMString <a href="#dom-area-rel" title="dom-area-rel">rel</a>;
|
|
readonly attribute <a href="#domtokenlist">DOMTokenList</a> <a href="#dom-area-rellist" title="dom-area-relList">relList</a>;
|
|
attribute DOMString <a href="#dom-area-media" title="dom-area-media">media</a>;
|
|
attribute DOMString <a href="#dom-area-hreflang" title="dom-area-hreflang">hreflang</a>;
|
|
attribute DOMString <a href="#dom-area-type" title="dom-area-type">type</a>;
|
|
|
|
// <a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a>
|
|
attribute DOMString <a href="#dom-area-protocol" title="dom-area-protocol">protocol</a>;
|
|
attribute DOMString <a href="#dom-area-host" title="dom-area-host">host</a>;
|
|
attribute DOMString <a href="#dom-area-hostname" title="dom-area-hostname">hostname</a>;
|
|
attribute DOMString <a href="#dom-area-port" title="dom-area-port">port</a>;
|
|
attribute DOMString <a href="#dom-area-pathname" title="dom-area-pathname">pathname</a>;
|
|
attribute DOMString <a href="#dom-area-search" title="dom-area-search">search</a>;
|
|
attribute DOMString <a href="#dom-area-hash" title="dom-area-hash">hash</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-area-element">area</a></code> element <a href="#represents">represents</a> either a
|
|
hyperlink with some text and a corresponding area on an <a href="#image-map">image
|
|
map</a>, or a dead area on an image map.<p>If the <code><a href="#the-area-element">area</a></code> element has an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute, then the
|
|
<code><a href="#the-area-element">area</a></code> element represents a <a href="#hyperlink">hyperlink</a>. In
|
|
this case, the <dfn id="attr-area-alt" title="attr-area-alt"><code>alt</code></dfn>
|
|
attribute must be present. It specifies the text of the
|
|
hyperlink. Its value must be text that, when presented with the
|
|
texts specified for the other hyperlinks of the <a href="#image-map">image
|
|
map</a>, and with the alternative text of the image, but without
|
|
the image itself, provides the user with the same kind of choice as
|
|
the hyperlink would when used without its text but with its shape
|
|
applied to the image. The <code title="attr-area-alt"><a href="#attr-area-alt">alt</a></code>
|
|
attribute may be left blank if there is another <code><a href="#the-area-element">area</a></code>
|
|
element in the same <a href="#image-map">image map</a> that points to the same
|
|
resource and has a non-blank <code title="attr-area-alt"><a href="#attr-area-alt">alt</a></code>
|
|
attribute.<p>If the <code><a href="#the-area-element">area</a></code> element has no <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute, then the area
|
|
represented by the element cannot be selected, and the <code title="attr-area-alt"><a href="#attr-area-alt">alt</a></code> attribute must be omitted.<p>In both cases, the <code title="attr-area-shape"><a href="#attr-area-shape">shape</a></code> and
|
|
<code title="attr-area-coords"><a href="#attr-area-coords">coords</a></code> attributes specify the
|
|
area.<p>The <dfn id="attr-area-shape" title="attr-area-shape"><code>shape</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">enumerated attribute</a>. The following
|
|
table lists the keywords defined for this attribute. The states
|
|
given in the first cell of the rows with keywords give the states to
|
|
which those keywords map. <span class="impl">Some of the keywords
|
|
are non-conforming, as noted in the last column.</span><table><thead><tr><th>State
|
|
<th>Keywords
|
|
<th class="impl">Notes
|
|
<tbody><tr><td rowspan="2"><a href="#attr-area-shape-circle" title="attr-area-shape-circle">Circle state</a>
|
|
<td><dfn id="attr-area-shape-keyword-circle" title="attr-area-shape-keyword-circle"><code>circle</code></dfn>
|
|
<td class="impl">
|
|
<tr><td class="impl"><dfn id="attr-area-shape-keyword-circ" title="attr-area-shape-keyword-circ"><code>circ</code></dfn>
|
|
<td class="impl">Non-conforming
|
|
<tr><td><a href="#attr-area-shape-default" title="attr-area-shape-default">Default state</a>
|
|
<td><dfn id="attr-area-shape-keyword-default" title="attr-area-shape-keyword-default"><code>default</code></dfn>
|
|
<td class="impl">
|
|
<tr><td rowspan="2"><a href="#attr-area-shape-poly" title="attr-area-shape-poly">Polygon state</a>
|
|
<td><dfn id="attr-area-shape-keyword-poly" title="attr-area-shape-keyword-poly"><code>poly</code></dfn>
|
|
<td class="impl">
|
|
<tr><td class="impl"><dfn id="attr-area-shape-keyword-polygon" title="attr-area-shape-keyword-polygon"><code>polygon</code></dfn>
|
|
<td class="impl">Non-conforming
|
|
<tr><td rowspan="2"><a href="#attr-area-shape-rect" title="attr-area-shape-rect">Rectangle state</a>
|
|
<td><dfn id="attr-area-shape-keyword-rect" title="attr-area-shape-keyword-rect"><code>rect</code></dfn>
|
|
<td class="impl">
|
|
<tr><td class="impl"><dfn id="attr-area-shape-keyword-rectangle" title="attr-area-shape-keyword-rectangle"><code>rectangle</code></dfn>
|
|
<td class="impl">Non-conforming
|
|
</table><p>The attribute may be omitted. The <i>missing value default</i> is
|
|
the <a href="#attr-area-shape-rect" title="attr-area-shape-rect">rectangle</a> state.<p>The <dfn id="attr-area-coords" title="attr-area-coords"><code>coords</code></dfn>
|
|
attribute must, if specified, contain a <a href="#valid-list-of-integers">valid list of
|
|
integers</a>. This attribute gives the coordinates for the shape
|
|
described by the <code title="attr-area-shape"><a href="#attr-area-shape">shape</a></code>
|
|
attribute. <span class="impl">The processing for this attribute is
|
|
described as part of the <a href="#image-map">image map</a> processing
|
|
model.</span></p><p>In the <dfn id="attr-area-shape-circle" title="attr-area-shape-circle">circle state</dfn>,
|
|
<code><a href="#the-area-element">area</a></code> elements must have a <code title="attr-area-coords"><a href="#attr-area-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>In the <dfn id="attr-area-shape-default" title="attr-area-shape-default">default state</dfn>
|
|
state, <code><a href="#the-area-element">area</a></code> elements must not have a <code title="attr-area-coords"><a href="#attr-area-coords">coords</a></code> attribute. (The area is the
|
|
whole image.)<p>In the <dfn id="attr-area-shape-poly" title="attr-area-shape-poly">polygon state</dfn>,
|
|
<code><a href="#the-area-element">area</a></code> elements must have a <code title="attr-area-coords"><a href="#attr-area-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>In the <dfn id="attr-area-shape-rect" title="attr-area-shape-rect">rectangle state</dfn>,
|
|
<code><a href="#the-area-element">area</a></code> elements must have a <code title="attr-area-coords"><a href="#attr-area-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 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.<div class="impl">
|
|
|
|
<p>When user agents allow users to <a href="#following-hyperlinks" title="following
|
|
hyperlinks">follow hyperlinks</a> created using the
|
|
<code><a href="#the-area-element">area</a></code> element, as described in the next section, the
|
|
<code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>,
|
|
<code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code>
|
|
attributes decide how the
|
|
link is followed. The <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>,
|
|
<code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code>, <code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code>, and <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">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>
|
|
|
|
</div><p>The <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code>,
|
|
<code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>, <code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code>, <code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code>, and <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code> attributes must be omitted
|
|
if the <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute is
|
|
not present.<div class="impl">
|
|
|
|
<p>The <a href="#activation-behavior">activation behavior</a> of <code><a href="#the-area-element">area</a></code>
|
|
elements is to run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code title="event-click"><a href="#event-click">click</a></code> event in
|
|
question is not <a href="#concept-events-trusted" title="concept-events-trusted">trusted</a>
|
|
(i.e. a <code title="dom-click"><a href="#dom-click">click()</a></code> method call was the
|
|
reason for the event being dispatched), and the <code><a href="#the-area-element">area</a></code>
|
|
element's <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code>
|
|
attribute is such that applying <a href="#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">the rules for choosing a
|
|
browsing context given a browsing context name</a>, using the
|
|
value of the <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code>
|
|
attribute as the browsing context name, would result in there not
|
|
being a chosen browsing context, then raise an
|
|
<code><a href="#invalid_access_err">INVALID_ACCESS_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li>Otherwise, the user agent must <a href="#following-hyperlinks" title="following
|
|
hyperlinks">follow the hyperlink</a> created by the
|
|
<code><a href="#the-area-element">area</a></code> element, if any.</li>
|
|
|
|
</ol><p>The IDL attributes <dfn id="dom-area-alt" title="dom-area-alt"><code>alt</code></dfn>, <dfn id="dom-area-coords" title="dom-area-coords"><code>coords</code></dfn>, <dfn id="dom-area-href" title="dom-area-href"><code>href</code></dfn>, <dfn id="dom-area-target" title="dom-area-target"><code>target</code></dfn>,
|
|
<dfn id="dom-area-rel" title="dom-area-rel"><code>rel</code></dfn>, <dfn id="dom-area-media" title="dom-area-media"><code>media</code></dfn>, <dfn id="dom-area-hreflang" title="dom-area-hreflang"><code>hreflang</code></dfn>, and <dfn id="dom-area-type" 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 IDL attribute <dfn id="dom-area-shape" title="dom-area-shape"><code>shape</code></dfn> must
|
|
<a href="#reflect">reflect</a> the <code title="attr-area-shape"><a href="#attr-area-shape">shape</a></code>
|
|
content attribute.</p>
|
|
|
|
<p>The IDL attribute <dfn id="dom-area-rellist" title="dom-area-rellist"><code>relList</code></dfn> must
|
|
<a href="#reflect">reflect</a> the <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>
|
|
content attribute.</p>
|
|
|
|
<p>The <code><a href="#the-area-element">area</a></code> element also supports the complement of
|
|
<a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a>, <dfn id="dom-area-protocol" title="dom-area-protocol"><code>protocol</code></dfn>, <dfn id="dom-area-host" title="dom-area-host"><code>host</code></dfn>, <dfn id="dom-area-port" title="dom-area-port"><code>port</code></dfn>, <dfn id="dom-area-hostname" title="dom-area-hostname"><code>hostname</code></dfn>, <dfn id="dom-area-pathname" title="dom-area-pathname"><code>pathname</code></dfn>, <dfn id="dom-area-search" title="dom-area-search"><code>search</code></dfn>, and <dfn id="dom-area-hash" title="dom-area-hash"><code>hash</code></dfn>. These must follow the
|
|
rules given for <a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a>, with
|
|
the <a href="#concept-uda-input" title="concept-uda-input">input</a> being the result of
|
|
<a href="#resolve-a-url" title="resolve a url">resolving</a> the element's <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute relative to the
|
|
element, if there is such an attribute and resolving it is
|
|
successful, or the empty string otherwise; and the <a href="#concept-uda-setter" title="concept-uda-setter">common setter action</a> being the
|
|
same as setting the element's <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute to the new output
|
|
value.</p>
|
|
|
|
</div><h4 id="image-maps"><span class="secno">4.8.14 </span>Image maps</h4><div class="impl">
|
|
|
|
<h5 id="authoring"><span class="secno">4.8.14.1 </span>Authoring</h5>
|
|
|
|
</div><p>An <dfn id="image-map">image map</dfn> allows geometric areas on an image to be
|
|
associated with <a href="#hyperlink" title="hyperlink">hyperlinks</a>.<p>An image, in the form of an <code><a href="#the-img-element">img</a></code> element or an
|
|
<code><a href="#the-object-element">object</a></code> element representing an image, may be associated
|
|
with an image map (in the form of a <code><a href="#the-map-element">map</a></code> element) by
|
|
specifying a <dfn id="attr-hyperlink-usemap" title="attr-hyperlink-usemap"><code>usemap</code></dfn> attribute on
|
|
the <code><a href="#the-img-element">img</a></code> or <code><a href="#the-object-element">object</a></code> element. The <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute, if specified,
|
|
must be a <a href="#valid-hash-name-reference">valid hash-name reference</a> to a
|
|
<code><a href="#the-map-element">map</a></code> element.<div class="example">
|
|
|
|
<p>Consider an image that looks as follows:</p>
|
|
|
|
<p><img alt="A line with four shapes in it, equally spaced: a red hollow box, a green circle, a blue triangle, and a yellow four-pointed star." height="150" src="sample-usemap.png" width="600"></p>
|
|
|
|
<p>If we wanted just the colored areas to be clickable, we could
|
|
do it as follows:</p>
|
|
|
|
<pre><p>
|
|
Please select a shape:
|
|
<img src="shapes.png" usemap="#shapes"
|
|
alt="Four shapes are available: a red hollow box, a green circle, a blue triangle, and a yellow four-pointed star.">
|
|
<map name="shapes">
|
|
<area shape=rect coords="50,50,100,100"> <!-- the hole in the red box -->
|
|
<area shape=rect coords="25,25,125,125" href="red.html" alt="Red box.">
|
|
<area shape=circle coords="200,75,50" href="green.html" alt="Green circle.">
|
|
<area shape=poly coords="325,25,262,125,388,125" href="blue.html" alt="Blue triangle.">
|
|
<area shape=poly coords="450,25,435,60,400,75,435,90,450,125,465,90,500,75,465,60"
|
|
href="yellow.html" alt="Yellow star.">
|
|
</map>
|
|
</p></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="processing-model"><span class="secno">4.8.14.2 </span>Processing model</h5>
|
|
|
|
<p>If an <code><a href="#the-img-element">img</a></code> element or an <code><a href="#the-object-element">object</a></code> element
|
|
representing an image has a <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute specified,
|
|
user agents must process it as follows:</p>
|
|
|
|
<ol><li><p>First, <a href="#rules-for-parsing-a-hash-name-reference">rules for parsing a hash-name reference</a>
|
|
to a <code><a href="#the-map-element">map</a></code> element must be followed. This will return
|
|
either an element (the <var title="">map</var>) or null.</li>
|
|
|
|
<li><p>If that returned null, then abort these steps. The image is
|
|
not associated with an image map after all.</li>
|
|
|
|
<li><p>Otherwise, the user agent must collect all the
|
|
<code><a href="#the-area-element">area</a></code> elements that are descendants of the <var title="">map</var>. Let those be the <var title="">areas</var>.</li>
|
|
|
|
</ol><p>Having obtained the list of <code><a href="#the-area-element">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="#the-img-element">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="#the-object-element">object</a></code> elements cannot represent
|
|
images, and thus this section never applies (the <a href="#fallback-content">fallback
|
|
content</a> is shown instead). The following steps therefore only
|
|
apply to <code><a href="#the-img-element">img</a></code> elements.</p>
|
|
|
|
<ol><li><p>Remove all the <code><a href="#the-area-element">area</a></code> elements in <var title="">areas</var> that have no <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute.</li>
|
|
|
|
<li><p>Remove all the <code><a href="#the-area-element">area</a></code> elements in <var title="">areas</var> that have no <code title="attr-area-alt"><a href="#attr-area-alt">alt</a></code> attribute, or whose <code title="attr-area-alt"><a href="#attr-area-alt">alt</a></code> attribute's value is the empty
|
|
string, <em>if</em> there is another <code><a href="#the-area-element">area</a></code> element in
|
|
<var title="">areas</var> with the same value in the <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute and with a
|
|
non-empty <code title="attr-area-alt"><a href="#attr-area-alt">alt</a></code> attribute.</li>
|
|
|
|
<li><p>Each remaining <code><a href="#the-area-element">area</a></code> element in <var title="">areas</var> represents a <a href="#hyperlink">hyperlink</a>. Those
|
|
hyperlinks should all be made available to the user in a manner
|
|
associated with the text of the <code><a href="#the-img-element">img</a></code>.</p>
|
|
|
|
<p>In this context, user agents may represent <code><a href="#the-area-element">area</a></code> and
|
|
<code><a href="#the-img-element">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.</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="#the-area-element">area</a></code> elements in <var title="">areas</var>, in reverse
|
|
tree order (so the last specified <code><a href="#the-area-element">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="#the-area-element">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="#attr-area-shape">shape</a></code> attribute represents.</li>
|
|
|
|
<li><p>Use the <a href="#rules-for-parsing-a-list-of-integers">rules for parsing a list of integers</a> to
|
|
parse the element's <code title="attr-area-coords"><a href="#attr-area-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.</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="#the-area-element">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>Minimum number of items
|
|
<tbody><tr><td><a href="#attr-area-shape-circle" title="attr-area-shape-circle">Circle state</a>
|
|
<td>3
|
|
<tr><td><a href="#attr-area-shape-default" title="attr-area-shape-default">Default state</a>
|
|
<td>0
|
|
<tr><td><a href="#attr-area-shape-poly" title="attr-area-shape-poly">Polygon state</a>
|
|
<td>6
|
|
<tr><td><a href="#attr-area-shape-rect" title="attr-area-shape-rect">Rectangle state</a>
|
|
<td>4
|
|
</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="#attr-area-shape">shape</a></code> attribute's state:</p>
|
|
<dl class="switch"><dt><a href="#attr-area-shape-circle" title="attr-area-shape-circle">Circle state</a></dt>
|
|
<dd>Drop any items in the list beyond the third.</dd>
|
|
<dt><a href="#attr-area-shape-default" title="attr-area-shape-default">Default state</a></dt>
|
|
<dd>Drop all items in the list.</dd>
|
|
<dt><a href="#attr-area-shape-poly" 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="#attr-area-shape-rect" 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="#attr-area-shape">shape</a></code> attribute
|
|
represents the <a href="#attr-area-shape-rect" 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.</li>
|
|
|
|
<li><p>If the <code title="attr-area-shape"><a href="#attr-area-shape">shape</a></code> attribute
|
|
represents the <a href="#attr-area-shape-rect" 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.</li>
|
|
|
|
<li><p>If the <code title="attr-area-shape"><a href="#attr-area-shape">shape</a></code> attribute
|
|
represents the <a href="#attr-area-shape-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.</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="#attr-area-shape">shape</a></code>
|
|
attribute:</p>
|
|
|
|
<dl class="switch"><dt><a href="#attr-area-shape-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="">y</var> CSS pixels from the top edge of the image, and
|
|
whose radius is <var title="">r</var> pixels.</p>
|
|
</dd>
|
|
|
|
<dt><a href="#attr-area-shape-default" 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="#attr-area-shape-poly" 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 title="">(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 title="">(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 title="">(<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="#refsGRAPHICS">[GRAPHICS]</a></p>
|
|
|
|
|
|
</dd>
|
|
|
|
<dt><a href="#attr-area-shape-rect" title="attr-area-shape-rect">Rectangle state</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Let <var title="">x<sub title="">1</sub></var> be the first
|
|
number in <var title="">coords</var>, <var title="">y<sub title="">1</sub></var> be the second number, <var title="">x<sub title="">2</sub></var> be the third number, and <var title="">y<sub title="">2</sub></var> be the fourth number.</p>
|
|
|
|
<p>The shape is a rectangle whose top-left corner is given by
|
|
the coordinate (<var title="">x<sub title="">1</sub></var>, <var title="">y<sub title="">1</sub></var>) and whose bottom right
|
|
corner is given by the coordinate (<var title="">x<sub title="">2</sub></var>, <var title="">y<sub title="">2</sub></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><a href="#event">Event</a></code>
|
|
object) to the image element itself. User agents may also allow
|
|
individual <code><a href="#the-area-element">area</a></code> elements representing <a href="#hyperlink" 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="#the-map-element">map</a></code> element (and its
|
|
<code><a href="#the-area-element">area</a></code> elements) can be associated with multiple
|
|
<code><a href="#the-img-element">img</a></code> and <code><a href="#the-object-element">object</a></code> elements, it is possible
|
|
for an <code><a href="#the-area-element">area</a></code> element to correspond to multiple focusable
|
|
areas of the document.</p>
|
|
|
|
<p>Image maps are <a href="#live">live</a>; if the DOM is mutated, then the
|
|
user agent must act as if it had rerun the algorithms for image
|
|
maps.</p>
|
|
|
|
</div><h4 id="mathml"><span class="secno">4.8.15 </span>MathML</h4><p>The <dfn id="math"><code>math</code></dfn> element from the <a href="#mathml-namespace">MathML
|
|
namespace</a> falls into the <a href="#embedded-content">embedded content</a>,
|
|
<a href="#phrasing-content">phrasing content</a>, and <a href="#flow-content">flow content</a>
|
|
categories for the purposes of the content models in this
|
|
specification.<div class="impl">
|
|
|
|
|
|
|
|
<p>User agents must handle text other than <a href="#inter-element-whitespace">inter-element
|
|
whitespace</a> found in MathML elements whose content models do
|
|
not allow straight text by pretending for the purposes of MathML
|
|
content models, layout, and rendering that that text is actually
|
|
wrapped in an <code title="">mtext</code> element in the
|
|
<a href="#mathml-namespace">MathML namespace</a>. (Such text is not, however,
|
|
conforming.)</p>
|
|
|
|
<p>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 <code title="">merror</code>
|
|
element in the <a href="#mathml-namespace">MathML namespace</a> containing some
|
|
appropriate error message.</p>
|
|
|
|
<p>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 an XML namespace-well-formed
|
|
XML fragment.</p>
|
|
|
|
</div><p>The semantics of MathML elements are defined by the MathML
|
|
specification and <a href="#other-applicable-specifications">other applicable specifications</a>. <a href="#refsMATHML">[MATHML]</a><div class="example">
|
|
|
|
<p>Here is an example of the use of MathML in an HTML document:</p>
|
|
|
|
<pre><!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>The quadratic formula</title>
|
|
</head>
|
|
<body>
|
|
<h1>The quadratic formula</h1>
|
|
<p>
|
|
<math>
|
|
<mi>x</mi>
|
|
<mo>=</mo>
|
|
<mfrac>
|
|
<mrow>
|
|
<mo form="prefix">−</mo> <mi>b</mi>
|
|
<mo>±</mo>
|
|
<msqrt>
|
|
<msup> <mi>b</mi> <mn>2</mn> </msup>
|
|
<mo>−</mo>
|
|
<mn>4</mn> <mo>⁢</mo> <mi>a</mi> <mo>⁢</mo> <mi>c</mi>
|
|
</msqrt>
|
|
</mrow>
|
|
<mrow>
|
|
<mn>2</mn> <mo>⁢</mo> <mi>a</mi>
|
|
</mrow>
|
|
</mfrac>
|
|
</math>
|
|
</p>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><h4 id="svg-0"><span class="secno">4.8.16 </span>SVG</h4><p>The <dfn id="svg"><code>svg</code></dfn> element from the <a href="#svg-namespace">SVG
|
|
namespace</a> falls into the <a href="#embedded-content">embedded content</a>,
|
|
<a href="#phrasing-content">phrasing content</a>, and <a href="#flow-content">flow content</a>
|
|
categories for the purposes of the content models in this
|
|
specification.<div class="impl">
|
|
|
|
<p>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 an XML namespace-well-formed XML
|
|
fragment.</p>
|
|
|
|
</div><p>When the SVG <code title="">foreignObject</code> element contains
|
|
elements from the <a href="#html-namespace-0">HTML namespace</a>, such elements must
|
|
all be <a href="#flow-content">flow content</a>. <a href="#refsSVG">[SVG]</a><p>The content model for <code title="">title</code> elements in the
|
|
<a href="#svg-namespace">SVG namespace</a> inside <a href="#html-documents">HTML documents</a> is
|
|
<a href="#phrasing-content">phrasing content</a>. (This further constrains the
|
|
requirements given in the SVG specification.)<p>The semantics of SVG elements are defined by the SVG
|
|
specification and <a href="#other-applicable-specifications">other applicable specifications</a>. <a href="#refsSVG">[SVG]</a></p><p>The SVG specification includes requirements regarding the
|
|
handling of elements in the DOM that are not in the SVG namespace,
|
|
that are in SVG fragments, and that are not included in a
|
|
<code title="">foreignObject</code> element. <em>This</em>
|
|
specification does not define any processing for elements in SVG
|
|
fragments that are not in the HTML namespace; they are considered
|
|
neither conforming nor non-conforming from the perspective of this
|
|
specification.<h4 id="dimension-attributes"><span class="secno">4.8.17 </span><dfn>Dimension attributes</dfn></h4><p><span class="impl"><strong>Author requirements</strong>:</span>
|
|
The <dfn id="attr-dim-width" title="attr-dim-width"><code>width</code></dfn> and <dfn id="attr-dim-height" title="attr-dim-height"><code>height</code></dfn> attributes on
|
|
<code><a href="#the-img-element">img</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-embed-element">embed</a></code>,
|
|
<code><a href="#the-object-element">object</a></code>, <code><a href="#the-video-element">video</a></code>, and, when their <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state,
|
|
<code><a href="#the-input-element">input</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="#valid-non-negative-integer" title="valid non-negative integer">valid
|
|
non-negative integers</a>.<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 one of the following statements must be true:<ul><li><span title=""><var title="">specified width</var> - 0.5 ≤
|
|
<var title="">specified height</var> * <var title="">target ratio</var> ≤
|
|
<var title="">specified width</var> + 0.5</span></li>
|
|
|
|
<li><span title=""><var title="">specified height</var> - 0.5 ≤
|
|
<var title="">specified width</var> / <var title="">target ratio</var> ≤
|
|
<var title="">specified height</var> + 0.5</span></li>
|
|
|
|
<li><span title=""><var title="">specified height</var> = <var title="">specified width</var> = 0</span></li>
|
|
|
|
</ul><p>The <var title="">target ratio</var> is the ratio of the
|
|
intrinsic width to the intrinsic height in the resource. The <var title="">specified width</var> and <var title="">specified
|
|
height</var> are the values of the <code title="attr-dim-width"><a href="#attr-dim-width">width</a></code> and <code title="attr-dim-height"><a href="#attr-dim-height">height</a></code> attributes respectively.<p>The two attributes must be omitted if the resource in question
|
|
does not have both an intrinsic width and an intrinsic height.<p>If the two attributes are both zero, it indicates that the
|
|
element is not intended for the user (e.g. it might be a part of a
|
|
service to count page views).<p class="note">The dimension attributes are not intended to be used
|
|
to stretch the image.<div class="impl">
|
|
|
|
<p><strong>User agent requirements</strong>: User agents are
|
|
expected to use these attributes <a href="#dimRendering">as hints
|
|
for the rendering</a>.</p>
|
|
|
|
<p>The <dfn id="dom-dim-width" title="dom-dim-width"><code>width</code></dfn> and <dfn id="dom-dim-height" title="dom-dim-height"><code>height</code></dfn> IDL attributes on
|
|
the <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-object-element">object</a></code>,
|
|
and <code><a href="#the-video-element">video</a></code> elements must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<p class="note">For <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-embed-element">embed</a></code>, and
|
|
<code><a href="#the-object-element">object</a></code> the IDL attributes are <code>DOMString</code>;
|
|
for <code><a href="#the-video-element">video</a></code> the IDL attributes are <code>unsigned
|
|
long</code>.</p>
|
|
|
|
</div><h3 id="tabular-data"><span class="secno">4.9 </span>Tabular data</h3><h4 id="the-table-element"><span class="secno">4.9.1 </span>The <dfn><code>table</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>In this order: optionally a <code><a href="#the-caption-element">caption</a></code> element,
|
|
followed by zero or more <code><a href="#the-colgroup-element">colgroup</a></code> elements, followed
|
|
optionally by a <code><a href="#the-thead-element">thead</a></code> element, followed optionally by
|
|
a <code><a href="#the-tfoot-element">tfoot</a></code> element, followed by either zero or more
|
|
<code><a href="#the-tbody-element">tbody</a></code> elements or one or more <code><a href="#the-tr-element">tr</a></code>
|
|
elements, followed optionally by a <code><a href="#the-tfoot-element">tfoot</a></code> element (but
|
|
there can only be one <code><a href="#the-tfoot-element">tfoot</a></code> element child in
|
|
total).</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-table-border"><a href="#attr-table-border">border</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmltableelement">HTMLTableElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute <a href="#htmltablecaptionelement">HTMLTableCaptionElement</a> <a href="#dom-table-caption" title="dom-table-caption">caption</a>;
|
|
<a href="#htmlelement">HTMLElement</a> <a href="#dom-table-createcaption" title="dom-table-createCaption">createCaption</a>();
|
|
void <a href="#dom-table-deletecaption" title="dom-table-deleteCaption">deleteCaption</a>();
|
|
attribute <a href="#htmltablesectionelement">HTMLTableSectionElement</a> <a href="#dom-table-thead" title="dom-table-tHead">tHead</a>;
|
|
<a href="#htmlelement">HTMLElement</a> <a href="#dom-table-createthead" title="dom-table-createTHead">createTHead</a>();
|
|
void <a href="#dom-table-deletethead" title="dom-table-deleteTHead">deleteTHead</a>();
|
|
attribute <a href="#htmltablesectionelement">HTMLTableSectionElement</a> <a href="#dom-table-tfoot" title="dom-table-tFoot">tFoot</a>;
|
|
<a href="#htmlelement">HTMLElement</a> <a href="#dom-table-createtfoot" title="dom-table-createTFoot">createTFoot</a>();
|
|
void <a href="#dom-table-deletetfoot" title="dom-table-deleteTFoot">deleteTFoot</a>();
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-table-tbodies" title="dom-table-tBodies">tBodies</a>;
|
|
<a href="#htmlelement">HTMLElement</a> <a href="#dom-table-createtbody" title="dom-table-createTBody">createTBody</a>();
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-table-rows" title="dom-table-rows">rows</a>;
|
|
<a href="#htmlelement">HTMLElement</a> <a href="#dom-table-insertrow" title="dom-table-insertRow">insertRow</a>(in optional long index);
|
|
void <a href="#dom-table-deleterow" title="dom-table-deleteRow">deleteRow</a>(in long index);
|
|
attribute DOMString <a href="#dom-table-border" title="dom-table-border">border</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-table-element">table</a></code> element <a href="#represents">represents</a> data with
|
|
more than one dimension, in the form of a <a href="#concept-table" title="concept-table">table</a>.<div class="impl">
|
|
<p>The <code><a href="#the-table-element">table</a></code> element takes part in the <a href="#table-model">table
|
|
model</a>.</p>
|
|
</div><p>Tables have rows, columns, and cells given by their descendants.
|
|
The rows and columns form a grid; a table's cells must completely
|
|
cover that grid without overlap.<div class="impl">
|
|
<p class="note">Precise rules for determining whether this
|
|
conformance requirement is met are described in the description of
|
|
the <a href="#table-model">table model</a>.</p>
|
|
</div><hr><p>Authors are encouraged to provide information describing how to
|
|
interpret complex tables. Guidance on how <a href="#table-descriptions-techniques">provide such information</a>
|
|
is given below.<div class="impl">
|
|
<p>If a <code><a href="#the-table-element">table</a></code> element has a <code title="attr-table-summary"><a href="#attr-table-summary">summary</a></code> attribute, and the user
|
|
agent has not classified the table as a layout table, the user agent
|
|
may report the contents of that attribute to the user.</p>
|
|
</div><hr><p>Tables should not be used as layout aids.
|
|
|
|
Historically, many Web authors have tables in HTML as a way to
|
|
control their page layout making it difficult to extract tabular
|
|
data from such documents.
|
|
|
|
In particular, users of accessibility tools, like screen readers,
|
|
are likely to find it very difficult to navigate pages with tables
|
|
used for layout.
|
|
|
|
If a table is to be used for layout it must be marked with the
|
|
attribute role="presentation" for a user agent to properly represent
|
|
the table to an assistive technology and to properly convey the
|
|
intent of the author to tools that wish to extract tabular data from
|
|
the document.</p><p class="note">There are a variety of alternatives to using HTML
|
|
tables for layout, primarily using CSS positioning and the CSS table
|
|
model.<p>The <dfn id="attr-table-border" title="attr-table-border"><code>border</code></dfn>
|
|
attribute may be specified on a <code><a href="#the-table-element">table</a></code> element to
|
|
explicitly indicate that the <code><a href="#the-table-element">table</a></code> element is not being
|
|
used for layout purposes. If specified, the attribute's value must
|
|
either be the empty string or the value "<code title="">1</code>".
|
|
The attribute is used by certain user agents as an indication that
|
|
borders should be drawn around cells of the table.</p><div class="impl">
|
|
<p>Tables can be complicated to understand and navigate. To help
|
|
users with this, user agents should clearly dilineate cells in a
|
|
table from each other, unless the user agent has classified the
|
|
table as a
|
|
layout table.</p>
|
|
</div><p class="note">Authors <span class="impl">and implementors</span>
|
|
are encouraged to consider using some of the <a href="#table-layout-techniques">table layout techniques</a>
|
|
described below to make tables easier to navigate for users.<div class="impl">
|
|
|
|
<p>User agents, especially those that do table analysis on arbitrary
|
|
content, are encouraged to find heuristics to determine which tables
|
|
actually contain data and which are merely being used for layout.
|
|
This specification does not define a precise heuristic, but the
|
|
following are suggested as possible indicators:</p>
|
|
|
|
<table><thead><tr><th>Feature
|
|
<th>Indication
|
|
<tbody><tr><td>The use of the <code title="attr-aria-role">role</code> attribute with the value <code title="attr-aria-role-presentation">presentation</code>
|
|
<td>Probably a layout table
|
|
<tr><td>The use of the <code title="attr-table-border"><a href="#attr-table-border">border</a></code> attribute with the non-conforming value 0
|
|
<td>Probably a layout table
|
|
<tr><td>The use of the non-conforming <code title="attr-table-cellspacing"><a href="#attr-table-cellspacing">cellspacing</a></code> and <code title="attr-table-cellpadding"><a href="#attr-table-cellpadding">cellpadding</a></code> attributes with the value 0
|
|
<td>Probably a layout table
|
|
<tbody><tr><td>The use of <code><a href="#the-caption-element">caption</a></code>, <code><a href="#the-thead-element">thead</a></code>, or <code><a href="#the-th-element">th</a></code> elements
|
|
<td>Probably a non-layout table
|
|
<tr><td>The use of the <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> and <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attributes
|
|
<td>Probably a non-layout table
|
|
<tr><td>The use of the <code title="attr-table-border"><a href="#attr-table-border">border</a></code> attribute with a value other than 0
|
|
<td>Probably a non-layout table
|
|
<tr><td>Explicit visible borders set using CSS
|
|
<td>Probably a non-layout table
|
|
<tbody><tr><td>The use of the <code title="attr-table-summary"><a href="#attr-table-summary">summary</a></code> attribute
|
|
<td>Not a good indicator (both layout and non-layout tables have historically been given this attribute)
|
|
</table></div><hr><dl class="domintro"><dt><var title="">table</var> . <code title="dom-table-caption"><a href="#dom-table-caption">caption</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the table's <code><a href="#the-caption-element">caption</a></code> element.</p>
|
|
<p>Can be set, to replace the <code><a href="#the-caption-element">caption</a></code> element. If the
|
|
new value is not a <code><a href="#the-caption-element">caption</a></code> element, throws a
|
|
<code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> exception.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">caption</var> = <var title="">table</var> . <code title="dom-table-createCaption"><a href="#dom-table-createcaption">createCaption</a></code>()</dt>
|
|
<dd>
|
|
<p>Ensures the table has a <code><a href="#the-caption-element">caption</a></code> element, and returns it.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">table</var> . <code title="dom-table-deleteCaption"><a href="#dom-table-deletecaption">deleteCaption</a></code>()</dt>
|
|
<dd>
|
|
<p>Ensures the table does not have a <code><a href="#the-caption-element">caption</a></code> element.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">table</var> . <code title="dom-table-tHead"><a href="#dom-table-thead">tHead</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the table's <code><a href="#the-thead-element">thead</a></code> element.</p>
|
|
<p>Can be set, to replace the <code><a href="#the-thead-element">thead</a></code> element. If the
|
|
new value is not a <code><a href="#the-thead-element">thead</a></code> element, throws a
|
|
<code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> exception.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">thead</var> = <var title="">table</var> . <code title="dom-table-createTHead"><a href="#dom-table-createthead">createTHead</a></code>()</dt>
|
|
<dd>
|
|
<p>Ensures the table has a <code><a href="#the-thead-element">thead</a></code> element, and returns it.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">table</var> . <code title="dom-table-deleteTHead"><a href="#dom-table-deletethead">deleteTHead</a></code>()</dt>
|
|
<dd>
|
|
<p>Ensures the table does not have a <code><a href="#the-thead-element">thead</a></code> element.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">table</var> . <code title="dom-table-tFoot"><a href="#dom-table-tfoot">tFoot</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the table's <code><a href="#the-tfoot-element">tfoot</a></code> element.</p>
|
|
<p>Can be set, to replace the <code><a href="#the-tfoot-element">tfoot</a></code> element. If the
|
|
new value is not a <code><a href="#the-tfoot-element">tfoot</a></code> element, throws a
|
|
<code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> exception.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">tfoot</var> = <var title="">table</var> . <code title="dom-table-createTFoot"><a href="#dom-table-createtfoot">createTFoot</a></code>()</dt>
|
|
<dd>
|
|
<p>Ensures the table has a <code><a href="#the-tfoot-element">tfoot</a></code> element, and returns it.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">table</var> . <code title="dom-table-deleteTFoot"><a href="#dom-table-deletetfoot">deleteTFoot</a></code>()</dt>
|
|
<dd>
|
|
<p>Ensures the table does not have a <code><a href="#the-tfoot-element">tfoot</a></code> element.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">table</var> . <code title="dom-table-tBodies"><a href="#dom-table-tbodies">tBodies</a></code></dt>
|
|
<dd>
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-tbody-element">tbody</a></code> elements of the table.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">tbody</var> = <var title="">table</var> . <code title="dom-table-createTBody"><a href="#dom-table-createtbody">createTBody</a></code>()</dt>
|
|
<dd>
|
|
<p>Creates a <code><a href="#the-tbody-element">tbody</a></code> element, inserts it into the table, and returns it.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">table</var> . <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code></dt>
|
|
<dd>
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-tr-element">tr</a></code> elements of the table.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">tr</var> = <var title="">table</var> . <code title="dom-table-insertRow"><a href="#dom-table-insertrow">insertRow</a></code>(<var title="">index</var>)</dt>
|
|
<dd>
|
|
<p>Creates a <code><a href="#the-tr-element">tr</a></code> element, along with a <code><a href="#the-tbody-element">tbody</a></code> if required, inserts them into the table at the position given by the argument, and returns the <code><a href="#the-tr-element">tr</a></code>.</p>
|
|
<p>The position is relative to the rows in the table. The index −1 is equivalent to inserting at the end of the table.</p>
|
|
<p>If the given position is less than −1 or greater than the number of rows, throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">table</var> . <code title="dom-table-deleteRow"><a href="#dom-table-deleterow">deleteRow</a></code>(<var title="">index</var>)</dt>
|
|
<dd>
|
|
<p>Removes the <code><a href="#the-tr-element">tr</a></code> element with the given position in the table.</p>
|
|
<p>The position is relative to the rows in the table. The index −1 is equivalent to deleting the last row of the table.</p>
|
|
<p>If the given position is less than −1 or greater than the index of the last row, or if there are no rows, throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-table-caption" title="dom-table-caption"><code>caption</code></dfn> IDL
|
|
attribute must return, on getting, the first <code><a href="#the-caption-element">caption</a></code>
|
|
element child of the <code><a href="#the-table-element">table</a></code> element, if any, or null
|
|
otherwise. On setting, if the new value is a <code><a href="#the-caption-element">caption</a></code>
|
|
element, the first <code><a href="#the-caption-element">caption</a></code> element child of the
|
|
<code><a href="#the-table-element">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="#the-table-element">table</a></code>
|
|
element. If the new value is not a <code><a href="#the-caption-element">caption</a></code> element,
|
|
then a <code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> DOM exception must be
|
|
raised instead.</p>
|
|
|
|
<p>The <dfn id="dom-table-createcaption" title="dom-table-createCaption"><code>createCaption()</code></dfn>
|
|
method must return the first <code><a href="#the-caption-element">caption</a></code> element child of
|
|
the <code><a href="#the-table-element">table</a></code> element, if any; otherwise a new
|
|
<code><a href="#the-caption-element">caption</a></code> element must be created, inserted as the first
|
|
node of the <code><a href="#the-table-element">table</a></code> element, and then returned.</p>
|
|
|
|
<p>The <dfn id="dom-table-deletecaption" title="dom-table-deleteCaption"><code>deleteCaption()</code></dfn>
|
|
method must remove the first <code><a href="#the-caption-element">caption</a></code> element child of
|
|
the <code><a href="#the-table-element">table</a></code> element, if any.</p>
|
|
|
|
<p>The <dfn id="dom-table-thead" title="dom-table-tHead"><code>tHead</code></dfn> IDL
|
|
attribute must return, on getting, the first <code><a href="#the-thead-element">thead</a></code>
|
|
element child of the <code><a href="#the-table-element">table</a></code> element, if any, or null
|
|
otherwise. On setting, if the new value is a <code><a href="#the-thead-element">thead</a></code>
|
|
element, the first <code><a href="#the-thead-element">thead</a></code> element child of the
|
|
<code><a href="#the-table-element">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="#the-table-element">table</a></code> element that is neither a <code><a href="#the-caption-element">caption</a></code>
|
|
element nor a <code><a href="#the-colgroup-element">colgroup</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="#the-thead-element">thead</a></code> element, then a
|
|
<code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> DOM exception must be raised
|
|
instead.</p>
|
|
|
|
<p>The <dfn id="dom-table-createthead" title="dom-table-createTHead"><code>createTHead()</code></dfn>
|
|
method must return the first <code><a href="#the-thead-element">thead</a></code> element child of the
|
|
<code><a href="#the-table-element">table</a></code> element, if any; otherwise a new
|
|
<code><a href="#the-thead-element">thead</a></code> element must be created and inserted immediately
|
|
before the first element in the <code><a href="#the-table-element">table</a></code> element that is
|
|
neither a <code><a href="#the-caption-element">caption</a></code> element nor a <code><a href="#the-colgroup-element">colgroup</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="dom-table-deletethead" title="dom-table-deleteTHead"><code>deleteTHead()</code></dfn>
|
|
method must remove the first <code><a href="#the-thead-element">thead</a></code> element child of the
|
|
<code><a href="#the-table-element">table</a></code> element, if any.</p>
|
|
|
|
<p>The <dfn id="dom-table-tfoot" title="dom-table-tFoot"><code>tFoot</code></dfn> IDL
|
|
attribute must return, on getting, the first <code><a href="#the-tfoot-element">tfoot</a></code>
|
|
element child of the <code><a href="#the-table-element">table</a></code> element, if any, or null
|
|
otherwise. On setting, if the new value is a <code><a href="#the-tfoot-element">tfoot</a></code>
|
|
element, the first <code><a href="#the-tfoot-element">tfoot</a></code> element child of the
|
|
<code><a href="#the-table-element">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="#the-table-element">table</a></code> element that is neither a <code><a href="#the-caption-element">caption</a></code>
|
|
element, a <code><a href="#the-colgroup-element">colgroup</a></code> element, nor a <code><a href="#the-thead-element">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="#the-tfoot-element">tfoot</a></code> element, then
|
|
a <code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> DOM exception must be raised
|
|
instead.</p>
|
|
|
|
<p>The <dfn id="dom-table-createtfoot" title="dom-table-createTFoot"><code>createTFoot()</code></dfn>
|
|
method must return the first <code><a href="#the-tfoot-element">tfoot</a></code> element child of the
|
|
<code><a href="#the-table-element">table</a></code> element, if any; otherwise a new
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> element must be created and inserted immediately
|
|
before the first element in the <code><a href="#the-table-element">table</a></code> element that is
|
|
neither a <code><a href="#the-caption-element">caption</a></code> element, a <code><a href="#the-colgroup-element">colgroup</a></code>
|
|
element, nor a <code><a href="#the-thead-element">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="dom-table-deletetfoot" title="dom-table-deleteTFoot"><code>deleteTFoot()</code></dfn>
|
|
method must remove the first <code><a href="#the-tfoot-element">tfoot</a></code> element child of the
|
|
<code><a href="#the-table-element">table</a></code> element, if any.</p>
|
|
|
|
<p>The <dfn id="dom-table-tbodies" title="dom-table-tBodies"><code>tBodies</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#the-table-element">table</a></code> node, whose filter matches only
|
|
<code><a href="#the-tbody-element">tbody</a></code> elements that are children of the
|
|
<code><a href="#the-table-element">table</a></code> element.</p>
|
|
|
|
<p>The <dfn id="dom-table-createtbody" title="dom-table-createTBody"><code>createTBody()</code></dfn>
|
|
method must create a new <code><a href="#the-tbody-element">tbody</a></code> element, insert it
|
|
immediately after the last <code><a href="#the-tbody-element">tbody</a></code> element in the
|
|
<code><a href="#the-table-element">table</a></code> element, if any, or at the end of the
|
|
<code><a href="#the-table-element">table</a></code> element if the <code><a href="#the-table-element">table</a></code> element has no
|
|
<code><a href="#the-tbody-element">tbody</a></code> element children, and then must return the new
|
|
<code><a href="#the-tbody-element">tbody</a></code> element.</p>
|
|
|
|
<p>The <dfn id="dom-table-rows" title="dom-table-rows"><code>rows</code></dfn> attribute
|
|
must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#the-table-element">table</a></code> node, whose filter matches only <code><a href="#the-tr-element">tr</a></code>
|
|
elements that are either children of the <code><a href="#the-table-element">table</a></code> element,
|
|
or children of <code><a href="#the-thead-element">thead</a></code>, <code><a href="#the-tbody-element">tbody</a></code>, or
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> elements that are themselves children of the
|
|
<code><a href="#the-table-element">table</a></code> element. The elements in the collection must be
|
|
ordered such that those elements whose parent is a
|
|
<code><a href="#the-thead-element">thead</a></code> are included first, in tree order, followed by
|
|
those elements whose parent is either a <code><a href="#the-table-element">table</a></code> or
|
|
<code><a href="#the-tbody-element">tbody</a></code> element, again in tree order, followed finally by
|
|
those elements whose parent is a <code><a href="#the-tfoot-element">tfoot</a></code> element, still
|
|
in tree order.</p>
|
|
|
|
<p>The behavior of the <dfn id="dom-table-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 −1 or greater than
|
|
the number of elements in <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code>
|
|
collection:</dt>
|
|
|
|
<dd>The method must raise an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code>
|
|
exception.</dd>
|
|
|
|
<dt>If the <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection has
|
|
zero elements in it, and the <code><a href="#the-table-element">table</a></code> has no
|
|
<code><a href="#the-tbody-element">tbody</a></code> elements in it:</dt>
|
|
|
|
<dd>The method must create a <code><a href="#the-tbody-element">tbody</a></code> element, then
|
|
create a <code><a href="#the-tr-element">tr</a></code> element, then append the <code><a href="#the-tr-element">tr</a></code>
|
|
element to the <code><a href="#the-tbody-element">tbody</a></code> element, then append the
|
|
<code><a href="#the-tbody-element">tbody</a></code> element to the <code><a href="#the-table-element">table</a></code> element, and
|
|
finally return the <code><a href="#the-tr-element">tr</a></code> element.</dd>
|
|
|
|
<dt>If the <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection has
|
|
zero elements in it:</dt>
|
|
|
|
<dd>The method must create a <code><a href="#the-tr-element">tr</a></code> element, append it to
|
|
the last <code><a href="#the-tbody-element">tbody</a></code> element in the table, and return the
|
|
<code><a href="#the-tr-element">tr</a></code> element.</dd>
|
|
|
|
<dt>If <var title="">index</var> is missing, equal to −1, or
|
|
equal to the number of items in <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection:</dt>
|
|
|
|
<dd>The method must create a <code><a href="#the-tr-element">tr</a></code> element, and append it
|
|
to the parent of the last <code><a href="#the-tr-element">tr</a></code> element in the <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection. Then, the newly
|
|
created <code><a href="#the-tr-element">tr</a></code> element must be returned.</dd>
|
|
|
|
<dt>Otherwise:</dt>
|
|
|
|
<dd>The method must create a <code><a href="#the-tr-element">tr</a></code> element, insert it
|
|
immediately before the <var title="">index</var>th <code><a href="#the-tr-element">tr</a></code>
|
|
element in the <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection,
|
|
in the same parent, and finally must return the newly created
|
|
<code><a href="#the-tr-element">tr</a></code> element.</dd>
|
|
|
|
</dl><p>When the <dfn id="dom-table-deleterow" title="dom-table-deleteRow"><code>deleteRow(<var title="">index</var>)</code></dfn> method is called, the user agent
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>If <var title="">index</var> is equal to −1, then
|
|
<var title="">index</var> must be set to the number if items in the
|
|
<code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection, minus
|
|
one.</li>
|
|
|
|
<li><p>Now, if <var title="">index</var> is less than zero, or
|
|
greater than or equal to the number of elements in the <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection, the method must
|
|
instead raise an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception, and these
|
|
steps must be aborted.</li>
|
|
|
|
<li><p>Otherwise, the method must remove the <var title="">index</var>th element in the <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection from its parent.</p>
|
|
|
|
</ol><p>The <dfn id="dom-table-border" title="dom-table-border"><code>border</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is an example of a table being used to mark up a Sudoku
|
|
puzzle. Observe the lack of headers, which are not necessary in
|
|
such a table.</p>
|
|
|
|
<pre><section>
|
|
<style scoped>
|
|
table { border-collapse: collapse; border: solid thick; }
|
|
colgroup, tbody { border: solid medium; }
|
|
td { border: solid thin; height: 1.4em; width: 1.4em; text-align: center; padding: 0; }
|
|
</style>
|
|
<h1>Today's Sudoku</h1>
|
|
<table>
|
|
<colgroup><col><col><col>
|
|
<colgroup><col><col><col>
|
|
<colgroup><col><col><col>
|
|
<tbody>
|
|
<tr> <td> 1 <td> <td> 3 <td> 6 <td> <td> 4 <td> 7 <td> <td> 9
|
|
<tr> <td> <td> 2 <td> <td> <td> 9 <td> <td> <td> 1 <td>
|
|
<tr> <td> 7 <td> <td> <td> <td> <td> <td> <td> <td> 6
|
|
<tbody>
|
|
<tr> <td> 2 <td> <td> 4 <td> <td> 3 <td> <td> 9 <td> <td> 8
|
|
<tr> <td> <td> <td> <td> <td> <td> <td> <td> <td>
|
|
<tr> <td> 5 <td> <td> <td> 9 <td> <td> 7 <td> <td> <td> 1
|
|
<tbody>
|
|
<tr> <td> 6 <td> <td> <td> <td> 5 <td> <td> <td> <td> 2
|
|
<tr> <td> <td> <td> <td> <td> 7 <td> <td> <td> <td>
|
|
<tr> <td> 9 <td> <td> <td> 8 <td> <td> 2 <td> <td> <td> 5
|
|
</table>
|
|
</section></pre>
|
|
|
|
</div><h5 id="table-descriptions-techniques"><span class="secno">4.9.1.1 </span>Techniques for describing tables</h5><p id="table-descriptions">For tables that consist of more than just
|
|
a grid of cells with headers in the first row and headers in the
|
|
first column, and for any table in general where the reader might
|
|
have difficulty understanding the content, authors should include
|
|
explanatory information introducing the table. This information is
|
|
useful for all users, but is especially useful for users who cannot
|
|
see the table, e.g. users of screen readers.<p>Such explanatory information should introduce the purpose of the
|
|
table, outline its basic cell structure, highlight any trends or
|
|
patterns, and generally teach the user how to use the table.</p><p>For instance, the following table:<table><caption>Characteristics with positive and negative sides</caption>
|
|
<thead><tr><th id="n"> Negative
|
|
<th> Characteristic
|
|
<th> Positive
|
|
<tbody><tr><td headers="n r1"> Sad
|
|
<th id="r1"> Mood
|
|
<td> Happy
|
|
<tr><td headers="n r2"> Failing
|
|
<th id="r2"> Grade
|
|
<td> Passing
|
|
</table><p>...might benefit from a description explaining the way the table
|
|
is laid out, something like "Characteristics are given in the
|
|
second column, with the negative side in the left column and the
|
|
positive side in the right column".<p>There are a variety of ways to include this information, such as:<dl><dt>In prose, surrounding the table</dt>
|
|
|
|
<dd>
|
|
<div class="example"><pre><p>In the following table, characteristics are given in the second
|
|
column, with the negative side in the left column and the positive
|
|
side in the right column.</p>
|
|
<table>
|
|
<caption>Characteristics with positive and negative sides</caption>
|
|
<thead>
|
|
<tr>
|
|
<th id="n"> Negative
|
|
<th> Characteristic
|
|
<th> Positive
|
|
<tbody>
|
|
<tr>
|
|
<td headers="n r1"> Sad
|
|
<th id="r1"> Mood
|
|
<td> Happy
|
|
<tr>
|
|
<td headers="n r2"> Failing
|
|
<th id="r2"> Grade
|
|
<td> Passing
|
|
</table></pre></div>
|
|
</dd>
|
|
|
|
<dt>In the table's <code><a href="#the-caption-element">caption</a></code></dt>
|
|
|
|
<dd>
|
|
<div class="example"><pre><table>
|
|
<caption>
|
|
<strong>Characteristics with positive and negative sides.</strong>
|
|
<p>Characteristics are given in the second column, with the
|
|
negative side in the left column and the positive side in the right
|
|
column.</p>
|
|
</caption>
|
|
<thead>
|
|
<tr>
|
|
<th id="n"> Negative
|
|
<th> Characteristic
|
|
<th> Positive
|
|
<tbody>
|
|
<tr>
|
|
<td headers="n r1"> Sad
|
|
<th id="r1"> Mood
|
|
<td> Happy
|
|
<tr>
|
|
<td headers="n r2"> Failing
|
|
<th id="r2"> Grade
|
|
<td> Passing
|
|
</table></pre></div>
|
|
</dd>
|
|
|
|
<dt>In the table's <code><a href="#the-caption-element">caption</a></code>, in a <code><a href="#the-details-element">details</a></code> element</dt>
|
|
|
|
<dd>
|
|
<div class="example"><pre><table>
|
|
<caption>
|
|
<strong>Characteristics with positive and negative sides.</strong>
|
|
<details>
|
|
<summary>Help</summary>
|
|
<p>Characteristics are given in the second column, with the
|
|
negative side in the left column and the positive side in the right
|
|
column.</p>
|
|
</details>
|
|
</caption>
|
|
<thead>
|
|
<tr>
|
|
<th id="n"> Negative
|
|
<th> Characteristic
|
|
<th> Positive
|
|
<tbody>
|
|
<tr>
|
|
<td headers="n r1"> Sad
|
|
<th id="r1"> Mood
|
|
<td> Happy
|
|
<tr>
|
|
<td headers="n r2"> Failing
|
|
<th id="r2"> Grade
|
|
<td> Passing
|
|
</table></pre></div>
|
|
</dd>
|
|
|
|
<dt>Next to the table, in the same <code><a href="#the-figure-element">figure</a></code></dt>
|
|
|
|
<dd>
|
|
<div class="example"><pre><figure>
|
|
<figcaption>Characteristics with positive and negative sides</figcaption>
|
|
<p>Characteristics are given in the second column, with the
|
|
negative side in the left column and the positive side in the right
|
|
column.</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th id="n"> Negative
|
|
<th> Characteristic
|
|
<th> Positive
|
|
<tbody>
|
|
<tr>
|
|
<td headers="n r1"> Sad
|
|
<th id="r1"> Mood
|
|
<td> Happy
|
|
<tr>
|
|
<td headers="n r2"> Failing
|
|
<th id="r2"> Grade
|
|
<td> Passing
|
|
</table>
|
|
</figure></pre></div>
|
|
</dd>
|
|
|
|
<dt>Next to the table, in a <code><a href="#the-figure-element">figure</a></code>'s <code><a href="#the-figcaption-element">figcaption</a></code></dt>
|
|
|
|
<dd>
|
|
<div class="example"><pre><figure>
|
|
<figcaption>
|
|
<strong>Characteristics with positive and negative sides</strong>
|
|
<p>Characteristics are given in the second column, with the
|
|
negative side in the left column and the positive side in the right
|
|
column.</p>
|
|
</figcaption>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th id="n"> Negative
|
|
<th> Characteristic
|
|
<th> Positive
|
|
<tbody>
|
|
<tr>
|
|
<td headers="n r1"> Sad
|
|
<th id="r1"> Mood
|
|
<td> Happy
|
|
<tr>
|
|
<td headers="n r2"> Failing
|
|
<th id="r2"> Grade
|
|
<td> Passing
|
|
</table>
|
|
</figure></pre></div>
|
|
</dd>
|
|
|
|
</dl><p>Authors may also use other techniques, or combinations of the
|
|
above techniques, as appropriate.<p>The best option, of course, rather than writing a description
|
|
explaining the way the table is laid out, is to adjust the table
|
|
such that no explanation is needed.<div class="example">
|
|
|
|
<p>In the case of the table used in the examples above, a simple
|
|
rearrangement of the table so that the headers are on the top and
|
|
left sides removes the need for an explanation as well as removing
|
|
the need for the use of <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> attributes:</p>
|
|
|
|
<pre><table>
|
|
<caption>Characteristics with positive and negative sides</caption>
|
|
<thead>
|
|
<tr>
|
|
<th> Characteristic
|
|
<th> Negative
|
|
<th> Positive
|
|
<tbody>
|
|
<tr>
|
|
<th> Mood
|
|
<td> Sad
|
|
<td> Happy
|
|
<tr>
|
|
<th> Grade
|
|
<td> Failing
|
|
<td> Passing
|
|
</table></pre>
|
|
|
|
</div><h5 id="table-layout-techniques"><span class="secno">4.9.1.2 </span>Techniques for table layout</h5><p>Good table layout is key to making tables more readable and usable.<p>In visual media, providing column and row borders and alternating
|
|
row backgrounds can be very effective to make complicated tables
|
|
more readable.<p>For tables with large volumes of numeric content, using
|
|
monospaced fonts can help users see patterns, especially in
|
|
situations where a user agent does not render the borders.
|
|
(Unfortunately, for historical reasons, not rendering borders on
|
|
tables is a common default.)<p>In speech media, table cells can be distinguished by reporting
|
|
the corresponding headers before reading the cell's contents, and by
|
|
allowing users to navigate the table in a grid fashion, rather than
|
|
serializing the entire contents of the table in source order.<p>Authors are encouraged to use CSS to achieve these effects.<div class="impl">
|
|
<p>User agents are encouraged to render tables using these
|
|
techniques whenever the page does not use CSS and the table is not
|
|
classified as a layout table.</p>
|
|
</div><h4 id="the-caption-element"><span class="secno">4.9.2 </span>The <dfn><code>caption</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As the first element child of a <code><a href="#the-table-element">table</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>, but with no descendant <code><a href="#the-table-element">table</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmltablecaptionelement">HTMLTableCaptionElement</dfn> : <a href="#htmlelement">HTMLElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-caption-element">caption</a></code> element <a href="#represents">represents</a> the title of the
|
|
<code><a href="#the-table-element">table</a></code> that is its parent, if it has a parent and that
|
|
is a <code><a href="#the-table-element">table</a></code> element.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-caption-element">caption</a></code> element takes part in the <a href="#table-model">table
|
|
model</a>.</p>
|
|
|
|
</div><p>When a <code><a href="#the-table-element">table</a></code> element is the only content in a
|
|
<code><a href="#the-figure-element">figure</a></code> element other than the <code><a href="#the-figcaption-element">figcaption</a></code>,
|
|
the <code><a href="#the-caption-element">caption</a></code> element should be omitted in favor of the
|
|
<code><a href="#the-figcaption-element">figcaption</a></code>.<p>A caption can introduce context for a table, making it
|
|
significantly easier to understand.<div class="example">
|
|
|
|
<p>Consider, for instance, the following table:</p>
|
|
|
|
<table class="dice-example"><tr><th> <th> 1 <th> 2 <th> 3 <th> 4 <th> 5 <th> 6
|
|
<tr><th> 1 <td> 2 <td> 3 <td> 4 <td> 5 <td> 6 <td> 7
|
|
<tr><th> 2 <td> 3 <td> 4 <td> 5 <td> 6 <td> 7 <td> 8
|
|
<tr><th> 3 <td> 4 <td> 5 <td> 6 <td> 7 <td> 8 <td> 9
|
|
<tr><th> 4 <td> 5 <td> 6 <td> 7 <td> 8 <td> 9 <td> 10
|
|
<tr><th> 5 <td> 6 <td> 7 <td> 8 <td> 9 <td> 10 <td> 11
|
|
<tr><th> 6 <td> 7 <td> 8 <td> 9 <td> 10 <td> 11 <td> 12
|
|
</table><p>In the abstract, this table is not clear. However, with a
|
|
caption giving the table's number (for reference in the main prose)
|
|
and explaining its use, it makes more sense:</p>
|
|
|
|
<pre><caption>
|
|
<p>Table 1.
|
|
<p>This table shows the total score obtained from rolling two
|
|
six-sided dice. The first row represents the value of the first die,
|
|
the first column the value of the second die. The total is given in
|
|
the cell that corresponds to the values of the two dice.
|
|
</caption></pre>
|
|
|
|
|
|
</div><h4 id="the-colgroup-element"><span class="secno">4.9.3 </span>The <dfn><code>colgroup</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-table-element">table</a></code> element, after any
|
|
<code><a href="#the-caption-element">caption</a></code> elements and before any <code><a href="#the-thead-element">thead</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, and <code><a href="#the-tr-element">tr</a></code>
|
|
elements.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>If the <code title="attr-colgroup-span"><a href="#attr-colgroup-span">span</a></code> attribute is present: Empty.</dd>
|
|
<dd>If the <code title="attr-colgroup-span"><a href="#attr-colgroup-span">span</a></code> attribute is absent: Zero or more <code><a href="#the-col-element">col</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-colgroup-span"><a href="#attr-colgroup-span">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="#dom-colgroup-span" title="dom-colgroup-span">span</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-colgroup-element">colgroup</a></code> element <a href="#represents">represents</a> a <a href="#concept-column-group" title="concept-column-group">group</a> of one or more <a href="#concept-column" title="concept-column">columns</a> in the <code><a href="#the-table-element">table</a></code> that
|
|
is its parent, if it has a parent and that is a <code><a href="#the-table-element">table</a></code>
|
|
element.<p>If the <code><a href="#the-colgroup-element">colgroup</a></code> element contains no <code><a href="#the-col-element">col</a></code>
|
|
elements, then the element may have a <dfn id="attr-colgroup-span" title="attr-colgroup-span"><code>span</code></dfn> content attribute
|
|
specified, whose value must be a <a href="#valid-non-negative-integer">valid non-negative
|
|
integer</a> greater than zero.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-colgroup-element">colgroup</a></code> element and its <code title="attr-colgroup-span"><a href="#attr-colgroup-span">span</a></code> attribute take part in the
|
|
<a href="#table-model">table model</a>.</p>
|
|
|
|
<p>The <dfn id="dom-colgroup-span" title="dom-colgroup-span"><code>span</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name. The value must be <a href="#limited-to-only-non-negative-numbers-greater-than-zero">limited to only non-negative
|
|
numbers greater than zero</a>.</p>
|
|
|
|
</div><h4 id="the-col-element"><span class="secno">4.9.4 </span>The <dfn><code>col</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-colgroup-element">colgroup</a></code> element that doesn't have
|
|
a <code title="attr-col-span"><a href="#attr-col-span">span</a></code> attribute.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-col-span"><a href="#attr-col-span">span</a></code></dd>
|
|
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<p><code><a href="#htmltablecolelement">HTMLTableColElement</a></code>, same as for
|
|
<code><a href="#the-colgroup-element">colgroup</a></code> elements. This interface defines one member,
|
|
<code title="dom-col-span"><a href="#dom-col-span">span</a></code>.</p>
|
|
</dd>
|
|
</dl><p>If a <code><a href="#the-col-element">col</a></code> element has a parent and that is a
|
|
<code><a href="#the-colgroup-element">colgroup</a></code> element that itself has a parent that is a
|
|
<code><a href="#the-table-element">table</a></code> element, then the <code><a href="#the-col-element">col</a></code> element
|
|
<a href="#represents">represents</a> one or more <a href="#concept-column" title="concept-column">columns</a> in the <a href="#concept-column-group" title="concept-column-group">column group</a> represented by that
|
|
<code><a href="#the-colgroup-element">colgroup</a></code>.<p>The element may have a <dfn id="attr-col-span" title="attr-col-span"><code>span</code></dfn> content attribute
|
|
specified, whose value must be a <a href="#valid-non-negative-integer">valid non-negative
|
|
integer</a> greater than zero.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-col-element">col</a></code> element and its <code title="attr-col-span"><a href="#attr-col-span">span</a></code> attribute take part in the
|
|
<a href="#table-model">table model</a>.</p>
|
|
|
|
<p>The <dfn id="dom-col-span" title="dom-col-span"><code>span</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name. The value must be <a href="#limited-to-only-non-negative-numbers-greater-than-zero">limited to only non-negative
|
|
numbers greater than zero</a>.</p>
|
|
|
|
</div><h4 id="the-tbody-element"><span class="secno">4.9.5 </span>The <dfn><code>tbody</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-table-element">table</a></code> element, after any
|
|
<code><a href="#the-caption-element">caption</a></code>, <code><a href="#the-colgroup-element">colgroup</a></code>, and
|
|
<code><a href="#the-thead-element">thead</a></code> elements, but only if there are no
|
|
<code><a href="#the-tr-element">tr</a></code> elements that are children of the
|
|
<code><a href="#the-table-element">table</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-tr-element">tr</a></code> elements</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmltablesectionelement">HTMLTableSectionElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-tbody-rows" title="dom-tbody-rows">rows</a>;
|
|
<a href="#htmlelement">HTMLElement</a> <a href="#dom-tbody-insertrow" title="dom-tbody-insertRow">insertRow</a>(in optional long index);
|
|
void <a href="#dom-tbody-deleterow" 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="#the-thead-element">thead</a></code> and <code><a href="#the-tfoot-element">tfoot</a></code> elements.</p>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-tbody-element">tbody</a></code> element <a href="#represents">represents</a> a <a href="#concept-row-group" title="concept-row-group">block</a> of <a href="#concept-row" title="concept-row">rows</a> that consist of a body of data for
|
|
the parent <code><a href="#the-table-element">table</a></code> element, if the <code><a href="#the-tbody-element">tbody</a></code>
|
|
element has a parent and it is a <code><a href="#the-table-element">table</a></code>.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-tbody-element">tbody</a></code> element takes part in the <a href="#table-model">table
|
|
model</a>.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">tbody</var> . <code title="dom-tbody-rows"><a href="#dom-tbody-rows">rows</a></code></dt>
|
|
<dd>
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-tr-element">tr</a></code> elements of the table section.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">tr</var> = <var title="">tbody</var> . <code title="dom-tbody-insertRow"><a href="#dom-tbody-insertrow">insertRow</a></code>( [ <var title="">index</var> ] )</dt>
|
|
<dd>
|
|
<p>Creates a <code><a href="#the-tr-element">tr</a></code> element, inserts it into the table section at the position given by the argument, and returns the <code><a href="#the-tr-element">tr</a></code>.</p>
|
|
<p>The position is relative to the rows in the table section. The index −1, which is the default if the argument is omitted, is equivalent to inserting at the end of the table section.</p>
|
|
<p>If the given position is less than −1 or greater than the number of rows, throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">tbody</var> . <code title="dom-tbody-deleteRow"><a href="#dom-tbody-deleterow">deleteRow</a></code>(<var title="">index</var>)</dt>
|
|
<dd>
|
|
<p>Removes the <code><a href="#the-tr-element">tr</a></code> element with the given position in the table section.</p>
|
|
<p>The position is relative to the rows in the table section. The index −1 is equivalent to deleting the last row of the table section.</p>
|
|
<p>If the given position is less than −1 or greater than the index of the last row, or if there are no rows, throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-tbody-rows" title="dom-tbody-rows"><code>rows</code></dfn> attribute
|
|
must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the element,
|
|
whose filter matches only <code><a href="#the-tr-element">tr</a></code> elements that are children
|
|
of the element.</p>
|
|
|
|
<p>The <dfn id="dom-tbody-insertrow" 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 −1 or greater than the
|
|
number of elements in the <code title="dom-tbody-rows"><a href="#dom-tbody-rows">rows</a></code>
|
|
collection, the method must raise an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code>
|
|
exception.</p>
|
|
|
|
<p>If <var title="">index</var> is missing, equal to −1, or
|
|
equal to the number of items in the <code title="dom-tbody-rows"><a href="#dom-tbody-rows">rows</a></code> collection, the method must
|
|
create a <code><a href="#the-tr-element">tr</a></code> element, append it to the element <var title="">table section</var>, and return the newly created
|
|
<code><a href="#the-tr-element">tr</a></code> element.</p>
|
|
|
|
<p>Otherwise, the method must create a <code><a href="#the-tr-element">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="#the-tr-element">tr</a></code> element in the <code title="dom-tbody-rows"><a href="#dom-tbody-rows">rows</a></code> collection, and finally must
|
|
return the newly created <code><a href="#the-tr-element">tr</a></code> element.</p>
|
|
|
|
<p>The <dfn id="dom-tbody-deleterow" 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="#dom-tbody-rows">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="#dom-tbody-rows">rows</a></code> collection, the method must
|
|
instead raise an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
|
|
</div><h4 id="the-thead-element"><span class="secno">4.9.6 </span>The <dfn><code>thead</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-table-element">table</a></code> element, after any
|
|
<code><a href="#the-caption-element">caption</a></code>, and <code><a href="#the-colgroup-element">colgroup</a></code>
|
|
elements and before any <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, and
|
|
<code><a href="#the-tr-element">tr</a></code> elements, but only if there are no other
|
|
<code><a href="#the-thead-element">thead</a></code> elements that are children of the
|
|
<code><a href="#the-table-element">table</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-tr-element">tr</a></code> elements</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd><code><a href="#htmltablesectionelement">HTMLTableSectionElement</a></code>, as defined for
|
|
<code><a href="#the-tbody-element">tbody</a></code> elements.</dd>
|
|
</dl><p>The <code><a href="#the-thead-element">thead</a></code> element <a href="#represents">represents</a> the <a href="#concept-row-group" title="concept-row-group">block</a> of <a href="#concept-row" title="concept-row">rows</a> that consist of the column labels
|
|
(headers) for the parent <code><a href="#the-table-element">table</a></code> element, if the
|
|
<code><a href="#the-thead-element">thead</a></code> element has a parent and it is a
|
|
<code><a href="#the-table-element">table</a></code>.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-thead-element">thead</a></code> element takes part in the <a href="#table-model">table
|
|
model</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This example shows a <code><a href="#the-thead-element">thead</a></code> element being used.
|
|
Notice the use of both <code><a href="#the-th-element">th</a></code> and <code><a href="#the-td-element">td</a></code> elements
|
|
in the <code><a href="#the-thead-element">thead</a></code> element: the first row is the headers,
|
|
and the second row is an explanation of how to fill in the
|
|
table.</p>
|
|
|
|
<pre><table>
|
|
<caption> School auction sign-up sheet </caption>
|
|
<strong> <thead>
|
|
<tr>
|
|
<th><label for=e1>Name</label>
|
|
<th><label for=e2>Product</label>
|
|
<th><label for=e3>Picture</label>
|
|
<th><label for=e4>Price</label>
|
|
<tr>
|
|
<td>Your name here
|
|
<td>What are you selling?
|
|
<td>Link to a picture
|
|
<td>Your reserve price
|
|
</strong> <tbody>
|
|
<tr>
|
|
<td>Ms Danus
|
|
<td>Doughnuts
|
|
<td><img src="http://example.com/mydoughnuts.png" title="Doughnuts from Ms Danus">
|
|
<td>$45
|
|
<tr>
|
|
<td><input id=e1 type=text name=who required form=f>
|
|
<td><input id=e2 type=text name=what required form=f>
|
|
<td><input id=e3 type=url name=pic form=f>
|
|
<td><input id=e4 type=number step=0.01 min=0 value=0 required form=f>
|
|
</table>
|
|
<form id=f action="/auction.cgi">
|
|
<input type=button name=add value="Submit">
|
|
</form></pre>
|
|
|
|
</div><h4 id="the-tfoot-element"><span class="secno">4.9.7 </span>The <dfn><code>tfoot</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-table-element">table</a></code> element, after any
|
|
<code><a href="#the-caption-element">caption</a></code>, <code><a href="#the-colgroup-element">colgroup</a></code>, and <code><a href="#the-thead-element">thead</a></code>
|
|
elements and before any <code><a href="#the-tbody-element">tbody</a></code> and <code><a href="#the-tr-element">tr</a></code>
|
|
elements, but only if there are no other <code><a href="#the-tfoot-element">tfoot</a></code>
|
|
elements that are children of the <code><a href="#the-table-element">table</a></code> element.</dd>
|
|
<dd>As a child of a <code><a href="#the-table-element">table</a></code> element, after any
|
|
<code><a href="#the-caption-element">caption</a></code>, <code><a href="#the-colgroup-element">colgroup</a></code>, <code><a href="#the-thead-element">thead</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, and <code><a href="#the-tr-element">tr</a></code> elements, but only if there
|
|
are no other <code><a href="#the-tfoot-element">tfoot</a></code> elements that are children of the
|
|
<code><a href="#the-table-element">table</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-tr-element">tr</a></code> elements</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd><code><a href="#htmltablesectionelement">HTMLTableSectionElement</a></code>, as defined for
|
|
<code><a href="#the-tbody-element">tbody</a></code> elements.</dd>
|
|
</dl><p>The <code><a href="#the-tfoot-element">tfoot</a></code> element <a href="#represents">represents</a> the <a href="#concept-row-group" title="concept-row-group">block</a> of <a href="#concept-row" title="concept-row">rows</a> that consist of the column summaries
|
|
(footers) for the parent <code><a href="#the-table-element">table</a></code> element, if the
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> element has a parent and it is a
|
|
<code><a href="#the-table-element">table</a></code>.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-tfoot-element">tfoot</a></code> element takes part in the <a href="#table-model">table
|
|
model</a>.</p>
|
|
|
|
</div><h4 id="the-tr-element"><span class="secno">4.9.8 </span>The <dfn><code>tr</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-thead-element">thead</a></code> element.</dd>
|
|
<dd>As a child of a <code><a href="#the-tbody-element">tbody</a></code> element.</dd>
|
|
<dd>As a child of a <code><a href="#the-tfoot-element">tfoot</a></code> element.</dd>
|
|
<dd>As a child of a <code><a href="#the-table-element">table</a></code> element, after any
|
|
<code><a href="#the-caption-element">caption</a></code>, <code><a href="#the-colgroup-element">colgroup</a></code>, and <code><a href="#the-thead-element">thead</a></code>
|
|
elements, but only if there are no <code><a href="#the-tbody-element">tbody</a></code> elements that
|
|
are children of the <code><a href="#the-table-element">table</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-td-element">td</a></code> or <code><a href="#the-th-element">th</a></code> elements</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></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="#dom-tr-rowindex" title="dom-tr-rowIndex">rowIndex</a>;
|
|
readonly attribute long <a href="#dom-tr-sectionrowindex" title="dom-tr-sectionRowIndex">sectionRowIndex</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-tr-cells" title="dom-tr-cells">cells</a>;
|
|
<a href="#htmlelement">HTMLElement</a> <a href="#dom-tr-insertcell" title="dom-tr-insertCell">insertCell</a>(in optional long index);
|
|
void <a href="#dom-tr-deletecell" title="dom-tr-deleteCell">deleteCell</a>(in long index);
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-tr-element">tr</a></code> element <a href="#represents">represents</a> a <a href="#concept-row" title="concept-row">row</a> of <a href="#concept-cell" title="concept-cell">cells</a> in a <a href="#concept-table" title="concept-table">table</a>.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-tr-element">tr</a></code> element takes part in the <a href="#table-model">table
|
|
model</a>.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">tr</var> . <code title="dom-tr-rowIndex"><a href="#dom-tr-rowindex">rowIndex</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the position of the row in the table's <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> list.</p>
|
|
|
|
<p>Returns −1 if the element isn't in a table.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">tr</var> . <code title="dom-tr-sectionRowIndex"><a href="#dom-tr-sectionrowindex">sectionRowIndex</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the position of the row in the table section's <code title="dom-tbody-rows"><a href="#dom-tbody-rows">rows</a></code> list.</p>
|
|
|
|
<p>Returns −1 if the element isn't in a table section.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">tr</var> . <code title="dom-tr-cells"><a href="#dom-tr-cells">cells</a></code></dt>
|
|
<dd>
|
|
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements of the row.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">cell</var> = <var title="">tr</var> . <code title="dom-tr-insertCell"><a href="#dom-tr-insertcell">insertCell</a></code>( [ <var title="">index</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Creates a <code><a href="#the-td-element">td</a></code> element, inserts it into the table
|
|
row at the position given by the argument, and returns the
|
|
<code><a href="#the-td-element">td</a></code>.</p>
|
|
|
|
<p>The position is relative to the cells in the row. The
|
|
index −1, which is the default if the argument is omitted,
|
|
is equivalent to inserting at the end of the row.</p>
|
|
|
|
<p>If the given position is less than −1 or greater than
|
|
the number of cells, throws an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code>
|
|
exception.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">tr</var> . <code title="dom-tr-deleteCell"><a href="#dom-tr-deletecell">deleteCell</a></code>(<var title="">index</var>)</dt>
|
|
<dd>
|
|
|
|
<p>Removes the <code><a href="#the-td-element">td</a></code> or <code><a href="#the-th-element">th</a></code> element with the
|
|
given position in the row.</p>
|
|
|
|
<p>The position is relative to the cells in the row. The index
|
|
−1 is equivalent to deleting the last cell of the row.</p>
|
|
|
|
<p>If the given position is less than −1 or greater than
|
|
the index of the last cell, or if there are no cells, throws an
|
|
<code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-tr-rowindex" title="dom-tr-rowIndex"><code>rowIndex</code></dfn>
|
|
attribute must, if the element has a parent <code><a href="#the-table-element">table</a></code>
|
|
element, or a parent <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, or
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> element and a <em>grandparent</em>
|
|
<code><a href="#the-table-element">table</a></code> element, return the index of the <code><a href="#the-tr-element">tr</a></code>
|
|
element in that <code><a href="#the-table-element">table</a></code> element's <code title="dom-table-rows"><a href="#dom-table-rows">rows</a></code> collection. If there is no such
|
|
<code><a href="#the-table-element">table</a></code> element, then the attribute must return
|
|
−1.</p>
|
|
|
|
<p>The <dfn id="dom-tr-sectionrowindex" title="dom-tr-sectionRowIndex"><code>sectionRowIndex</code></dfn>
|
|
attribute must, if the element has a parent <code><a href="#the-table-element">table</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, or <code><a href="#the-tfoot-element">tfoot</a></code>
|
|
element, return the index of the <code><a href="#the-tr-element">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="#dom-table-rows">HTMLTableElement.rows</a></code>
|
|
collection; for table sections, that's the <code title="dom-tbody-rows"><a href="#dom-tbody-rows">HTMLTableRowElement.rows</a></code>
|
|
collection). If there is no such parent element, then the attribute
|
|
must return −1.</p>
|
|
|
|
<p>The <dfn id="dom-tr-cells" title="dom-tr-cells"><code>cells</code></dfn> attribute
|
|
must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#the-tr-element">tr</a></code> element, whose filter matches only <code><a href="#the-td-element">td</a></code>
|
|
and <code><a href="#the-th-element">th</a></code> elements that are children of the
|
|
<code><a href="#the-tr-element">tr</a></code> element.</p>
|
|
|
|
<p>The <dfn id="dom-tr-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 −1 or greater than the
|
|
number of elements in the <code title="dom-tr-cells"><a href="#dom-tr-cells">cells</a></code>
|
|
collection, the method must raise an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code>
|
|
exception.</p>
|
|
|
|
<p>If <var title="">index</var> is missing, equal to −1, or
|
|
equal to the number of items in <code title="dom-tr-cells"><a href="#dom-tr-cells">cells</a></code> collection, the method must create
|
|
a <code><a href="#the-td-element">td</a></code> element, append it to the <code><a href="#the-tr-element">tr</a></code> element,
|
|
and return the newly created <code><a href="#the-td-element">td</a></code> element.</p>
|
|
|
|
<p>Otherwise, the method must create a <code><a href="#the-td-element">td</a></code> element,
|
|
insert it as a child of the <code><a href="#the-tr-element">tr</a></code> element, immediately
|
|
before the <var title="">index</var>th <code><a href="#the-td-element">td</a></code> or
|
|
<code><a href="#the-th-element">th</a></code> element in the <code title="dom-tr-cells"><a href="#dom-tr-cells">cells</a></code> collection, and finally must
|
|
return the newly created <code><a href="#the-td-element">td</a></code> element.</p>
|
|
|
|
<p>The <dfn id="dom-tr-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="#dom-tr-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="#dom-tr-cells">cells</a></code> collection, the method must
|
|
instead raise an <code><a href="#index_size_err">INDEX_SIZE_ERR</a></code> exception.</p>
|
|
|
|
</div><h4 id="the-td-element"><span class="secno">4.9.9 </span>The <dfn><code>td</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#sectioning-root">Sectioning root</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-tr-element">tr</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code></dd>
|
|
<dd><code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">rowspan</a></code></dd>
|
|
<dd><code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code></dd>
|
|
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmltabledatacellelement">HTMLTableDataCellElement</dfn> : <a href="#htmltablecellelement">HTMLTableCellElement</a> {};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-td-element">td</a></code> element <a href="#represents">represents</a> a data <a href="#concept-cell" title="concept-cell">cell</a> in a table.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-td-element">td</a></code> element and its <code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code>, <code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">rowspan</a></code>, and <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> attributes take part in the
|
|
<a href="#table-model">table model</a>.</p>
|
|
|
|
</div><h4 id="the-th-element"><span class="secno">4.9.10 </span>The <dfn><code>th</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-tr-element">tr</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code></dd>
|
|
<dd><code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">rowspan</a></code></dd>
|
|
<dd><code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code></dd>
|
|
<dd><code title="attr-th-scope"><a href="#attr-th-scope">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="#dom-th-scope" title="dom-th-scope">scope</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-th-element">th</a></code> element <a href="#represents">represents</a> a header <a href="#concept-cell" title="concept-cell">cell</a> in a table.<p>The <code><a href="#the-th-element">th</a></code> element may have a <dfn id="attr-th-scope" title="attr-th-scope"><code>scope</code></dfn> content attribute
|
|
specified. The <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute is
|
|
an <a href="#enumerated-attribute">enumerated attribute</a> with five states, four of which
|
|
have explicit keywords:<dl><dt>The <dfn id="attr-th-scope-row" title="attr-th-scope-row"><code>row</code></dfn>
|
|
keyword, which maps to the <i>row</i> state</dt>
|
|
|
|
<dd>The <i>row</i> state means the header cell applies to some of
|
|
the subsequent cells in the same row(s).</dd>
|
|
|
|
<dt>The <dfn id="attr-th-scope-col" title="attr-th-scope-col"><code>col</code></dfn>
|
|
keyword, which maps to the <i>column</i> state</dt>
|
|
|
|
<dd>The <i>column</i> state means the header cell applies to some
|
|
of the subsequent cells in the same column(s).</dd>
|
|
|
|
<dt>The <dfn id="attr-th-scope-rowgroup" title="attr-th-scope-rowgroup"><code>rowgroup</code></dfn> keyword,
|
|
which maps to the <i>row group</i> state</dt>
|
|
|
|
<dd>The <i>row group</i> state means the header cell applies to all
|
|
the remaining cells in the row group. A <code><a href="#the-th-element">th</a></code> element's
|
|
<code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute must not be in
|
|
the <a href="#attr-th-scope-rowgroup" title="attr-th-scope-rowgroup">row group</a> state if
|
|
the element is not anchored in a <a href="#concept-row-group" title="concept-row-group">row group</a>.</dd>
|
|
|
|
<dt>The <dfn id="attr-th-scope-colgroup" title="attr-th-scope-colgroup"><code>colgroup</code></dfn> keyword,
|
|
which maps to the <i>column group</i> state</dt>
|
|
|
|
<dd>The <i>column group</i> state means the header cell applies to
|
|
all the remaining cells in the column group. A <code><a href="#the-th-element">th</a></code>
|
|
element's <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute must
|
|
not be in the <a href="#attr-th-scope-colgroup" title="attr-th-scope-colgroup">column
|
|
group</a> state if the element is not anchored in a <a href="#concept-column-group" title="concept-column-group">column group</a>.</dd>
|
|
|
|
<dt>The <dfn id="attr-th-scope-auto" title="attr-th-scope-auto">auto</dfn> state</dt>
|
|
|
|
<dd>The <i>auto</i> 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="#attr-th-scope">scope</a></code> attribute's
|
|
<i>missing value default</i> is the <i>auto</i> state.<div class="impl">
|
|
|
|
<p>The <code><a href="#the-th-element">th</a></code> element and its <code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code>, <code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">rowspan</a></code>, <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code>, and <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attributes take part in the
|
|
<a href="#table-model">table model</a>.</p>
|
|
|
|
<p>The <dfn id="dom-th-scope" title="dom-th-scope"><code>scope</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows how the <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute's <code title="attr-th-scope-rowgroup"><a href="#attr-th-scope-rowgroup">rowgroup</a></code> value affects which
|
|
data cells a header cell applies to.</p>
|
|
|
|
<p>Here is a markup fragment showing a table:</p>
|
|
|
|
<pre><table>
|
|
<thead>
|
|
<tr> <th> ID <th> Measurement <th> Average <th> Maximum
|
|
<tbody>
|
|
<tr> <td> <th scope=rowgroup> Cats <td> <td>
|
|
<tr> <td> 93 <th scope=row> Legs <td> 3.5 <td> 4
|
|
<tr> <td> 10 <th scope=row> Tails <td> 1 <td> 1
|
|
<tbody>
|
|
<tr> <td> <th scope=rowgroup> English speakers <td> <td>
|
|
<tr> <td> 32 <th scope=row> Legs <td> 2.67 <td> 4
|
|
<tr> <td> 35 <th scope=row> Tails <td> 0.33 <td> 1
|
|
</table></pre>
|
|
|
|
<p>This would result in the following table:</p>
|
|
|
|
<table><thead><tr><th> ID <th> Measurement <th> Average <th> Maximum
|
|
<tbody><tr><td> <th scope="rowgroup"> Cats <td> <td>
|
|
<tr><td> 93 <th scope="row"> Legs <td> 3.5 <td> 4
|
|
<tr><td> 10 <th scope="row"> Tails <td> 1 <td> 1
|
|
<tbody><tr><td> <th scope="rowgroup"> English speakers <td> <td>
|
|
<tr><td> 32 <th scope="row"> Legs <td> 2.67 <td> 4
|
|
<tr><td> 35 <th scope="row"> Tails <td> 0.33 <td> 1
|
|
</table><p>The headers in the first row all apply directly down to the rows
|
|
in their column.</p>
|
|
|
|
<p>The headers with the explicit <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attributes apply to all the
|
|
cells in their row group other than the cells in the first column.</p>
|
|
|
|
<p>The remaining headers apply just to the cells to the right of
|
|
them.</p>
|
|
|
|
|
|
<img alt="" height="256" src="table-scope-diagram.png" width="459"></div><h4 id="attributes-common-to-td-and-th-elements"><span class="secno">4.9.11 </span>Attributes common to <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</h4><p>The <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements may have a <dfn id="attr-tdth-colspan" title="attr-tdth-colspan"><code>colspan</code></dfn> content
|
|
attribute specified, whose value must be a <a href="#valid-non-negative-integer">valid non-negative
|
|
integer</a> greater than zero.<p>The <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements may also have a
|
|
<dfn id="attr-tdth-rowspan" title="attr-tdth-rowspan"><code>rowspan</code></dfn> content
|
|
attribute specified, whose value must be a <a href="#valid-non-negative-integer">valid non-negative
|
|
integer</a>.<p>These attributes give the number of columns and rows respectively
|
|
that the cell is to span. These attributes must not be used to
|
|
overlap cells<span class="impl">, as described in the description of
|
|
the <a href="#table-model">table model</a></span>.</p><hr><p>The <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> element may have a <dfn id="attr-tdth-headers" title="attr-tdth-headers"><code>headers</code></dfn> content
|
|
attribute specified. The <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> attribute, if specified,
|
|
must contain a string consisting of an <a href="#unordered-set-of-unique-space-separated-tokens">unordered set of unique
|
|
space-separated tokens</a> that are <a href="#case-sensitive">case-sensitive</a>,
|
|
each of which must have the value of an <a href="#concept-id" title="concept-id">ID</a> of a <code><a href="#the-th-element">th</a></code> element taking
|
|
part in the same <a href="#concept-table" title="concept-table">table</a> as the
|
|
<code><a href="#the-td-element">td</a></code> or <code><a href="#the-th-element">th</a></code> element<span class="impl"> (as
|
|
defined by the <a href="#table-model">table model</a>)</span>.<p>A <code><a href="#the-th-element">th</a></code> element with <a href="#concept-id" title="concept-id">ID</a> <var title="">id</var> is said
|
|
to be <i>directly targeted</i> by all <code><a href="#the-td-element">td</a></code> and
|
|
<code><a href="#the-th-element">th</a></code> elements in the same <a href="#concept-table" title="concept-table">table</a> that have <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> attributes whose values
|
|
include as one of their tokens the <a href="#concept-id" title="concept-id">ID</a> <var title="">id</var>. A
|
|
<code><a href="#the-th-element">th</a></code> element <var title="">A</var> is said to be
|
|
<i>targeted</i> by a <code><a href="#the-th-element">th</a></code> or <code><a href="#the-td-element">td</a></code> element
|
|
<var title="">B</var> if either <var title="">A</var> is <i>directly
|
|
targeted</i> by <var title="">B</var> or if there exists an element
|
|
<var title="">C</var> that is itself <i>targeted</i> by the element
|
|
<var title="">B</var> and <var title="">A</var> is <i>directly
|
|
targeted</i> by <var title="">C</var>.<p>A <code><a href="#the-th-element">th</a></code> element must not be <i>targeted</i> by
|
|
itself.<div class="impl">
|
|
|
|
<p>The <code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code>, <code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">rowspan</a></code>, and <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> attributes take part in the
|
|
<a href="#table-model">table model</a>.</p>
|
|
|
|
</div><hr><p>The <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements implement
|
|
interfaces that inherit from the <code><a href="#htmltablecellelement">HTMLTableCellElement</a></code>
|
|
interface:<pre class="idl">interface <dfn id="htmltablecellelement">HTMLTableCellElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute unsigned long <a href="#dom-tdth-colspan" title="dom-tdth-colSpan">colSpan</a>;
|
|
attribute unsigned long <a href="#dom-tdth-rowspan" title="dom-tdth-rowSpan">rowSpan</a>;
|
|
[PutForwards=<a href="#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</a>] readonly attribute <a href="#domsettabletokenlist">DOMSettableTokenList</a> <a href="#dom-tdth-headers" title="dom-tdth-headers">headers</a>;
|
|
readonly attribute long <a href="#dom-tdth-cellindex" title="dom-tdth-cellIndex">cellIndex</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">cell</var> . <code title="dom-tdth-cellIndex"><a href="#dom-tdth-cellindex">cellIndex</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the position of the cell in the row's <code title="dom-tr-cells"><a href="#dom-tr-cells">cells</a></code> list. This does not necessarily
|
|
correspond to the <var title="">x</var>-position of the cell in
|
|
the table, since earlier cells might cover multiple rows or
|
|
columns.</p>
|
|
|
|
<p>Returns 0 if the element isn't in a row.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-tdth-colspan" title="dom-tdth-colSpan"><code>colSpan</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name. The value must be <a href="#limited-to-only-non-negative-numbers-greater-than-zero">limited to only non-negative
|
|
numbers greater than zero</a>.</p>
|
|
|
|
<p>The <dfn id="dom-tdth-rowspan" title="dom-tdth-rowSpan"><code>rowSpan</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name. Its default value, which must be used if <a href="#rules-for-parsing-non-negative-integers" title="rules for parsing non-negative integers">parsing the
|
|
attribute as a non-negative integer</a> returns an error, is 1.</p>
|
|
|
|
<p>The <dfn id="dom-tdth-headers" title="dom-tdth-headers"><code>headers</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
<p>The <dfn id="dom-tdth-cellindex" title="dom-tdth-cellIndex"><code>cellIndex</code></dfn>
|
|
IDL attribute must, if the element has a parent <code><a href="#the-tr-element">tr</a></code>
|
|
element, return the index of the cell's element in the parent
|
|
element's <code title="dom-tr-cells"><a href="#dom-tr-cells">cells</a></code> collection. If
|
|
there is no such parent element, then the attribute must return
|
|
0.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="processing-model-0"><span class="secno">4.9.12 </span>Processing model</h4>
|
|
|
|
<p>The various table elements and their content attributes together
|
|
define the <dfn id="table-model">table model</dfn>.</p>
|
|
|
|
<p>A <dfn id="concept-table" title="concept-table">table</dfn> consists of cells
|
|
aligned on a two-dimensional grid of <dfn id="concept-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 title="">0 ≤ <var title="">x</var> < <var title="">x<sub title="">width</sub></var></span>, and the <var title="">y</var>
|
|
coordinates are always in the range <span title="">0 ≤ <var title="">y</var> < <var title="">y<sub title="">height</sub></var></span>. If one or both of <var title="">x<sub title="">width</sub></var> and <var title="">y<sub title="">height</sub></var> are zero, then the table is empty (has
|
|
no slots). Tables correspond to <code><a href="#the-table-element">table</a></code> elements.</p>
|
|
|
|
<p>A <dfn id="concept-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 title=""><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 title=""><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>. Cells can
|
|
either be <em>data cells</em> or <em>header cells</em>. Data cells
|
|
correspond to <code><a href="#the-td-element">td</a></code> elements, and header cells correspond
|
|
to <code><a href="#the-th-element">th</a></code> elements. Cells of both types can have zero or
|
|
more associated header cells.</p>
|
|
|
|
<p>It is possible, in certain error cases, for two cells to occupy
|
|
the same slot.</p>
|
|
|
|
<p>A <dfn id="concept-row" title="concept-row">row</dfn> is a complete set of slots
|
|
from <span title=""><var title="">x</var>=0</span> to <span title=""><var title="">x</var>=<var title="">x<sub title="">width</sub></var>-1</span>, for a particular value of <var title="">y</var>. Rows correspond to <code><a href="#the-tr-element">tr</a></code> elements.</p>
|
|
|
|
<p>A <dfn id="concept-column" title="concept-column">column</dfn> is a complete set of
|
|
slots from <span title=""><var title="">y</var>=0</span> to <span title=""><var title="">y</var>=<var title="">y<sub title="">height</sub></var>-1</span>, for a particular value of <var title="">x</var>. Columns can correspond to <code><a href="#the-col-element">col</a></code>
|
|
elements. In the absence of <code><a href="#the-col-element">col</a></code> elements, columns are
|
|
implied.</p>
|
|
|
|
<p>A <dfn id="concept-row-group" title="concept-row-group">row group</dfn> is a set of
|
|
<a href="#concept-row" title="concept-row">rows</a> anchored at a slot (0, <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 title="">0 ≤ <var title="">x</var> < <var title="">x<sub title="">width</sub></var></span> and <span title=""><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="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> elements. Not every row is necessarily in a row
|
|
group.</p>
|
|
|
|
<p>A <dfn id="concept-column-group" title="concept-column-group">column group</dfn> is a set
|
|
of <a href="#concept-column" title="concept-column">columns</a> anchored at a slot
|
|
(<var title="">group<sub title="">x</sub></var>, 0) 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 title=""><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 title="">0 ≤ <var title="">y</var> < <var title="">y<sub title="">height</sub></var></span>. Column groups
|
|
correspond to <code><a href="#the-colgroup-element">colgroup</a></code> elements. Not every column is
|
|
necessarily in a column group.</p>
|
|
|
|
<p><a href="#concept-row-group" title="concept-row-group">Row groups</a> cannot overlap
|
|
each other. Similarly, <a href="#concept-column-group" title="concept-column-group">column
|
|
groups</a> cannot overlap each other.</p>
|
|
|
|
<p>A <a href="#concept-cell" title="concept-cell">cell</a> cannot cover slots that
|
|
are from two or more <a href="#concept-row-group" title="concept-row-group">row
|
|
groups</a>. It is, however, possible for a cell to be in multiple
|
|
<a href="#concept-column-group" title="concept-column-group">column groups</a>. All the
|
|
slots that form part of one cell are part of zero or one <a href="#concept-row-group" title="concept-row-group">row groups</a> and zero or more <a href="#concept-column-group" title="concept-column-group">column groups</a>.</p>
|
|
|
|
<p>In addition to <a href="#concept-cell" title="concept-cell">cells</a>, <a href="#concept-column" title="concept-column">columns</a>, <a href="#concept-row" title="concept-row">rows</a>, <a href="#concept-row-group" title="concept-row-group">row
|
|
groups</a>, and <a href="#concept-column-group" title="concept-column-group">column
|
|
groups</a>, <a href="#concept-table" title="concept-table">tables</a> can have a
|
|
<code><a href="#the-caption-element">caption</a></code> element associated with them. This gives the
|
|
table a heading, or legend.</p>
|
|
|
|
<p>A <dfn id="table-model-error">table model error</dfn> is an error with the data
|
|
represented by <code><a href="#the-table-element">table</a></code> elements and their
|
|
descendants. Documents must not have table model errors.</p>
|
|
|
|
|
|
<h5 id="forming-a-table"><span class="secno">4.9.12.1 </span>Forming a table</h5>
|
|
|
|
<p>To determine which elements correspond to which slots in a <a href="#concept-table" title="concept-table">table</a> associated with a
|
|
<code><a href="#the-table-element">table</a></code> element, to determine the dimensions of the table
|
|
(<var title="">x<sub title="">width</sub></var> and <var title="">y<sub title="">height</sub></var>), and to determine if
|
|
there are any <a href="#table-model-error" 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="">width</sub></var> be zero.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>Let <var title="">y<sub title="">height</sub></var> be zero.</p>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">pending <code><a href="#the-tfoot-element">tfoot</a></code> elements</var> be
|
|
a list of <code><a href="#the-tfoot-element">tfoot</a></code> elements, initially empty.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
<p>Let <var title="">the table</var> be the <a href="#concept-table" title="concept-table">table</a> represented by the
|
|
<code><a href="#the-table-element">table</a></code> element. The <var title="">x<sub title="">width</sub></var> and <var title="">y<sub title="">height</sub></var> variables give <var title="">the
|
|
table</var>'s dimensions. <var title="">The table</var> is
|
|
initially empty.</p>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
|
|
<p>If the <code><a href="#the-table-element">table</a></code> element has no children elements,
|
|
then return <var title="">the table</var> (which will be empty),
|
|
and abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Associate the first <code><a href="#the-caption-element">caption</a></code> element child of the
|
|
<code><a href="#the-table-element">table</a></code> element with <var title="">the table</var>. If
|
|
there are no such children, then it has no associated
|
|
<code><a href="#the-caption-element">caption</a></code> element.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the <var title="">current element</var> be the first
|
|
element child of the <code><a href="#the-table-element">table</a></code> element.</p>
|
|
|
|
<p>If a step in this algorithm ever requires the <var title="">current element</var> to be <dfn id="concept-table-advance" title="concept-table-advance">advanced to the next child of the
|
|
<code>table</code></dfn> when there is no such next child, then
|
|
the user agent must jump to the step labeled <i>end</i>, near the
|
|
end of this algorithm.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>While the <var title="">current element</var> is not one of the
|
|
following elements, <a href="#concept-table-advance" title="concept-table-advance">advance</a> the <var title="">current element</var> to the next child of the
|
|
<code><a href="#the-table-element">table</a></code>:</p>
|
|
|
|
<ul class="brief"><li><code><a href="#the-colgroup-element">colgroup</a></code></li>
|
|
<li><code><a href="#the-thead-element">thead</a></code></li>
|
|
<li><code><a href="#the-tbody-element">tbody</a></code></li>
|
|
<li><code><a href="#the-tfoot-element">tfoot</a></code></li>
|
|
<li><code><a href="#the-tr-element">tr</a></code></li>
|
|
</ul></li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">current element</var> is a
|
|
<code><a href="#the-colgroup-element">colgroup</a></code>, follow these substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p><i>Column groups</i>: Process the <var title="">current
|
|
element</var> according to the appropriate case below:</p>
|
|
|
|
<dl class="switch"><dt>If the <var title="">current element</var> has any
|
|
<code><a href="#the-col-element">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 of <span title=""><var title="">x<sub title="">width</sub></var></span>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the <var title="">current column</var> be the first
|
|
<code><a href="#the-col-element">col</a></code> element child of the <code><a href="#the-colgroup-element">colgroup</a></code>
|
|
element.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><i>Columns</i>: If the <var title="">current column</var>
|
|
<code><a href="#the-col-element">col</a></code> element has a <code title="attr-col-span"><a href="#attr-col-span">span</a></code> attribute, then parse its
|
|
value using the <a href="#rules-for-parsing-non-negative-integers">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="#the-col-element">col</a></code> element has no <code title="attr-col-span"><a href="#attr-col-span">span</a></code> attribute, or if trying to
|
|
parse the attribute's value resulted in an error or zero,
|
|
then let <var title="">span</var> be 1.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Increase <var title="">x<sub title="">width</sub></var> by
|
|
<var title="">span</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the last <var title="">span</var> <a href="#concept-column" title="concept-column">columns</a> in <var title="">the
|
|
table</var> correspond to the <var title="">current
|
|
column</var> <code><a href="#the-col-element">col</a></code> element.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">current column</var> is not the last
|
|
<code><a href="#the-col-element">col</a></code> element child of the <code><a href="#the-colgroup-element">colgroup</a></code>
|
|
element, then let the <var title="">current column</var> be
|
|
the next <code><a href="#the-col-element">col</a></code> element child of the
|
|
<code><a href="#the-colgroup-element">colgroup</a></code> element, and return to the step
|
|
labeled <i>columns</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let all the last <a href="#concept-column" title="concept-column">columns</a> in <var title="">the
|
|
table</var> from <span title="">x=<var title="">x<sub title="">start</sub></var></span> to <span title="">x=<var title="">x<sub title="">width</sub></var>-1</span> form a
|
|
new <a href="#concept-column-group" title="concept-column-group">column group</a>,
|
|
anchored at the slot (<var title="">x<sub title="">start</sub></var>, 0), with width <span title=""><var title="">x<sub title="">width</sub></var>-<var title="">x<sub title="">start</sub></var></span>,
|
|
corresponding to the <code><a href="#the-colgroup-element">colgroup</a></code> element.</p>
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>If the <var title="">current element</var> has no
|
|
<code><a href="#the-col-element">col</a></code> element children</dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the <code><a href="#the-colgroup-element">colgroup</a></code> element has a <code title="attr-colgroup-span"><a href="#attr-colgroup-span">span</a></code> attribute, then parse
|
|
its value using the <a href="#rules-for-parsing-non-negative-integers">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="#the-colgroup-element">colgroup</a></code> element has no
|
|
<code title="attr-colgroup-span"><a href="#attr-colgroup-span">span</a></code> attribute, or
|
|
if trying to parse the attribute's value resulted in an
|
|
error or zero, then let <var title="">span</var> be 1.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Increase <var title="">x<sub title="">width</sub></var> by
|
|
<var title="">span</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the last <var title="">span</var> <a href="#concept-column" title="concept-column">columns</a> in <var title="">the
|
|
table</var> form a new <a href="#concept-column-group" title="concept-column-group">column group</a>, anchored
|
|
at the slot (<span title=""><var title="">x<sub title="">width</sub></var>-<var title="">span</var></span>,
|
|
0), with width <var title="">span</var>, corresponding to
|
|
the <code><a href="#the-colgroup-element">colgroup</a></code> element.</p>
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#concept-table-advance" title="concept-table-advance">Advance</a> the <var title="">current element</var> to the next child of the
|
|
<code><a href="#the-table-element">table</a></code>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>While the <var title="">current element</var> is not one of
|
|
the following elements, <a href="#concept-table-advance" title="concept-table-advance">advance</a> the <var title="">current element</var> to the next child of the
|
|
<code><a href="#the-table-element">table</a></code>:</p>
|
|
|
|
<ul class="brief"><li><code><a href="#the-colgroup-element">colgroup</a></code></li>
|
|
<li><code><a href="#the-thead-element">thead</a></code></li>
|
|
<li><code><a href="#the-tbody-element">tbody</a></code></li>
|
|
<li><code><a href="#the-tfoot-element">tfoot</a></code></li>
|
|
<li><code><a href="#the-tr-element">tr</a></code></li>
|
|
</ul></li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">current element</var> is a
|
|
<code><a href="#the-colgroup-element">colgroup</a></code> element, jump to the step labeled
|
|
<i>column groups</i> above.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">y<sub title="">current</sub></var> be
|
|
zero.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the <var title="">list of downward-growing cells</var> be
|
|
an empty list.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><i>Rows</i>: While the <var title="">current element</var> is
|
|
not one of the following elements, <a href="#concept-table-advance" title="concept-table-advance">advance</a> the <var title="">current element</var> to the next child of the
|
|
<code><a href="#the-table-element">table</a></code>:</p>
|
|
|
|
<ul class="brief"><li><code><a href="#the-thead-element">thead</a></code></li>
|
|
<li><code><a href="#the-tbody-element">tbody</a></code></li>
|
|
<li><code><a href="#the-tfoot-element">tfoot</a></code></li>
|
|
<li><code><a href="#the-tr-element">tr</a></code></li>
|
|
</ul></li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">current element</var> is a
|
|
<code><a href="#the-tr-element">tr</a></code>, then run the <a href="#algorithm-for-processing-rows">algorithm for processing
|
|
rows</a>, <a href="#concept-table-advance" title="concept-table-advance">advance</a>
|
|
the <var title="">current element</var> to the next child of the
|
|
<code><a href="#the-table-element">table</a></code>, and return to the step labeled
|
|
<i>rows</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Run the <a href="#algorithm-for-ending-a-row-group">algorithm for ending a row group</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">current element</var> is a
|
|
<code><a href="#the-tfoot-element">tfoot</a></code>, then add that element to the list of <var title="">pending <code><a href="#the-tfoot-element">tfoot</a></code> elements</var>, <a href="#concept-table-advance" title="concept-table-advance">advance</a> the <var title="">current element</var> to the next child of the
|
|
<code><a href="#the-table-element">table</a></code>, and return to the step labeled
|
|
<i>rows</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>The <var title="">current element</var> is either a
|
|
<code><a href="#the-thead-element">thead</a></code> or a <code><a href="#the-tbody-element">tbody</a></code>.</p>
|
|
|
|
<p>Run the <a href="#algorithm-for-processing-row-groups">algorithm for processing row groups</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#concept-table-advance" title="concept-table-advance">Advance</a> the <var title="">current element</var> to the next child of the
|
|
<code><a href="#the-table-element">table</a></code>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Return to the step labeled <i>rows</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><i>End</i>: For each <code><a href="#the-tfoot-element">tfoot</a></code> element in the list of
|
|
<var title="">pending <code><a href="#the-tfoot-element">tfoot</a></code> elements</var>, in tree
|
|
order, run the <a href="#algorithm-for-processing-row-groups">algorithm for processing row
|
|
groups</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there exists a <a href="#concept-row" title="concept-row">row</a> or <a href="#concept-column" title="concept-column">column</a> in <var title="">the
|
|
table</var> containing only <a href="#concept-slots" title="concept-slots">slots</a> that do not have a <a href="#concept-cell" title="concept-cell">cell</a> anchored to them, then this is a
|
|
<a href="#table-model-error">table model error</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Return <var title="">the table</var>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The <dfn id="algorithm-for-processing-row-groups">algorithm for processing row groups</dfn>, which is
|
|
invoked by the set of steps above for processing
|
|
<code><a href="#the-thead-element">thead</a></code>, <code><a href="#the-tbody-element">tbody</a></code>, and <code><a href="#the-tfoot-element">tfoot</a></code>
|
|
elements, is:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">y<sub title="">start</sub></var> have the
|
|
value of <var title="">y<sub title="">height</sub></var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>For each <code><a href="#the-tr-element">tr</a></code> element that is a child of the element
|
|
being processed, in tree order, run the <a href="#algorithm-for-processing-rows">algorithm for
|
|
processing rows</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
|
|
<p>If <span title=""><var title="">y<sub title="">height</sub></var> > <var title="">y<sub title="">start</sub></var></span>, then let all the last <a href="#concept-row" title="concept-row">rows</a> in <var title="">the table</var>
|
|
from <span title="">y=<var title="">y<sub title="">start</sub></var></span>
|
|
to <span title="">y=<var title="">y<sub title="">height</sub></var>-1</span> form a new <a href="#concept-row-group" title="concept-row-group">row group</a>, anchored at the slot
|
|
with coordinate (0, <var title="">y<sub title="">start</sub></var>), with height <span title=""><var title="">y<sub title="">height</sub></var>-<var title="">y<sub title="">start</sub></var></span>, corresponding to the element
|
|
being processed.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Run the <a href="#algorithm-for-ending-a-row-group">algorithm for ending a row group</a>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The <dfn id="algorithm-for-ending-a-row-group">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>While <var title="">y<sub title="">current</sub></var> is less
|
|
than <var title="">y<sub title="">height</sub></var>, follow these
|
|
steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Run the <a href="#algorithm-for-growing-downward-growing-cells">algorithm for growing downward-growing
|
|
cells</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Increase <var title="">y<sub title="">current</sub></var> by
|
|
1.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>Empty the <var title="">list of downward-growing
|
|
cells</var>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The <dfn id="algorithm-for-processing-rows">algorithm for processing rows</dfn>, which is invoked by
|
|
the set of steps above for processing <code><a href="#the-tr-element">tr</a></code> elements,
|
|
is:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If <var title="">y<sub title="">height</sub></var> is equal to
|
|
<var title="">y<sub title="">current</sub></var>, then increase
|
|
<var title="">y<sub title="">height</sub></var> by 1. (<var title="">y<sub title="">current</sub></var> is never
|
|
<em>greater</em> than <var title="">y<sub title="">height</sub></var>.)</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">x<sub title="">current</sub></var> be 0.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Run the <a href="#algorithm-for-growing-downward-growing-cells">algorithm for growing downward-growing
|
|
cells</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <code><a href="#the-tr-element">tr</a></code> element being processed has no
|
|
<code><a href="#the-td-element">td</a></code> or <code><a href="#the-th-element">th</a></code> element children, then increase
|
|
<var title="">y<sub title="">current</sub></var> by 1, abort this
|
|
set of steps, and return to the algorithm above.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">current cell</var> be the first
|
|
<code><a href="#the-td-element">td</a></code> or <code><a href="#the-th-element">th</a></code> element in the <code><a href="#the-tr-element">tr</a></code>
|
|
element being processed.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><i>Cells</i>: While <var title="">x<sub title="">current</sub></var> is less than <var title="">x<sub title="">width</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 equal to
|
|
<var title="">x<sub title="">width</sub></var>, increase <var title="">x<sub title="">width</sub></var> by 1. (<var title="">x<sub title="">current</sub></var> is never
|
|
<em>greater</em> than <var title="">x<sub title="">width</sub></var>.)</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">current cell</var> has a <code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code> attribute, then <a href="#rules-for-parsing-non-negative-integers" title="rules for parsing non-negative integers">parse that
|
|
attribute's value</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="#attr-tdth-rowspan">rowspan</a></code> attribute, then <a href="#rules-for-parsing-non-negative-integers" title="rules for
|
|
parsing non-negative integers">parse that attribute's
|
|
value</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 title=""><var title="">x<sub title="">width</sub></var> < <var title="">x<sub title="">current</sub></var>+<var title="">colspan</var></span>,
|
|
then let <var title="">x<sub title="">width</sub></var> be
|
|
<span title=""><var title="">x<sub title="">current</sub></var>+<var title="">colspan</var></span>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <span title=""><var title="">y<sub title="">height</sub></var> < <var title="">y<sub title="">current</sub></var>+<var title="">rowspan</var></span>,
|
|
then let <var title="">y<sub title="">height</sub></var> be
|
|
<span title=""><var title="">y<sub title="">current</sub></var>+<var title="">rowspan</var></span>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the slots with coordinates (<var title="">x</var>, <var title="">y</var>) such that <span title=""><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 title=""><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="#concept-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="#the-th-element">th</a></code> element, let this new cell <var title="">c</var>
|
|
be a header cell; otherwise, let it be a data cell.</p>
|
|
|
|
<p>To establish which header cells apply to the <var title="">current cell</var> element, use the <a href="#algorithm-for-assigning-header-cells">algorithm for
|
|
assigning header cells</a> described in the next section.</p>
|
|
|
|
<p>If any of the slots involved already had a <a href="#concept-cell" title="concept-cell">cell</a> covering them, then this is a
|
|
<a href="#table-model-error">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="#the-td-element">td</a></code>
|
|
or <code><a href="#the-th-element">th</a></code> element in the <code><a href="#the-tr-element">tr</a></code> element being
|
|
processed, then increase <var title="">y<sub title="">current</sub></var> by 1, abort this set of steps, and
|
|
return to the algorithm above.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">current cell</var> be the next
|
|
<code><a href="#the-td-element">td</a></code> or <code><a href="#the-th-element">th</a></code> element in the <code><a href="#the-tr-element">tr</a></code>
|
|
element being processed.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Return to the step labelled <i>cells</i>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>When the algorithms above require the user agent to run the
|
|
<dfn id="algorithm-for-growing-downward-growing-cells">algorithm for growing downward-growing cells</dfn>, the user
|
|
agent must, for 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>, if
|
|
any, extend the <a href="#concept-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 title=""><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>.</p>
|
|
|
|
|
|
|
|
|
|
<h5 id="header-and-data-cell-semantics"><span class="secno">4.9.12.2 </span>Forming relationships between data cells and header cells</h5>
|
|
|
|
<p>Each cell can be assigned zero or more header cells. The
|
|
<dfn id="algorithm-for-assigning-header-cells">algorithm for assigning header cells</dfn> to a cell <var title="">principal cell</var> is as follows.</p>
|
|
|
|
<ol><!-- INITIALIZATION --><li>
|
|
|
|
<p>Let <var title="">header list</var> be an empty list of
|
|
cells.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let (<var title="">principal<sub title="">x</sub></var>, <var title="">principal<sub title="">y</sub></var>) be the coordinate
|
|
of the slot to which the <var title="">principal cell</var> is
|
|
anchored.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<dl class="switch"><dt>If the <var title="">principal cell</var> has a <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> attribute specified</dt>
|
|
|
|
<dd>
|
|
|
|
<!-- HEADERS="" -->
|
|
|
|
<ol><li>
|
|
|
|
<p>Take the value of the <var title="">principal cell</var>'s
|
|
<code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> attribute and
|
|
<a href="#split-a-string-on-spaces" title="split a string on spaces">split it on
|
|
spaces</a>, letting <var title="">id list</var> be the list
|
|
of tokens obtained.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<p>For each token in the <var title="">id list</var>, if the
|
|
first element in the <code><a href="#document">Document</a></code> with an <a href="#concept-id" title="concept-id">ID</a> equal to
|
|
the token is a cell in the same <a href="#concept-table" title="concept-table">table</a>, and that cell is not the
|
|
<var title="">principal cell</var>, then add that cell to <var title="">header list</var>.</p>
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>If <var title="">principal cell</var> does not have a <code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code> attribute specified</dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">principal<sub title="">width</sub></var>
|
|
be the width of the <var title="">principal cell</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">principal<sub title="">height</sub></var>
|
|
be the height of the <var title="">principal cell</var>.</p>
|
|
|
|
</li>
|
|
|
|
|
|
<!-- HORIZONTAL -->
|
|
|
|
<li>
|
|
|
|
<p>For each value of <var title="">y</var> from <var title="">principal<sub title="">y</sub></var> to <span title=""><var title="">principal<sub title="">y</sub></var>+<var title="">principal<sub title="">height</sub></var>-1</span>,
|
|
run the <a href="#internal-algorithm-for-scanning-and-assigning-header-cells">internal algorithm for scanning and assigning
|
|
header cells</a>, with the <var title="">principal
|
|
cell</var>, the <var title="">header list</var>, the initial
|
|
coordinate (<var title="">principal<sub title="">x</sub></var>,<var title="">y</var>), and the
|
|
increments <span title="">Δ<var title="">x</var>=−1</span>
|
|
and <span title="">Δ<var title="">y</var>=0</span>.</p>
|
|
|
|
</li>
|
|
|
|
|
|
<!-- VERTICAL -->
|
|
|
|
<li>
|
|
|
|
<p>For each value of <var title="">x</var> from <var title="">principal<sub title="">x</sub></var> to <span title=""><var title="">principal<sub title="">x</sub></var>+<var title="">principal<sub title="">width</sub></var>-1</span>,
|
|
run the <a href="#internal-algorithm-for-scanning-and-assigning-header-cells">internal algorithm for scanning and assigning
|
|
header cells</a>, with the <var title="">principal
|
|
cell</var>, the <var title="">header list</var>, the initial
|
|
coordinate (<var title="">x</var>,<var title="">principal<sub title="">y</sub></var>), and the increments <span title="">Δ<var title="">x</var>=0</span> and <span title="">Δ<var title="">y</var>=−1</span>.</p>
|
|
|
|
</li>
|
|
|
|
|
|
<!-- ROW GROUP HEADERS -->
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">principal cell</var> is anchored in a
|
|
<a href="#concept-row-group" title="concept-row-group">row group</a>, then add all
|
|
header cells that are <a href="#row-group-header" title="row group header">row group
|
|
headers</a> and are anchored in the same row group with an
|
|
<var title="">x</var>-coordinate less than or equal to
|
|
<span title=""><var title="">principal<sub title="">x</sub></var>+<var title="">principal<sub title="">width</sub></var>-1</span> and
|
|
a <var title="">y</var>-coordinate less than or equal to
|
|
<span title=""><var title="">principal<sub title="">y</sub></var>+<var title="">principal<sub title="">height</sub></var>-1</span> to
|
|
<var title="">header list</var>.</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<!-- COLUMN GROUP HEADERS -->
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">principal cell</var> is anchored in a
|
|
<a href="#concept-column-group" title="concept-column-group">column group</a>, then
|
|
add all header cells that are <a href="#column-group-header" title="column group
|
|
header">column group headers</a> and are anchored in the
|
|
same column group with an <var title="">x</var>-coordinate
|
|
less than or equal to <span title=""><var title="">principal<sub title="">x</sub></var>+<var title="">principal<sub title="">width</sub></var>-1</span> and a <var title="">y</var>-coordinate less than or equal to <span title=""><var title="">principal<sub title="">y</sub></var>+<var title="">principal<sub title="">height</sub></var>-1</span> to
|
|
<var title="">header list</var>.</p>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl></li>
|
|
|
|
|
|
<!-- CLEANUP -->
|
|
|
|
<li>
|
|
|
|
<p>Remove all the <a href="#empty-cell" title="empty cell">empty cells</a> from
|
|
the <var title="">header list</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Remove any duplicates from the <var title="">header
|
|
list</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Remove <var title="">principal cell</var> from the <var title="">header list</var> if it is there.</p>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Assign the headers in the <var title="">header list</var> to
|
|
the <var title="">principal cell</var>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The <dfn id="internal-algorithm-for-scanning-and-assigning-header-cells">internal algorithm for scanning and assigning header
|
|
cells</dfn>, given a <var title="">principal cell</var>, a <var title="">header list</var>, an initial coordinate (<var title="">initial<sub title="">x</sub></var>, <var title="">initial<sub title="">y</sub></var>), and Δ<var title="">x</var> and Δ<var title="">y</var> increments, is as
|
|
follows:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">x</var> equal <var title="">initial<sub title="">x</sub></var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">y</var> equal <var title="">initial<sub title="">y</sub></var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">opaque headers</var> be an empty list of
|
|
cells.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<dl class="switch"><dt>If <var title="">principal cell</var> is a header cell</dt>
|
|
|
|
<dd><p>Let <var title="">in header block</var> be true, and let
|
|
<var title="">headers from current header block</var> be a list
|
|
of cells containing just the <var title="">principal
|
|
cell</var>.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>Let <var title="">in header block</var> be false and let
|
|
<var title="">headers from current header block</var> be an
|
|
empty list of cells.</p>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p><i>Loop</i>: Increment <var title="">x</var> by Δ<var title="">x</var>; increment <var title="">y</var> by Δ<var title="">y</var>.</p>
|
|
|
|
<p class="note">For each invocation of this algorithm, one of
|
|
Δ<var title="">x</var> and Δ<var title="">y</var> will
|
|
be −1, and the other will be 0.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If either <var title="">x</var> or <var title="">y</var> is
|
|
less than 0, then abort this internal algorithm.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is no cell covering slot (<var title="">x</var>,
|
|
<var title="">y</var>), or if there is more than one cell
|
|
covering slot (<var title="">x</var>, <var title="">y</var>),
|
|
return to the substep labeled <i>loop</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">current cell</var> be the cell covering
|
|
slot (<var title="">x</var>, <var title="">y</var>).</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<dl class="switch"><dt>If <var title="">current cell</var> is a header cell</dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li><p>Set <var title="">in header block</var> to
|
|
true.</li>
|
|
|
|
<li><p>Add <var title="">current cell</var> to <var title="">headers from current header block</var>.</li>
|
|
|
|
<li><p>Let <var title="">blocked</var> be false.</li>
|
|
|
|
<li>
|
|
|
|
<dl class="switch"><dt>If Δ<var title="">x</var> is 0</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If there are any cells in the <var title="">opaque
|
|
headers</var> list anchored with the same <var title="">x</var>-coordinate as the <var title="">current
|
|
cell</var>, and with the same width as <var title="">current
|
|
cell</var>, then let <var title="">blocked</var> be
|
|
true.</p>
|
|
|
|
<p>If the <var title="">current cell</var> is not a
|
|
<a href="#column-header">column header</a>, then let <var title="">blocked</var> be true.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If Δ<var title="">y</var> is 0</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If there are any cells in the <var title="">opaque
|
|
headers</var> list anchored with the same <var title="">y</var>-coordinate as the <var title="">current
|
|
cell</var>, and with the same height as <var title="">current cell</var>, then let <var title="">blocked</var> be true.</p>
|
|
|
|
<p>If the <var title="">current cell</var> is not a
|
|
<a href="#row-header">row header</a>, then let <var title="">blocked</var> be true.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>If <var title="">blocked</var> is false, then add the
|
|
<var title="">current cell</var> to the <var title="">headers
|
|
list</var>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>If <var title="">current cell</var> is a data cell and <var title="">in header block</var> is true</dt>
|
|
|
|
<dd><p>Set <var title="">in header block</var> to false. Add
|
|
all the cells in <var title="">headers from current header
|
|
block</var> to the <var title="">opaque headers</var> list, and
|
|
empty the <var title="">headers from current header block</var>
|
|
list.</p>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>Return to the step labeled <i>loop</i>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>A header cell anchored at the slot with coordinate (<var title="">x</var>, <var title="">y</var>) with width <var title="">width</var> and height <var title="">height</var> is said
|
|
to be a <dfn id="column-header">column header</dfn> if any of the following conditions
|
|
are true:</p>
|
|
|
|
<ul><li>The cell's <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute
|
|
is in the <a href="#attr-th-scope-col" title="attr-th-scope-col">column</a> state, or</li>
|
|
|
|
<li>The cell's <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute
|
|
is in the <a href="#attr-th-scope-auto" title="attr-th-scope-auto">auto</a> state, and
|
|
there are no data cells in any of the cells covering slots with
|
|
<var title="">y</var>-coordinates <var title="">y</var>
|
|
.. <span title=""><var title="">y</var>+<var title="">height</var>-1</span>.</li>
|
|
|
|
</ul><p>A header cell anchored at the slot with coordinate (<var title="">x</var>, <var title="">y</var>) with width <var title="">width</var> and height <var title="">height</var> is said
|
|
to be a <dfn id="row-header">row header</dfn> if any of the following conditions
|
|
are true:</p>
|
|
|
|
<ul><li>The cell's <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute
|
|
is in the <a href="#attr-th-scope-row" title="attr-th-scope-row">row</a> state, or</li>
|
|
|
|
<li>The cell's <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute
|
|
is in the <a href="#attr-th-scope-auto" title="attr-th-scope-auto">auto</a> state, the
|
|
cell is not a <a href="#column-header">column header</a>, and there are no data
|
|
cells in any of the cells covering slots with <var title="">x</var>-coordinates <var title="">x</var> .. <span title=""><var title="">x</var>+<var title="">width</var>-1</span>.</li>
|
|
|
|
</ul><p>A header cell is said to be a <dfn id="column-group-header">column group header</dfn> if
|
|
its <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute is in the
|
|
<a href="#attr-th-scope-colgroup" title="attr-th-scope-colgroup">column group</a> state.</p>
|
|
|
|
<p>A header cell is said to be a <dfn id="row-group-header">row group header</dfn> if
|
|
its <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute is in the
|
|
<a href="#attr-th-scope-rowgroup" title="attr-th-scope-rowgroup">row group</a> state.</p>
|
|
|
|
<p>A cell is said to be an <dfn id="empty-cell">empty cell</dfn> if it contains no
|
|
elements and its text content, if any, consists only of
|
|
<a href="#white_space">White_Space</a> characters.</p>
|
|
|
|
</div><h4 id="examples"><span class="secno">4.9.13 </span>Examples</h4><p><i>This section is non-normative.</i><p>The following shows how might one mark up the bottom part of
|
|
table 45 of the <cite>Smithsonian physical tables, Volume
|
|
71</cite>:</p><pre><table>
|
|
<caption>Specification values: <b>Steel</b>, <b>Castings</b>,
|
|
Ann. A.S.T.M. A27-16, Class B;* P max. 0.06; S max. 0.05.</caption>
|
|
<thead>
|
|
<tr>
|
|
<th rowspan=2>Grade.</th>
|
|
<th rowspan=2>Yield Point.</th>
|
|
<th colspan=2>Ultimate tensile strength</th>
|
|
<th rowspan=2>Per cent elong. 50.8mm or 2 in.</th>
|
|
<th rowspan=2>Per cent reduct. area.</th>
|
|
</tr>
|
|
<tr>
|
|
<th>kg/mm<sup>2</sup></th>
|
|
<th>lb/in<sup>2</sup></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Hard</td>
|
|
<td>0.45 ultimate</td>
|
|
<td>56.2</td>
|
|
<td>80,000</td>
|
|
<td>15</td>
|
|
<td>20</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Medium</td>
|
|
<td>0.45 ultimate</td>
|
|
<td>49.2</td>
|
|
<td>70,000</td>
|
|
<td>18</td>
|
|
<td>25</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Soft</td>
|
|
<td>0.45 ultimate</td>
|
|
<td>42.2</td>
|
|
<td>60,000</td>
|
|
<td>22</td>
|
|
<td>30</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></pre><p>This table could look like this:<table id="table-example-1"><caption>Specification values: <b>Steel</b>, <b>Castings</b>,
|
|
Ann. A.S.T.M. A27-16, Class B;* P max. 0.06; S max. 0.05.</caption>
|
|
<thead><tr><th rowspan="2">Grade.</th>
|
|
<th rowspan="2">Yield Point.</th>
|
|
<th colspan="2">Ultimate tensile strength</th>
|
|
<th rowspan="2">Per cent elong. 50.8 mm or 2 in.</th>
|
|
<th rowspan="2">Per cent reduct. area.</th>
|
|
<tr><th>kg/mm<sup>2</sup></th>
|
|
<th>lb/in<sup>2</sup></th>
|
|
<tbody><tr><td>Hard</td>
|
|
<td>0.45 ultimate</td>
|
|
<td>56.2</td>
|
|
<td>80,000</td>
|
|
<td>15</td>
|
|
<td>20</td>
|
|
<tr><td>Medium</td>
|
|
<td>0.45 ultimate</td>
|
|
<td>49.2</td>
|
|
<td>70,000</td>
|
|
<td>18</td>
|
|
<td>25</td>
|
|
<tr><td>Soft</td>
|
|
<td>0.45 ultimate</td>
|
|
<td>42.2</td>
|
|
<td>60,000</td>
|
|
<td>22</td>
|
|
<td>30</td>
|
|
</table><hr><p>The following shows how one might mark up the gross margin table
|
|
on page 46 of Apple, Inc's 10-K filing for fiscal year 2008:<pre><table>
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
<th>2008
|
|
<th>2007
|
|
<th>2006
|
|
<tbody>
|
|
<tr>
|
|
<th>Net sales
|
|
<td>$ 32,479
|
|
<td>$ 24,006
|
|
<td>$ 19,315
|
|
<tr>
|
|
<th>Cost of sales
|
|
<td> 21,334
|
|
<td> 15,852
|
|
<td> 13,717
|
|
<tbody>
|
|
<tr>
|
|
<th>Gross margin
|
|
<td>$ 11,145
|
|
<td>$ 8,154
|
|
<td>$ 5,598
|
|
<tfoot>
|
|
<tr>
|
|
<th>Gross margin percentage
|
|
<td>34.3%
|
|
<td>34.0%
|
|
<td>29.0%
|
|
</table></pre><hr><p>The following shows how one might mark up the operating expenses
|
|
table from lower on the same page of that document:<pre><table>
|
|
<colgroup> <col>
|
|
<colgroup> <col> <col> <col>
|
|
<thead>
|
|
<tr> <th> <th>2008 <th>2007 <th>2006
|
|
<tbody>
|
|
<tr> <th scope=rowgroup> Research and development
|
|
<td> $ 1,109 <td> $ 782 <td> $ 712
|
|
<tr> <th scope=row> Percentage of net sales
|
|
<td> 3.4% <td> 3.3% <td> 3.7%
|
|
<tbody>
|
|
<tr> <th scope=rowgroup> Selling, general, and administrative
|
|
<td> $ 3,761 <td> $ 2,963 <td> $ 2,433
|
|
<tr> <th scope=row> Percentage of net sales
|
|
<td> 11.6% <td> 12.3% <td> 12.6%
|
|
</table></pre><p>This table could look like this:<table class="apple-table-examples e2"><thead><tr><th> <th>2008 <th>2007 <th>2006
|
|
<tbody><tr><th scope="rowgroup"> Research and development
|
|
<td> $ 1,109 <td> $ 782 <td> $ 712
|
|
<tr><th scope="row"> Percentage of net sales
|
|
<td> 3.4% <td> 3.3% <td> 3.7%
|
|
<tbody><tr><th scope="rowgroup"> Selling, general, and administrative
|
|
<td> $ 3,761 <td> $ 2,963 <td> $ 2,433
|
|
<tr><th scope="row"> Percentage of net sales
|
|
<td> 11.6% <td> 12.3% <td> 12.6%
|
|
</table><h3 id="forms"><span class="secno">4.10 </span>Forms</h3><h4 id="introduction-1"><span class="secno">4.10.1 </span>Introduction</h4><p><i>This section is non-normative.</i><p>A form is a component of a Web page that has form controls, such
|
|
as text fields, buttons, checkboxes, range controls, or color
|
|
pickers. A user can interact with such a form, providing data that
|
|
can then be sent to the server for further processing (e.g.
|
|
returning the results of a search or calculation). No client-side
|
|
scripting is needed in many cases, though an API is available so
|
|
that scripts can augment the user experience or use forms for
|
|
purposes other than submitting data to a server.<p>Writing a form consists of several steps, which can be performed
|
|
in any order: writing the user interface, implementing the
|
|
server-side processing, and configuring the user interface to
|
|
communicate with the server.<h5 id="writing-a-form-s-user-interface"><span class="secno">4.10.1.1 </span>Writing a form's user interface</h5><p><i>This section is non-normative.</i><p>For the purposes of this brief introduction, we will create a
|
|
pizza ordering form.<p>Any form starts with a <code><a href="#the-form-element">form</a></code> element, inside which
|
|
are placed the controls. Most controls are represented by the
|
|
<code><a href="#the-input-element">input</a></code> element, which by default provides a one-line
|
|
text field. To label a control, the <code><a href="#the-label-element">label</a></code> element is
|
|
used; the label text and the control itself go inside the
|
|
<code><a href="#the-label-element">label</a></code> element. Each part of a form is considered a
|
|
<a href="#paragraph">paragraph</a>, and is typically separated from other parts
|
|
using <code><a href="#the-p-element">p</a></code> elements. Putting this together, here is how
|
|
one might ask for the customer's name:<pre><strong><form>
|
|
<p><label>Customer name: <input></label></p>
|
|
</form></strong></pre><p>To let the user select the size of the pizza, we can use a set of
|
|
radio buttons. Radio buttons also use the <code><a href="#the-input-element">input</a></code>
|
|
element, this time with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute with the value <code title="attr-input-type-radio"><a href="#radio-button-state">radio</a></code>. To make the radio
|
|
buttons work as a group, they are given a common name using the
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute. To group a batch
|
|
of controls together, such as, in this case, the radio buttons, one
|
|
can use the <code><a href="#the-fieldset-element">fieldset</a></code> element. The title of such a group
|
|
of controls is given by the first element in the
|
|
<code><a href="#the-fieldset-element">fieldset</a></code>, which has to be a <code><a href="#the-legend-element">legend</a></code>
|
|
element.<pre><form>
|
|
<p><label>Customer name: <input></label></p>
|
|
<strong> <fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size> Small </label></p>
|
|
<p><label> <input type=radio name=size> Medium </label></p>
|
|
<p><label> <input type=radio name=size> Large </label></p>
|
|
</fieldset></strong>
|
|
</form></pre><p class="note">Changes from the previous step are highlighted.<p>To pick toppings, we can use checkboxes. These use the
|
|
<code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute with the value <code title="attr-input-type-checkbox"><a href="#checkbox-state">checkbox</a></code>:<pre><form>
|
|
<p><label>Customer name: <input></label></p>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size> Small </label></p>
|
|
<p><label> <input type=radio name=size> Medium </label></p>
|
|
<p><label> <input type=radio name=size> Large </label></p>
|
|
</fieldset>
|
|
<strong> <fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox> Bacon </label></p>
|
|
<p><label> <input type=checkbox> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox> Onion </label></p>
|
|
<p><label> <input type=checkbox> Mushroom </label></p>
|
|
</fieldset></strong>
|
|
</form></pre><p>The pizzeria for which this form is being written is always
|
|
making mistakes, so it needs a way to contact the customer. For this
|
|
purpose, we can use form controls specifically for telephone numbers
|
|
(<code><a href="#the-input-element">input</a></code> elements with their <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute set to <code title="attr-input-type-tel"><a href="#telephone-state">tel</a></code>) and e-mail addresses
|
|
(<code><a href="#the-input-element">input</a></code> elements with their <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute set to <code title="attr-input-type-email"><a href="#e-mail-state">email</a></code>):<pre><form>
|
|
<p><label>Customer name: <input></label></p>
|
|
<strong> <p><label>Telephone: <input type=tel></label></p>
|
|
<p><label>E-mail address: <input type=email></label></p></strong>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size> Small </label></p>
|
|
<p><label> <input type=radio name=size> Medium </label></p>
|
|
<p><label> <input type=radio name=size> Large </label></p>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox> Bacon </label></p>
|
|
<p><label> <input type=checkbox> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox> Onion </label></p>
|
|
<p><label> <input type=checkbox> Mushroom </label></p>
|
|
</fieldset>
|
|
</form></pre><p>We can use an <code><a href="#the-input-element">input</a></code> element with its <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute set to <code title="attr-input-type-time"><a href="#time-state">time</a></code> to ask for a delivery
|
|
time. Many of these form controls have attributes to control exactly
|
|
what values can be specified; in this case, three attributes of
|
|
particular interest are <code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>, and <code title="attr-input-step"><a href="#attr-input-step">step</a></code>. These set the minimum time, the
|
|
maximum time, and the interval between allowed values (in
|
|
seconds). This pizzeria only delivers between 11am and 9pm, and
|
|
doesn't promise anything better than 15 minute increments, which we
|
|
can mark up as follows:<pre><form>
|
|
<p><label>Customer name: <input></label></p>
|
|
<p><label>Telephone: <input type=tel></label></p>
|
|
<p><label>E-mail address: <input type=email></label></p>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size> Small </label></p>
|
|
<p><label> <input type=radio name=size> Medium </label></p>
|
|
<p><label> <input type=radio name=size> Large </label></p>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox> Bacon </label></p>
|
|
<p><label> <input type=checkbox> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox> Onion </label></p>
|
|
<p><label> <input type=checkbox> Mushroom </label></p>
|
|
</fieldset>
|
|
<strong> <p><label>Preferred delivery time: <input type=time min="11:00" max="21:00" step="900"></label></p></strong>
|
|
</form></pre><p>The <code><a href="#the-textarea-element">textarea</a></code> element can be used to provide a
|
|
free-form text field. In this instance, we are going to use it to
|
|
provide a space for the customer to give delivery instructions:<pre><form>
|
|
<p><label>Customer name: <input></label></p>
|
|
<p><label>Telephone: <input type=tel></label></p>
|
|
<p><label>E-mail address: <input type=email></label></p>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size> Small </label></p>
|
|
<p><label> <input type=radio name=size> Medium </label></p>
|
|
<p><label> <input type=radio name=size> Large </label></p>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox> Bacon </label></p>
|
|
<p><label> <input type=checkbox> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox> Onion </label></p>
|
|
<p><label> <input type=checkbox> Mushroom </label></p>
|
|
</fieldset>
|
|
<p><label>Preferred delivery time: <input type=time min="11:00" max="21:00" step="900"></label></p>
|
|
<strong> <p><label>Delivery instructions: <textarea></textarea></label></p></strong>
|
|
</form></pre><p>Finally, to make the form submittable we use the
|
|
<code><a href="#the-button-element">button</a></code> element:<pre><form>
|
|
<p><label>Customer name: <input></label></p>
|
|
<p><label>Telephone: <input type=tel></label></p>
|
|
<p><label>E-mail address: <input type=email></label></p>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size> Small </label></p>
|
|
<p><label> <input type=radio name=size> Medium </label></p>
|
|
<p><label> <input type=radio name=size> Large </label></p>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox> Bacon </label></p>
|
|
<p><label> <input type=checkbox> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox> Onion </label></p>
|
|
<p><label> <input type=checkbox> Mushroom </label></p>
|
|
</fieldset>
|
|
<p><label>Preferred delivery time: <input type=time min="11:00" max="21:00" step="900"></label></p>
|
|
<p><label>Delivery instructions: <textarea></textarea></label></p>
|
|
<strong> <p><button>Submit order</button></p></strong>
|
|
</form></pre><h5 id="implementing-the-server-side-processing-for-a-form"><span class="secno">4.10.1.2 </span>Implementing the server-side processing for a form</h5><p><i>This section is non-normative.</i><p>The exact details for writing a server-side processor are out of
|
|
scope for this specification. For the purposes of this introduction,
|
|
we will assume that the script at <code title="">https://pizza.example.com/order.cgi</code> is configured to
|
|
accept submissions using the <code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</a></code>
|
|
format, expecting the following parameters sent in an HTTP POST
|
|
body:<dl><dt><code title="">custname</code></dt>
|
|
<dd>Customer's name</dd>
|
|
|
|
<dt><code title="">custtel</code></dt>
|
|
<dd>Customer's telephone number</dd>
|
|
|
|
<dt><code title="">custemail</code></dt>
|
|
<dd>Customer's e-mail address</dd>
|
|
|
|
<dt><code title="">size</code></dt>
|
|
<dd>The pizza size, either <code title="">small</code>, <code title="">medium</code>, or <code title="">large</code></dd>
|
|
|
|
<dt><code title="">toppings</code></dt>
|
|
<dd>The topping, specified once for each selected topping, with the allowed values being <code title="">bacon</code>, <code title="">cheese</code>, <code title="">onion</code>, and <code title="">mushroom</code></dd>
|
|
|
|
<dt><code title="">delivery</code></dt>
|
|
<dd>The requested delivery time</dd>
|
|
|
|
<dt><code title="">comments</code></dt>
|
|
<dd>The delivery instructions</dd>
|
|
|
|
</dl><h5 id="configuring-a-form-to-communicate-with-a-server"><span class="secno">4.10.1.3 </span>Configuring a form to communicate with a server</h5><p><i>This section is non-normative.</i><p>Form submissions are exposed to servers in a variety of ways,
|
|
most commonly as HTTP GET or POST requests. To specify the exact
|
|
method used, the <code title="attr-fs-method"><a href="#attr-fs-method">method</a></code>
|
|
attribute is specified on the <code><a href="#the-form-element">form</a></code> element. This
|
|
doesn't specify how the form data is encoded, though; to specify
|
|
that, you use the <code title="attr-fs-enctype"><a href="#attr-fs-enctype">enctype</a></code>
|
|
attribute. You also have to specify the <a href="#url">URL</a> of the
|
|
service that will handle the submitted data, using the <code title="attr-fs-action"><a href="#attr-fs-action">action</a></code> attribute.<p>For each form control you want submitted, you then have to give a
|
|
name that will be used to refer to the data in the submission. We
|
|
already specified the name for the group of radio buttons; the same
|
|
attribute (<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>) also specifies
|
|
the submission name. Radio buttons can be distinguished from each
|
|
other in the submission by giving them different values, using the
|
|
<code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute.<p>Multiple controls can have the same name; for example, here we
|
|
give all the checkboxes the same name, and the server distinguishes
|
|
which checkbox was checked by seeing which values are submitted with
|
|
that name — like the radio buttons, they are also given unique
|
|
values with the <code title="attr-input-value"><a href="#attr-input-value">value</a></code>
|
|
attribute.<p>Given the settings in the previous section, this all becomes:<pre><form<strong> method="post"
|
|
enctype="application/x-www-form-urlencoded"
|
|
action="https://pizza.example.com/order.cgi"</strong>>
|
|
<p><label>Customer name: <input<strong> name="custname"</strong>></label></p>
|
|
<p><label>Telephone: <input type=tel<strong> name="custtel"</strong>></label></p>
|
|
<p><label>E-mail address: <input type=email<strong> name="custemail"</strong>></label></p>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size<strong> value="small"</strong>> Small </label></p>
|
|
<p><label> <input type=radio name=size<strong> value="medium"</strong>> Medium </label></p>
|
|
<p><label> <input type=radio name=size<strong> value="large"</strong>> Large </label></p>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox<strong> name="topping" value="bacon"</strong>> Bacon </label></p>
|
|
<p><label> <input type=checkbox<strong> name="topping" value="cheese"</strong>> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox<strong> name="topping" value="onion"</strong>> Onion </label></p>
|
|
<p><label> <input type=checkbox<strong> name="topping" value="mushroom"</strong>> Mushroom </label></p>
|
|
</fieldset>
|
|
<p><label>Preferred delivery time: <input type=time min="11:00" max="21:00" step="900"<strong> name="delivery"</strong>></label></p>
|
|
<p><label>Delivery instructions: <textarea<strong> name="comments"</strong>></textarea></label></p>
|
|
<p><button>Submit order</button><p>
|
|
</form></pre><p>For example, if the customer entered "Denise Lawrence" as their
|
|
name, "555-321-8642" as their telephone number, did not specify an
|
|
e-mail address, asked for a medium-sized pizza, selected the Extra
|
|
Cheese and Mushroom toppings, entered a delivery time of 7pm, and
|
|
left the delivery instructions text field blank, the user agent
|
|
would submit the following to the online Web service:<pre>custname=Denise+Lawrence&custtel=555-321-8624&custemail=&size=medium&topping=cheese&topping=mushroom&delivery=19%3A00&comments=</pre><h5 id="client-side-form-validation"><span class="secno">4.10.1.4 </span>Client-side form validation</h5><p><i>This section is non-normative.</i><p>Forms can be annotated in such a way that the user agent will
|
|
check the user's input before the form is submitted. The server
|
|
still has to verify the input is valid (since hostile users can
|
|
easily bypass the form validation), but it allows the user to avoid
|
|
the wait incurred by having the server be the sole checker of the
|
|
user's input.<p>The simplest annotation is the <code title="attr-input-required"><a href="#attr-input-required">required</a></code> attribute, which can be
|
|
specified on <code><a href="#the-input-element">input</a></code> elements to indicate that the form
|
|
is not to be submitted until a value is given. By adding this
|
|
attribute to the customer name and delivery time fields, we allow
|
|
the user agent to notify the user when the user submits the form
|
|
without filling in those fields:<pre><form method="post"
|
|
enctype="application/x-www-form-urlencoded"
|
|
action="https://pizza.example.com/order.cgi">
|
|
<p><label>Customer name: <input name="custname"<strong> required</strong>></label></p>
|
|
<p><label>Telephone: <input type=tel name="custtel"></label></p>
|
|
<p><label>E-mail address: <input type=email name="custemail"></label></p>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size value="small"> Small </label></p>
|
|
<p><label> <input type=radio name=size value="medium"> Medium </label></p>
|
|
<p><label> <input type=radio name=size value="large"> Large </label></p>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox name="topping" value="bacon"> Bacon </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="cheese"> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="onion"> Onion </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="mushroom"> Mushroom </label></p>
|
|
</fieldset>
|
|
<p><label>Preferred delivery time: <input type=time min="11:00" max="21:00" step="900" name="delivery"<strong> required</strong>></label></p>
|
|
<p><label>Delivery instructions: <textarea name="comments"></textarea></label></p>
|
|
<p><button>Submit order</button><p>
|
|
</form></pre><p>It is also possible to limit the length of the input, using the
|
|
<code title="attr-fe-maxlength"><a href="#attr-fe-maxlength">maxlength</a></code> attribute. By
|
|
adding this to the <code><a href="#the-textarea-element">textarea</a></code> element, we can limit users
|
|
to 1000 characters, preventing them from writing huge essays to the
|
|
busy delivery drivers instead of staying focused and to the
|
|
point:<pre><form method="post"
|
|
enctype="application/x-www-form-urlencoded"
|
|
action="https://pizza.example.com/order.cgi">
|
|
<p><label>Customer name: <input name="custname" required></label></p>
|
|
<p><label>Telephone: <input type=tel name="custtel"></label></p>
|
|
<p><label>E-mail address: <input type=email name="custemail"></label></p>
|
|
<fieldset>
|
|
<legend> Pizza Size </legend>
|
|
<p><label> <input type=radio name=size value="small"> Small </label></p>
|
|
<p><label> <input type=radio name=size value="medium"> Medium </label></p>
|
|
<p><label> <input type=radio name=size value="large"> Large </label></p>
|
|
</fieldset>
|
|
<fieldset>
|
|
<legend> Pizza Toppings </legend>
|
|
<p><label> <input type=checkbox name="topping" value="bacon"> Bacon </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="cheese"> Extra Cheese </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="onion"> Onion </label></p>
|
|
<p><label> <input type=checkbox name="topping" value="mushroom"> Mushroom </label></p>
|
|
</fieldset>
|
|
<p><label>Preferred delivery time: <input type=time min="11:00" max="21:00" step="900" name="delivery" required></label></p>
|
|
<p><label>Delivery instructions: <textarea name="comments"<strong> maxlength=1000</strong>></textarea></label></p>
|
|
<p><button>Submit order</button><p>
|
|
</form></pre><h4 id="categories"><span class="secno">4.10.2 </span>Categories</h4><p>Mostly for historical reasons, elements in this section fall into
|
|
several overlapping (but subtly different) categories in addition to
|
|
the usual ones like <a href="#flow-content">flow content</a>, <a href="#phrasing-content">phrasing
|
|
content</a>, and <a href="#interactive-content">interactive content</a>.<p>A number of the elements are <dfn id="form-associated-element" title="form-associated
|
|
element">form-associated elements</dfn>, which means they can have a
|
|
<a href="#form-owner">form owner</a> and, to expose this, have a <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> content attribute with a matching
|
|
<code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> IDL attribute.</p><ul class="brief category-list"><li><code><a href="#the-button-element">button</a></code></li>
|
|
<li><code><a href="#the-fieldset-element">fieldset</a></code></li>
|
|
<li><code><a href="#the-input-element">input</a></code></li>
|
|
<li><code><a href="#the-keygen-element">keygen</a></code></li>
|
|
<li><code><a href="#the-label-element">label</a></code></li>
|
|
<li><code><a href="#the-meter-element">meter</a></code></li>
|
|
<li><code><a href="#the-object-element">object</a></code></li>
|
|
<li><code><a href="#the-output-element">output</a></code></li>
|
|
<li><code><a href="#the-progress-element">progress</a></code></li>
|
|
<li><code><a href="#the-select-element">select</a></code></li>
|
|
<li><code><a href="#the-textarea-element">textarea</a></code></li>
|
|
</ul><p>The <a href="#form-associated-element" title="form-associated element">form-associated
|
|
elements</a> fall into several subcategories:<dl><dt><dfn id="category-listed" title="category-listed">Listed elements</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Denotes elements that are listed in the <code title="dom-form-elements"><a href="#dom-form-elements"><var title="">form</var>.elements</a></code>
|
|
and <code title="dom-fieldset-elements"><a href="#dom-fieldset-elements"><var title="">fieldset</var>.elements</a></code> APIs.</p>
|
|
|
|
|
|
<ul class="brief category-list"><li><code><a href="#the-button-element">button</a></code></li>
|
|
<li><code><a href="#the-fieldset-element">fieldset</a></code></li>
|
|
<li><code><a href="#the-input-element">input</a></code></li>
|
|
<li><code><a href="#the-keygen-element">keygen</a></code></li>
|
|
<li><code><a href="#the-object-element">object</a></code></li>
|
|
<li><code><a href="#the-output-element">output</a></code></li>
|
|
<li><code><a href="#the-select-element">select</a></code></li>
|
|
<li><code><a href="#the-textarea-element">textarea</a></code></li>
|
|
</ul></dd>
|
|
|
|
<dt><dfn id="category-label" title="category-label">Labelable elements</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Denotes elements that can be associated with <code><a href="#the-label-element">label</a></code>
|
|
elements.</p>
|
|
|
|
|
|
<ul class="brief category-list"><li><code><a href="#the-button-element">button</a></code></li>
|
|
<li><code><a href="#the-input-element">input</a></code> (if the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is <em>not</em> in the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state)</li>
|
|
<li><code><a href="#the-keygen-element">keygen</a></code></li>
|
|
<li><code><a href="#the-meter-element">meter</a></code></li>
|
|
<li><code><a href="#the-output-element">output</a></code></li>
|
|
<li><code><a href="#the-progress-element">progress</a></code></li>
|
|
<li><code><a href="#the-select-element">select</a></code></li>
|
|
<li><code><a href="#the-textarea-element">textarea</a></code></li>
|
|
</ul></dd>
|
|
|
|
<dt><dfn id="category-submit" title="category-submit">Submittable elements</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Denotes elements that can be used for <a href="#constructing-form-data-set">constructing the form data
|
|
set</a> when a <code><a href="#the-form-element">form</a></code> element is <a href="#concept-form-submit" title="concept-form-submit">submitted</a>.</p>
|
|
|
|
|
|
<ul class="brief category-list"><li><code><a href="#the-button-element">button</a></code></li>
|
|
<li><code><a href="#the-input-element">input</a></code></li>
|
|
<li><code><a href="#the-keygen-element">keygen</a></code></li>
|
|
<li><code><a href="#the-object-element">object</a></code></li>
|
|
<li><code><a href="#the-select-element">select</a></code></li>
|
|
<li><code><a href="#the-textarea-element">textarea</a></code></li>
|
|
</ul></dd>
|
|
|
|
<dt><dfn id="category-reset" title="category-reset">Resettable elements</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Denotes elements that can be affected when a <code><a href="#the-form-element">form</a></code>
|
|
element is <a href="#concept-form-reset" title="concept-form-reset">reset</a>.</p>
|
|
|
|
|
|
<ul class="brief category-list"><li><code><a href="#the-input-element">input</a></code></li>
|
|
<li><code><a href="#the-keygen-element">keygen</a></code></li>
|
|
<li><code><a href="#the-output-element">output</a></code></li>
|
|
<li><code><a href="#the-select-element">select</a></code></li>
|
|
<li><code><a href="#the-textarea-element">textarea</a></code></li>
|
|
</ul></dd>
|
|
|
|
</dl><p>In addition, some <a href="#category-submit" title="category-submit">submittable
|
|
elements</a> can be, depending on their attributes, <dfn id="concept-button" title="concept-button">buttons</dfn>. The prose below defines when
|
|
an element is a button. Some buttons are specifically <dfn id="concept-submit-button" title="concept-submit-button">submit buttons</dfn>.<p class="note">The <code><a href="#the-object-element">object</a></code> element is also a
|
|
<a href="#form-associated-element">form-associated element</a> and can, with the use of a
|
|
suitable <a href="#plugin">plugin</a>, partake in <a href="#form-submission">form
|
|
submission</a>.<h4 id="the-form-element"><span class="secno">4.10.3 </span>The <dfn><code>form</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#flow-content">Flow content</a>, but with no <code><a href="#the-form-element">form</a></code> element descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code></dd>
|
|
<dd><code title="attr-fs-action"><a href="#attr-fs-action">action</a></code></dd>
|
|
<dd><code title="attr-form-autocomplete"><a href="#attr-form-autocomplete">autocomplete</a></code></dd>
|
|
<dd><code title="attr-fs-enctype"><a href="#attr-fs-enctype">enctype</a></code></dd>
|
|
<dd><code title="attr-fs-method"><a href="#attr-fs-method">method</a></code></dd>
|
|
<dd><code title="attr-form-name"><a href="#attr-form-name">name</a></code></dd>
|
|
<dd><code title="attr-fs-novalidate"><a href="#attr-fs-novalidate">novalidate</a></code></dd>
|
|
<dd><code title="attr-fs-target"><a href="#attr-fs-target">target</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">[OverrideBuiltins]
|
|
interface <dfn id="htmlformelement">HTMLFormElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-form-acceptcharset" title="dom-form-acceptCharset">acceptCharset</a>;
|
|
attribute DOMString <a href="#dom-fs-action" title="dom-fs-action">action</a>;
|
|
attribute DOMString <a href="#dom-form-autocomplete" title="dom-form-autocomplete">autocomplete</a>;
|
|
attribute DOMString <a href="#dom-fs-enctype" title="dom-fs-enctype">enctype</a>;
|
|
attribute DOMString <a href="#dom-fs-encoding" title="dom-fs-encoding">encoding</a>;
|
|
attribute DOMString <a href="#dom-fs-method" title="dom-fs-method">method</a>;
|
|
attribute DOMString <a href="#dom-form-name" title="dom-form-name">name</a>;
|
|
attribute boolean <a href="#dom-fs-novalidate" title="dom-fs-noValidate">noValidate</a>;
|
|
attribute DOMString <a href="#dom-fs-target" title="dom-fs-target">target</a>;
|
|
|
|
readonly attribute <a href="#htmlformcontrolscollection">HTMLFormControlsCollection</a> <a href="#dom-form-elements" title="dom-form-elements">elements</a>;
|
|
readonly attribute long <a href="#dom-form-length" title="dom-form-length">length</a>;
|
|
caller <a href="#dom-form-item" title="dom-form-item">getter</a> any (in unsigned long index);
|
|
caller <a href="#dom-form-nameditem" title="dom-form-namedItem">getter</a> any (in DOMString name);
|
|
|
|
void <a href="#dom-form-submit" title="dom-form-submit">submit</a>();
|
|
void <a href="#dom-form-reset" title="dom-form-reset">reset</a>();
|
|
boolean <a href="#dom-form-checkvalidity" title="dom-form-checkValidity">checkValidity</a>();
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-form-element">form</a></code> element <a href="#represents">represents</a> a
|
|
collection of <a href="#form-associated-element" title="form-associated element">form-associated
|
|
elements</a>, some of which can represent editable values that
|
|
can be submitted to a server for processing.<p>The <dfn id="attr-form-accept-charset" title="attr-form-accept-charset"><code>accept-charset</code></dfn>
|
|
attribute gives the character encodings that are to be used for the
|
|
submission. If specified, the value must be an <a href="#ordered-set-of-unique-space-separated-tokens">ordered set of
|
|
unique space-separated tokens</a> that are <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a>, and each token must be an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the <a href="#preferred-mime-name">preferred MIME
|
|
name</a> of an <a href="#ascii-compatible-character-encoding">ASCII-compatible character encoding</a>.
|
|
<a href="#refsIANACHARSET">[IANACHARSET]</a><p>The <dfn id="attr-form-name" title="attr-form-name"><code>name</code></dfn> attribute
|
|
represents the <code><a href="#the-form-element">form</a></code>'s name within the <code title="dom-document-forms"><a href="#dom-document-forms">forms</a></code> collection. The value must
|
|
not be the empty string, and the value must be unique amongst the
|
|
<code><a href="#the-form-element">form</a></code> elements in the <code title="dom-document-forms"><a href="#dom-document-forms">forms</a></code> collection that it is in, if
|
|
any.<p>The <dfn id="attr-form-autocomplete" title="attr-form-autocomplete"><code>autocomplete</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">enumerated attribute</a>. The attribute has
|
|
two states. The <code title="attr-form-autocomplete-on">on</code>
|
|
keyword maps to the <dfn id="attr-form-autocomplete-on-state" title="attr-form-autocomplete-on-state">on</dfn> state, and the
|
|
<code title="attr-form-autocomplete-off">off</code> keyword maps to
|
|
the <dfn id="attr-form-autocomplete-off-state" title="attr-form-autocomplete-off-state">off</dfn>
|
|
state. The attribute may also be omitted. The <i>missing value
|
|
default</i> is the <a href="#attr-form-autocomplete-on-state" title="attr-form-autocomplete-on-state">on</a> state. The <a href="#attr-form-autocomplete-off-state" title="attr-form-autocomplete-off-state">off</a> state indicates
|
|
that by default, <code><a href="#the-input-element">input</a></code> elements in the form will have
|
|
their <a href="#resulting-autocompletion-state">resulting autocompletion state</a> set to <i title="">off</i>; the <a href="#attr-form-autocomplete-on-state" title="attr-form-autocomplete-on-state">on</a> state indicates
|
|
that by default, <code><a href="#the-input-element">input</a></code> elements in the form will have
|
|
their <a href="#resulting-autocompletion-state">resulting autocompletion state</a> set to <i title="">on</i>.<p>The <code title="attr-fs-action"><a href="#attr-fs-action">action</a></code>, <code title="attr-fs-enctype"><a href="#attr-fs-enctype">enctype</a></code>, <code title="attr-fs-method"><a href="#attr-fs-method">method</a></code>, <code title="attr-fs-novalidate"><a href="#attr-fs-novalidate">novalidate</a></code>, and <code title="attr-fs-target"><a href="#attr-fs-target">target</a></code> attributes are <a href="#attributes-for-form-submission">attributes
|
|
for form submission</a>.<dl class="domintro"><dt><var title="">form</var> . <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the form controls in
|
|
the form (excluding image buttons for historical reasons).</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">form</var> . <code title="dom-form-length"><a href="#dom-form-length">length</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the number of form controls in the form (excluding
|
|
image buttons for historical reasons).</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">form</var>[<var title="">index</var>]</dt>
|
|
<dt><var title="">form</var>(<var title="">index</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <var title="">index</var>th element in the form
|
|
(excluding image buttons for historical reasons).</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">form</var>[<var title="">name</var>]</dt>
|
|
<dt><var title="">form</var>(<var title="">name</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the form control in the form with the given <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> (excluding image buttons for
|
|
historical reasons).</p>
|
|
|
|
<p>Once an element has been referenced using a particular name,
|
|
that name will continue being available as a way to reference that
|
|
element in this method, even if the element's actual <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> changes, for as long as the
|
|
element remains in the <code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p>If there are multiple matching items, then a
|
|
<code><a href="#nodelist">NodeList</a></code> object containing all those elements is
|
|
returned.</p>
|
|
|
|
<p>Returns null if no element with that <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> could be found.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">form</var> . <code title="dom-form-submit"><a href="#dom-form-submit">submit</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Submits the form.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">form</var> . <code title="dom-form-reset"><a href="#dom-form-reset">reset</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Resets the form.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">form</var> . <code title="dom-form-checkValidity"><a href="#dom-form-checkvalidity">checkValidity</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the form's controls are all valid; otherwise,
|
|
returns false.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-form-autocomplete" title="dom-form-autocomplete"><code>autocomplete</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>.</p>
|
|
|
|
<p>The <dfn id="dom-form-name" title="dom-form-name"><code>name</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
<p>The <dfn id="dom-form-acceptcharset" title="dom-form-acceptCharset"><code>acceptCharset</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code> content
|
|
attribute.</p>
|
|
|
|
<hr><p>The <dfn id="dom-form-elements" title="dom-form-elements"><code>elements</code></dfn>
|
|
IDL attribute must return an <code><a href="#htmlformcontrolscollection">HTMLFormControlsCollection</a></code>
|
|
rooted at the <code><a href="#document">Document</a></code> node, whose filter matches <a href="#category-listed" title="category-listed">listed elements</a> whose <a href="#form-owner">form
|
|
owner</a> is the <code><a href="#the-form-element">form</a></code> element, with the exception of
|
|
<code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, which must,
|
|
for historical reasons, be excluded from this particular
|
|
collection.</p>
|
|
|
|
<p>The <dfn id="dom-form-length" title="dom-form-length"><code>length</code></dfn> IDL
|
|
attribute must return the number of nodes <a href="#represented-by-the-collection" title="represented
|
|
by the collection">represented</a> by the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> collection.</p>
|
|
|
|
<p>The <a href="#supported-property-indices">supported property indices</a> at any instant are
|
|
the indices supported by the object returned by the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> attribute at that
|
|
instant.</p>
|
|
|
|
<p>When a <code><a href="#the-form-element">form</a></code> element is <dfn id="dom-form-item" title="dom-form-item">indexed for indexed property retrieval</dfn>,
|
|
the user agent must return the value returned by the <code title="dom-HTMLFormControlsCollection-item">item</code> method on
|
|
the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> collection, when
|
|
invoked with the given index as its argument.</p>
|
|
|
|
<p>Each <code><a href="#the-form-element">form</a></code> element has a mapping of names to elements
|
|
called the <dfn id="past-names-map">past names map</dfn>. It is used to persist names of
|
|
controls even when they change names.</p>
|
|
|
|
<p>The <a href="#supported-property-names">supported property names</a> are the union of the
|
|
names currently supported by the object returned by the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> attribute, and the names
|
|
currently in the <a href="#past-names-map">past names map</a>.</p>
|
|
|
|
<p>When a <code><a href="#the-form-element">form</a></code> element is <dfn id="dom-form-nameditem" title="dom-form-namedItem">indexed for named property
|
|
retrieval</dfn>, the user agent must run the following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If <var title="">name</var> is one of the <a href="#supported-property-names">supported
|
|
property names</a> of the object returned by the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> attribute, then run
|
|
these substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">candidate</var> be the object returned
|
|
by the <code title="dom-HTMLFormControlsCollection-namedItem"><a href="#dom-htmlformcontrolscollection-nameditem">namedItem()</a></code>
|
|
method on the object returned by the <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> attribute when passed
|
|
the <var title="">name</var> argument.</li>
|
|
|
|
<li><p>If <var title="">candidate</var> is an element, then add a
|
|
mapping from <var title="">name</var> to <var title="">candidate</var> in the <code><a href="#the-form-element">form</a></code> element's
|
|
<a href="#past-names-map">past names map</a>, replacing the previous entry with
|
|
the same name, if any.</li>
|
|
|
|
<li><p>Return <var title="">candidate</var> and abort these
|
|
steps.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Otherwise, <var title="">name</var> is the name of one of
|
|
the entries in the <code><a href="#the-form-element">form</a></code> element's <a href="#past-names-map">past names
|
|
map</a>: return the object associated with <var title="">name</var> in that map.</li>
|
|
|
|
</ol><p>If an element listed in the <code><a href="#the-form-element">form</a></code> element's <a href="#past-names-map">past
|
|
names map</a> is removed from the <code><a href="#document">Document</a></code>, then its
|
|
entries must be removed from the map.</p>
|
|
|
|
|
|
<hr><p>The <dfn id="dom-form-submit" title="dom-form-submit"><code>submit()</code></dfn>
|
|
method, when invoked, must <a href="#concept-form-submit" title="concept-form-submit">submit</a> the <code><a href="#the-form-element">form</a></code>
|
|
element from the <code><a href="#the-form-element">form</a></code> element itself, with the <var title="">scripted-submit</var> flag set.</p>
|
|
|
|
<p>The <dfn id="dom-form-reset" title="dom-form-reset"><code>reset()</code></dfn>
|
|
method, when invoked, must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#the-form-element">form</a></code> element is marked as <i><a href="#locked-for-reset">locked for
|
|
reset</a></i>, then abort these steps.</li>
|
|
|
|
<li><p>Mark the <code><a href="#the-form-element">form</a></code> element as <dfn id="locked-for-reset">locked for
|
|
reset</dfn>.</li>
|
|
|
|
<li><p><a href="#concept-form-reset" title="concept-form-reset">Reset</a> the
|
|
<code><a href="#the-form-element">form</a></code> element.</li>
|
|
|
|
<li><p>Unmark the <code><a href="#the-form-element">form</a></code> element as <i><a href="#locked-for-reset">locked for
|
|
reset</a></i>.</li>
|
|
|
|
</ol><p>If the <dfn id="dom-form-checkvalidity" title="dom-form-checkValidity"><code>checkValidity()</code></dfn>
|
|
method is invoked, the user agent must <a href="#statically-validate-the-constraints">statically validate the
|
|
constraints</a> of the <code><a href="#the-form-element">form</a></code> element, and return true
|
|
if the constraint validation return a <i>positive</i> result, and
|
|
false if it returned a <i>negative</i> result.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This example shows two search forms:</p>
|
|
|
|
<pre><form action="http://www.google.com/search" method="get">
|
|
<label>Google: <input type="search" name="q"></label> <input type="submit" value="Search...">
|
|
</form>
|
|
<form action="http://www.bing.com/search" method="get">
|
|
<label>Bing: <input type="search" name="q"></label> <input type="submit" value="Search...">
|
|
</form></pre>
|
|
|
|
</div><h4 id="the-fieldset-element"><span class="secno">4.10.4 </span>The <dfn><code>fieldset</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#sectioning-root">Sectioning root</a>.</dd>
|
|
<dd><a href="#category-listed" title="category-listed">Listed</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Optionally a <code><a href="#the-legend-element">legend</a></code> element, followed by <a href="#flow-content">flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-fieldset-disabled"><a href="#attr-fieldset-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlfieldsetelement">HTMLFieldSetElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-fieldset-disabled" title="dom-fieldset-disabled">disabled</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
attribute DOMString <a href="#dom-fe-name" title="dom-fe-name">name</a>;
|
|
|
|
readonly attribute DOMString <a href="#dom-fieldset-type" title="dom-fieldset-type">type</a>;
|
|
|
|
readonly attribute <a href="#htmlformcontrolscollection">HTMLFormControlsCollection</a> <a href="#dom-fieldset-elements" title="dom-fieldset-elements">elements</a>;
|
|
|
|
readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
|
|
readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
|
|
readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
|
|
boolean <a href="#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
|
|
void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-fieldset-element">fieldset</a></code> element <a href="#represents">represents</a> a set
|
|
of form controls optionally grouped under a common name.<p>The name of the group is given by the first <code><a href="#the-legend-element">legend</a></code>
|
|
element that is a child of the <code><a href="#the-fieldset-element">fieldset</a></code> element, if
|
|
any. The remainder of the descendants form the group.<p>The <dfn id="attr-fieldset-disabled" title="attr-fieldset-disabled"><code>disabled</code></dfn>
|
|
attribute, when specified, causes all the form control descendants
|
|
of the <code><a href="#the-fieldset-element">fieldset</a></code> element, excluding those that are
|
|
descendants of the <code><a href="#the-fieldset-element">fieldset</a></code> element's first
|
|
<code><a href="#the-legend-element">legend</a></code> element child, if any, to be <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>.<p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-fieldset-element">fieldset</a></code> element with its
|
|
<a href="#form-owner">form owner</a>. The <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>
|
|
attribute represents the element's name.<dl class="domintro"><dt><var title="">fieldset</var> . <code title="dom-fieldset-type"><a href="#dom-fieldset-type">type</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the string "fieldset".</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">fieldset</var> . <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns an <code><a href="#htmlformcontrolscollection">HTMLFormControlsCollection</a></code> of the form
|
|
controls in the element.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-fieldset-disabled" title="dom-fieldset-disabled"><code>disabled</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
<p>The <dfn id="dom-fieldset-type" title="dom-fieldset-type"><code>type</code></dfn> IDL
|
|
attribute must return the string "<code title="">fieldset</code>".</p>
|
|
|
|
<p>The <dfn id="dom-fieldset-elements" title="dom-fieldset-elements"><code>elements</code></dfn> IDL
|
|
attribute must return an <code><a href="#htmlformcontrolscollection">HTMLFormControlsCollection</a></code>
|
|
rooted at the <code><a href="#the-fieldset-element">fieldset</a></code> element, whose filter matches
|
|
<a href="#category-listed" title="category-listed">listed elements</a>.</p>
|
|
|
|
<p>The <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code>
|
|
attributes, and the <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
methods, are part of the <a href="#the-constraint-validation-api">constraint validation API</a>. The
|
|
<code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> and <code title="dom-fe-name"><a href="#dom-fe-name">name</a></code> IDL attributes are part of the
|
|
element's forms API.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: <code><a href="#the-fieldset-element">fieldset</a></code>
|
|
elements are always <a href="#barred-from-constraint-validation">barred from constraint
|
|
validation</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following snippet shows a fieldset with a checkbox in the
|
|
legend that controls whether or not the fieldset is enabled. The
|
|
contents of the fieldset consist of two required text fields and an
|
|
optional year/month control.</p>
|
|
|
|
<pre><fieldset name="clubfields" disabled>
|
|
<legend> <label>
|
|
<input type=checkbox name=club onchange="form.clubfields.disabled = !checked">
|
|
Use Club Card
|
|
</label> </legend>
|
|
<p><label>Name on card: <input name=clubname required></label></p>
|
|
<p><label>Card number: <input name=clubnum required pattern="[-0-9]+"></label></p>
|
|
<p><label>Expiry date: <input name=clubexp type=month></label></p>
|
|
</fieldset></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>You can also nest <code><a href="#the-fieldset-element">fieldset</a></code> elements. Here is an
|
|
example expanding on the previous one that does so:</p>
|
|
|
|
<pre><fieldset name="clubfields" disabled>
|
|
<legend> <label>
|
|
<input type=checkbox name=club onchange="form.clubfields.disabled = !checked">
|
|
Use Club Card
|
|
</label> </legend>
|
|
<p><label>Name on card: <input name=clubname required></label></p>
|
|
<fieldset name="numfields">
|
|
<legend> <label>
|
|
<input type=radio checked name=clubtype onchange="form.numfields.disabled = !checked">
|
|
My card has numbers on it
|
|
</label> </legend>
|
|
<p><label>Card number: <input name=clubnum required pattern="[-0-9]+"></label></p>
|
|
</fieldset>
|
|
<fieldset name="letfields" disabled>
|
|
<legend> <label>
|
|
<input type=radio name=clubtype onchange="form.letfields.disabled = !checked">
|
|
My card has letters on it
|
|
</label> </legend>
|
|
<p><label>Card code: <input name=clublet required pattern="[A-Za-z]+"></label></p>
|
|
</fieldset>
|
|
</fieldset></pre>
|
|
|
|
<p>In this example, if the outer "Use Club Card" checkbox is not
|
|
checked, everything inside the outer <code><a href="#the-fieldset-element">fieldset</a></code>,
|
|
including the two radio buttons in the legends of the two nested
|
|
<code><a href="#the-fieldset-element">fieldset</a></code>s, will be disabled. However, if the checkbox
|
|
is checked, then the radio buttons will both be enabled and will
|
|
let you select which of the two inner <code><a href="#the-fieldset-element">fieldset</a></code>s is to
|
|
be enabled.</p>
|
|
|
|
</div><h4 id="the-legend-element"><span class="secno">4.10.5 </span>The <dfn><code>legend</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As the first child of a <code><a href="#the-fieldset-element">fieldset</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmllegendelement">HTMLLegendElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-legend-form" title="dom-legend-form">form</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-legend-element">legend</a></code> element <a href="#represents">represents</a> a caption
|
|
for the rest of the contents of the <code><a href="#the-legend-element">legend</a></code> element's
|
|
parent <code><a href="#the-fieldset-element">fieldset</a></code> element<span class="impl">, if
|
|
any</span>.<dl class="domintro"><dt><var title="">legend</var> . <code title="dom-legend-form"><a href="#dom-legend-form">form</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the element's <code><a href="#the-form-element">form</a></code> element, if any, or
|
|
null otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-legend-form" title="dom-legend-form"><code>form</code></dfn> IDL
|
|
attribute's behavior depends on whether the <code><a href="#the-legend-element">legend</a></code>
|
|
element is in a <code><a href="#the-fieldset-element">fieldset</a></code> element or not. If the
|
|
<code><a href="#the-legend-element">legend</a></code> has a <code><a href="#the-fieldset-element">fieldset</a></code> element as its
|
|
parent, then the <code title="dom-legend-form"><a href="#dom-legend-form">form</a></code> IDL
|
|
attribute must return the same value as the <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> IDL attribute on that
|
|
<code><a href="#the-fieldset-element">fieldset</a></code> element. Otherwise, it must return null.</p>
|
|
|
|
</div><h4 id="the-label-element"><span class="secno">4.10.6 </span>The <dfn><code>label</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dd><a href="#form-associated-element">Form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>, but with no descendant <a href="#category-label" title="category-label">labelable form-associated elements</a> unless it is the element's <a href="#labeled-control">labeled control</a>, and no descendant <code><a href="#the-label-element">label</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-label-for"><a href="#attr-label-for">for</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmllabelelement">HTMLLabelElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
attribute DOMString <a href="#dom-label-htmlfor" title="dom-label-htmlFor">htmlFor</a>;
|
|
readonly attribute <a href="#htmlelement">HTMLElement</a> <a href="#dom-label-control" title="dom-label-control">control</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-label-element">label</a></code> <a href="#represents">represents</a> a caption in a
|
|
user interface. The caption can be associated with a specific form
|
|
control<span class="impl">, known as the <code><a href="#the-label-element">label</a></code>
|
|
element's <dfn id="labeled-control">labeled control</dfn></span>, either using <code title="attr-label-for"><a href="#attr-label-for">for</a></code> attribute, or by putting the form
|
|
control inside the <code><a href="#the-label-element">label</a></code> element itself.<div class="impl">
|
|
|
|
<p>Except where otherwise specified by the following rules, a
|
|
<code><a href="#the-label-element">label</a></code> element has no <a href="#labeled-control">labeled control</a>.</p>
|
|
|
|
</div><p>The <dfn id="attr-label-for" title="attr-label-for"><code>for</code></dfn> attribute
|
|
may be specified to indicate a form control with which the caption
|
|
is to be associated. If the attribute is specified, the attribute's
|
|
value must be the <a href="#concept-id" title="concept-id">ID</a> of a <a href="#category-label" title="category-label">labelable
|
|
form-associated element</a> in the same <code><a href="#document">Document</a></code> as
|
|
the <code><a href="#the-label-element">label</a></code> element. <span class="impl">If the attribute
|
|
is specified and there is an element in the <code><a href="#document">Document</a></code>
|
|
whose <a href="#concept-id" title="concept-id">ID</a> is equal to the value of the <code title="attr-label-for"><a href="#attr-label-for">for</a></code> attribute, and the first such
|
|
element is a <a href="#category-label" title="category-label">labelable form-associated
|
|
element</a>, then that element is the <code><a href="#the-label-element">label</a></code>
|
|
element's <a href="#labeled-control">labeled control</a>.</span><div class="impl">
|
|
|
|
<p>If the <code title="attr-label-for"><a href="#attr-label-for">for</a></code> attribute is not
|
|
specified, but the <code><a href="#the-label-element">label</a></code> element has a <a href="#category-label" title="category-label">labelable form-associated element</a>
|
|
descendant, then the first such descendant in <a href="#tree-order">tree
|
|
order</a> is the <code><a href="#the-label-element">label</a></code> element's <a href="#labeled-control">labeled
|
|
control</a>.</p>
|
|
|
|
<p>The <code><a href="#the-label-element">label</a></code> element's exact default presentation and
|
|
behavior, in particular what its <a href="#activation-behavior">activation behavior</a>
|
|
might be, if anything, should match the platform's label
|
|
behavior.</p>
|
|
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, on platforms where clicking a checkbox label checks
|
|
the checkbox, clicking the <code><a href="#the-label-element">label</a></code> in the following
|
|
snippet could trigger the user agent to <a href="#run-synthetic-click-activation-steps">run synthetic click
|
|
activation steps</a> on the <code><a href="#the-input-element">input</a></code> element, as if
|
|
the element itself had been triggered by the user:</p>
|
|
|
|
<pre><label><input type=checkbox name=lost> Lost</label></pre>
|
|
|
|
<p>On other platforms, the behavior might be just to focus the
|
|
control, or do nothing.</p>
|
|
|
|
</div>
|
|
|
|
</div><dl class="domintro"><dt><var title="">label</var> . <code title="dom-label-control"><a href="#dom-label-control">control</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the form control that is associated with this element.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-label-element">label</a></code> element with its
|
|
<a href="#form-owner">form owner</a>.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-label-htmlfor" title="dom-label-htmlFor"><code>htmlFor</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-label-for"><a href="#attr-label-for">for</a></code> content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-label-control" title="dom-label-control"><code>control</code></dfn> IDL
|
|
attribute must return the <code><a href="#the-label-element">label</a></code> element's <a href="#labeled-control">labeled
|
|
control</a>, if any, or null if there isn't one.</p>
|
|
|
|
</div><hr><dl class="domintro"><dt><var title="">control</var> . <code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#nodelist">NodeList</a></code> of all the <code><a href="#the-label-element">label</a></code>
|
|
elements that the form control is associated with.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p><a href="#category-label" title="category-label">Labelable form-associated
|
|
elements</a> have a <code><a href="#nodelist">NodeList</a></code> object associated with
|
|
them that represents the list of <code><a href="#the-label-element">label</a></code> elements, in
|
|
<a href="#tree-order">tree order</a>, whose <a href="#labeled-control">labeled control</a> is the
|
|
element in question. The <dfn id="dom-lfe-labels" title="dom-lfe-labels"><code>labels</code></dfn> IDL attribute of
|
|
<a href="#category-label" title="category-label">labelable form-associated
|
|
elements</a>, on getting, must return that <code><a href="#nodelist">NodeList</a></code>
|
|
object.</p>
|
|
|
|
<p>The <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> IDL attribute is part
|
|
of the element's forms API.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows three form controls each with a
|
|
label, two of which have small text showing the right format for
|
|
users to use.</p>
|
|
|
|
<pre><p><label>Full name: <input name=fn> <small>Format: First Last</small></label></p>
|
|
<p><label>Age: <input name=age type=number min=0></label></p>
|
|
<p><label>Post code: <input name=pc> <small>Format: AB12 3CD</small></label></p></pre>
|
|
|
|
</div><h4 id="the-input-element"><span class="secno">4.10.7 </span>The <dfn><code>input</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd>If the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is <em>not</em> in the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state: <a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dd>If the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is <em>not</em> in the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state: <a href="#category-listed" title="category-listed">Listed</a>, <a href="#category-label" title="category-label">labelable</a>, <a href="#category-submit" title="category-submit">submittable</a>, and <a href="#category-reset" title="category-reset">resettable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dd>If the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state: <a href="#category-listed" title="category-listed">Listed</a>, <a href="#category-submit" title="category-submit">submittable</a>, and <a href="#category-reset" title="category-reset">resettable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-input-accept"><a href="#attr-input-accept">accept</a></code></dd>
|
|
<dd><code title="attr-input-alt"><a href="#attr-input-alt">alt</a></code></dd>
|
|
<dd><code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code></dd>
|
|
<dd><code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code></dd>
|
|
<dd><code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code></dd>
|
|
<dd><code title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code></dd>
|
|
<dd><code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code></dd>
|
|
<dd><code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code></dd>
|
|
<dd><code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code></dd>
|
|
<dd><code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code></dd>
|
|
<dd><code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code></dd>
|
|
<dd><code title="attr-dim-height"><a href="#attr-dim-height">height</a></code></dd>
|
|
<dd><code title="attr-input-list"><a href="#attr-input-list">list</a></code></dd>
|
|
<dd><code title="attr-input-max"><a href="#attr-input-max">max</a></code></dd>
|
|
<dd><code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code></dd>
|
|
<dd><code title="attr-input-min"><a href="#attr-input-min">min</a></code></dd>
|
|
<dd><code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code></dd>
|
|
<dd><code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></dd>
|
|
<dd><code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code></dd>
|
|
<dd><code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code></dd>
|
|
<dd><code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code></dd>
|
|
<dd><code title="attr-input-required"><a href="#attr-input-required">required</a></code></dd>
|
|
<dd><code title="attr-input-size"><a href="#attr-input-size">size</a></code></dd>
|
|
<dd><code title="attr-input-src"><a href="#attr-input-src">src</a></code></dd>
|
|
<dd><code title="attr-input-step"><a href="#attr-input-step">step</a></code></dd>
|
|
<dd><code title="attr-input-type"><a href="#attr-input-type">type</a></code></dd>
|
|
<dd><code title="attr-input-value"><a href="#attr-input-value">value</a></code></dd>
|
|
<dd><code title="attr-dim-width"><a href="#attr-dim-width">width</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlinputelement">HTMLInputElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-input-accept" title="dom-input-accept">accept</a>;
|
|
attribute DOMString <a href="#dom-input-alt" title="dom-input-alt">alt</a>;
|
|
attribute DOMString <a href="#dom-input-autocomplete" title="dom-input-autocomplete">autocomplete</a>;
|
|
attribute boolean <a href="#dom-fe-autofocus" title="dom-fe-autofocus">autofocus</a>;
|
|
attribute boolean <a href="#dom-input-defaultchecked" title="dom-input-defaultChecked">defaultChecked</a>;
|
|
attribute boolean <a href="#dom-input-checked" title="dom-input-checked">checked</a>;
|
|
attribute DOMString <a href="#dom-input-dirname" title="dom-input-dirName">dirName</a>;
|
|
attribute boolean <a href="#dom-fe-disabled" title="dom-fe-disabled">disabled</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
readonly attribute <a href="#filelist">FileList</a> <a href="#dom-input-files" title="dom-input-files">files</a>;
|
|
attribute DOMString <a href="#dom-fs-formaction" title="dom-fs-formAction">formAction</a>;
|
|
attribute DOMString <a href="#dom-fs-formenctype" title="dom-fs-formEnctype">formEnctype</a>;
|
|
attribute DOMString <a href="#dom-fs-formmethod" title="dom-fs-formMethod">formMethod</a>;
|
|
attribute boolean <a href="#dom-fs-formnovalidate" title="dom-fs-formNoValidate">formNoValidate</a>;
|
|
attribute DOMString <a href="#dom-fs-formtarget" title="dom-fs-formTarget">formTarget</a>;
|
|
attribute DOMString <a href="#dom-dim-height" title="dom-dim-height">height</a>;
|
|
attribute boolean <a href="#dom-input-indeterminate" title="dom-input-indeterminate">indeterminate</a>;
|
|
readonly attribute <a href="#htmlelement">HTMLElement</a> <a href="#dom-input-list" title="dom-input-list">list</a>;
|
|
attribute DOMString <a href="#dom-input-max" title="dom-input-max">max</a>;
|
|
attribute long <a href="#dom-input-maxlength" title="dom-input-maxLength">maxLength</a>;
|
|
attribute DOMString <a href="#dom-input-min" title="dom-input-min">min</a>;
|
|
attribute boolean <a href="#dom-input-multiple" title="dom-input-multiple">multiple</a>;
|
|
attribute DOMString <a href="#dom-fe-name" title="dom-fe-name">name</a>;
|
|
attribute DOMString <a href="#dom-input-pattern" title="dom-input-pattern">pattern</a>;
|
|
attribute DOMString <a href="#dom-input-placeholder" title="dom-input-placeholder">placeholder</a>;
|
|
attribute boolean <a href="#dom-input-readonly" title="dom-input-readOnly">readOnly</a>;
|
|
attribute boolean <a href="#dom-input-required" title="dom-input-required">required</a>;
|
|
attribute unsigned long <a href="#dom-input-size" title="dom-input-size">size</a>;
|
|
attribute DOMString <a href="#dom-input-src" title="dom-input-src">src</a>;
|
|
attribute DOMString <a href="#dom-input-step" title="dom-input-step">step</a>;
|
|
attribute DOMString <a href="#dom-input-type" title="dom-input-type">type</a>;
|
|
attribute DOMString <a href="#dom-input-defaultvalue" title="dom-input-defaultValue">defaultValue</a>;
|
|
attribute DOMString <a href="#dom-input-value" title="dom-input-value">value</a>;
|
|
attribute <span>Date</span> <a href="#dom-input-valueasdate" title="dom-input-valueAsDate">valueAsDate</a>;
|
|
attribute double <a href="#dom-input-valueasnumber" title="dom-input-valueAsNumber">valueAsNumber</a>;
|
|
readonly attribute <a href="#htmloptionelement">HTMLOptionElement</a> <a href="#dom-input-selectedoption" title="dom-input-selectedOption">selectedOption</a>;
|
|
attribute DOMString <a href="#dom-dim-width" title="dom-dim-width">width</a>;
|
|
|
|
void <a href="#dom-input-stepup" title="dom-input-stepUp">stepUp</a>(in optional long n);
|
|
void <a href="#dom-input-stepdown" title="dom-input-stepDown">stepDown</a>(in optional long n);
|
|
|
|
readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
|
|
readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
|
|
readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
|
|
boolean <a href="#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
|
|
void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
|
|
|
|
readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
|
|
|
|
void <a href="#dom-textarea-input-select" title="dom-textarea/input-select">select</a>();
|
|
attribute unsigned long <a href="#dom-textarea-input-selectionstart" title="dom-textarea/input-selectionStart">selectionStart</a>;
|
|
attribute unsigned long <a href="#dom-textarea-input-selectionend" title="dom-textarea/input-selectionEnd">selectionEnd</a>;
|
|
attribute DOMString <a href="#dom-textarea-input-selectiondirection" title="dom-textarea/input-selectionDirection">selectionDirection</a>;
|
|
void <a href="#dom-textarea-input-setselectionrange" title="dom-textarea/input-setSelectionRange">setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a typed data field,
|
|
usually with a form control to allow the user to edit the data.<p>The <dfn id="attr-input-type" title="attr-input-type"><code>type</code></dfn>
|
|
attribute controls the data type (and associated control) of the
|
|
element. It is an <a href="#enumerated-attribute">enumerated attribute</a>. The following
|
|
table lists the keywords and states for the attribute — the
|
|
keywords in the left column map to the states in the cell in the
|
|
second column on the same row as the keyword.<table id="attr-input-type-keywords"><thead><tr><th> Keyword
|
|
<th> State
|
|
<th> Data type
|
|
<th> Control type
|
|
<tbody><tr><td> <dfn id="attr-input-type-hidden-keyword" title="attr-input-type-hidden-keyword"><code>hidden</code></dfn>
|
|
<td> <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a>
|
|
<td> An arbitrary string
|
|
<td> n/a
|
|
<tr><td> <dfn id="attr-input-type-text-keyword" title="attr-input-type-text-keyword"><code>text</code></dfn>
|
|
<td> <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a>
|
|
<td> Text with no line breaks
|
|
<td> Text field
|
|
<tr><td> <dfn id="attr-input-type-search-keyword" title="attr-input-type-search-keyword"><code>search</code></dfn>
|
|
<td> <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a>
|
|
<td> Text with no line breaks
|
|
<td> Search field
|
|
<tr><td> <dfn id="attr-input-type-tel-keyword" title="attr-input-type-tel-keyword"><code>tel</code></dfn>
|
|
<td> <a href="#telephone-state" title="attr-input-type-tel">Telephone</a>
|
|
<td> Text with no line breaks
|
|
<td> A text field
|
|
<tr><td> <dfn id="attr-input-type-url-keyword" title="attr-input-type-url-keyword"><code>url</code></dfn>
|
|
<td> <a href="#url-state" title="attr-input-type-url">URL</a>
|
|
<td> An absolute IRI
|
|
<td> A text field
|
|
<tr><td> <dfn id="attr-input-type-email-keyword" title="attr-input-type-email-keyword"><code>email</code></dfn>
|
|
<td> <a href="#e-mail-state" title="attr-input-type-email">E-mail</a>
|
|
<td> An e-mail address or list of e-mail addresses
|
|
<td> A text field
|
|
<tr><td> <dfn id="attr-input-type-password-keyword" title="attr-input-type-password-keyword"><code>password</code></dfn>
|
|
<td> <a href="#password-state" title="attr-input-type-password">Password</a>
|
|
<td> Text with no line breaks (sensitive information)
|
|
<td> Text field that obscures data entry
|
|
<tr><td> <dfn id="attr-input-type-datetime-keyword" title="attr-input-type-datetime-keyword"><code>datetime</code></dfn>
|
|
<td> <a href="#date-and-time-state" title="attr-input-type-datetime">Date and Time</a>
|
|
<td> A date and time (year, month, day, hour, minute, second, fraction of a second) with the time zone set to UTC
|
|
<td> A date and time control
|
|
<tr><td> <dfn id="attr-input-type-date-keyword" title="attr-input-type-date-keyword"><code>date</code></dfn>
|
|
<td> <a href="#date-state" title="attr-input-type-date">Date</a>
|
|
<td> A date (year, month, day) with no time zone
|
|
<td> A date control
|
|
<tr><td> <dfn id="attr-input-type-month-keyword" title="attr-input-type-month-keyword"><code>month</code></dfn>
|
|
<td> <a href="#month-state" title="attr-input-type-month">Month</a>
|
|
<td> A date consisting of a year and a month with no time zone
|
|
<td> A month control
|
|
<tr><td> <dfn id="attr-input-type-week-keyword" title="attr-input-type-week-keyword"><code>week</code></dfn>
|
|
<td> <a href="#week-state" title="attr-input-type-week">Week</a>
|
|
<td> A date consisting of a week-year number and a week number with no time zone
|
|
<td> A week control
|
|
<tr><td> <dfn id="attr-input-type-time-keyword" title="attr-input-type-time-keyword"><code>time</code></dfn>
|
|
<td> <a href="#time-state" title="attr-input-type-time">Time</a>
|
|
<td> A time (hour, minute, seconds, fractional seconds) with no time zone
|
|
<td> A time control
|
|
<tr><td> <dfn id="attr-input-type-datetime-local-keyword" title="attr-input-type-datetime-local-keyword"><code>datetime-local</code></dfn>
|
|
<td> <a href="#local-date-and-time-state" title="attr-input-type-datetime-local">Local Date and Time</a>
|
|
<td> A date and time (year, month, day, hour, minute, second, fraction of a second) with no time zone
|
|
<td> A date and time control
|
|
<tr><td> <dfn id="attr-input-type-number-keyword" title="attr-input-type-number-keyword"><code>number</code></dfn>
|
|
<td> <a href="#number-state" title="attr-input-type-number">Number</a>
|
|
<td> A numerical value
|
|
<td> A text field or spinner control
|
|
<tr><td> <dfn id="attr-input-type-range-keyword" title="attr-input-type-range-keyword"><code>range</code></dfn>
|
|
<td> <a href="#range-state" title="attr-input-type-range">Range</a>
|
|
<td> A numerical value, with the extra semantic that the exact value is not important
|
|
<td> A slider control or similar
|
|
<tr><td> <dfn id="attr-input-type-color-keyword" title="attr-input-type-color-keyword"><code>color</code></dfn>
|
|
<td> <a href="#color-state" title="attr-input-type-color">Color</a>
|
|
<td> An sRGB color with 8-bit red, green, and blue components
|
|
<td> A color well
|
|
<tr><td> <dfn id="attr-input-type-checkbox-keyword" title="attr-input-type-checkbox-keyword"><code>checkbox</code></dfn>
|
|
<td> <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a>
|
|
<td> A set of zero or more values from a predefined list
|
|
<td> A checkbox
|
|
<tr><td> <dfn id="attr-input-type-radio-keyword" title="attr-input-type-radio-keyword"><code>radio</code></dfn>
|
|
<td> <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a>
|
|
<td> An enumerated value
|
|
<td> A radio button
|
|
<tr><td> <dfn id="attr-input-type-file-keyword" title="attr-input-type-file-keyword"><code>file</code></dfn>
|
|
<td> <a href="#file-upload-state" title="attr-input-type-file">File Upload</a>
|
|
<td> Zero or more files each with a <a href="#mime-type">MIME type</a> and optionally a file name
|
|
<td> A label and a button
|
|
<tr><td> <dfn id="attr-input-type-submit-keyword" title="attr-input-type-submit-keyword"><code>submit</code></dfn>
|
|
<td> <a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a>
|
|
<td> An enumerated value, with the extra semantic that it must be the last value selected and initiates form submission
|
|
<td> A button
|
|
<tr><td> <dfn id="attr-input-type-image-keyword" title="attr-input-type-image-keyword"><code>image</code></dfn>
|
|
<td> <a href="#image-button-state" title="attr-input-type-image">Image Button</a>
|
|
<td> A coordinate, relative to a particular image's size, with the extra semantic that it must be the last value selected and initiates form submission
|
|
<td> Either a clickable image, or a button
|
|
<tr><td> <dfn id="attr-input-type-reset-keyword" title="attr-input-type-reset-keyword"><code>reset</code></dfn>
|
|
<td> <a href="#reset-button-state" title="attr-input-type-reset">Reset Button</a>
|
|
<td> n/a
|
|
<td> A button
|
|
<tr><td> <dfn id="attr-input-type-button-keyword" title="attr-input-type-button-keyword"><code>button</code></dfn>
|
|
<td> <a href="#button-state" title="attr-input-type-button">Button</a>
|
|
<td> n/a
|
|
<td> A button
|
|
</table><p>The <i>missing value default</i> is the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state.<p>Which of the <code title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>, <code title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>, <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>, <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>, <code title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>, <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>, <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>, <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>, <code title="attr-dim-height"><a href="#attr-dim-height">height</a></code>, <code title="attr-input-list"><a href="#attr-input-list">list</a></code>, <code title="attr-input-max"><a href="#attr-input-max">max</a></code>, <code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>, <code title="attr-input-min"><a href="#attr-input-min">min</a></code>, <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>, <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>, <code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>, <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>, <code title="attr-input-required"><a href="#attr-input-required">required</a></code>, <code title="attr-input-size"><a href="#attr-input-size">size</a></code>, <code title="attr-input-src"><a href="#attr-input-src">src</a></code>, <code title="attr-input-step"><a href="#attr-input-step">step</a></code>, and <code title="attr-dim-width"><a href="#attr-dim-width">width</a></code> content attributes, the <code title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>, <code title="dom-input-files"><a href="#dom-input-files">files</a></code>, <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, <code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, <code title="dom-input-list"><a href="#dom-input-list">list</a></code>, and <code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL
|
|
attributes, the <code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> method, the <code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>, and
|
|
<code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
IDL attributes, the <code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>
|
|
method, the <code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> and
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> methods, and the
|
|
<code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply to an
|
|
<code><a href="#the-input-element">input</a></code> element depends on the state of its <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute. The following table
|
|
<span class="impl">is non-normative and</span> summarizes which of
|
|
those content attributes, IDL attributes, methods, and events apply
|
|
to each state:<table class="applies" id="input-type-attr-summary"><thead><tr><th>
|
|
<th> <span title=""><a href="#hidden-state" title="attr-input-type-hidden">Hidden</a></span>
|
|
<th> <span title=""><a href="#text-state-and-search-state" title="attr-input-type-text">Text</a>,</span>
|
|
<span title=""><a href="#text-state-and-search-state" title="attr-input-type-search">Search</a></span>
|
|
<th> <span title=""><a href="#url-state" title="attr-input-type-url">URL</a>,</span>
|
|
<span title=""><a href="#telephone-state" title="attr-input-type-tel">Telephone</a></span>
|
|
<th> <span title=""><a href="#e-mail-state" title="attr-input-type-email">E-mail</a></span>
|
|
<th> <span title=""><a href="#password-state" title="attr-input-type-password">Password</a></span>
|
|
<th> <span title=""><a href="#date-and-time-state" title="attr-input-type-datetime">Date and Time</a>,</span>
|
|
<span title=""><a href="#date-state" title="attr-input-type-date">Date</a>,</span>
|
|
<span title=""><a href="#month-state" title="attr-input-type-month">Month</a>,</span>
|
|
<span title=""><a href="#week-state" title="attr-input-type-week">Week</a>,</span>
|
|
<span title=""><a href="#time-state" title="attr-input-type-time">Time</a></span>
|
|
<th> <span title=""><a href="#local-date-and-time-state" title="attr-input-type-datetime-local">Local Date and Time</a>,</span>
|
|
<span title=""><a href="#number-state" title="attr-input-type-number">Number</a></span>
|
|
<th> <span title=""><a href="#range-state" title="attr-input-type-range">Range</a></span>
|
|
<th> <span title=""><a href="#color-state" title="attr-input-type-color">Color</a></span>
|
|
<th> <span title=""><a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a>,</span>
|
|
<span title=""><a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a></span>
|
|
<th> <span title=""><a href="#file-upload-state" title="attr-input-type-file">File Upload</a></span>
|
|
<th> <span title=""><a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a></span>
|
|
<th> <span title=""><a href="#image-button-state" title="attr-input-type-image">Image Button</a></span>
|
|
<th> <span title=""><a href="#reset-button-state" title="attr-input-type-reset">Reset Button</a>,</span>
|
|
<span title=""><a href="#button-state" title="attr-input-type-button">Button</a></span>
|
|
|
|
<tbody><tr><th colspan="15" scope="rowgroup">Content attributes
|
|
|
|
<tr><th> <code title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-dim-height"><a href="#attr-dim-height">height</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-list"><a href="#attr-input-list">list</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-min"><a href="#attr-input-min">min</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-required"><a href="#attr-input-required">required</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-size"><a href="#attr-input-size">size</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-src"><a href="#attr-input-src">src</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-input-step"><a href="#attr-input-step">step</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="attr-dim-width"><a href="#attr-dim-width">width</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
|
|
<tbody><tr><th colspan="15" scope="rowgroup">IDL attributes and methods
|
|
|
|
<tr><th> <code title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-input-files"><a href="#dom-input-files">files</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr class="impl"><th> <code title="dom-input-value"><a href="#dom-input-value">value</a></code>
|
|
<td class="yes"> <a href="#dom-input-value-default" title="dom-input-value-default">default</a>
|
|
<td class="yes"> <a href="#dom-input-value-value" title="dom-input-value-value">value</a>
|
|
<td class="yes"> <a href="#dom-input-value-value" title="dom-input-value-value">value</a>
|
|
<td class="yes"> <a href="#dom-input-value-value" title="dom-input-value-value">value</a>
|
|
<td class="yes"> <a href="#dom-input-value-value" title="dom-input-value-value">value</a>
|
|
<td class="yes"> <a href="#dom-input-value-value" title="dom-input-value-value">value</a>
|
|
<td class="yes"> <a href="#dom-input-value-value" title="dom-input-value-value">value</a>
|
|
<td class="yes"> <a href="#dom-input-value-value" title="dom-input-value-value">value</a>
|
|
<td class="yes"> <a href="#dom-input-value-value" title="dom-input-value-value">value</a>
|
|
<td class="yes"> <a href="#dom-input-value-default-on" title="dom-input-value-default-on">default/on</a>
|
|
<td class="yes"> <a href="#dom-input-value-filename" title="dom-input-value-filename">filename</a>
|
|
<td class="yes"> <a href="#dom-input-value-default" title="dom-input-value-default">default</a>
|
|
<td class="yes"> <a href="#dom-input-value-default" title="dom-input-value-default">default</a>
|
|
<td class="yes"> <a href="#dom-input-value-default" title="dom-input-value-default">default</a>
|
|
|
|
<tr><th> <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-input-list"><a href="#dom-input-list">list</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes†
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code>
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tbody><tr><th colspan="15" scope="rowgroup">Events
|
|
|
|
<tr><th> <span title=""><code title="event-input-input"><a href="#event-input-input">input</a></code> event</span>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
<tr><th> <span title=""><code title="event-input-change"><a href="#event-input-change">change</a></code> event</span>
|
|
<td class="no"> ·
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="yes"> Yes
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
<td class="no"> ·
|
|
|
|
</table><p class="note">† The dagger symbol (†) indicates that
|
|
the feature only applies when the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute is not
|
|
specified.<div class="impl">
|
|
|
|
<p>Some states of the <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute define a <dfn id="value-sanitization-algorithm">value sanitization algorithm</dfn>.</p>
|
|
|
|
<p>Each <code><a href="#the-input-element">input</a></code> element has a <a href="#concept-fe-value" title="concept-fe-value">value</a>, which is exposed by the <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute. Some states
|
|
define an <dfn id="concept-input-value-string-number" title="concept-input-value-string-number">algorithm
|
|
to convert a string to a number</dfn>, an <dfn id="concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</dfn>, an <dfn id="concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
|
|
string to a <code>Date</code> object</dfn>, and an <dfn id="concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
|
|
<code>Date</code> object to a string</dfn>, which are used by
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code>,
|
|
<code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>,
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code>.</p>
|
|
|
|
<p>Each <code><a href="#the-input-element">input</a></code> element has a boolean <dfn id="concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value flag</dfn>. The
|
|
<a href="#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value flag</a>
|
|
must be initially set to false when the element is created, and must
|
|
be set to true whenever the user interacts with the control in a way
|
|
that changes the <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</div><p>The <dfn id="attr-input-value" title="attr-input-value"><code>value</code></dfn>
|
|
content attribute gives the default <a href="#concept-fe-value" title="concept-fe-value">value</a> of the <code><a href="#the-input-element">input</a></code>
|
|
element. <span class="impl">When the <code title="attr-input-value"><a href="#attr-input-value">value</a></code> content attribute is added,
|
|
set, or removed, if the control's <a href="#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value flag</a> is
|
|
false, the user agent must set the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element to the value of
|
|
the <code title="attr-input-value"><a href="#attr-input-value">value</a></code> content attribute,
|
|
if there is one, or the empty string otherwise, and then run the
|
|
current <a href="#value-sanitization-algorithm">value sanitization algorithm</a>, if one is
|
|
defined.</span><div class="impl">
|
|
|
|
<p>Each <code><a href="#the-input-element">input</a></code> element has a <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a>, which is exposed by
|
|
the <code title="dom-input-checked"><a href="#dom-input-checked">checked</a></code> IDL
|
|
attribute.</p>
|
|
|
|
<p>Each <code><a href="#the-input-element">input</a></code> element has a boolean <dfn id="concept-input-checked-dirty-flag" title="concept-input-checked-dirty-flag">dirty checkedness
|
|
flag</dfn>. When it is true, the element is said to have a <dfn id="concept-input-checked-dirty" title="concept-input-checked-dirty"><i>dirty
|
|
checkedness</i></dfn>. The <a href="#concept-input-checked-dirty-flag" title="concept-input-checked-dirty-flag">dirty checkedness
|
|
flag</a> must be initially set to false when the element is
|
|
created, and must be set to true whenever the user interacts with
|
|
the control in a way that changes the <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a>.</p>
|
|
|
|
</div><p>The <dfn id="attr-input-checked" title="attr-input-checked"><code>checked</code></dfn>
|
|
content attribute is a <a href="#boolean-attribute">boolean attribute</a> that gives the
|
|
default <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> of the
|
|
<code><a href="#the-input-element">input</a></code> element. <span class="impl">When the <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code> content attribute is
|
|
added, if the control does not have <i title="concept-input-checked-dirty"><a href="#concept-input-checked-dirty">dirty checkedness</a></i>, the user
|
|
agent must set the <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> of the element to
|
|
true; when the <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>
|
|
content attribute is removed, if the control does not have <i title="concept-input-checked-dirty"><a href="#concept-input-checked-dirty">dirty checkedness</a></i>, the user
|
|
agent must set the <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> of the element to
|
|
false.</span><div class="impl">
|
|
|
|
<p>The <a href="#concept-form-reset-control" title="concept-form-reset-control">reset
|
|
algorithm</a> for <code><a href="#the-input-element">input</a></code> elements is to set the <a href="#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value flag</a> and
|
|
<a href="#concept-input-checked-dirty-flag" title="concept-input-checked-dirty-flag">dirty checkedness
|
|
flag</a> back to false, set the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element to the value of
|
|
the <code title="attr-input-value"><a href="#attr-input-value">value</a></code> content attribute,
|
|
if there is one, or the empty string otherwise, set the <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> of the element to true
|
|
if the element has a <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>
|
|
content attribute and false if it does not, empty the list of <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>, and
|
|
then invoke the <a href="#value-sanitization-algorithm">value sanitization algorithm</a>, if the
|
|
<code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state
|
|
defines one.</p>
|
|
|
|
<p>Each <code><a href="#the-input-element">input</a></code> element is either <dfn id="concept-input-mutable" title="concept-input-mutable"><i>mutable</i></dfn> or <dfn id="concept-input-immutable" title="concept-input-immutable"><i>immutable</i></dfn>. Except where
|
|
otherwise specified, an <code><a href="#the-input-element">input</a></code> element is always <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>. Similarly, except where
|
|
otherwise specified, the user agent should not allow the user to
|
|
modify the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> or
|
|
<a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a>.</p>
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element is <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>, it is <i title="concept-input-immutable"><a href="#concept-input-immutable">immutable</a></i>.</p>
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element does not have a
|
|
<code><a href="#document">Document</a></code> node as one of its ancestors (i.e. when it is
|
|
not in the document), it is <i title="concept-input-immutable"><a href="#concept-input-immutable">immutable</a></i>.</p>
|
|
<p class="note">The <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute can also in
|
|
some cases (e.g. for the <a href="#date-state" title="attr-input-type-date">Date</a> state, but not the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state) make an
|
|
<code><a href="#the-input-element">input</a></code> element <i title="concept-input-immutable"><a href="#concept-input-immutable">immutable</a></i>.</p>
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element is <a href="#concept-clone" title="concept-clone">cloned</a>, the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>, <a href="#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value flag</a>,
|
|
<a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a>, and <a href="#concept-input-checked-dirty-flag" title="concept-input-checked-dirty-flag">dirty checkedness
|
|
flag</a> must be propagated to the clone when it is created.</p>
|
|
|
|
<hr><p>When an <code><a href="#the-input-element">input</a></code> element is first created, the
|
|
element's rendering and behavior must be set to the rendering and
|
|
behavior defined for the <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute's state, and the <a href="#value-sanitization-algorithm">value sanitization
|
|
algorithm</a>, if one is defined for the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's state, must be
|
|
invoked.</p>
|
|
|
|
</div><div class="impl" id="input-type-change">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute changes state, the
|
|
user agent must run the following steps:</p>
|
|
|
|
<ol><li><p>If the previous state of the element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute put the <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute in the <i title="dom-input-value-value"><a href="#dom-input-value-value">value</a></i> mode, and the element's
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> is not the empty
|
|
string, and the new state of the element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute puts the <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute in either the <i title="dom-input-value-default"><a href="#dom-input-value-default">default</a></i> mode or the <i title="dom-input-value-default-on"><a href="#dom-input-value-default-on">default/on</a></i> mode, then set
|
|
the element's <code title="attr-input-value"><a href="#attr-input-value">value</a></code> content
|
|
attribute to the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.</li>
|
|
|
|
<li><p>Otherwise, if the previous state of the element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute put the <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute in any mode
|
|
other than the <i title="dom-input-value-value"><a href="#dom-input-value-value">value</a></i> mode, and
|
|
the new state of the element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute puts the <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute in the <i title="dom-input-value-value"><a href="#dom-input-value-value">value</a></i> mode, then set the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element to the value
|
|
of the <code title="attr-input-value"><a href="#attr-input-value">value</a></code> content
|
|
attribute, if there is one, or the empty string otherwise, and
|
|
then set the control's <a href="#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value flag</a> to
|
|
false.</li>
|
|
|
|
<li><p>Update the element's rendering and behavior to the new
|
|
state's.</li>
|
|
|
|
<li><p>Invoke the <a href="#value-sanitization-algorithm">value sanitization algorithm</a>, if one
|
|
is defined for the <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute's new state.</li>
|
|
|
|
</ol></div><hr><p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-input-element">input</a></code> element with its
|
|
<a href="#form-owner">form owner</a>. The <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>
|
|
attribute represents the element's name. The <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> attribute is used to make
|
|
the control non-interactive and to prevent its value from being
|
|
submitted. The <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>
|
|
attribute controls focus.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-input-indeterminate" title="dom-input-indeterminate"><code>indeterminate</code></dfn> IDL
|
|
attribute must initially be set to false. On getting, it must return
|
|
the last value it was set to. On setting, it must be set to the new
|
|
value. It has no effect except for changing the appearance of <a href="#checkbox-state" title="attr-input-type-checkbox">checkbox</a> controls.</p>
|
|
|
|
<p>The <dfn id="dom-input-accept" title="dom-input-accept"><code>accept</code></dfn>, <dfn id="dom-input-alt" title="dom-input-alt"><code>alt</code></dfn>, <dfn id="dom-input-max" title="dom-input-max"><code>max</code></dfn>, <dfn id="dom-input-min" title="dom-input-min"><code>min</code></dfn>, <dfn id="dom-input-multiple" title="dom-input-multiple"><code>multiple</code></dfn>, <dfn id="dom-input-pattern" title="dom-input-pattern"><code>pattern</code></dfn>, <dfn id="dom-input-placeholder" title="dom-input-placeholder"><code>placeholder</code></dfn>, <dfn id="dom-input-required" title="dom-input-required"><code>required</code></dfn>, <dfn id="dom-input-size" title="dom-input-size"><code>size</code></dfn>, <dfn id="dom-input-src" title="dom-input-src"><code>src</code></dfn>, and <dfn id="dom-input-step" title="dom-input-step"><code>step</code></dfn> IDL attributes must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name. The <dfn id="dom-input-dirname" title="dom-input-dirName"><code>dirName</code></dfn> IDL attribute
|
|
must <a href="#reflect">reflect</a> the <code title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code> content attribute. The <dfn id="dom-input-readonly" title="dom-input-readOnly"><code>readOnly</code></dfn> IDL attribute
|
|
must <a href="#reflect">reflect</a> the <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> content attribute. The
|
|
<dfn id="dom-input-defaultchecked" title="dom-input-defaultChecked"><code>defaultChecked</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code> content attribute. The
|
|
<dfn id="dom-input-defaultvalue" title="dom-input-defaultValue"><code>defaultValue</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the <code title="attr-input-value"><a href="#attr-input-value">value</a></code> content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-input-autocomplete" title="dom-input-autocomplete"><code>autocomplete</code></dfn> and
|
|
<dfn id="dom-input-type" title="dom-input-type"><code>type</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>. The <dfn id="dom-input-maxlength" title="dom-input-maxLength"><code>maxLength</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code> content attribute,
|
|
<a href="#limited-to-only-non-negative-numbers">limited to only non-negative numbers</a>.</p>
|
|
|
|
<p>The <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code>
|
|
attributes, and the <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
methods, are part of the <a href="#the-constraint-validation-api">constraint validation API</a>. The
|
|
<code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code> attribute provides a list
|
|
of the element's <code><a href="#the-label-element">label</a></code>s. The <code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>, <code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
and <code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>
|
|
methods and attributes expose the element's text selection. The
|
|
<code title="dom-fe-autofocus"><a href="#dom-fe-autofocus">autofocus</a></code>, <code title="dom-fe-disabled"><a href="#dom-fe-disabled">disabled</a></code>, <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code>, and <code title="dom-fe-name"><a href="#dom-fe-name">name</a></code> IDL attributes are part of the
|
|
element's forms API.</p>
|
|
|
|
</div><h5 id="states-of-the-type-attribute"><span class="secno">4.10.7.1 </span>States of the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute</h5><h6 id="hidden-state"><span class="secno">4.10.7.1.1 </span><dfn title="attr-input-type-hidden">Hidden</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state, the rules in
|
|
this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a value
|
|
that is not intended to be examined or manipulated by the user.<div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: If an <code><a href="#the-input-element">input</a></code>
|
|
element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in
|
|
the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state, it is
|
|
<a href="#barred-from-constraint-validation">barred from constraint validation</a>.</p>
|
|
|
|
</div><p>If the <code title="attr-input-value"><a href="#attr-input-value">name</a></code> attribute is
|
|
present and has a value that is a <a href="#case-sensitive">case-sensitive</a> match
|
|
for the string "<code title="attr-fe-name-charset"><a href="#attr-fe-name-charset">_charset_</a></code>", then the element's
|
|
<code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute must be
|
|
omitted.<div class="bookkeeping">
|
|
|
|
<p>The
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>
|
|
IDL attribute applies to this element and is
|
|
in mode <a href="#dom-input-value-default" title="dom-input-value-default">default</a>.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-required"><a href="#attr-input-required">required</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code class="no-backref" title="event-input-input"><a href="#event-input-input">input</a></code> and <code class="no-backref" title="event-input-change"><a href="#event-input-change">change</a></code> events do not apply.</p>
|
|
|
|
</div><h6 id="text-state-and-search-state"><span class="secno">4.10.7.1.2 </span><dfn title="attr-input-type-text">Text</dfn> state and <dfn title="attr-input-type-search">Search</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state or the <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a> state, the rules in
|
|
this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a one line
|
|
plain text edit control for the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.<p class="note">The difference between the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state and the <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a> state is primarily
|
|
stylistic: on platforms where search fields are distinguished from
|
|
regular text fields, the <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a> state might result in
|
|
an appearance consistent with the platform's search fields rather
|
|
than appearing like a regular text field.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
its <a href="#concept-fe-value" title="concept-fe-value">value</a> should be editable
|
|
by the user. User agents must not allow users to insert U+000A LINE
|
|
FEED (LF) or U+000D CARRIAGE RETURN (CR) characters into the
|
|
element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the writing direction
|
|
of the element, setting it either to a left-to-right writing
|
|
direction or a right-to-left writing direction. If the user does so,
|
|
the user agent must then run the following steps:</p>
|
|
|
|
<ol><li><p>Set the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code>
|
|
attribute to "<code title="attr-dir-ltr"><a href="#attr-dir-ltr">ltr</a></code>" if the user
|
|
selected a left-to-right writing direction, and "<code title="attr-dir-rtl"><a href="#attr-dir-rtl">rtl</a></code>" if the user selected a
|
|
right-to-left writing direction.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that bubbles named <code title="event-input">input</code> at the <code><a href="#the-input-element">input</a></code>
|
|
element.</li>
|
|
|
|
</ol></div><p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified, must have a value that contains no U+000A LINE FEED (LF)
|
|
or U+000D CARRIAGE RETURN (CR) characters.<div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: <a href="#strip-line-breaks">Strip line breaks</a> from the <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-size"><a href="#attr-input-size">size</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>, and
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attributes;
|
|
<code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
</div><h6 id="telephone-state"><span class="secno">4.10.7.1.3 </span><dfn title="attr-input-type-tel">Telephone</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#telephone-state" title="attr-input-type-tel">Telephone</a> state, the rules in
|
|
this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for editing a telephone number given in the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
its <a href="#concept-fe-value" title="concept-fe-value">value</a> should be editable
|
|
by the user. User agents may change the spacing and, with care, the
|
|
punctuation of <a href="#concept-fe-value" title="concept-fe-value">values</a> that the
|
|
user enters. User agents must not allow users to insert U+000A LINE
|
|
FEED (LF) or U+000D CARRIAGE RETURN (CR) characters into the
|
|
element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</div><p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified, must have a value that contains no U+000A LINE FEED (LF)
|
|
or U+000D CARRIAGE RETURN (CR) characters.<div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: <a href="#strip-line-breaks">Strip line breaks</a> from the <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</div><p class="note">Unlike the <a href="#url-state" title="attr-input-type-url">URL</a> and <a href="#e-mail-state" title="attr-input-type-email">E-mail</a> types, the <a href="#telephone-state" title="attr-input-type-tel">Telephone</a> type does not enforce a
|
|
particular syntax. This is intentional; in practice, telephone
|
|
number fields tend to be free-form fields, because there are a wide
|
|
variety of valid phone numbers. Systems that need to enforce a
|
|
particular format are encouraged to use the <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute or the <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code> method
|
|
to hook into the client-side validation mechanism.<div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-size"><a href="#attr-input-size">size</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>, and
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attributes;
|
|
<code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
</div><h6 id="url-state"><span class="secno">4.10.7.1.4 </span><dfn title="attr-input-type-url">URL</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#url-state" title="attr-input-type-url">URL</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for editing a single <a href="#absolute-url">absolute URL</a> given in the
|
|
element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the URL represented
|
|
by its <a href="#concept-fe-value" title="concept-fe-value">value</a>. User agents may
|
|
allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string that is not a
|
|
<a href="#valid-url" title="valid URL">valid</a> <a href="#absolute-url">absolute URL</a>, but
|
|
may also or instead automatically escape characters entered by the
|
|
user so that the <a href="#concept-fe-value" title="concept-fe-value">value</a> is
|
|
always a <a href="#valid-url" title="valid URL">valid</a> <a href="#absolute-url">absolute
|
|
URL</a> (even if that isn't the actual value seen and edited by
|
|
the user in the interface). User agents should allow the user to set
|
|
the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty
|
|
string. User agents must not allow users to insert U+000A LINE FEED
|
|
(LF) or U+000D CARRIAGE RETURN (CR) characters into the <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</div><p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-url-potentially-surrounded-by-spaces">valid URL
|
|
potentially surrounded by spaces</a> that is also an
|
|
<a href="#absolute-url">absolute URL</a>.<div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: <a href="#strip-line-breaks">Strip line breaks</a> from the <a href="#concept-fe-value" title="concept-fe-value">value</a>, then <a href="#strip-leading-and-trailing-whitespace">strip leading and
|
|
trailing whitespace</a> from the <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: While the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element is neither the
|
|
empty string nor a <a href="#valid-url" title="valid URL">valid</a>
|
|
<a href="#absolute-url">absolute URL</a>, the element is <a href="#suffering-from-a-type-mismatch">suffering from a
|
|
type mismatch</a>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-size"><a href="#attr-input-size">size</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>, and
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attributes;
|
|
<code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>If a document contained the following markup:</p>
|
|
|
|
<pre><input type="url" name="location" list="urls">
|
|
<datalist id="urls">
|
|
<option label="MIME: Format of Internet Message Bodies" value="http://tools.ietf.org/html/rfc2045">
|
|
<option label="HTML 4.01 Specification" value="http://www.w3.org/TR/html4/">
|
|
<option label="Form Controls" value="http://www.w3.org/TR/xforms/slice8.html#ui-commonelems-hint">
|
|
<option label="Scalable Vector Graphics (SVG) 1.1 Specification" value="http://www.w3.org/TR/SVG/">
|
|
<option label="Feature Sets - SVG 1.1 - 20030114" value="http://www.w3.org/TR/SVG/feature.html">
|
|
<option label="The Single UNIX Specification, Version 3" value="http://www.unix-systems.org/version3/">
|
|
</datalist>
|
|
</pre>
|
|
|
|
<p>...and the user had typed "<kbd>www.w3</kbd>", and the user
|
|
agent had also found that the user had visited
|
|
<code>http://www.w3.org/Consortium/#membership</code> and
|
|
<code>http://www.w3.org/TR/XForms/</code> in the recent past, then
|
|
the rendering might look like this:</p>
|
|
|
|
<p><img alt='A text box with an icon on the left followed by the text "www.w3" and a cursor, with a drop down button on the right hand side; with, below, a drop down box containing a list of six URLs on the left, with the first four having grayed out labels on the right; and a scroll bar to the right of the drow down box, indicating further values are available.' height="134" src="sample-url.png" width="472"></p>
|
|
|
|
<p>The first four URLs in this sample consist of the four URLs in
|
|
the author-specified list that match the text the user has entered,
|
|
sorted in some UA-defined manner (maybe by how frequently the user
|
|
refers to those URLs). Note how the UA is using the knowledge that
|
|
the values are URLs to allow the user to omit the scheme part and
|
|
perform intelligent matching on the domain name.</p>
|
|
|
|
<p>The last two URLs (and probably many more, given the scrollbar's
|
|
indications of more values being available) are the matches from
|
|
the user agent's session history data. This data is not made
|
|
available to the page DOM. In this particular case, the UA has no
|
|
titles to provide for those values.</p>
|
|
|
|
</div><h6 id="e-mail-state"><span class="secno">4.10.7.1.5 </span><dfn title="attr-input-type-email">E-mail</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#e-mail-state" title="attr-input-type-email">E-mail</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>How the <a href="#e-mail-state" title="attr-input-type-email">E-mail</a> state
|
|
operates depends on whether the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute is specified
|
|
or not.<dl class="switch"><dt>When the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>
|
|
attribute is not specified on the element</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a
|
|
control for editing an e-mail address given in the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the e-mail address
|
|
represented by its <a href="#concept-fe-value" title="concept-fe-value">value</a>.
|
|
User agents may allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string that is not a
|
|
<a href="#valid-e-mail-address">valid e-mail address</a>. The user agent should act in a
|
|
manner consistent with expecting the user to provide a single
|
|
e-mail address. User agents should allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string. User
|
|
agents must not allow users to insert U+000A LINE FEED (LF) or
|
|
U+000D CARRIAGE RETURN (CR) characters into the <a href="#concept-fe-value" title="concept-fe-value">value</a>. User agents may transform
|
|
the <a href="#concept-fe-value" title="concept-fe-value">value</a> for display and
|
|
editing; in particular, user agents should convert punycode in the
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> to IDN in the display
|
|
and vice versa.</p>
|
|
|
|
</div>
|
|
|
|
<p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a single
|
|
<a href="#valid-e-mail-address">valid e-mail address</a>.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: <a href="#strip-line-breaks">Strip line breaks</a> from the <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
<p>When the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>
|
|
attribute is removed, the user agent must run the <a href="#value-sanitization-algorithm">value
|
|
sanitization algorithm</a>.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: While the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element is neither
|
|
the empty string nor a single <a href="#valid-e-mail-address">valid e-mail address</a>,
|
|
the element is <a href="#suffering-from-a-type-mismatch">suffering from a type mismatch</a>.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
<dt>When the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>
|
|
attribute <em>is</em> specified on the element</dt>
|
|
|
|
<dd>
|
|
|
|
<div class="impl">
|
|
|
|
<p>The element's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a> are the result of
|
|
<a href="#split-a-string-on-commas" title="split a string on commas">splitting on commas</a>
|
|
the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</div>
|
|
|
|
<p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a
|
|
control for adding, removing, and editing the e-mail addresses
|
|
given in the element's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a>.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to add, remove, and edit the
|
|
e-mail addresses represented by its <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a>. User agents may
|
|
allow the user to set any individual value in the list of <a href="#concept-fe-value" title="concept-fe-value">value<em>s</em></a> to a string that
|
|
is not a <a href="#valid-e-mail-address">valid e-mail address</a>, but must not allow
|
|
users to set any individual value to a string containing U+002C
|
|
COMMA (,), U+000A LINE FEED (LF), or U+000D CARRIAGE RETURN (CR)
|
|
characters. User agents should allow the user to remove all the
|
|
addresses in the element's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a>. User agents may
|
|
transform the <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a> for display and
|
|
editing; in particular, user agents should convert punycode in the
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> to IDN in the display
|
|
and vice versa.</p>
|
|
|
|
<p>Whenever the user changes the element's <a href="#concept-fe-value" title="concept-fe-value">value<em>s</em></a>, the user agent
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">latest values</var> be a copy of the
|
|
element's <a href="#concept-fe-value" title="concept-fe-value">value<em>s</em></a>.</li>
|
|
|
|
|
|
<li><p><a href="#strip-leading-and-trailing-whitespace">Strip leading and trailing whitespace</a> from
|
|
each value in <var title="">latest values</var>.</li>
|
|
|
|
<li><p>Let the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> be the result of
|
|
concatenating all the values in <var title="">latest
|
|
values</var>, separating each value from the next by a single
|
|
U+002C COMMA character (,), maintaining the list's
|
|
order.</li>
|
|
|
|
</ol></div>
|
|
|
|
<p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-e-mail-address-list">valid e-mail address
|
|
list</a>.</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>:</p>
|
|
|
|
<ol><li><p><a href="#split-a-string-on-commas" title="split a string on commas">Split on
|
|
commas</a> the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>, <a href="#strip-leading-and-trailing-whitespace">strip leading and
|
|
trailing whitespace</a> from each resulting token, if any, and
|
|
let the element's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a> be the (possibly
|
|
empty) resulting list of (possibly empty) tokens, maintaining the
|
|
original order.</li>
|
|
|
|
<li><p>Let the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> be the result of
|
|
concatenating the element's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a>, separating each
|
|
value from the next by a single U+002C COMMA character (,),
|
|
maintaining the list's order.</li>
|
|
|
|
</ol><p>When the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>
|
|
attribute is set, the user agent must run the <a href="#value-sanitization-algorithm">value
|
|
sanitization algorithm</a>.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: While the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element is not a
|
|
<a href="#valid-e-mail-address-list">valid e-mail address list</a>, the element is
|
|
<a href="#suffering-from-a-type-mismatch">suffering from a type mismatch</a>.</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
</dl><p>A <dfn id="valid-e-mail-address">valid e-mail address</dfn> is a string that matches the
|
|
ABNF production <code title="">1*( atext / "." ) "@" ldh-str *( "." ldh-str )</code>
|
|
where <code title="">atext</code> is defined in RFC 5322 section
|
|
3.2.3, and <code title="">ldh-str</code> is defined in RFC 1034
|
|
section 3.5. <a href="#refsABNF">[ABNF]</a> <a href="#refsRFC5322">[RFC5322]</a> <a href="#refsRFC1034">[RFC1034]</a></p><p class="note">This requirement is a <a href="#willful-violation">willful violation</a>
|
|
of RFC 5322, which defines a syntax for e-mail addresses that is
|
|
simultaneously too strict (before the "@" character), too vague
|
|
(after the "@" character), and too lax (allowing comments, white
|
|
space characters, and quoted strings in manners unfamiliar to most
|
|
users) to be of practical use here.<p>A <dfn id="valid-e-mail-address-list">valid e-mail address list</dfn> is a <a href="#set-of-comma-separated-tokens">set of
|
|
comma-separated tokens</a>, where each token is itself a
|
|
<a href="#valid-e-mail-address">valid e-mail address</a>. <span class="impl">To obtain the
|
|
list of tokens from a <a href="#valid-e-mail-address-list">valid e-mail address list</a>, and
|
|
implementation must <a href="#split-a-string-on-commas" title="split a string on commas">split the
|
|
string on commas</a>.</span><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-size"><a href="#attr-input-size">size</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code> and
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attributes.</p>
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element when
|
|
the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute is
|
|
not specified:
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attribute.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
</div><h6 id="password-state"><span class="secno">4.10.7.1.6 </span><dfn title="attr-input-type-password">Password</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#password-state" title="attr-input-type-password">Password</a> state, the rules in
|
|
this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a one line
|
|
plain text edit control for the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>. The user agent should obscure
|
|
the value so that people other than the user cannot see it.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
its <a href="#concept-fe-value" title="concept-fe-value">value</a> should be editable
|
|
by the user. User agents must not allow users to insert U+000A LINE
|
|
FEED (LF) or U+000D CARRIAGE RETURN (CR) characters into the <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</div><p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified, must have a value that contains no U+000A LINE FEED (LF)
|
|
or U+000D CARRIAGE RETURN (CR) characters.<div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: <a href="#strip-line-breaks">Strip line breaks</a> from the <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-size"><a href="#attr-input-size">size</a></code> content attributes;
|
|
<code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>, and
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attributes;
|
|
<code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>, and
|
|
<code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
</div><h6 id="date-and-time-state"><span class="secno">4.10.7.1.7 </span><dfn title="attr-input-type-datetime">Date and Time</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#date-and-time-state" title="attr-input-type-datetime">Date and Time</a> state, the
|
|
rules in this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
specific <a href="#concept-datetime" title="concept-datetime">global date and
|
|
time</a>. <span class="impl">User agents may display the date and
|
|
time in whatever time zone is appropriate for the user.</span><div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the <a href="#concept-datetime" title="concept-datetime">global date and time</a> represented by
|
|
its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as obtained by
|
|
<a href="#parse-a-global-date-and-time-string" title="parse a global date and time string">parsing a global
|
|
date and time</a> from it. User agents must not allow the user to
|
|
set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a non-empty
|
|
string that is not a <a href="#valid-global-date-and-time-string">valid global date and time string</a>
|
|
expressed in UTC, though user agents may allow the user to set and
|
|
view the time in another time zone and silently translate the time
|
|
to and from the UTC time zone in the <a href="#concept-fe-value" title="concept-fe-value">value</a>. If the user agent provides a
|
|
user interface for selecting a <a href="#concept-datetime" title="concept-datetime">global
|
|
date and time</a>, then the <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to a <a href="#valid-global-date-and-time-string">valid
|
|
global date and time string</a> expressed in UTC representing the
|
|
user's selection. User agents should allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p class="note">The format shown to the user is independent of the
|
|
format used for form submission. Browsers are encouraged to use user
|
|
interfaces that present dates and times according to the conventions
|
|
of the user's preferred locale.<p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-global-date-and-time-string">valid
|
|
global date and time string</a>.</p><div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is a <a href="#valid-global-date-and-time-string">valid global date and time string</a>,
|
|
then adjust the time so that the <a href="#concept-fe-value" title="concept-fe-value">value</a> represents the same point in
|
|
time but expressed in the UTC time zone, otherwise, set it to the
|
|
empty string instead.</p>
|
|
|
|
</div><p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-global-date-and-time-string">valid global date and
|
|
time string</a>. The <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, if specified, must have a value that is a <a href="#valid-global-date-and-time-string">valid
|
|
global date and time string</a>.<p>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute is
|
|
expressed in seconds. <span class="impl">The <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a> is 1000
|
|
(which converts the seconds to milliseconds, as used in the other
|
|
algorithms).</span> The <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> is 60
|
|
seconds.<div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>,
|
|
the user agent may round the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the nearest <a href="#concept-datetime" title="concept-datetime">global date and time</a> for which the
|
|
element would not <a href="#suffering-from-a-step-mismatch" title="suffering from a step
|
|
mismatch">suffer from a step mismatch</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a>, given a string <var title="">input</var>,
|
|
is as follows</strong>: If <a href="#parse-a-global-date-and-time-string" title="parse a global date and time
|
|
string">parsing a global date and time</a> from <var title="">input</var> results in an error, then return an error;
|
|
otherwise, return the number of milliseconds elapsed from midnight
|
|
UTC on the morning of 1970-01-01 (the time represented by the value
|
|
"<code title="">1970-01-01T00:00:00.0Z</code>") to the parsed <a href="#concept-datetime" title="concept-datetime">global date and time</a>, ignoring leap
|
|
seconds.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, given a number <var title="">input</var>,
|
|
is as follows</strong>: Return a <a href="#valid-global-date-and-time-string">valid global date and time
|
|
string</a> expressed in UTC that represents the <a href="#concept-datetime" title="concept-datetime">global date and time</a> that is <var title="">input</var> milliseconds after midnight UTC on the morning
|
|
of 1970-01-01 (the time represented by the value "<code title="">1970-01-01T00:00:00.0Z</code>").</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
|
|
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href="#parse-a-global-date-and-time-string" title="parse
|
|
a global date and time string">parsing a global date and time</a>
|
|
from <var title="">input</var> results in an error, then return an
|
|
error; otherwise, return a <code>Date</code> object representing the
|
|
parsed <a href="#concept-datetime" title="concept-datetime">global date and time</a>,
|
|
expressed in UTC.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
|
|
<code>Date</code> object to a string</a>, given a
|
|
<code>Date</code> object <var title="">input</var>, is as
|
|
follows</strong>: Return a <a href="#valid-global-date-and-time-string">valid global date and time
|
|
string</a> expressed in UTC that represents the <a href="#concept-datetime" title="concept-datetime">global date and time</a> that is
|
|
represented by <var title="">input</var>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>,
|
|
<code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes;
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>, and
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following fragment shows part of a calendar application. A
|
|
user can specify a date and time for a meeting (in his local time
|
|
zone, probably, though the user agent can allow the user to change
|
|
that), and since the submitted data includes the time-zone offset,
|
|
the application can ensure that the meeting is shown at the correct
|
|
time regardless of the time zones used by all the participants.</p>
|
|
|
|
<pre><fieldset>
|
|
<legend>Add Meeting</legend>
|
|
<p><label>Meeting name: <input type=text name="meeting.label"></label>
|
|
<p><label>Meeting time: <input type=datetime name="meeting.start"></label>
|
|
</fieldset></pre>
|
|
|
|
<p>Had the application used the <code title="attr-input-type-datetime-local"><a href="#local-date-and-time-state">datetime-local</a></code> type
|
|
instead, the calendar application would have also had to explicitly
|
|
determine which time zone the user intended.</p>
|
|
|
|
</div><h6 id="date-state"><span class="secno">4.10.7.1.8 </span><dfn title="attr-input-type-date">Date</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#date-state" title="attr-input-type-date">Date</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
specific <a href="#concept-date" title="concept-date">date</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the <a href="#concept-date" title="concept-date">date</a> represented by its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as obtained by <a href="#parse-a-date-string" title="parse a date string">parsing a date</a> from it. User
|
|
agents must not allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a non-empty string that is
|
|
not a <a href="#valid-date-string">valid date string</a>. If the user agent provides a
|
|
user interface for selecting a <a href="#concept-date" title="concept-date">date</a>, then the <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to a <a href="#valid-date-string">valid
|
|
date string</a> representing the user's selection. User agents
|
|
should allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p class="note">The format shown to the user is independent of the
|
|
format used for form submission. Browsers are encouraged to use user
|
|
interfaces that present dates according to the conventions of the
|
|
user's preferred locale.<p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-date-string">valid
|
|
date string</a>.</p><div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is not a <a href="#valid-date-string">valid date string</a>, then set it
|
|
to the empty string instead.</p>
|
|
|
|
</div><p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-date-string">valid date
|
|
string</a>. The <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, if specified, must have a value that is a <a href="#valid-date-string">valid
|
|
date string</a>.<p>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute is
|
|
expressed in days. <span class="impl">The <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a> is
|
|
86,400,000 (which converts the days to milliseconds, as used in the
|
|
other algorithms).</span> The <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> is 1 day.<div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>,
|
|
the user agent may round the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the nearest <a href="#concept-date" title="concept-date">date</a> for which the element would not
|
|
<a href="#suffering-from-a-step-mismatch" title="suffering from a step mismatch">suffer from a step
|
|
mismatch</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a>, given a string <var title="">input</var>,
|
|
is as follows</strong>: If <a href="#parse-a-date-string" title="parse a date string">parsing
|
|
a date</a> from <var title="">input</var> results in an error,
|
|
then return an error; otherwise, return the number of milliseconds
|
|
elapsed from midnight UTC on the morning of 1970-01-01 (the time
|
|
represented by the value "<code title="">1970-01-01T00:00:00.0Z</code>") to midnight UTC on the
|
|
morning of the parsed <a href="#concept-date" title="concept-date">date</a>,
|
|
ignoring leap seconds.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, given a number <var title="">input</var>,
|
|
is as follows</strong>: Return a <a href="#valid-date-string">valid date string</a> that
|
|
represents the <a href="#concept-date" title="concept-date">date</a> that, in UTC,
|
|
is current <var title="">input</var> milliseconds after midnight UTC
|
|
on the morning of 1970-01-01 (the time represented by the value
|
|
"<code title="">1970-01-01T00:00:00.0Z</code>").</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
|
|
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href="#parse-a-date-string" title="parse
|
|
a date string">parsing a date</a> from <var title="">input</var>
|
|
results in an error, then return an error; otherwise, return a
|
|
<code>Date</code> object representing midnight UTC on the morning of
|
|
the parsed <a href="#concept-date" title="concept-date">date</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
|
|
<code>Date</code> object to a string</a>, given a
|
|
<code>Date</code> object <var title="">input</var>, is as
|
|
follows</strong>: Return a <a href="#valid-date-string">valid date string</a> that
|
|
represents the <a href="#concept-date" title="concept-date">date</a> current at the
|
|
time represented by <var title="">input</var> in the UTC
|
|
time zone.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>,
|
|
<code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes;
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>, and
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
</div><h6 id="month-state"><span class="secno">4.10.7.1.9 </span><dfn title="attr-input-type-month">Month</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#month-state" title="attr-input-type-month">Month</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
specific <a href="#concept-month" title="concept-month">month</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the <a href="#concept-month" title="concept-month">month</a> represented by its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as obtained by <a href="#parse-a-month-string" title="parse a month string">parsing a month</a> from it. User
|
|
agents must not allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a non-empty string that is
|
|
not a <a href="#valid-month-string">valid month string</a>. If the user agent provides a
|
|
user interface for selecting a <a href="#concept-month" title="concept-month">month</a>, then the <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to a <a href="#valid-month-string">valid
|
|
month string</a> representing the user's selection. User agents
|
|
should allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p class="note">The format shown to the user is independent of the
|
|
format used for form submission. Browsers are encouraged to use user
|
|
interfaces that present months according to the conventions of the
|
|
user's preferred locale.<p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-month-string">valid
|
|
month string</a>.</p><div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is not a <a href="#valid-month-string">valid month string</a>, then set it
|
|
to the empty string instead.</p>
|
|
|
|
</div><p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-month-string">valid month
|
|
string</a>. The <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, if specified, must have a value that is a <a href="#valid-month-string">valid
|
|
month string</a>.<p>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute is
|
|
expressed in months. <span class="impl">The <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a> is 1
|
|
(there is no conversion needed as the algorithms use months).</span>
|
|
The <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> is
|
|
1 month.<div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>,
|
|
the user agent may round the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the nearest <a href="#concept-month" title="concept-month">month</a> for which the element would not
|
|
<a href="#suffering-from-a-step-mismatch" title="suffering from a step mismatch">suffer from a step
|
|
mismatch</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a>, given a string <var title="">input</var>,
|
|
is as follows</strong>: If <a href="#parse-a-month-string" title="parse a month
|
|
string">parsing a month</a> from <var title="">input</var>
|
|
results in an error, then return an error; otherwise, return the
|
|
number of months between January 1970 and the parsed <a href="#concept-month" title="concept-month">month</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, given a number <var title="">input</var>,
|
|
is as follows</strong>: Return a <a href="#valid-month-string">valid month string</a>
|
|
that represents the <a href="#concept-month" title="concept-month">month</a> that
|
|
has <var title="">input</var> months between it and January
|
|
1970.</p>
|
|
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
|
|
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href="#parse-a-month-string" title="parse
|
|
a month string">parsing a month</a> from <var title="">input</var> results in an error, then return an error;
|
|
otherwise, return a <code>Date</code> object representing midnight
|
|
UTC on the morning of the first day of the parsed <a href="#concept-month" title="concept-month">month</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
|
|
<code>Date</code> object to a string</a>, given a
|
|
<code>Date</code> object <var title="">input</var>, is as
|
|
follows</strong>: Return a <a href="#valid-month-string">valid month string</a> that
|
|
represents the <a href="#concept-month" title="concept-month">month</a> current at
|
|
the time represented by <var title="">input</var> in the UTC
|
|
time zone.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>,
|
|
<code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes;
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>, and
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
</div><h6 id="week-state"><span class="secno">4.10.7.1.10 </span><dfn title="attr-input-type-week">Week</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#week-state" title="attr-input-type-week">Week</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
specific <a href="#concept-week" title="concept-week">week</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the <a href="#concept-week" title="concept-week">week</a> represented by its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as obtained by <a href="#parse-a-week-string" title="parse a week string">parsing a week</a> from it. User
|
|
agents must not allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a non-empty string that is
|
|
not a <a href="#valid-week-string">valid week string</a>. If the user agent provides a
|
|
user interface for selecting a <a href="#concept-week" title="concept-week">week</a>, then the <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to a <a href="#valid-week-string">valid
|
|
week string</a> representing the user's selection. User agents
|
|
should allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p class="note">The format shown to the user is independent of the
|
|
format used for form submission. Browsers are encouraged to use user
|
|
interfaces that present weeks according to the conventions of the
|
|
user's preferred locale.<p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-week-string">valid
|
|
week string</a>.</p><div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is not a <a href="#valid-week-string">valid week string</a>, then set it
|
|
to the empty string instead.</p>
|
|
|
|
</div><p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-week-string">valid week
|
|
string</a>. The <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, if specified, must have a value that is a <a href="#valid-week-string">valid
|
|
week string</a>.<p>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute is
|
|
expressed in weeks. <span class="impl">The <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a> is
|
|
604,800,000 (which converts the weeks to milliseconds, as used in
|
|
the other algorithms).</span> The <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> is 1
|
|
week. <span class="impl">The <a href="#concept-input-step-default-base" title="concept-input-step-default-base">default step base</a> is
|
|
−259,200,000 (the start of week 1970-W01).</span><div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>,
|
|
the user agent may round the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the nearest <a href="#concept-week" title="concept-week">week</a> for which the element would not
|
|
<a href="#suffering-from-a-step-mismatch" title="suffering from a step mismatch">suffer from a step
|
|
mismatch</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a>, given a string <var title="">input</var>,
|
|
is as follows</strong>: If <a href="#parse-a-week-string" title="parse a week string">parsing
|
|
a week string</a> from <var title="">input</var> results in an
|
|
error, then return an error; otherwise, return the number of
|
|
milliseconds elapsed from midnight UTC on the morning of 1970-01-01
|
|
(the time represented by the value "<code title="">1970-01-01T00:00:00.0Z</code>") to midnight UTC on the
|
|
morning of the Monday of the parsed <a href="#concept-week" title="concept-week">week</a>, ignoring leap seconds.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, given a number <var title="">input</var>,
|
|
is as follows</strong>: Return a <a href="#valid-week-string">valid week string</a> that
|
|
represents the <a href="#concept-week" title="concept-week">week</a> that, in UTC,
|
|
is current <var title="">input</var> milliseconds after midnight UTC
|
|
on the morning of 1970-01-01 (the time represented by the value
|
|
"<code title="">1970-01-01T00:00:00.0Z</code>").</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
|
|
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href="#parse-a-week-string" title="parse
|
|
a week string">parsing a week</a> from <var title="">input</var>
|
|
results in an error, then return an error; otherwise, return a
|
|
<code>Date</code> object representing midnight UTC on the morning of
|
|
the Monday of the parsed <a href="#concept-week" title="concept-week">week</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
|
|
<code>Date</code> object to a string</a>, given a
|
|
<code>Date</code> object <var title="">input</var>, is as
|
|
follows</strong>: Return a <a href="#valid-week-string">valid week string</a> that
|
|
represents the <a href="#concept-week" title="concept-week">week</a> current at the
|
|
time represented by <var title="">input</var> in the UTC
|
|
time zone.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>,
|
|
<code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes;
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>, and
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
</div><h6 id="time-state"><span class="secno">4.10.7.1.11 </span><dfn title="attr-input-type-time">Time</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#time-state" title="attr-input-type-time">Time</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
specific <a href="#concept-time" title="concept-time">time</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the <a href="#concept-time" title="concept-time">time</a> represented by its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as obtained by <a href="#parse-a-time-string" title="parse a time string">parsing a time</a> from it. User
|
|
agents must not allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a non-empty string that is
|
|
not a <a href="#valid-time-string">valid time string</a>. If the user agent provides a
|
|
user interface for selecting a <a href="#concept-time" title="concept-time">time</a>, then the <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to a <a href="#valid-time-string">valid
|
|
time string</a> representing the user's selection. User agents
|
|
should allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p class="note">The format shown to the user is independent of the
|
|
format used for form submission. Browsers are encouraged to use user
|
|
interfaces that present times according to the conventions of the
|
|
user's preferred locale.<p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-time-string">valid
|
|
time string</a>.</p><div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is not a <a href="#valid-time-string">valid time string</a>, then set it
|
|
to the empty string instead.</p>
|
|
|
|
</div><p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-time-string">valid time
|
|
string</a>. The <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, if specified, must have a value that is a <a href="#valid-time-string">valid
|
|
time string</a>.<p>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute is
|
|
expressed in seconds. <span class="impl">The <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a> is 1000
|
|
(which converts the seconds to milliseconds, as used in the other
|
|
algorithms).</span> The <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> is 60
|
|
seconds.<div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>,
|
|
the user agent may round the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the nearest <a href="#concept-time" title="concept-time">time</a> for which the element would not
|
|
<a href="#suffering-from-a-step-mismatch" title="suffering from a step mismatch">suffer from a step
|
|
mismatch</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a>, given a string <var title="">input</var>,
|
|
is as follows</strong>: If <a href="#parse-a-time-string" title="parse a time string">parsing
|
|
a time</a> from <var title="">input</var> results in an error,
|
|
then return an error; otherwise, return the number of milliseconds
|
|
elapsed from midnight to the parsed <a href="#concept-time" title="concept-time">time</a> on a day with no time changes.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, given a number <var title="">input</var>,
|
|
is as follows</strong>: Return a <a href="#valid-time-string">valid time string</a> that
|
|
represents the <a href="#concept-time" title="concept-time">time</a> that is <var title="">input</var> milliseconds after midnight on a day with no
|
|
time changes.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
|
|
string to a <code>Date</code> object</a>, given a string <var title="">input</var>, is as follows</strong>: If <a href="#parse-a-time-string" title="parse
|
|
a time string">parsing a time</a> from <var title="">input</var>
|
|
results in an error, then return an error; otherwise, return a
|
|
<code>Date</code> object representing the parsed <a href="#concept-time" title="concept-time">time</a> in UTC on 1970-01-01.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
|
|
<code>Date</code> object to a string</a>, given a
|
|
<code>Date</code> object <var title="">input</var>, is as
|
|
follows</strong>: Return a <a href="#valid-time-string">valid time string</a> that
|
|
represents the UTC <a href="#concept-time" title="concept-time">time</a> component
|
|
that is represented by <var title="">input</var>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>,
|
|
<code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes;
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>, and
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
</div><h6 id="local-date-and-time-state"><span class="secno">4.10.7.1.12 </span><dfn title="attr-input-type-datetime-local">Local Date and Time</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#local-date-and-time-state" title="attr-input-type-datetime-local">Local Date and Time</a>
|
|
state, the rules in this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
<a href="#concept-datetime-local" title="concept-datetime-local">local date and time</a>,
|
|
with no time-zone offset information.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the <a href="#concept-datetime-local" title="concept-datetime-local">date and time</a> represented by
|
|
its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as obtained by
|
|
<a href="#parse-a-local-date-and-time-string" title="parse a local date and time string">parsing a date and
|
|
time</a> from it. User agents must not allow the user to set the
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> to a non-empty string
|
|
that is not a <a href="#valid-local-date-and-time-string">valid local date and time string</a>. If the
|
|
user agent provides a user interface for selecting a <a href="#concept-datetime-local" title="concept-datetime-local">local date and time</a>, then the
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to a
|
|
<a href="#valid-local-date-and-time-string">valid local date and time string</a> representing the
|
|
user's selection. User agents should allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p class="note">The format shown to the user is independent of the
|
|
format used for form submission. Browsers are encouraged to use user
|
|
interfaces that present dates and times according to the conventions
|
|
of the user's preferred locale.<p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-local-date-and-time-string">valid
|
|
local date and time string</a>.</p><div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is not a <a href="#valid-local-date-and-time-string">valid local date and time
|
|
string</a>, then set it to the empty string instead.</p>
|
|
|
|
</div><p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-local-date-and-time-string">valid local date and
|
|
time string</a>. The <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, if specified, must have a value that is a <a href="#valid-local-date-and-time-string">valid
|
|
local date and time string</a>.<p>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute is
|
|
expressed in seconds. <span class="impl">The <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a> is 1000
|
|
(which converts the seconds to milliseconds, as used in the other
|
|
algorithms).</span> The <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> is 60
|
|
seconds.<div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>,
|
|
the user agent may round the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the nearest <a href="#concept-datetime-local" title="concept-datetime-local">local date and time</a> for which
|
|
the element would not <a href="#suffering-from-a-step-mismatch" title="suffering from a step
|
|
mismatch">suffer from a step mismatch</a>.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a>, given a string <var title="">input</var>,
|
|
is as follows</strong>: If <a href="#parse-a-local-date-and-time-string" title="parse a local date and time
|
|
string">parsing a date and time</a> from <var title="">input</var> results in an error, then return an error;
|
|
otherwise, return the number of milliseconds elapsed from midnight
|
|
on the morning of 1970-01-01 (the time represented by the value
|
|
"<code title="">1970-01-01T00:00:00.0</code>") to the parsed <a href="#concept-datetime-local" title="concept-datetime-local">local date and time</a>, ignoring
|
|
leap seconds.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, given a number <var title="">input</var>,
|
|
is as follows</strong>: Return a <a href="#valid-local-date-and-time-string">valid local date and time
|
|
string</a> that represents the date and time that is <var title="">input</var> milliseconds after midnight on the morning of
|
|
1970-01-01 (the time represented by the value "<code title="">1970-01-01T00:00:00.0</code>").</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes;
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows part of a flight booking
|
|
application. The application uses an <code><a href="#the-input-element">input</a></code> element
|
|
with its <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute set to
|
|
<code title="attr-input-type-datetime-local"><a href="#local-date-and-time-state">datetime-local</a></code>,
|
|
and it then interprets the given date and time in the time zone of
|
|
the selected airport.</p>
|
|
|
|
<pre><fieldset>
|
|
<legend>Destination</legend>
|
|
<p><label>Airport: <input type=text name=to list=airports></label></p>
|
|
<p><label>Departure time: <input type=datetime-local name=totime step=3600></label></p>
|
|
</fieldset>
|
|
<datalist id=airports>
|
|
<option value=ATL label="Atlanta">
|
|
<option value=MEM label="Memphis">
|
|
<option value=LHR label="London Heathrow">
|
|
<option value=LAX label="Los Angeles">
|
|
<option value=FRA label="Frankfurt">
|
|
</datalist></pre>
|
|
|
|
<p>If the application instead used the <code title="attr-input-type-datetime"><a href="#date-and-time-state">datetime</a></code> type, then the
|
|
user would have to work out the time-zone conversions himself,
|
|
which is clearly not a good user experience!</p>
|
|
|
|
</div><h6 id="number-state"><span class="secno">4.10.7.1.13 </span><dfn title="attr-input-type-number">Number</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#number-state" title="attr-input-type-number">Number</a> state, the rules in
|
|
this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
number.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the number
|
|
represented by its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as
|
|
obtained from applying the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating point
|
|
number values</a> to it. User agents must not allow the user to
|
|
set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a non-empty
|
|
string that is not a <a href="#valid-floating-point-number">valid floating point number</a>. If
|
|
the user agent provides a user interface for selecting a number,
|
|
then the <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to
|
|
the <a href="#best-representation-of-the-number-as-a-floating-point-number" title="best representation of the number as a floating
|
|
point number">best representation of the number representing the
|
|
user's selection as a floating point number</a>. User agents
|
|
should allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-floating-point-number">valid
|
|
floating point number</a>.</p><div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is not a <a href="#valid-floating-point-number">valid floating point number</a>,
|
|
then set it to the empty string instead.</p>
|
|
|
|
</div><p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-floating-point-number">valid floating point
|
|
number</a>. The <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, if specified, must have a value that is a <a href="#valid-floating-point-number">valid
|
|
floating point number</a>.<p><span class="impl">The <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a> is
|
|
1.</span> The <a href="#concept-input-step-default" title="concept-input-step-default">default
|
|
step</a> is 1 (allowing only integers, unless the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute has a non-integer
|
|
value).<div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>,
|
|
the user agent may round the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the nearest number for
|
|
which the element would not <a href="#suffering-from-a-step-mismatch" title="suffering from a step
|
|
mismatch">suffer from a step mismatch</a>. If there are two such
|
|
numbers, user agents are encouraged to pick the one nearest positive
|
|
infinity.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a>, given a string <var title="">input</var>,
|
|
is as follows</strong>: If applying the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing
|
|
floating point number values</a> to <var title="">input</var>
|
|
results in an error, then return an error; otherwise, return the
|
|
resulting number.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, given a number <var title="">input</var>,
|
|
is as follows</strong>: Return a <a href="#valid-floating-point-number">valid floating point
|
|
number</a> that represents <var title="">input</var>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>, and
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes;
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
</div><h6 id="range-state"><span class="secno">4.10.7.1.14 </span><dfn title="attr-input-type-range">Range</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#range-state" title="attr-input-type-range">Range</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
number, but with the caveat that the exact value is not important,
|
|
letting UAs provide a simpler interface than they do for the <a href="#number-state" title="attr-input-type-number">Number</a> state.<div class="impl">
|
|
|
|
<p class="note">In this state, the range and step constraints are
|
|
enforced even during user input, and there is no way to set the
|
|
value to the empty string.</p>
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the number
|
|
represented by its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as
|
|
obtained from applying the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating point
|
|
number values</a> to it. User agents must not allow the user to
|
|
set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string that
|
|
is not a <a href="#valid-floating-point-number">valid floating point number</a>. If the user agent
|
|
provides a user interface for selecting a number, then the <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to a <a href="#best-representation-of-the-number-as-a-floating-point-number" title="best representation of the number as a floating point
|
|
number">best representation of the number representing the user's
|
|
selection as a floating point number</a>. User agents must not
|
|
allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-floating-point-number">valid floating point
|
|
number</a>.</p><div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is not a <a href="#valid-floating-point-number">valid floating point number</a>,
|
|
then set it to a <a href="#valid-floating-point-number">valid floating point number</a> that
|
|
represents the <a href="#concept-input-value-default-range" title="concept-input-value-default-range">default value</a>.</p>
|
|
|
|
</div><p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-floating-point-number">valid floating point
|
|
number</a>. The <a href="#concept-input-min-default" title="concept-input-min-default">default
|
|
minimum</a> is 0. The <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, if specified, must have a value that is a <a href="#valid-floating-point-number">valid
|
|
floating point number</a>. The <a href="#concept-input-max-default" title="concept-input-max-default">default maximum</a> is 100.<p>The <dfn id="concept-input-value-default-range" title="concept-input-value-default-range">default
|
|
value</dfn> is the <a href="#concept-input-min" title="concept-input-min">minimum</a>
|
|
plus half the difference between the <a href="#concept-input-min" title="concept-input-min">minimum</a> and the <a href="#concept-input-max" title="concept-input-max">maximum</a>, unless the <a href="#concept-input-max" title="concept-input-max">maximum</a> is less than the <a href="#concept-input-min" title="concept-input-min">minimum</a>, in which case the <a href="#concept-input-value-default-range" title="concept-input-value-default-range">default value</a> is
|
|
the <a href="#concept-input-min" title="concept-input-min">minimum</a>.<div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-an-underflow">suffering from an
|
|
underflow</a>, the user agent must set the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a <a href="#valid-floating-point-number">valid floating point
|
|
number</a> that represents the <a href="#concept-input-min" title="concept-input-min">minimum</a>.</p>
|
|
|
|
<p>When the element is <a href="#suffering-from-an-overflow">suffering from an overflow</a>,
|
|
if the <a href="#concept-input-max" title="concept-input-max">maximum</a> is not less
|
|
than the <a href="#concept-input-min" title="concept-input-min">minimum</a>, the user
|
|
agent must set the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a <a href="#valid-floating-point-number">valid floating point
|
|
number</a> that represents the <a href="#concept-input-max" title="concept-input-max">maximum</a>.</p>
|
|
|
|
</div><p><span class="impl">The <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a> is
|
|
1.</span> The <a href="#concept-input-step-default" title="concept-input-step-default">default
|
|
step</a> is 1 (allowing only integers, unless the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute has a non-integer
|
|
value).<div class="impl">
|
|
|
|
<p>When the element is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>,
|
|
the user agent must round the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the nearest number for
|
|
which the element would not <a href="#suffering-from-a-step-mismatch" title="suffering from a step
|
|
mismatch">suffer from a step mismatch</a>, and which is greater
|
|
than or equal to the <a href="#concept-input-min" title="concept-input-min">minimum</a>,
|
|
and, if the <a href="#concept-input-max" title="concept-input-max">maximum</a> is not
|
|
less than the <a href="#concept-input-min" title="concept-input-min">minimum</a>, which
|
|
is less than or equal to the <a href="#concept-input-max" title="concept-input-max">maximum</a>. If two numbers match these
|
|
constraints, then user agents must use the one nearest to positive
|
|
infinity.</p>
|
|
|
|
<p class="example">For example, the markup
|
|
<code><input type="range" min=0 max=100 step=20 value=50></code>
|
|
results in a range control whose initial value is 60.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a>, given a string <var title="">input</var>,
|
|
is as follows</strong>: If applying the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing
|
|
floating point number values</a> to <var title="">input</var>
|
|
results in an error, then return an error; otherwise, return the
|
|
resulting number.</p>
|
|
|
|
<p><strong>The <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, given a number <var title="">input</var>,
|
|
is as follows</strong>: Return a <a href="#valid-floating-point-number">valid floating point
|
|
number</a> that represents <var title="">input</var>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>, and
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>,
|
|
<code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes;
|
|
<code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-required"><a href="#attr-input-required">required</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code> and
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code> methods.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is an example of a range control using an autocomplete list
|
|
with the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute. This
|
|
could be useful if there are values along the full range of the
|
|
control that are especially important, such as preconfigured light
|
|
levels or typical speed limits in a range control used as a speed
|
|
control. The following markup fragment:</p>
|
|
|
|
<pre><input type="range" min="-100" max="100" value="0" step="10" name="power" list="powers">
|
|
<datalist id="powers">
|
|
<option value="0">
|
|
<option value="-30">
|
|
<option value="30">
|
|
<option value="+50">
|
|
</datalist>
|
|
</pre>
|
|
|
|
<p>...with the following style sheet applied:</p>
|
|
|
|
<pre>input { height: 75px; width: 49px; background: #D5CCBB; color: black; }</pre>
|
|
|
|
<p>...might render as:</p>
|
|
|
|
<p><img alt="A vertical slider control whose primary color is black and whose background color is beige, with the slider having five tick marks, one long one at each extremity, and three short ones clustered around the midpoint." height="75" src="sample-range.png" width="49"><p>Note how the UA determined the orientation of the control from
|
|
the ratio of the style-sheet-specified height and width properties.
|
|
The colors were similiarly derived from the style sheet. The tick
|
|
marks, however, were derived from the markup. In particular, the
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute has not
|
|
affected the placement of tick marks, the UA deciding to only use
|
|
the author-specified completion values and then adding longer tick
|
|
marks at the extremes.</p>
|
|
|
|
<p>Note also how the invalid value <code title="">+50</code> was
|
|
completely ignored.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>For another example, consider the following markup fragment:</p>
|
|
|
|
<pre><input name=x type=range min=100 max=700 step=9.09090909 value=509.090909></pre>
|
|
|
|
<p>A user agent could display in a variety of ways, for instance:</p>
|
|
|
|
<p><img alt="As a dial." height="57" src="sample-range-2a.png" width="231"></p>
|
|
|
|
<p>Or, alternatively, for instance:</p>
|
|
|
|
<p><img alt="As a long horizontal slider with tick marks." height="56" src="sample-range-2b.png" width="445"></p>
|
|
|
|
<p>The user agent could pick which one to display based on the
|
|
dimensions given in the style sheet. This would allow it to
|
|
maintain the same resolution for the tick marks, despite the
|
|
differences in width.</p>
|
|
|
|
</div><h6 id="color-state"><span class="secno">4.10.7.1.15 </span><dfn title="attr-input-type-color">Color</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#color-state" title="attr-input-type-color">Color</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a color
|
|
well control, for setting the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string representing a
|
|
<a href="#simple-color">simple color</a>.<div class="impl">
|
|
|
|
<p class="note">In this state, there is always a color picked, and
|
|
there is no way to set the value to the empty string.</p>
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the color represented
|
|
by its <a href="#concept-fe-value" title="concept-fe-value">value</a>, as obtained from
|
|
applying the <a href="#rules-for-parsing-simple-color-values">rules for parsing simple color values</a> to
|
|
it. User agents must not allow the user to set the <a href="#concept-fe-value" title="concept-fe-value">value</a> to a string that is not a
|
|
<a href="#valid-lowercase-simple-color">valid lowercase simple color</a>. If the user agent
|
|
provides a user interface for selecting a color, then the <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set to the result of
|
|
using the <a href="#rules-for-serializing-simple-color-values">rules for serializing simple color values</a> to
|
|
the user's selection. User agents must not allow the user to set the
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> to the empty string.</p>
|
|
|
|
</div><p>The <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if
|
|
specified and not empty, must have a value that is a <a href="#valid-simple-color">valid
|
|
simple color</a>.<div class="impl">
|
|
|
|
<p><strong>The <a href="#value-sanitization-algorithm">value sanitization algorithm</a> is as
|
|
follows</strong>: If the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element is a <a href="#valid-simple-color">valid simple color</a>, then set it to
|
|
the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>; otherwise, set it to the string
|
|
"<code title="">#000000</code>".</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes, IDL attributes, and methods apply to the element:
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code> and
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code> content attributes;
|
|
<code title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code>, and
|
|
<code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL attributes.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>.</p>
|
|
|
|
<p>The <code title="event-input-input"><a href="#event-input-input">input</a></code> and <code title="event-input-change"><a href="#event-input-change">change</a></code> events apply.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-required"><a href="#attr-input-required">required</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
</div><h6 id="checkbox-state"><span class="secno">4.10.7.1.16 </span><dfn title="attr-input-type-checkbox">Checkbox</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state, the rules in
|
|
this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a
|
|
two-state control that represents the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> state. If the
|
|
element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> state
|
|
is true, the control represents a positive selection, and if it is
|
|
false, a negative selection. If the element's <code title="dom-input-indeterminate"><a href="#dom-input-indeterminate">indeterminate</a></code> IDL attribute
|
|
is set to true, then the control's selection should be obscured as
|
|
if the control was in a third, indeterminate, state.<p class="note">The control is never a true tri-state control, even
|
|
if the element's <code title="dom-input-indeterminate"><a href="#dom-input-indeterminate">indeterminate</a></code> IDL attribute
|
|
is set to true. The <code title="dom-input-indeterminate"><a href="#dom-input-indeterminate">indeterminate</a></code> IDL attribute
|
|
only gives the appearance of a third state.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
then: The <a href="#pre-click-activation-steps">pre-click activation steps</a> consist of setting
|
|
the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> to
|
|
its opposite value (i.e. true if it is false, false if it is true),
|
|
and of setting the element's <code title="dom-input-indeterminate"><a href="#dom-input-indeterminate">indeterminate</a></code> IDL attribute
|
|
to false. The <a href="#canceled-activation-steps">canceled activation steps</a> consist of
|
|
setting the <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> and
|
|
the element's <code title="dom-input-indeterminate"><a href="#dom-input-indeterminate">indeterminate</a></code> IDL attribute
|
|
back to the values they had before the <a href="#pre-click-activation-steps">pre-click activation
|
|
steps</a> were run. The <a href="#activation-behavior">activation behavior</a> is to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> that bubbles named <code title="event-change">change</code> at the element. </p>
|
|
|
|
<p><strong>Constraint validation</strong>: If the element is <i title="concept-input-required"><a href="#concept-input-required">required</a></i> and its <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> is false, then the
|
|
element is <a href="#suffering-from-being-missing">suffering from being missing</a>.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">input</var> . <code title="dom-input-indeterminate"><a href="#dom-input-indeterminate">indeterminate</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>When set, overrides the rendering of <a href="#checkbox-state" title="attr-input-type-checkbox">checkbox</a> controls so that
|
|
the current value is not visible.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes and IDL attributes apply to the element:
|
|
<code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>, and
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code> content attributes;
|
|
<code title="dom-input-checked"><a href="#dom-input-checked">checked</a></code> and
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attributes.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-default-on" title="dom-input-value-default-on">default/on</a>.</p>
|
|
|
|
<p>The <code title="event-input-change"><a href="#event-input-change">change</a></code> event applies.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code class="no-backref" title="event-input-input"><a href="#event-input-input">input</a></code> event does not apply.</p>
|
|
|
|
</div><h6 id="radio-button-state"><span class="secno">4.10.7.1.17 </span><dfn title="attr-input-type-radio">Radio Button</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a> state, the rules
|
|
in this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a control
|
|
that, when used in conjunction with other <code><a href="#the-input-element">input</a></code>
|
|
elements, forms a <i><a href="#radio-button-group">radio button group</a></i> in which only one
|
|
control can have its <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> state set to true. If
|
|
the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a>
|
|
state is true, the control represents the selected control in the
|
|
group, and if it is false, it indicates a control in the group that
|
|
is not selected.<p>The <dfn id="radio-button-group"><i>radio button group</i></dfn> that contains an
|
|
<code><a href="#the-input-element">input</a></code> element <var title="">a</var> also contains all
|
|
the other <code><a href="#the-input-element">input</a></code> elements <var title="">b</var> that
|
|
fulfill all of the following conditions:<ul><li>The <code><a href="#the-input-element">input</a></code> element <var title="">b</var>'s <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a> state.</li>
|
|
|
|
<li>Either <var title="">a</var> and <var title="">b</var> have the
|
|
same <a href="#form-owner">form owner</a>, or they both have no <a href="#form-owner">form
|
|
owner</a>.</li>
|
|
|
|
<li>They both have a <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>
|
|
attribute, their <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attributes
|
|
are not empty, and the value of <var title="">a</var>'s <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute is a <a href="#compatibility-caseless">compatibility
|
|
caseless</a> match for the value of <var title="">b</var>'s
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute.</li>
|
|
|
|
</ul><p>A document must not contain an <code><a href="#the-input-element">input</a></code> element whose
|
|
<i><a href="#radio-button-group">radio button group</a></i> contains only that element.<div class="impl">
|
|
|
|
<p>When any of the following phenomena occur, if the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> state is true after
|
|
the occurrence, the <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> state of all the other
|
|
elements in the same <i><a href="#radio-button-group">radio button group</a></i> must be set to
|
|
false:</p>
|
|
|
|
<ul><li>The element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> state is set to
|
|
true (for whatever reason).</li>
|
|
|
|
<li>The element's <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute
|
|
is set, changed, or removed.</li>
|
|
|
|
<li>The element's <a href="#form-owner">form owner</a> changes.</li>
|
|
|
|
</ul><p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
then: The <a href="#pre-click-activation-steps">pre-click activation steps</a> consist of setting
|
|
the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> to
|
|
true. The <a href="#canceled-activation-steps">canceled activation steps</a> consist of setting
|
|
the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> to
|
|
false. The <a href="#activation-behavior">activation behavior</a> is to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> that bubbles named <code title="event-change">change</code> at the element. .</p>
|
|
|
|
<p><strong>Constraint validation</strong>: If an element in the
|
|
<i><a href="#radio-button-group">radio button group</a></i> is <i title="concept-input-required"><a href="#concept-input-required">required</a></i>, and all of the
|
|
<code><a href="#the-input-element">input</a></code> elements in the <i><a href="#radio-button-group">radio button group</a></i> have a
|
|
<a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> that is false,
|
|
then the element is <a href="#suffering-from-being-missing">suffering from being missing</a>.</p>
|
|
|
|
</div><p class="note">If none of the radio buttons in a <a href="#radio-button-group">radio button
|
|
group</a> are checked when they are inserted into the document,
|
|
then they will all be initially unchecked in the interface, until
|
|
such time as one of them is checked (either by the user or by
|
|
script).<div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes and IDL attributes apply to the element:
|
|
<code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code> and
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code> content attributes;
|
|
<code title="dom-input-checked"><a href="#dom-input-checked">checked</a></code> and
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attributes.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-default-on" title="dom-input-value-default-on">default/on</a>.</p>
|
|
|
|
<p>The <code title="event-input-change"><a href="#event-input-change">change</a></code> event applies.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code class="no-backref" title="event-input-input"><a href="#event-input-input">input</a></code> event does not apply.</p>
|
|
|
|
</div><h6 id="file-upload-state"><span class="secno">4.10.7.1.18 </span><dfn title="attr-input-type-file">File Upload</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#file-upload-state" title="attr-input-type-file">File Upload</a> state, the rules in this
|
|
section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a list of
|
|
<dfn id="concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</dfn>,
|
|
each file consisting of a file name, a file type, and a file body
|
|
(the contents of the file).<div class="impl">
|
|
|
|
<p>File names may contain partial paths, e.g. in the case that a
|
|
user has selected an entire directory hierarchy. Path components
|
|
should be separated from each other using U+005C REVERSE SOLIDUS
|
|
character (\).</p>
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to change the files on the
|
|
list, e.g. adding or removing files. Files can be from the
|
|
filesystem or created on the fly, e.g. a picture taken from a camera
|
|
connected to the user's device.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: If the element is <i title="concept-input-required"><a href="#concept-input-required">required</a></i> and the list of <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a> is
|
|
empty, then the element is <a href="#suffering-from-being-missing">suffering from being
|
|
missing</a>.</p>
|
|
|
|
<p>Unless the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>
|
|
attribute is set, there must be no more than one file in the list of
|
|
<a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected
|
|
files</a>.</p>
|
|
|
|
</div><hr><p>The <dfn id="attr-input-accept" title="attr-input-accept"><code>accept</code></dfn>
|
|
attribute may be specified to provide user agents with a hint of
|
|
what file types will be accepted.<p>If specified, the attribute must consist of a <a href="#set-of-comma-separated-tokens">set of
|
|
comma-separated tokens</a>, each of which must be an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for one of the following:<dl><dt>The string <code title="">audio/*</code></dt>
|
|
|
|
<dd>Indicates that sound files are accepted.</dd>
|
|
|
|
<dt>The string <code title="">video/*</code></dt>
|
|
|
|
<dd>Indicates that video files are accepted.</dd>
|
|
|
|
<dt>The string <code title="">image/*</code></dt>
|
|
|
|
<dd>Indicates that image files are accepted.</dd>
|
|
|
|
<dt>A <a href="#valid-mime-type-with-no-parameters">valid MIME type with no parameters</a></dt>
|
|
|
|
<dd>Indicates that files of the specified type are accepted.</dd>
|
|
|
|
</dl><p>The tokens must not be <a href="#ascii-case-insensitive">ASCII case-insensitive</a>
|
|
matches for any of the other tokens (i.e. duplicates are not
|
|
allowed). <span class="impl">To obtain the list of tokens from the
|
|
attribute, the user agent must <a href="#split-a-string-on-commas" title="split a string on
|
|
commas">split the attribute value on commas</a>.</span><p>User agents may use the value of this attribute to display a more
|
|
appropriate user interface than a generic file picker. For instance,
|
|
given the value <code title="">image/*</code>, a user agent could
|
|
offer the user the option of using a local camera or selecting a
|
|
photograph from their photo collection; given the value <code title="">audio/*</code>, a user agent could offer the user the
|
|
option of recording a clip using a headset microphone.<div class="impl">
|
|
|
|
<p>User agents should prevent the user from selecting files that are
|
|
not accepted by one (or more) of these tokens.</p>
|
|
|
|
</div><div class="example" id="fakepath-srsly">
|
|
|
|
<p>For historical reasons, the <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute prefixes the
|
|
filename with the string "<code title="">C:\fakepath\</code>". Some
|
|
legacy user agents actually included the full path (which was a
|
|
security vulnerability). As a result of this, obtaining the
|
|
filename from the <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL
|
|
attribute in a backwards-compatible way is non-trivial. The
|
|
following function extracts the filename in a suitably compatible
|
|
manner:</p>
|
|
|
|
<pre>function extractFilename(path) { var x;
|
|
x = path.lastIndexOf('\\');
|
|
if (x >= 0) // Windows-based path
|
|
return path.substr(x+1);
|
|
x = path.lastIndexOf('/');
|
|
if (x >= 0) // Unix-based path
|
|
return path.substr(x+1);
|
|
return path; // just the filename
|
|
}</pre>
|
|
|
|
<p>This can be used as follows:</p>
|
|
|
|
<pre><p><input type=file name=image onchange="updateFilename(this.value)"></p>
|
|
<p>The name of the file you picked is: <span id="filename">(none)</span></p>
|
|
<script>
|
|
function updateFilename(path) {
|
|
var name = extractFilename(path);
|
|
document.getElementById('filename').textContent = name;
|
|
}
|
|
</script></pre>
|
|
|
|
|
|
|
|
</div><hr><div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes apply to the element:
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes and IDL attributes apply to the element:
|
|
<code title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>, and
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>;
|
|
<code title="dom-input-files"><a href="#dom-input-files">files</a></code> and
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attributes.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-filename" title="dom-input-value-filename">filename</a>.</p>
|
|
|
|
<p>The <code title="event-input-change"><a href="#event-input-change">change</a></code> event applies.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The element's <code title="attr-input-value"><a href="#attr-input-value">value</a></code>
|
|
attribute must be omitted.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code class="no-backref" title="event-input-input"><a href="#event-input-input">input</a></code> event does not apply.</p>
|
|
|
|
</div><h6 id="submit-button-state"><span class="secno">4.10.7.1.19 </span><dfn title="attr-input-type-submit">Submit Button</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a> state, the rules
|
|
in this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a button
|
|
that, when activated, submits the form. <span class="impl">If the
|
|
element has a <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute,
|
|
the button's label must be the value of that attribute; otherwise,
|
|
it must be an implementation-defined string that means "Submit" or
|
|
some such.</span> The element is a <a href="#concept-button" title="concept-button">button</a>, specifically a <a href="#concept-submit-button" title="concept-submit-button">submit button</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to activate the element.</p>
|
|
|
|
<p>The element's <a href="#activation-behavior">activation behavior</a>, if the element
|
|
has a <a href="#form-owner">form owner</a>, is to <a href="#concept-form-submit" title="concept-form-submit">submit</a> the <a href="#form-owner">form
|
|
owner</a> from the <code><a href="#the-input-element">input</a></code> element; otherwise, it is
|
|
to do nothing.</p>
|
|
|
|
</div><p>The <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>, <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code> attributes are <a href="#attributes-for-form-submission">attributes
|
|
for form submission</a>.<p class="note">The <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code> attribute can
|
|
be used to make submit buttons that do not trigger the constraint
|
|
validation.<div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes and IDL attributes apply to the element:
|
|
<code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>, and
|
|
<code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code> content attributes;
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-default" title="dom-input-value-default">default</a>.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-required"><a href="#attr-input-required">required</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code class="no-backref" title="event-input-input"><a href="#event-input-input">input</a></code> and <code class="no-backref" title="event-input-change"><a href="#event-input-change">change</a></code> events do not apply.</p>
|
|
|
|
</div><h6 id="image-button-state"><span class="secno">4.10.7.1.20 </span><dfn title="attr-input-type-image">Image Button</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, the rules
|
|
in this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> either an
|
|
image from which a user can select a coordinate and submit the form,
|
|
or alternatively a button from which the user can submit the
|
|
form. The element is a <a href="#concept-button" title="concept-button">button</a>,
|
|
specifically a <a href="#concept-submit-button" title="concept-submit-button">submit
|
|
button</a>.<hr><p>The image is given by the <dfn id="attr-input-src" title="attr-input-src"><code>src</code></dfn> attribute. The <code title="attr-input-src"><a href="#attr-input-src">src</a></code> attribute must be present, and
|
|
must contain a <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</a> referencing a non-interactive, optionally animated,
|
|
image resource that is neither paged nor scripted.<div class="impl">
|
|
|
|
<p>When any of the following events occur, unless the user agent
|
|
cannot support images, or its support for images has been disabled,
|
|
or the user agent only fetches elements on demand, or the <code title="attr-input-src"><a href="#attr-input-src">src</a></code> attribute's value is the empty
|
|
string, the user agent must <a href="#resolve-a-url" title="resolve a
|
|
url">resolve</a> the value of the <code title="attr-input-src"><a href="#attr-input-src">src</a></code> attribute, relative to the
|
|
element, and if that is successful, must <a href="#fetch">fetch</a> the
|
|
resulting <a href="#absolute-url">absolute URL</a>:</p>
|
|
<ul><li>The <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is first set to the
|
|
<a href="#image-button-state" title="attr-input-type-image">Image Button</a> state
|
|
(possibly when the element is first created), and the <code title="attr-input-src"><a href="#attr-input-src">src</a></code> attribute is present.</li>
|
|
|
|
<li>The <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is changed back to
|
|
the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state,
|
|
and the <code title="attr-input-src"><a href="#attr-input-src">src</a></code> attribute is
|
|
present, and its value has changed since the last time the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute was in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state.</li>
|
|
|
|
<li>The <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, and the
|
|
<code title="attr-input-src"><a href="#attr-input-src">src</a></code> attribute is set or
|
|
changed.</li>
|
|
|
|
</ul><p>Fetching the image must <a href="#delay-the-load-event">delay the load event</a> of the
|
|
element's document until the <a href="#concept-task" title="concept-task">task</a>
|
|
that is <a href="#queue-a-task" title="queue a task">queued</a> by the
|
|
<a href="#networking-task-source">networking task source</a> once the resource has been <a href="#fetch" title="fetch">fetched</a> (defined below) has been run.</p>
|
|
|
|
<p>If the image was successfully obtained, with no network errors,
|
|
and the image's type is a supported image type, and the image is a
|
|
valid image of that type, then the image is said to be <dfn id="input-img-available" title="input-img-available"><i>available</i></dfn>. If this is true
|
|
before the image is completely downloaded, each <a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue a
|
|
task">queued</a> by the <a href="#networking-task-source">networking task source</a> while
|
|
the image is being <a href="#fetch" title="fetch">fetched</a> must update
|
|
the presentation of the image appropriately.</p>
|
|
|
|
<p>The user agents should apply the <a href="#content-type-sniffing:-image" title="Content-Type
|
|
sniffing: image">image sniffing rules</a> to determine the type
|
|
of the image, with the image's <a href="#content-type" title="Content-Type">associated
|
|
Content-Type headers</a> giving the <var title="">official
|
|
type</var>. If these rules are not applied, then the type of the
|
|
image must be the type given by the image's <a href="#content-type" title="Content-Type">associated Content-Type headers</a>.</p>
|
|
|
|
<p>User agents must not support non-image resources with the
|
|
<code><a href="#the-input-element">input</a></code> element. User agents must not run executable code
|
|
embedded in the image resource. User agents must only display the
|
|
first page of a multipage resource. User agents must not allow the
|
|
resource to act in an interactive fashion, but should honor any
|
|
animation in the resource.</p>
|
|
|
|
<p>The <a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue a task">queued</a> by the <a href="#networking-task-source">networking task
|
|
source</a> once the resource has been <a href="#fetch" title="fetch">fetched</a>, must, if the download was successful
|
|
and the image is <i title="input-img-available"><a href="#input-img-available">available</a></i>,
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-load">load</code> at the <code><a href="#the-input-element">input</a></code>
|
|
element; and otherwise, if the fetching process fails without a
|
|
response from the remote server, or completes but the image is not a
|
|
valid or supported image, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-error">error</code> on
|
|
the <code><a href="#the-input-element">input</a></code> element.</p>
|
|
|
|
<hr></div><p>The <dfn id="attr-input-alt" title="attr-input-alt"><code>alt</code></dfn> attribute
|
|
provides the textual label for the alternative button for users and
|
|
user agents who cannot use the image. The <code title="attr-input-alt"><a href="#attr-input-alt">alt</a></code> attribute must also be present,
|
|
and must contain a non-empty string.<p>The <code><a href="#the-input-element">input</a></code> element supports <a href="#dimension-attributes">dimension
|
|
attributes</a>.<div class="impl">
|
|
|
|
<hr><p>If the <code title="attr-input-src"><a href="#attr-input-src">src</a></code> attribute is set,
|
|
and the image is <i title="input-img-available"><a href="#input-img-available">available</a></i> and
|
|
the user agent is configured to display that image, then: The
|
|
element <a href="#represents">represents</a> a control for selecting a <a href="#concept-input-type-image-coordinate" title="concept-input-type-image-coordinate">coordinate</a> from
|
|
the image specified by the <code title="attr-input-src"><a href="#attr-input-src">src</a></code>
|
|
attribute; if the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>, the user agent should
|
|
allow the user to select this <a href="#concept-input-type-image-coordinate" title="concept-input-type-image-coordinate">coordinate</a>. The
|
|
<a href="#activation-behavior">activation behavior</a> in this case consists of taking the
|
|
user's selected <a href="#concept-input-type-image-coordinate" title="concept-input-type-image-coordinate">coordinate</a>, and
|
|
then, if the element has a <a href="#form-owner">form owner</a>, <a href="#concept-form-submit" title="concept-form-submit">submitting</a> the <code><a href="#the-input-element">input</a></code>
|
|
element's <a href="#form-owner">form owner</a> from the <code><a href="#the-input-element">input</a></code>
|
|
element. If the user activates the control without explicitly
|
|
selecting a coordinate, then the coordinate (0,0) must be
|
|
assumed.</p>
|
|
|
|
<p>Otherwise, the element <a href="#represents">represents</a> a submit button
|
|
whose label is given by the value of the <code title="attr-input-alt"><a href="#attr-input-alt">alt</a></code> attribute; if the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>, the user agent should
|
|
allow the user to activate the button. The <a href="#activation-behavior">activation
|
|
behavior</a> in this case consists of setting the <a href="#concept-input-type-image-coordinate" title="concept-input-type-image-coordinate">selected
|
|
coordinate</a> to (0,0), and then, if the element has a
|
|
<a href="#form-owner">form owner</a>, <a href="#concept-form-submit" title="concept-form-submit">submitting</a> the <code><a href="#the-input-element">input</a></code>
|
|
element's <a href="#form-owner">form owner</a> from the <code><a href="#the-input-element">input</a></code>
|
|
element.</p>
|
|
|
|
<p>The <dfn id="concept-input-type-image-coordinate" title="concept-input-type-image-coordinate">selected
|
|
coordinate</dfn> must consist of an <var title="">x</var>-component
|
|
and a <var title="">y</var>-component. The coordinates represent the
|
|
position relative to the edge of the image, with the coordinate
|
|
space having the positive <var title="">x</var> direction to the
|
|
right, and the positive <var title="">y</var> direction
|
|
downwards.</p>
|
|
|
|
<p>The <var title="">x</var>-component must be a <a href="#valid-integer">valid
|
|
integer</a> representing a number <var title="">x</var> in the
|
|
range <span title="">−(<var title="">border<sub title="">left</sub></var>+<var title="">padding<sub title="">left</sub></var>) ≤ <var title="">x</var> ≤ <var title="">width</var>+<var title="">border<sub title="">right</sub></var>+<var title="">padding<sub title="">right</sub></var></span>, where <var title="">width</var>
|
|
is the rendered width of the image, <var title="">border<sub title="">left</sub></var> is the width of the border on the left of
|
|
the image, <var title="">padding<sub title="">left</sub></var> is
|
|
the width of the padding on the left of the image, <var title="">border<sub title="">right</sub></var> is the width of the
|
|
border on the right of the image, and <var title="">padding<sub title="">right</sub></var> is the width of the padding on the right
|
|
of the image, with all dimensions given in CSS pixels.</p>
|
|
|
|
<p>The <var title="">y</var>-component must be a <a href="#valid-integer">valid
|
|
integer</a> representing a number <var title="">y</var> in the
|
|
range <span title="">−(<var title="">border<sub title="">top</sub></var>+<var title="">padding<sub title="">top</sub></var>) ≤ <var title="">y</var> ≤ <var title="">height</var>+<var title="">border<sub title="">bottom</sub></var>+<var title="">padding<sub title="">bottom</sub></var></span>, where <var title="">height</var>
|
|
is the rendered height of the image, <var title="">border<sub title="">top</sub></var> is the width of the border above the image,
|
|
<var title="">padding<sub title="">top</sub></var> is the width of
|
|
the padding above the image, <var title="">border<sub title="">bottom</sub></var> is the width of the border below the
|
|
image, and <var title="">padding<sub title="">bottom</sub></var> is
|
|
the width of the padding below the image, with all dimensions given
|
|
in CSS pixels.</p>
|
|
|
|
<p>Where a border or padding is missing, its width is zero CSS
|
|
pixels.</p>
|
|
|
|
<hr></div><p>The <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>, <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code> attributes are <a href="#attributes-for-form-submission">attributes
|
|
for form submission</a>.<div class="bookkeeping">
|
|
|
|
<p>The following common <code><a href="#the-input-element">input</a></code> element content
|
|
attributes and IDL attributes apply to the element:
|
|
<code title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code title="attr-input-src"><a href="#attr-input-src">src</a></code>, and
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">width</a></code> content attributes;
|
|
<code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute.</p>
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute is
|
|
in mode <a href="#dom-input-value-default" title="dom-input-value-default">default</a>.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-required"><a href="#attr-input-required">required</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>, and
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>.</p>
|
|
|
|
<p>The element's <code title="attr-input-value"><a href="#attr-input-value">value</a></code>
|
|
attribute must be omitted.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code class="no-backref" title="event-input-input"><a href="#event-input-input">input</a></code> and <code class="no-backref" title="event-input-change"><a href="#event-input-change">change</a></code> events do not apply.</p>
|
|
|
|
</div><p class="note">Many aspects of this state's behavior are similar to
|
|
the behavior of the <code><a href="#the-img-element">img</a></code> element. Readers are encouraged
|
|
to read that section, where many of the same requirements are
|
|
described in more detail.<h6 id="reset-button-state"><span class="secno">4.10.7.1.21 </span><dfn title="attr-input-type-reset">Reset Button</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#reset-button-state" title="attr-input-type-reset">Reset Button</a> state, the rules
|
|
in this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a button
|
|
that, when activated, resets the form. <span class="impl">If the
|
|
element has a <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute,
|
|
the button's label must be the value of that attribute; otherwise,
|
|
it must be an implementation-defined string that means "Reset" or
|
|
some such.</span> The element is a <a href="#concept-button" title="concept-button">button</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to activate the element.</p>
|
|
|
|
<p>The element's <a href="#activation-behavior">activation behavior</a>, if the element
|
|
has a <a href="#form-owner">form owner</a>, is to <a href="#concept-form-reset" title="concept-form-reset">reset</a> the <a href="#form-owner">form owner</a>;
|
|
otherwise, it is to do nothing.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: The element is
|
|
<a href="#barred-from-constraint-validation">barred from constraint validation</a>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute
|
|
applies to this element and is in mode <a href="#dom-input-value-default" title="dom-input-value-default">default</a>.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-required"><a href="#attr-input-required">required</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code class="no-backref" title="event-input-input"><a href="#event-input-input">input</a></code> and <code class="no-backref" title="event-input-change"><a href="#event-input-change">change</a></code> events do not apply.</p>
|
|
|
|
</div><h6 id="button-state"><span class="secno">4.10.7.1.22 </span><dfn title="attr-input-type-button">Button</dfn> state</h6><div class="impl">
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#button-state" title="attr-input-type-button">Button</a> state, the rules in
|
|
this section apply.</p>
|
|
|
|
</div><p>The <code><a href="#the-input-element">input</a></code> element <a href="#represents">represents</a> a button
|
|
with no default behavior. A label for the button must be provided in
|
|
the <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, though it
|
|
may be the empty string. <span class="impl">If the element has a
|
|
<code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, the button's
|
|
label must be the value of that attribute; otherwise, it must be the
|
|
empty string.</span> The element is a <a href="#concept-button" title="concept-button">button</a>.<div class="impl">
|
|
|
|
<p>If the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>,
|
|
the user agent should allow the user to activate the element. The
|
|
element's <a href="#activation-behavior">activation behavior</a> is to do nothing.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: The element is
|
|
<a href="#barred-from-constraint-validation">barred from constraint validation</a>.</p>
|
|
|
|
</div><div class="bookkeeping">
|
|
|
|
<p>The <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute
|
|
applies to this element and is in mode <a href="#dom-input-value-default" title="dom-input-value-default">default</a>.</p>
|
|
|
|
<p>The following content attributes must not be specified and do not
|
|
apply to the element:
|
|
<code class="no-backref" title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>,
|
|
<code class="no-backref" title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>,
|
|
<code class="no-backref" title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>,
|
|
<code class="no-backref" title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>,
|
|
<code class="no-backref" title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>,
|
|
<code class="no-backref" title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>,
|
|
<code class="no-backref" title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>,
|
|
<code class="no-backref" title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>,
|
|
<code class="no-backref" title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>,
|
|
<code class="no-backref" title="attr-dim-height"><a href="#attr-dim-height">height</a></code>,
|
|
<code class="no-backref" title="attr-input-list"><a href="#attr-input-list">list</a></code>,
|
|
<code class="no-backref" title="attr-input-max"><a href="#attr-input-max">max</a></code>,
|
|
<code class="no-backref" title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code class="no-backref" title="attr-input-min"><a href="#attr-input-min">min</a></code>,
|
|
<code class="no-backref" title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>,
|
|
<code class="no-backref" title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>,
|
|
<code class="no-backref" title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>,
|
|
<code class="no-backref" title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>,
|
|
<code class="no-backref" title="attr-input-required"><a href="#attr-input-required">required</a></code>,
|
|
<code class="no-backref" title="attr-input-size"><a href="#attr-input-size">size</a></code>,
|
|
<code class="no-backref" title="attr-input-src"><a href="#attr-input-src">src</a></code>,
|
|
<code class="no-backref" title="attr-input-step"><a href="#attr-input-step">step</a></code>, and
|
|
<code class="no-backref" title="attr-dim-width"><a href="#attr-dim-width">width</a></code>.</p>
|
|
|
|
<p>The following IDL attributes and methods do not apply to the
|
|
element:
|
|
<code class="no-backref" title="dom-input-checked"><a href="#dom-input-checked">checked</a></code>,
|
|
<code class="no-backref" title="dom-input-files"><a href="#dom-input-files">files</a></code>,
|
|
<code class="no-backref" title="dom-input-list"><a href="#dom-input-list">list</a></code>,
|
|
<code class="no-backref" title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
<code class="no-backref" title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code>, and
|
|
<code class="no-backref" title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> IDL attributes;
|
|
<code class="no-backref" title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>,
|
|
<code class="no-backref" title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>,
|
|
<code class="no-backref" title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code>, and
|
|
<code class="no-backref" title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods.</p>
|
|
|
|
<p>The <code class="no-backref" title="event-input-input"><a href="#event-input-input">input</a></code> and <code class="no-backref" title="event-input-change"><a href="#event-input-change">change</a></code> events do not apply.</p>
|
|
|
|
</div><h5 id="common-input-element-attributes"><span class="secno">4.10.7.2 </span>Common <code><a href="#the-input-element">input</a></code> element attributes</h5><div class="impl">
|
|
|
|
<p>These attributes only apply to an <code><a href="#the-input-element">input</a></code> element if
|
|
its <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in a
|
|
state whose definition declares that the attribute applies. When an
|
|
attribute doesn't apply to an <code><a href="#the-input-element">input</a></code> element, user
|
|
agents must <a href="#ignore">ignore</a> the attribute, regardless of the
|
|
requirements and definitions below.</p>
|
|
|
|
</div><h6 id="the-autocomplete-attribute"><span class="secno">4.10.7.2.1 </span>The <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code> attribute</h6><p>User agents sometimes have features for helping users fill forms
|
|
in, for example prefilling the user's address based on earlier user
|
|
input.<p>The <dfn id="attr-input-autocomplete" title="attr-input-autocomplete"><code>autocomplete</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">enumerated attribute</a>. The attribute has
|
|
three states. The <code title="attr-input-autocomplete-on">on</code>
|
|
keyword maps to the <dfn id="attr-input-autocomplete-on-state" title="attr-input-autocomplete-on-state">on</dfn> state, and the
|
|
<code title="attr-input-autocomplete-off">off</code> keyword maps to
|
|
the <dfn id="attr-input-autocomplete-off-state" title="attr-input-autocomplete-off-state">off</dfn>
|
|
state. The attribute may also be omitted. The <i>missing value
|
|
default</i> is the <dfn id="attr-input-autocomplete-default-state" title="attr-input-autocomplete-default-state">default</dfn>
|
|
state.<p>The <a href="#attr-input-autocomplete-off-state" title="attr-input-autocomplete-off-state">off</a>
|
|
state indicates either that the control's input data is particularly
|
|
sensitive (for example the activation code for a nuclear weapon); or
|
|
that it is a value that will never be reused (for example a
|
|
one-time-key for a bank login) and the user will therefore have to
|
|
explicitly enter the data each time, instead of being able to rely
|
|
on the UA to prefill the value for him; or that the document
|
|
provides its own autocomplete mechanism and does not want the user
|
|
agent to provide autocompletion values.<p>Conversely, the <a href="#attr-input-autocomplete-on-state" title="attr-input-autocomplete-on-state">on</a> state indicates
|
|
that the value is not particularly sensitive and the user can expect
|
|
to be able to rely on his user agent to remember values he has
|
|
entered for that control.<p>The <a href="#attr-input-autocomplete-default-state" title="attr-input-autocomplete-default-state">default</a> state
|
|
indicates that the user agent is to use the <code title="attr-form-autocomplete"><a href="#attr-form-autocomplete">autocomplete</a></code> attribute on the
|
|
element's <a href="#form-owner">form owner</a> instead. (By default, the <code title="attr-form-autocomplete"><a href="#attr-form-autocomplete">autocomplete</a></code> attribute of
|
|
<code><a href="#the-form-element">form</a></code> elements is in the <a href="#attr-form-autocomplete-on-state" title="attr-form-autocomplete-on-state">on</a> state.)<div class="impl">
|
|
|
|
<p>Each <code><a href="#the-input-element">input</a></code> element has a <dfn id="resulting-autocompletion-state">resulting
|
|
autocompletion state</dfn>, which is either <i title="">on</i> or <i title="">off</i>.</p>
|
|
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element is in one of the following
|
|
conditions, the <code><a href="#the-input-element">input</a></code> element's <a href="#resulting-autocompletion-state">resulting
|
|
autocompletion state</a> is <i title="">on</i>; otherwise, the
|
|
<code><a href="#the-input-element">input</a></code> element's <a href="#resulting-autocompletion-state">resulting autocompletion
|
|
state</a> is <i title="">off</i>:</p>
|
|
|
|
<ul class="brief"><li>Its <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>
|
|
attribute is in the <a href="#attr-input-autocomplete-on-state" title="attr-input-autocomplete-on-state">on</a> state.</li>
|
|
|
|
<li>Its <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>
|
|
attribute is in the <a href="#attr-input-autocomplete-default-state" title="attr-input-autocomplete-default-state">default</a> state,
|
|
and the element has no <a href="#form-owner">form owner</a>.</li>
|
|
|
|
<li>Its <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>
|
|
attribute is in the <a href="#attr-input-autocomplete-default-state" title="attr-input-autocomplete-default-state">default</a> state,
|
|
and the element's <a href="#form-owner">form owner</a>'s <code title="attr-form-autocomplete"><a href="#attr-form-autocomplete">autocomplete</a></code> attribute is in
|
|
the <a href="#attr-form-autocomplete-on-state" title="attr-form-autocomplete-on-state">on</a>
|
|
state.</li>
|
|
|
|
</ul><p>When an <code><a href="#the-input-element">input</a></code> element's <a href="#resulting-autocompletion-state">resulting
|
|
autocompletion state</a> is <i title="">on</i>, the user agent
|
|
may store the value entered by the user so that if the user returns
|
|
to the page, the UA can prefill the form. Otherwise, the user agent
|
|
should not remember the control's <a href="#concept-fe-value" title="concept-fe-value">value</a>, and should not offer past
|
|
values to the user.</p>
|
|
|
|
<p>In addition, if the <a href="#resulting-autocompletion-state">resulting autocompletion state</a>
|
|
is <i title="">off</i>, <a href="#history-autocomplete">values are
|
|
reset</a> when <a href="#traverse-the-history" title="traverse the history">traversing the
|
|
history</a>.</p>
|
|
|
|
<p>The autocompletion mechanism must be implemented by the user
|
|
agent acting as if the user had modified the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>, and must be done at a time
|
|
where the element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>
|
|
(e.g. just after the element has been inserted into the document, or
|
|
when the user agent <a href="#stop-parsing" title="stop parsing">stops
|
|
parsing</a>).</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Banks frequently do not want UAs to prefill login
|
|
information:</p>
|
|
|
|
<pre><p><label>Account: <input type="text" name="ac" autocomplete="off"></label></p>
|
|
<p><label>PIN: <input type="password" name="pin" autocomplete="off"></label></p></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<p>A user agent may allow the user to override the <a href="#resulting-autocompletion-state">resulting
|
|
autocompletion state</a> and set it to always <i title="">on</i>,
|
|
always allowing values to be remembered and prefilled), or always <i title="">off</i>, never remembering values. However, the ability to
|
|
override the <a href="#resulting-autocompletion-state">resulting autocompletion state</a> to <i title="">on</i> should not be trivially accessible, as there are
|
|
significant security implications for the user if all values are
|
|
always remembered, regardless of the site's preferences.</p>
|
|
|
|
</div><h6 id="the-dirname-attribute"><span class="secno">4.10.7.2.2 </span>The <code title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code> attribute</h6><p>The <dfn id="attr-input-dirname" title="attr-input-dirname"><code>dirname</code></dfn>
|
|
attribute, when it applies, is a <a href="#form-control-dirname-attribute">form control <code title="">dirname</code> attribute</a>.<div class="example">
|
|
|
|
<p>In this example, a form contains a text field and a submission
|
|
button:</p>
|
|
|
|
<pre><form action="addcomment.cgi" method=post>
|
|
<p><label>Comment: <input type=text name="comment" dirname="comment.dir" required></label></p>
|
|
<p><button name="mode" type=submit value="add">Post Comment</button></p>
|
|
</form></pre>
|
|
|
|
<p>When the user submits the form, the user agent includes three
|
|
fields, one called "comment", one called "comment.dir", and one
|
|
called "mode"; so if the user types "Hello", the submission body
|
|
might be something like:</p>
|
|
|
|
<pre>comment=Hello&<strong>comment.dir=ltr</strong>&mode=add</pre>
|
|
|
|
<p>If the user manually switches to a right-to-left writing
|
|
direction and enters "<span dir="rtl" lang="ar" title="">مرحبًا</span>", the
|
|
submission body might be something like:</p>
|
|
|
|
<pre>comment=%D9%85%D8%B1%D8%AD%D8%A8%D9%8B%D8%A7&<strong>comment.dir=rtl</strong>&mode=add</pre>
|
|
|
|
</div><h6 id="the-list-attribute"><span class="secno">4.10.7.2.3 </span>The <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute</h6><p>The <dfn id="attr-input-list" title="attr-input-list"><code>list</code></dfn>
|
|
attribute is used to identify an element that lists predefined
|
|
options suggested to the user.<p>If present, its value must be the <a href="#concept-id" title="concept-id">ID</a> of a <code><a href="#the-datalist-element">datalist</a></code> element in
|
|
the same document.<div class="impl">
|
|
|
|
<p>The <dfn id="concept-input-list" title="concept-input-list">suggestions source
|
|
element</dfn> is the first element in the document in <a href="#tree-order">tree
|
|
order</a> to have an <a href="#concept-id" title="concept-id">ID</a> equal to
|
|
the value of the <code title="attr-input-list"><a href="#attr-input-list">list</a></code>
|
|
attribute, if that element is a <code><a href="#the-datalist-element">datalist</a></code> element. If
|
|
there is no <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute, or
|
|
if there is no element with that <a href="#concept-id" title="concept-id">ID</a>,
|
|
or if the first element with that <a href="#concept-id" title="concept-id">ID</a>
|
|
is not a <code><a href="#the-datalist-element">datalist</a></code> element, then there is no <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>.</p>
|
|
|
|
<p>If there is a <a href="#concept-input-list" title="concept-input-list">suggestions source
|
|
element</a>, then, when the user agent is allowing the user to
|
|
edit the <code><a href="#the-input-element">input</a></code> element's <a href="#concept-fe-value" title="concept-fe-value">value</a>, the user agent should offer
|
|
the suggestions represented by the <a href="#concept-input-list" title="concept-input-list">suggestions source element</a> to the
|
|
user in a manner suitable for the type of control used. The user
|
|
agent may use the suggestion's <a href="#concept-option-label" title="concept-option-label">label</a> to identify the suggestion
|
|
if appropriate.</p>
|
|
|
|
<p>How user selections of suggestions are handled depends on whether
|
|
the element is a control accepting a single value only, or whether
|
|
it accepts multiple values:</p>
|
|
|
|
<dl class="switch"><dt>If the element does not have a <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute specified or
|
|
if the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute
|
|
does not apply</dt>
|
|
|
|
<dd>
|
|
|
|
<p>When the user selects a suggestion, the <code><a href="#the-input-element">input</a></code>
|
|
element's <a href="#concept-fe-value" title="concept-fe-value">value</a> must be set
|
|
to the selected suggestion's <a href="#concept-option-value" title="concept-option-value">value</a>, as if the user had
|
|
written that value himself.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the element <em>does</em> have a <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute specified,
|
|
and the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute
|
|
does apply</dt>
|
|
|
|
<dd>
|
|
|
|
<p>When the user selects a suggestion, the user agent must either
|
|
add a new entry to the <code><a href="#the-input-element">input</a></code> element's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a>, whose value is
|
|
the selected suggestion's <a href="#concept-option-value" title="concept-option-value">value</a>, or change an existing
|
|
entry in the <code><a href="#the-input-element">input</a></code> element's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a> to have the value
|
|
given by the selected suggestion's <a href="#concept-option-value" title="concept-option-value">value</a>, as if the user had
|
|
himself added an entry with that value, or edited an existing
|
|
entry to be that value. Which behavior is to be applied depends on
|
|
the user interface in a user-agent-defined manner.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><hr><p>If the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute does
|
|
not apply, there is no <a href="#concept-input-list" title="concept-input-list">suggestions
|
|
source element</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This URL field offers some suggestions.</p>
|
|
|
|
<pre><label>Homepage: <input name=hp type=url list=hpurls></label>
|
|
<datalist id=hpurls>
|
|
<option value="http://www.google.com/" label="Google">
|
|
<option value="http://www.reddit.com/" label="Reddit">
|
|
</datalist></pre>
|
|
|
|
<p>Other URLs from the user's history might show also; this is up
|
|
to the user agent.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>This example demonstrates how to design a form that uses the
|
|
autocompletion list feature while still degrading usefully in
|
|
legacy user agents.</p>
|
|
|
|
<p>If the autocompletion list is merely an aid, and is not
|
|
important to the content, then simply using a <code><a href="#the-datalist-element">datalist</a></code>
|
|
element with children <code><a href="#the-option-element">option</a></code> elements is enough. To
|
|
prevent the values from being rendered in legacy user agents, they
|
|
should be placed inside the <code title="attr-option-value"><a href="#attr-option-value">value</a></code> attribute instead of
|
|
inline.</p>
|
|
|
|
<pre><p>
|
|
<label>
|
|
Enter a breed:
|
|
<input type="text" name="breed" list="breeds">
|
|
<datalist id="breeds">
|
|
<option value="Abyssinian">
|
|
<option value="Alpaca">
|
|
<!-- ... -->
|
|
</datalist>
|
|
</label>
|
|
</p></pre>
|
|
|
|
<p>However, if the values need to be shown in legacy UAs, then
|
|
fallback content can be placed inside the <code><a href="#the-datalist-element">datalist</a></code>
|
|
element, as follows:</p>
|
|
|
|
<pre><p>
|
|
<label>
|
|
Enter a breed:
|
|
<input type="text" name="breed" list="breeds">
|
|
</label>
|
|
<datalist id="breeds">
|
|
<label>
|
|
or select one from the list:
|
|
<select name="breed">
|
|
<option value=""> (none selected)
|
|
<option>Abyssinian
|
|
<option>Alpaca
|
|
<!-- ... -->
|
|
</select>
|
|
</label>
|
|
</datalist>
|
|
</p>
|
|
</pre>
|
|
|
|
<p>The fallback content will only be shown in UAs that don't
|
|
support <code><a href="#the-datalist-element">datalist</a></code>. The options, on the other hand, will
|
|
be detected by all UAs, even though they are not direct children of
|
|
the <code><a href="#the-datalist-element">datalist</a></code> element.</p>
|
|
|
|
<p>Note that if an <code><a href="#the-option-element">option</a></code> element used in a
|
|
<code><a href="#the-datalist-element">datalist</a></code> is <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code>, it will be selected
|
|
by default by legacy UAs (because it affects the
|
|
<code><a href="#the-select-element">select</a></code>), but it will not have any effect on the
|
|
<code><a href="#the-input-element">input</a></code> element in UAs that support
|
|
<code><a href="#the-datalist-element">datalist</a></code>.</p>
|
|
|
|
</div><h6 id="the-readonly-attribute"><span class="secno">4.10.7.2.4 </span>The <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute</h6><p>The <dfn id="attr-input-readonly" title="attr-input-readonly"><code>readonly</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a> that controls whether
|
|
or not the user can edit the form control. <span class="impl">When
|
|
specified, the element is <i title="concept-input-immutable"><a href="#concept-input-immutable">immutable</a></i>.</span><div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: If the <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute is specified
|
|
on an <code><a href="#the-input-element">input</a></code> element, the element is <a href="#barred-from-constraint-validation">barred from
|
|
constraint validation</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, the existing product identifiers
|
|
cannot be modified, but they are still displayed as part of the
|
|
form, for consistency with the row representing a new product
|
|
(where the identifier is not yet filled in).</p>
|
|
|
|
<pre><form action="products.cgi" method=post enctype="multipart/form-data">
|
|
<table>
|
|
<tr> <th> Product ID <th> Product name <th> Price <th> Action
|
|
<tr>
|
|
<td> <input readonly name="1.pid" value="H412">
|
|
<td> <input required name="1.pname" value="Floor lamp Ulke">
|
|
<td> $<input required type=number min=0 step=0.01 name="1.pprice" value="49.99">
|
|
<td> <button formnovalidate name="action" value="delete:1">Delete</button>
|
|
<tr>
|
|
<td> <input readonly name="2.pid" value="FG28">
|
|
<td> <input required name="2.pname" value="Table lamp Ulke">
|
|
<td> $<input required type=number min=0 step=0.01 name="2.pprice" value="24.99">
|
|
<td> <button formnovalidate name="action" value="delete:2">Delete</button>
|
|
<tr>
|
|
<td> <input required name="3.pid" value="" pattern="[A-Z0-9]+">
|
|
<td> <input required name="3.pname" value="">
|
|
<td> $<input required type=number min=0 step=0.01 name="3.pprice" value="">
|
|
<td> <button formnovalidate name="action" value="delete:3">Delete</button>
|
|
</table>
|
|
<p> <button formnovalidate name="action" value="add">Add</button> </p>
|
|
<p> <button name="action" value="update">Save</button> </p>
|
|
</form></pre>
|
|
|
|
</div><h6 id="the-size-attribute"><span class="secno">4.10.7.2.5 </span>The <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute</h6><p>The <dfn id="attr-input-size" title="attr-input-size"><code>size</code></dfn>
|
|
attribute gives the number of characters that, in a visual
|
|
rendering, the user agent is to allow the user to see while editing
|
|
the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.<p>The <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-non-negative-integer">valid non-negative
|
|
integer</a> greater than zero.<div class="impl">
|
|
|
|
<p>If the attribute is present, then its value must be parsed using
|
|
the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</a>, and if the
|
|
result is a number greater than zero, then the user agent should
|
|
ensure that at least that many characters are visible.</p>
|
|
|
|
<p>The <code title="dom-input-size"><a href="#dom-input-size">size</a></code> IDL attribute is
|
|
<a href="#limited-to-only-non-negative-numbers-greater-than-zero">limited to only non-negative numbers greater than
|
|
zero</a> and has a default value of 20.</p>
|
|
|
|
</div><h6 id="the-required-attribute"><span class="secno">4.10.7.2.6 </span>The <code title="attr-input-required"><a href="#attr-input-required">required</a></code> attribute</h6><p>The <dfn id="attr-input-required" title="attr-input-required"><code>required</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. When specified, the
|
|
element is <dfn id="concept-input-required" title="concept-input-required"><i>required</i></dfn>.<div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: If the element is <i title="concept-input-required"><a href="#concept-input-required">required</a></i>, and its <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute applies and is in
|
|
the mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>, and the
|
|
element is <i title="concept-input-mutable"><a href="#concept-input-mutable">mutable</a></i>, and the
|
|
element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is the empty
|
|
string, then the element is <a href="#suffering-from-being-missing">suffering from being
|
|
missing</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following form has two required fields, one for an e-mail
|
|
address and one for a password. It also has a third field that is
|
|
only considerd valid if the user types the same password in the
|
|
password field and this third field.</p>
|
|
|
|
<pre><h1>Create new account</h1>
|
|
<form action="/newaccount" method=post
|
|
oninput="up2.setCustomValidity(up2.value != up.value ? 'Passwords do not match.' : '')">
|
|
<p>
|
|
<label for="username">E-mail address:</label>
|
|
<input id="username" type=email required name=un>
|
|
<p>
|
|
<label for="password1">Password:</label>
|
|
<input id="password1" type=password required name=up>
|
|
<p>
|
|
<label for="password2">Confirm password:</label>
|
|
<input id="password2" type=password name=up2>
|
|
<p>
|
|
<input type=submit value="Create account">
|
|
</form></pre>
|
|
|
|
</div><h6 id="the-multiple-attribute"><span class="secno">4.10.7.2.7 </span>The <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute</h6><p>The <dfn id="attr-input-multiple" title="attr-input-multiple"><code>multiple</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a> that indicates whether
|
|
the user is to be allowed to specify more than one value.<div class="example">
|
|
|
|
<p>The following extract shows how an e-mail client's "Cc" field
|
|
could accept multiple e-mail addresses.</p>
|
|
|
|
<pre><label>Cc: <input type=email multiple name=cc></label></pre>
|
|
|
|
<p>If the user had, amongst many friends in his user contacts
|
|
database, two friends "Arthur Dent" (with address
|
|
"art@example.net") and "Adam Josh" (with address
|
|
"adamjosh@example.net"), then, after the user has typed "a", the
|
|
user agent might suggest these two e-mail addresses to the
|
|
user.</p>
|
|
|
|
<p><img alt="" height="140" src="sample-email-1.png" width="500"></p>
|
|
|
|
<p>The page could also link in the user's contacts database from the site:</p>
|
|
|
|
<pre><label>Cc: <input type=email multiple name=cc list=contacts></label>
|
|
...
|
|
<datalist id="contacts">
|
|
<option value="hedral@damowmow.com">
|
|
<option value="pillar@example.com">
|
|
<option value="astrophy@cute.example">
|
|
<option value="astronomy@science.example.org">
|
|
</datalist></pre>
|
|
|
|
<p>Suppose the user had entered "bob@example.net" into this text
|
|
field, and then started typing a second e-mail address starting
|
|
with "a". The user agent might show both the two friends mentioned
|
|
earlier, as well as the "astrophy" and "astronomy" values given in
|
|
the <code><a href="#the-datalist-element">datalist</a></code> element.</p>
|
|
|
|
<p><img alt="" height="171" src="sample-email-2.png" width="500"></p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following extract shows how an e-mail client's "Attachments"
|
|
field could accept multiple files for upload.</p>
|
|
|
|
<pre><label>Attachments: <input type=file multiple name=att></label></pre>
|
|
|
|
</div><h6 id="the-maxlength-attribute"><span class="secno">4.10.7.2.8 </span>The <code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code> attribute</h6><p>The <dfn id="attr-input-maxlength" title="attr-input-maxlength"><code>maxlength</code></dfn>
|
|
attribute<span class="impl">, when it applies,</span> is a <a href="#attr-fe-maxlength" title="attr-fe-maxlength">form control <code title="">maxlength</code> attribute</a><span class="impl">
|
|
controlled by the <code><a href="#the-input-element">input</a></code> element's <a href="#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value
|
|
flag</a></span>.<p>If the <code><a href="#the-input-element">input</a></code> element has a <a href="#maximum-allowed-value-length">maximum allowed
|
|
value length</a>, then the <a href="#code-point-length">code-point length</a> of the
|
|
value of the element's <code title="attr-input-value"><a href="#attr-input-value">value</a></code>
|
|
attribute must be equal to or less than the element's <a href="#maximum-allowed-value-length">maximum
|
|
allowed value length</a>.<div class="example">
|
|
|
|
<p>The following extract shows how a messaging client's text entry
|
|
could be arbitrarily restricted to a fixed number of characters,
|
|
thus forcing any conversation through this medium to be terse and
|
|
discouraging intelligent discourse.</p>
|
|
|
|
<pre>What are you doing? <input name=status maxlength=140></pre>
|
|
|
|
</div><h6 id="the-pattern-attribute"><span class="secno">4.10.7.2.9 </span>The <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute</h6><p>The <dfn id="attr-input-pattern" title="attr-input-pattern"><code>pattern</code></dfn>
|
|
attribute specifies a regular expression against which the control's
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a>, or, when the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute applies and is
|
|
set, the control's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a>, are to be
|
|
checked.<p>If specified, the attribute's value must match the JavaScript <i title="">Pattern</i> production. <a href="#refsECMA262">[ECMA262]</a><div class="impl">
|
|
|
|
<p>If an <code><a href="#the-input-element">input</a></code> element has a <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute specified, and
|
|
the attribute's value, when compiled as a JavaScript regular
|
|
expression with the <code title="">global</code>, <code title="">ignoreCase</code>, and <code title="">multiline</code>
|
|
flags <em>disabled</em> (see ECMA262 Edition 5, sections 15.10.7.2
|
|
through 15.10.7.4), compiles successfully, then the resulting
|
|
regular expression is the element's <dfn id="compiled-pattern-regular-expression">compiled pattern regular
|
|
expression</dfn>. If the element has no such attribute, or if the
|
|
value doesn't compile successfully, then the element has no
|
|
<a href="#compiled-pattern-regular-expression">compiled pattern regular expression</a>. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
<p><strong>Constraint validation</strong>: If the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is not the empty string, and
|
|
either the element's <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute is not
|
|
specified or it does not apply to the <code><a href="#the-input-element">input</a></code> element
|
|
given its <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's
|
|
current state, and the element has a <a href="#compiled-pattern-regular-expression">compiled pattern regular
|
|
expression</a> but that regular expression does not match the
|
|
entirety of the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>, then the element is
|
|
<a href="#suffering-from-a-pattern-mismatch">suffering from a pattern mismatch</a>.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: If the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is not the empty string, and
|
|
the element's <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>
|
|
attribute is specified and applies to the <code><a href="#the-input-element">input</a></code>
|
|
element, and the element has a <a href="#compiled-pattern-regular-expression">compiled pattern regular
|
|
expression</a> but that regular expression does not match the
|
|
entirety of each of the element's <a href="#concept-fe-values" title="concept-fe-values">value<em>s</em></a>, then the element
|
|
is <a href="#suffering-from-a-pattern-mismatch">suffering from a pattern mismatch</a>.</p>
|
|
|
|
<p class="note">This implies that the regular expression language
|
|
used for this attribute is the same as that used in JavaScript,
|
|
except that the <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>
|
|
attribute must match the entire value, not just any subset (somewhat
|
|
as if it implied a <code title="">^(?:</code> at the start of the
|
|
pattern and a <code title="">)$</code> at the end).</p>
|
|
|
|
</div><p>When an <code><a href="#the-input-element">input</a></code> element has a <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute specified,
|
|
authors should include a <code title="attr-title"><a href="#the-title-attribute">title</a></code>
|
|
attribute to give a description of the pattern. User agents may use
|
|
the contents of this attribute, if it is present, when informing the
|
|
user that the pattern is not matched, or at any other suitable time,
|
|
such as in a tooltip or read out by assistive technology when the
|
|
control gains focus.<div class="example">
|
|
<p>For example, the following snippet:</p>
|
|
<pre><label> Part number:
|
|
<input pattern="[0-9][A-Z]{3}" name="part"
|
|
title="A part number is a digit followed by three uppercase letters."/>
|
|
</label></pre>
|
|
<p>...could cause the UA to display an alert such as:</p>
|
|
<pre><samp>A part number is a digit followed by three uppercase letters.
|
|
You cannot submit this form when the field is incorrect.</samp></pre>
|
|
</div><p>When a control has a <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute, the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute, if used, must describe
|
|
the pattern. Additional information could also be included, so long
|
|
as it assists the user in filling in the control. Otherwise,
|
|
assistive technology would be impaired.<p class="example">For instance, if the title attribute contained
|
|
the caption of the control, assistive technology could end up saying
|
|
something like <samp>The text you have entered does not match the
|
|
required pattern. Birthday</samp>, which is not useful.<p>UAs may still show the <code><a href="#the-title-element">title</a></code> in non-error situations
|
|
(for example, as a tooltip when hovering over the control), so
|
|
authors should be careful not to word <code><a href="#the-title-element">title</a></code>s as if an
|
|
error has necessarily occurred.<h6 id="the-min-and-max-attributes"><span class="secno">4.10.7.2.10 </span>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> and <code title="attr-input-max"><a href="#attr-input-max">max</a></code> attributes</h6><p>The <dfn id="attr-input-min" title="attr-input-min"><code>min</code></dfn> and <dfn id="attr-input-max" title="attr-input-max"><code>max</code></dfn> attributes indicate
|
|
the allowed range of values for the element.<div class="impl">
|
|
|
|
<p>Their syntax is defined by the section that defines the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state.</p>
|
|
|
|
<p>If the element has a <code title="attr-input-min"><a href="#attr-input-min">min</a></code>
|
|
attribute, and the result of applying the <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a> to the value of the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute is a number, then that
|
|
number is the element's <dfn id="concept-input-min" title="concept-input-min">minimum</dfn>; otherwise, if the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state
|
|
defines a <dfn id="concept-input-min-default" title="concept-input-min-default">default
|
|
minimum</dfn>, then that is the <a href="#concept-input-min" title="concept-input-min">minimum</a>; otherwise, the element has
|
|
no <a href="#concept-input-min" title="concept-input-min">minimum</a>.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: When the element has a
|
|
<a href="#attr-input-min" title="attr-input-min">minimum</a>, and the result of
|
|
applying the <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a> to the string given by the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is a number, and the number
|
|
obtained from that algorithm is less than the <a href="#attr-input-min" title="attr-input-min">minimum</a>, the element is
|
|
<a href="#suffering-from-an-underflow">suffering from an underflow</a>.</p>
|
|
|
|
<p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute also
|
|
defines the <a href="#concept-input-min-zero" title="concept-input-min-zero">step
|
|
base</a>.</p>
|
|
|
|
<p>If the element has a <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
|
|
attribute, and the result of applying the <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a> to the value of the <code title="attr-input-max"><a href="#attr-input-max">max</a></code> attribute is a number, then that
|
|
number is the element's <dfn id="concept-input-max" title="concept-input-max">maximum</dfn>; otherwise, if the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state
|
|
defines a <dfn id="concept-input-max-default" title="concept-input-max-default">default
|
|
maximum</dfn>, then that is the <a href="#concept-input-max" title="concept-input-max">maximum</a>; otherwise, the element has
|
|
no <a href="#concept-input-max" title="concept-input-max">maximum</a>.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: When the element has a
|
|
<a href="#attr-input-max" title="attr-input-max">maximum</a>, and the result of
|
|
applying the <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a> to the string given by the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is a number, and the number
|
|
obtained from that algorithm is more than the <a href="#attr-input-max" title="attr-input-max">maximum</a>, the element is
|
|
<a href="#suffering-from-an-overflow">suffering from an overflow</a>.</p>
|
|
|
|
</div><p>The <code title="attr-input-max"><a href="#attr-input-max">max</a></code> attribute's value
|
|
(the <a href="#concept-input-max" title="concept-input-max">maximum</a>) must not be
|
|
less than the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute's
|
|
value (its <a href="#concept-input-min" title="concept-input-min">minimum</a>).<div class="impl">
|
|
|
|
<p class="note">If an element has a <a href="#attr-input-max" title="attr-input-max">maximum</a> that is less than its <a href="#attr-input-min" title="attr-input-min">minimum</a>, then so long as the element
|
|
has a <a href="#concept-fe-value" title="concept-fe-value">value</a>, it will either be
|
|
<a href="#suffering-from-an-underflow">suffering from an underflow</a> or <a href="#suffering-from-an-overflow">suffering from an
|
|
overflow</a>.</p>
|
|
|
|
</div><p>An element <dfn id="have-range-limitations" title="have range limitations">has range
|
|
limitations</dfn> if it has a defined <a href="#concept-input-min" title="concept-input-min">minimum</a> or a defined <a href="#concept-input-max" title="concept-input-max">maximum</a>.<div class="example">
|
|
|
|
<p>The following date control limits input to dates that are before
|
|
the 1980s:</p>
|
|
|
|
<pre><input name=bday type=date max="1979-12-31"></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following number control limits input to whole numbers
|
|
greater than zero:</p>
|
|
|
|
<pre><input name=quantity required type=number min=1 value=1></pre>
|
|
|
|
</div><h6 id="the-step-attribute"><span class="secno">4.10.7.2.11 </span>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute</h6><p>The <dfn id="attr-input-step" title="attr-input-step"><code>step</code></dfn>
|
|
attribute indicates the granularity that is expected (and required)
|
|
of the <a href="#concept-fe-value" title="concept-fe-value">value</a>, by limiting the
|
|
allowed values. <span class="impl">The section that defines the
|
|
<code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state
|
|
also defines the <dfn id="concept-input-step-default" title="concept-input-step-default">default
|
|
step</dfn>, the <dfn id="concept-input-step-scale" title="concept-input-step-scale">step scale
|
|
factor</dfn>, and in some cases the <dfn id="concept-input-step-default-base" title="concept-input-step-default-base">default step base</dfn>,
|
|
which are used in processing the attribute as described
|
|
below.</span><p>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute, if
|
|
specified, must either have a value that is a <a href="#valid-floating-point-number">valid floating
|
|
point number</a> that <a href="#rules-for-parsing-floating-point-number-values" title="rules for parsing floating
|
|
point number values">parses</a> to a number that is greater than
|
|
zero, or must have a value that is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">any</code>".<div class="impl">
|
|
|
|
<p>The attribute provides the <dfn id="concept-input-step" title="concept-input-step">allowed value step</dfn> for the element,
|
|
as follows:</p>
|
|
|
|
<ol><li>If the attribute is absent, then the <a href="#concept-input-step" title="concept-input-step">allowed value step</a> is the <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> multiplied
|
|
by the <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale
|
|
factor</a>.</li>
|
|
|
|
<li>Otherwise, if the attribute's value is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">any</code>", then there is no <a href="#concept-input-step" title="concept-input-step">allowed value step</a>.</li>
|
|
|
|
<li>Otherwise, if the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating point number
|
|
values</a>, when they are applied to the attribute's value,
|
|
return an error, zero, or a number less than zero, then the <a href="#concept-input-step" title="concept-input-step">allowed value step</a> is the <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> multiplied
|
|
by the <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale
|
|
factor</a>.</li>
|
|
|
|
<li>Otherwise, the <a href="#concept-input-step" title="concept-input-step">allowed value
|
|
step</a> is the number returned by the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing
|
|
floating point number values</a> when they are applied to the
|
|
attribute's value, multiplied by the <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a>.</li>
|
|
|
|
</ol><p>The <dfn id="concept-input-min-zero" title="concept-input-min-zero">step base</dfn> is the
|
|
result of applying the <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a> to the value of the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, unless the element does
|
|
not have a <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute
|
|
specified or the result of applying that algorithm is an error, in
|
|
which case the <a href="#concept-input-min-zero" title="concept-input-min-zero">step base</a>
|
|
is the <a href="#concept-input-step-default-base" title="concept-input-step-default-base">default step
|
|
base</a>, if one is defined, or zero, if not.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: When the element has an
|
|
<a href="#concept-input-step" title="concept-input-step">allowed value step</a>, and the
|
|
result of applying the <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a> to the string given by the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is a number, and that
|
|
number subtracted from the <a href="#concept-input-min-zero" title="concept-input-min-zero">step
|
|
base</a> is not an integral multiple of the <a href="#concept-input-step" title="concept-input-step">allowed value step</a>, the element is
|
|
<a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following range control only accepts values in the range
|
|
0..1, and allows 256 steps in that range:</p>
|
|
|
|
<pre><input name=opacity type=range min=0 max=1 step=0.00392156863></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following control allows any time in the day to be selected,
|
|
with any accuracy (e.g. thousandth-of-a-second accuracy or
|
|
more):</p>
|
|
|
|
<pre><input name=favtime type=time step=any></pre>
|
|
|
|
<p>Normally, time controls are limited to an accuracy of one
|
|
minute.</p>
|
|
|
|
</div><h6 id="the-placeholder-attribute"><span class="secno">4.10.7.2.12 </span>The <code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code> attribute</h6><p>The <dfn id="attr-input-placeholder" title="attr-input-placeholder"><code>placeholder</code></dfn>
|
|
attribute represents a <em>short</em> hint (a word or short phrase)
|
|
intended to aid the user with data entry. A hint could be a sample
|
|
value or a brief description of the expected format. The attribute,
|
|
if specified, must have a value that contains no U+000A LINE FEED
|
|
(LF) or U+000D CARRIAGE RETURN (CR) characters.<p class="note">For a longer hint or other advisory text, the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute is more appropriate.<p>The <code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>
|
|
attribute should not be used as an alternative to a
|
|
<code><a href="#the-label-element">label</a></code>.<div class="impl">
|
|
|
|
<p>User agents should present this hint to the user, after having
|
|
<a href="#strip-line-breaks" title="strip line breaks">stripped line breaks</a> from it,
|
|
when the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is
|
|
the empty string and the control is not focused (e.g. by displaying
|
|
it inside a blank unfocused control).</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is an example of a mail configuration user interface that
|
|
uses the <code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>
|
|
attribute:</p>
|
|
|
|
<pre><fieldset>
|
|
<legend>Mail Account</legend>
|
|
<p><label>Name: <input type="text" name="fullname" placeholder="John Ratzenberger"></label></p>
|
|
<p><label>Address: <input type="email" name="address" placeholder="john@example.net"></label></p>
|
|
<p><label>Password: <input type="password" name="password"></label></p>
|
|
<p><label>Description: <input type="text" name="desc" placeholder="My Email Account"></label></p>
|
|
</fieldset></pre>
|
|
|
|
</div><h5 id="common-input-element-apis"><span class="secno">4.10.7.3 </span>Common <code><a href="#the-input-element">input</a></code> element APIs</h5><dl class="domintro"><dt><var title="">input</var> . <code title="dom-input-value"><a href="#dom-input-value">value</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the form control.</p>
|
|
|
|
<p>Can be set, to change the value.</p>
|
|
|
|
<p>Throws an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception if it is
|
|
set to any value other than the empty string when the control is a
|
|
file upload control.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">input</var> . <code title="dom-input-checked"><a href="#dom-input-checked">checked</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> of the form
|
|
control.</p>
|
|
|
|
<p>Can be set, to change the <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">input</var> . <code title="dom-input-files"><a href="#dom-input-files">files</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#filelist">FileList</a></code> object listing the <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a> of
|
|
the form control.</p>
|
|
|
|
<p>Returns null if the control isn't a file control.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">input</var> . <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code>Date</code> object representing the form
|
|
control's <a href="#concept-fe-value" title="concept-fe-value">value</a>, if
|
|
applicable; otherwise, returns null.</p>
|
|
|
|
<p>Can be set, to change the value.</p>
|
|
|
|
<p>Throws an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception if the
|
|
control isn't date- or time-based.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">input</var> . <code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a number representing the form control's <a href="#concept-fe-value" title="concept-fe-value">value</a>, if applicable; otherwise,
|
|
returns null.</p>
|
|
|
|
<p>Can be set, to change the value.</p>
|
|
|
|
<p>Throws an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception if the
|
|
control is neither date- or time-based nor numeric.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">input</var> . <code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp</a></code>( [ <var title="">n</var> ] )</dt>
|
|
<dt><var title="">input</var> . <code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown</a></code>( [ <var title="">n</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Changes the form control's <a href="#concept-fe-value" title="concept-fe-value">value</a> by the value given in the
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute, multiplied by
|
|
<var title="">n</var>. The default value for <var title="">n</var>
|
|
is 1.</p>
|
|
|
|
<p>Throws <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception if the control
|
|
is neither date- or time-based nor numeric, if the <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute's value is "<code title="">any</code>", if the current <a href="#concept-fe-value" title="concept-fe-value">value</a> could not be parsed, or if
|
|
stepping in the given direction by the given amount would take the
|
|
value out of range.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">input</var> . <code title="dom-input-list"><a href="#dom-input-list">list</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#the-datalist-element">datalist</a></code> element indicated by the
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">input</var> . <code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#the-option-element">option</a></code> element from the
|
|
<code><a href="#the-datalist-element">datalist</a></code> element indicated by the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute that matches the
|
|
form control's <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-input-value" title="dom-input-value"><code>value</code></dfn> IDL
|
|
attribute allows scripts to manipulate the <a href="#concept-fe-value" title="concept-fe-value">value</a> of an <code><a href="#the-input-element">input</a></code>
|
|
element. The attribute is in one of the following modes, which
|
|
define its behavior:</p>
|
|
|
|
<dl><dt><dfn id="dom-input-value-value" title="dom-input-value-value">value</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>On getting, it must return the current <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element. On setting,
|
|
it must set the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to the new value, set the
|
|
element's <a href="#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value
|
|
flag</a> to true, and then invoke the <a href="#value-sanitization-algorithm">value sanitization
|
|
algorithm</a>, if the element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state
|
|
defines one.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="dom-input-value-default" title="dom-input-value-default">default</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>On getting, if the element has a <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, it must return
|
|
that attribute's value; otherwise, it must return the empty
|
|
string. On setting, it must set the element's <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute to the new
|
|
value.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="dom-input-value-default-on" title="dom-input-value-default-on">default/on</dfn>
|
|
|
|
<dd>
|
|
|
|
<p>On getting, if the element has a <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, it must return
|
|
that attribute's value; otherwise, it must return the string
|
|
"<code title="">on</code>". On setting, it must set the element's
|
|
<code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute to the new
|
|
value.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="dom-input-value-filename" title="dom-input-value-filename">filename</dfn>
|
|
|
|
<dd id="fakepath-orly">
|
|
|
|
<p>On getting, it must return the string "<code title="">C:\fakepath\</code>" followed by the filename of the
|
|
first file in the list of <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>, if
|
|
any, or the empty string if the list is empty. On setting, if the
|
|
new value is the empty string, it must empty the list of <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>;
|
|
otherwise, it must throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code>
|
|
exception.</p>
|
|
|
|
<p class="note">This "fakepath" requirement is a sad accident of
|
|
history. See <a href="#fakepath-srsly">the example in the File
|
|
Upload state section</a> for more information.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><hr><p>The <dfn id="dom-input-checked" title="dom-input-checked"><code>checked</code></dfn> IDL
|
|
attribute allows scripts to manipulate the <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> of an
|
|
<code><a href="#the-input-element">input</a></code> element. On getting, it must return the current
|
|
<a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> of the element;
|
|
and on setting, it must set the element's <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> to the new value and
|
|
set the element's <a href="#concept-input-checked-dirty-flag" title="concept-input-checked-dirty-flag">dirty checkedness
|
|
flag</a> to true.</p>
|
|
|
|
<hr><p>The <dfn id="dom-input-files" title="dom-input-files"><code>files</code></dfn> IDL
|
|
attribute allows scripts to access the element's <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>. On
|
|
getting, if the IDL attribute applies, it must return a
|
|
<code><a href="#filelist">FileList</a></code> object that represents the current <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>. The
|
|
same object must be returned until the list of <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>
|
|
changes. If the IDL attribute does not apply, then it must instead
|
|
return null. <a href="#refsFILEAPI">[FILEAPI]</a></p>
|
|
|
|
<hr><p>The <dfn id="dom-input-valueasdate" title="dom-input-valueAsDate"><code>valueAsDate</code></dfn> IDL
|
|
attribute represents the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element, interpreted
|
|
as a date.</p>
|
|
|
|
<p>On getting, if the <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> attribute does not
|
|
apply, as defined for the <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state, then
|
|
return null. Otherwise, run the <a href="#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
|
|
string to a <code>Date</code> object</a> defined for that state;
|
|
if the algorithm returned a <code>Date</code> object, then return
|
|
it, otherwise, return null.</p>
|
|
|
|
<p>On setting, if the <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> attribute does not
|
|
apply, as defined for the <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state, then
|
|
throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception; otherwise, if
|
|
the new value is null, then set the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element to the empty
|
|
string; otherwise, run the <a href="#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
|
|
<code>Date</code> object to a string</a>, as defined for that
|
|
state, on the new value, and set the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the element to resulting
|
|
string.</p>
|
|
|
|
<hr><p>The <dfn id="dom-input-valueasnumber" title="dom-input-valueAsNumber"><code>valueAsNumber</code></dfn> IDL
|
|
attribute represents the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element, interpreted as a number.</p>
|
|
|
|
<p>On getting, if the <code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> attribute does
|
|
not apply, as defined for the <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state, then
|
|
return a Not-a-Number (NaN) value. Otherwise, if the <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAs<em>Date</em></a></code>
|
|
attribute applies, run the <a href="#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
|
|
string to a <code>Date</code> object</a> defined for that state;
|
|
if the algorithm returned a <code>Date</code> object, then return
|
|
the <i>time value</i> of the object (the number of milliseconds from
|
|
midnight UTC the morning of 1970-01-01 to the time represented by
|
|
the <code>Date</code> object), otherwise, return a Not-a-Number
|
|
(NaN) value. Otherwise, run the <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a> defined for that state; if the algorithm
|
|
returned a number, then return it, otherwise, return a Not-a-Number
|
|
(NaN) value.</p>
|
|
|
|
<p>On setting, if the <code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> attribute does
|
|
not apply, as defined for the <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state, then
|
|
throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception. Otherwise, if
|
|
the <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAs<em>Date</em></a></code>
|
|
attribute applies, run the <a href="#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
|
|
<code>Date</code> object to a string</a> defined for that state,
|
|
passing it a <code>Date</code> object whose <i>time value</i> is the
|
|
new value, and set the <a href="#concept-fe-value" title="concept-fe-value">value</a>
|
|
of the element to resulting string. Otherwise, run the <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, as defined for that state, on the new
|
|
value, and set the <a href="#concept-fe-value" title="concept-fe-value">value</a> of
|
|
the element to resulting string.</p>
|
|
|
|
<hr><p>The <dfn id="dom-input-stepdown" title="dom-input-stepDown"><code>stepDown(<var title="">n</var>)</code></dfn> and <dfn id="dom-input-stepup" title="dom-input-stepUp"><code>stepUp(<var title="">n</var>)</code></dfn> methods, when invoked, must run the
|
|
following algorithm:</p>
|
|
|
|
<ol><li><p>If the <code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
|
|
<code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods do not
|
|
apply, as defined for the <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's current state, then
|
|
throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception, and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the element has no <a href="#concept-input-step" title="concept-input-step">allowed value step</a>, then throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception, and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If applying the <a href="#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
|
|
string to a number</a> to the string given by the element's
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> results in an error,
|
|
then throw an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception, and abort
|
|
these steps; otherwise, let <var title="">value</var> be the result
|
|
of that algorithm.</li>
|
|
|
|
<li><p>Let <var title="">n</var> be the argument, or 1 if the
|
|
argument was omitted.</li>
|
|
|
|
<li><p>Let <var title="">delta</var> be the <a href="#concept-input-step" title="concept-input-step">allowed value step</a> multiplied by
|
|
<var title="">n</var>.</li>
|
|
|
|
<li><p>If the method invoked was the <code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> method, negate <var title="">delta</var>.</li>
|
|
|
|
<li><p>Let <var title="">value</var> be the result of adding <var title="">delta</var> to <var title="">value</var>.</li>
|
|
<li><p>If the element has a <a href="#concept-input-min" title="concept-input-min">minimum</a>, and the <var title="">value</var> is less than that <a href="#concept-input-min" title="concept-input-min">minimum</a>, then throw a
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception.</li>
|
|
|
|
<li><p>If the element has a <a href="#concept-input-max" title="concept-input-max">maximum</a>, and the <var title="">value</var> is greater than that <a href="#concept-input-max" title="concept-input-max">maximum</a>, then throw a
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception.</li>
|
|
|
|
<li><p>Let <var title="">value as string</var> be the result of
|
|
running the <a href="#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
|
|
number to a string</a>, as defined for the <code><a href="#the-input-element">input</a></code>
|
|
element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute's
|
|
current state, on <var title="">value</var>.</li>
|
|
|
|
<li><p>Set the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the
|
|
element to <var title="">value as string</var>.</li>
|
|
|
|
</ol><hr><p>The <dfn id="dom-input-list" title="dom-input-list"><code>list</code></dfn> IDL
|
|
attribute must return the current <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>, if
|
|
any, or null otherwise.</p>
|
|
|
|
<p>The <dfn id="dom-input-selectedoption" title="dom-input-selectedOption"><code>selectedOption</code></dfn>
|
|
IDL attribute must return the value determined by the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>If there is no <a href="#concept-input-list" title="concept-input-list">suggestions
|
|
source element</a> (e.g. because the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute doesn't apply or is
|
|
not specified), then return null and abort these steps.</li>
|
|
|
|
<li><p>If the <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>
|
|
attribute is specified and applies, then return null and abort
|
|
these steps. (The <code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> IDL
|
|
attribute doesn't apply.)</li>
|
|
|
|
<li><p>Return the first <code><a href="#the-option-element">option</a></code> element, in <a href="#tree-order">tree
|
|
order</a>, to be a child of the <a href="#concept-input-list" title="concept-input-list">suggestions source element</a> and
|
|
whose <a href="#concept-option-value" title="concept-option-value">value</a> matches the
|
|
<code><a href="#the-input-element">input</a></code> element's <a href="#concept-fe-value" title="concept-fe-value">value</a>, if any. If the <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>
|
|
contains no matching <code><a href="#the-option-element">option</a></code> element, then return null
|
|
instead.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h5 id="common-event-behaviors"><span class="secno">4.10.7.4 </span>Common event behaviors</h5>
|
|
|
|
<p>When the <dfn id="event-input-input" title="event-input-input"><code>input</code></dfn>
|
|
event applies, any time the user causes the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to change, the user agent must
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> that
|
|
bubbles named <code title="event-input">input</code> at the
|
|
<code><a href="#the-input-element">input</a></code> element. User agents may wait for a suitable
|
|
break in the user's interaction before queuing the task; for
|
|
example, a user agent could wait for the user to have not hit a key
|
|
for 100ms, so as to only fire the event when the user pauses,
|
|
instead of continuously for each keystroke.</p>
|
|
<p class="example">Examples of a user changing the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> would include the user typing
|
|
into a text field, pasting a new value into the field, or undoing an
|
|
edit in that field. Some user interactions do not cause changes to
|
|
the value, e.g. hitting the "delete" key in an empty text field, or
|
|
replacing some text in the field with text from the clipboard that
|
|
happens to be exactly the same text.</p>
|
|
|
|
<p>When the <dfn id="event-input-change" title="event-input-change"><code>change</code></dfn> event applies,
|
|
if the element does not have an <a href="#activation-behavior">activation behavior</a>
|
|
defined but uses a user interface that involves an explicit commit
|
|
action, then any time the user commits a change to the element's
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> or list of <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>, the
|
|
user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that bubbles named <code title="event-change">change</code> at the <code><a href="#the-input-element">input</a></code>
|
|
element.</p>
|
|
|
|
<p class="example">An example of a user interface with a commit
|
|
action would be a <a href="#file-upload-state" title="attr-input-type-file">File
|
|
Upload</a> control that consists of a single button that brings
|
|
up a file selection dialog: when the dialog is closed, if that the
|
|
<a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">file selection</a>
|
|
changed as a result, then the user has committed a new <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">file selection</a>.</p>
|
|
|
|
<p class="example">Another example of a user interface with a commit
|
|
action would be a <a href="#date-state" title="attr-input-type-date">Date</a>
|
|
control that allows both text-based user input and user selection
|
|
from a drop-down calendar: while text input might not have an
|
|
explicit commit step, selecting a date from the drop down calendar
|
|
and then dismissing the drop down would be a commit action.</p>
|
|
|
|
<p>When the user agent changes the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> on behalf of the user (e.g. as
|
|
part of a form prefilling feature), the user agent must follow these
|
|
steps:</p>
|
|
|
|
<ol><li>If the <code title="event-input-input"><a href="#event-input-input">input</a></code> event
|
|
applies, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that bubbles named <code title="event-input">input</code> at the <code><a href="#the-input-element">input</a></code>
|
|
element.</li>
|
|
|
|
<li>If the <code title="event-input-change"><a href="#event-input-change">change</a></code> event
|
|
applies, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that bubbles named <code title="event-change">change</code> at the <code><a href="#the-input-element">input</a></code>
|
|
element.</li>
|
|
|
|
</ol><p class="note">In addition, when the <code title="event-input-change"><a href="#event-input-change">change</a></code> event applies, <code title="event-change">change</code> events can also be fired as part
|
|
of the element's <a href="#activation-behavior">activation behavior</a> and as part of the
|
|
<a href="#unfocusing-steps">unfocusing steps</a>.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <a href="#user-interaction-task-source">user interaction task
|
|
source</a>.</p>
|
|
|
|
</div><h4 id="the-button-element"><span class="secno">4.10.8 </span>The <dfn><code>button</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dd><a href="#category-listed" title="category-listed">Listed</a>, <a href="#category-label" title="category-label">labelable</a>, and <a href="#category-submit" title="category-submit">submittable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>, but there must be no <a href="#interactive-content">interactive content</a> descendant.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code></dd>
|
|
<dd><code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code></dd>
|
|
<dd><code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code></dd>
|
|
<dd><code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code></dd>
|
|
<dd><code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code></dd>
|
|
<dd><code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code></dd>
|
|
<dd><code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></dd>
|
|
<dd><code title="attr-button-type"><a href="#attr-button-type">type</a></code></dd>
|
|
<dd><code title="attr-button-value"><a href="#attr-button-value">value</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlbuttonelement">HTMLButtonElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-fe-autofocus" title="dom-fe-autofocus">autofocus</a>;
|
|
attribute boolean <a href="#dom-fe-disabled" title="dom-fe-disabled">disabled</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
attribute DOMString <a href="#dom-fs-formaction" title="dom-fs-formAction">formAction</a>;
|
|
attribute DOMString <a href="#dom-fs-formenctype" title="dom-fs-formEnctype">formEnctype</a>;
|
|
attribute DOMString <a href="#dom-fs-formmethod" title="dom-fs-formMethod">formMethod</a>;
|
|
attribute DOMString <a href="#dom-fs-formnovalidate" title="dom-fs-formNoValidate">formNoValidate</a>;
|
|
attribute DOMString <a href="#dom-fs-formtarget" title="dom-fs-formTarget">formTarget</a>;
|
|
attribute DOMString <a href="#dom-fe-name" title="dom-fe-name">name</a>;
|
|
attribute DOMString <a href="#dom-button-type" title="dom-button-type">type</a>;
|
|
attribute DOMString <a href="#dom-button-value" title="dom-button-value">value</a>;
|
|
|
|
readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
|
|
readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
|
|
readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
|
|
boolean <a href="#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
|
|
void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
|
|
|
|
readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-button-element">button</a></code> element <a href="#represents">represents</a> a
|
|
button. <span class="impl">If the element is not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>, then the user agent
|
|
should allow the user to activate the button.</span><p>The element is a <a href="#concept-button" title="concept-button">button</a>.<p>The <dfn id="attr-button-type" title="attr-button-type"><code>type</code></dfn>
|
|
attribute controls the behavior of the button when it is activated.
|
|
It is an <a href="#enumerated-attribute">enumerated attribute</a>. The following table
|
|
lists the keywords and states for the attribute — the keywords
|
|
in the left column map to the states in the cell in the second
|
|
column on the same row as the keyword.<table><thead><tr><th> Keyword
|
|
<th> State
|
|
<th> Brief description
|
|
<tbody><tr><td><dfn id="attr-button-type-submit" title="attr-button-type-submit"><code>submit</code></dfn>
|
|
<td><a href="#attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</a>
|
|
<td>Submits the form.
|
|
<tr><td><dfn id="attr-button-type-reset" title="attr-button-type-reset"><code>reset</code></dfn>
|
|
<td><a href="#attr-button-type-reset-state" title="attr-button-type-reset-state">Reset Button</a>
|
|
<td>Resets the form.
|
|
<tr><td><dfn id="attr-button-type-button" title="attr-button-type-button"><code>button</code></dfn>
|
|
<td><a href="#attr-button-type-button-state" title="attr-button-type-button-state">Button</a>
|
|
<td>Does nothing.
|
|
</table><p>The <i>missing value default</i> is the <a href="#attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</a>
|
|
state.<p>If the <code title="attr-button-type"><a href="#attr-button-type">type</a></code> attribute is in
|
|
the <a href="#attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</a>
|
|
state, the element is specifically a <a href="#concept-submit-button" title="concept-submit-button">submit button</a>.<div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: If the <code title="attr-button-type"><a href="#attr-button-type">type</a></code> attribute is in the <a href="#attr-button-type-reset-state" title="attr-button-type-reset-state">Reset Button</a> state or
|
|
the <a href="#attr-button-type-button-state" title="attr-button-type-button-state">Button</a> state,
|
|
the element is <a href="#barred-from-constraint-validation">barred from constraint validation</a>.</p>
|
|
|
|
<p>If the element is not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>, the <a href="#activation-behavior">activation
|
|
behavior</a> of the <code><a href="#the-button-element">button</a></code> element is to run the
|
|
steps defined in the following list for the current state of the
|
|
element's <code title="attr-button-type"><a href="#attr-button-type">type</a></code> attribute.</p>
|
|
|
|
<dl><dt> <dfn id="attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</dfn> </dt>
|
|
|
|
<dd><p>If the element has a <a href="#form-owner">form owner</a>, the element
|
|
must <a href="#concept-form-submit" title="concept-form-submit">submit</a> the <a href="#form-owner">form
|
|
owner</a> from the <code><a href="#the-button-element">button</a></code> element.</dd>
|
|
|
|
<dt> <dfn id="attr-button-type-reset-state" title="attr-button-type-reset-state">Reset Button</dfn> </dt>
|
|
|
|
<dd><p>If the element has a <a href="#form-owner">form owner</a>, the element
|
|
must <a href="#concept-form-reset" title="concept-form-reset">reset</a> the <a href="#form-owner">form
|
|
owner</a>.</dd>
|
|
|
|
<dt> <dfn id="attr-button-type-button-state" title="attr-button-type-button-state">Button</dfn>
|
|
|
|
<dd><p>Do nothing.</dd>
|
|
|
|
</dl></div><p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-button-element">button</a></code> element with its
|
|
<a href="#form-owner">form owner</a>. The <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>
|
|
attribute represents the element's name. The <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> attribute is used to make
|
|
the control non-interactive and to prevent its value from being
|
|
submitted. The <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>
|
|
attribute controls focus. The <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>, <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code> attributes are
|
|
<a href="#attributes-for-form-submission">attributes for form submission</a>.<p class="note">The <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code> attribute can
|
|
be used to make submit buttons that do not trigger the constraint
|
|
validation.<p>The <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>, <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code> must not be specified
|
|
if the element's <code title="attr-button-type"><a href="#attr-button-type">type</a></code>
|
|
attribute is not in the <a href="#attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</a>
|
|
state.<p>The <dfn id="attr-button-value" title="attr-button-value"><code>value</code></dfn>
|
|
attribute gives the element's value for the purposes of form
|
|
submission. The element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is the value of the element's
|
|
<code title="attr-button-value"><a href="#attr-button-value">value</a></code> attribute, if there is
|
|
one, or the empty string otherwise.<p class="note">A button (and its value) is only included in the
|
|
form submission if the button itself was used to initiate the form
|
|
submission.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-button-value" title="dom-button-value"><code>value</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
<p>The <dfn id="dom-button-type" title="dom-button-type"><code>type</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>.</p>
|
|
|
|
<p>The <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code>
|
|
attributes, and the <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
methods, are part of the <a href="#the-constraint-validation-api">constraint validation API</a>. The
|
|
<code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code> attribute provides a list
|
|
of the element's <code><a href="#the-label-element">label</a></code>s. The <code title="dom-fe-autofocus"><a href="#dom-fe-autofocus">autofocus</a></code>, <code title="dom-fe-disabled"><a href="#dom-fe-disabled">disabled</a></code>, <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code>, and <code title="dom-fe-name"><a href="#dom-fe-name">name</a></code> IDL attributes are part of the
|
|
element's forms API.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following button is labeled "Show hint" and pops up a dialog
|
|
box when activated:</p>
|
|
|
|
<pre><button type=button
|
|
onclick="alert('This 15-20 minute piece was composed by George Gershwin.')">
|
|
Show hint
|
|
</button></pre>
|
|
|
|
</div><h4 id="the-select-element"><span class="secno">4.10.9 </span>The <dfn><code>select</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dd><a href="#category-listed" title="category-listed">Listed</a>, <a href="#category-label" title="category-label">labelable</a>, <a href="#category-submit" title="category-submit">submittable</a>, and <a href="#category-reset" title="category-reset">resettable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-option-element">option</a></code> or <code><a href="#the-optgroup-element">optgroup</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code></dd>
|
|
<dd><code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code></dd>
|
|
<dd><code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></dd>
|
|
<dd><code title="attr-select-required"><a href="#attr-select-required">required</a></code></dd>
|
|
<dd><code title="attr-select-size"><a href="#attr-select-size">size</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlselectelement">HTMLSelectElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-fe-autofocus" title="dom-fe-autofocus">autofocus</a>;
|
|
attribute boolean <a href="#dom-fe-disabled" title="dom-fe-disabled">disabled</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
attribute boolean <a href="#dom-select-multiple" title="dom-select-multiple">multiple</a>;
|
|
attribute DOMString <a href="#dom-fe-name" title="dom-fe-name">name</a>;
|
|
attribute boolean <a href="#dom-select-required" title="dom-select-required">required</a>;
|
|
attribute unsigned long <a href="#dom-select-size" title="dom-select-size">size</a>;
|
|
|
|
readonly attribute DOMString <a href="#dom-select-type" title="dom-select-type">type</a>;
|
|
|
|
readonly attribute <a href="#htmloptionscollection">HTMLOptionsCollection</a> <a href="#dom-select-options" title="dom-select-options">options</a>;
|
|
attribute unsigned long <a href="#dom-select-length" title="dom-select-length">length</a>;
|
|
getter any <a href="#dom-select-item" title="dom-select-item">item</a>(in unsigned long index);
|
|
any <a href="#dom-select-nameditem" title="dom-select-namedItem">namedItem</a>(in DOMString name);
|
|
void <a href="#dom-select-add" title="dom-select-add">add</a>(in <a href="#htmlelement">HTMLElement</a> element, in optional <a href="#htmlelement">HTMLElement</a> before);
|
|
void <a href="#dom-select-add" title="dom-select-add">add</a>(in <a href="#htmlelement">HTMLElement</a> element, in long before);
|
|
void <a href="#dom-select-remove" title="dom-select-remove">remove</a>(in long index);
|
|
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-select-selectedoptions" title="dom-select-selectedOptions">selectedOptions</a>;
|
|
attribute long <a href="#dom-select-selectedindex" title="dom-select-selectedIndex">selectedIndex</a>;
|
|
attribute DOMString <a href="#dom-select-value" title="dom-select-value">value</a>;
|
|
|
|
readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
|
|
readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
|
|
readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
|
|
boolean <a href="#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
|
|
void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
|
|
|
|
readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-select-element">select</a></code> element represents a control for
|
|
selecting amongst a set of options.<p>The <dfn id="attr-select-multiple" title="attr-select-multiple"><code>multiple</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. If the attribute is
|
|
present, then the <code><a href="#the-select-element">select</a></code> element
|
|
<a href="#represents">represents</a> a control for selecting zero or more options
|
|
from the <a href="#concept-select-option-list" title="concept-select-option-list">list of
|
|
options</a>. If the attribute is absent, then the
|
|
<code><a href="#the-select-element">select</a></code> element <a href="#represents">represents</a> a control for
|
|
selecting a single option from the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>.<p>The <dfn id="attr-select-size" title="attr-select-size"><code>size</code></dfn>
|
|
attribute gives the number of options to show to the user. The <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute, if specified, must
|
|
have a value that is a <a href="#valid-non-negative-integer">valid non-negative integer</a>
|
|
greater than zero. If the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute is present,
|
|
then the <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute's
|
|
default value is 4. If the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute is absent,
|
|
then the <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute's
|
|
default value is 1.<div class="impl">
|
|
|
|
<p>The <dfn id="concept-select-size" title="concept-select-size">display size</dfn> of a
|
|
<code><a href="#the-select-element">select</a></code> element is the result of applying the
|
|
<a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</a> to the value of
|
|
element's <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute, if it
|
|
has one and parsing it is successful. If applying those rules to the
|
|
attribute's value is not successful, or if the <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute is absent, the
|
|
element's <a href="#concept-select-size" title="concept-select-size">display size</a> is
|
|
the default value of the attribute.</p>
|
|
|
|
</div><p>The <dfn id="concept-select-option-list" title="concept-select-option-list">list of options</dfn>
|
|
for a <code><a href="#the-select-element">select</a></code> element consists of all the
|
|
<code><a href="#the-option-element">option</a></code> element children of the <code><a href="#the-select-element">select</a></code>
|
|
element, and all the <code><a href="#the-option-element">option</a></code> element children of all the
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element children of the <code><a href="#the-select-element">select</a></code>
|
|
element, in <a href="#tree-order">tree order</a>.<p>The <dfn id="attr-select-required" title="attr-select-required"><code>required</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. When specified, the
|
|
user will be required to select a value before submitting the
|
|
form.<p>If a <code><a href="#the-select-element">select</a></code> element has a <code title="attr-select-required"><a href="#attr-select-required">required</a></code> attribute specified,
|
|
does not have a <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>
|
|
attribute specified, and has a <a href="#concept-select-size" title="concept-select-size">display size</a> of 1;
|
|
and if the <a href="#concept-option-value" title="concept-option-value">value</a> of the
|
|
first <code><a href="#the-option-element">option</a></code> element in the <code><a href="#the-select-element">select</a></code>
|
|
element's <a href="#concept-select-option-list" title="concept-select-option-list">list of
|
|
options</a> (if any) is the empty string, and that
|
|
<code><a href="#the-option-element">option</a></code> element's parent node is the <code><a href="#the-select-element">select</a></code>
|
|
element (and not an <code><a href="#the-optgroup-element">optgroup</a></code> element), then that
|
|
<code><a href="#the-option-element">option</a></code> is the <code><a href="#the-select-element">select</a></code> element's
|
|
<dfn id="placeholder-label-option">placeholder label option</dfn>.<p>If a <code><a href="#the-select-element">select</a></code> element has a <code title="attr-select-required"><a href="#attr-select-required">required</a></code> attribute specified,
|
|
does not have a <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>
|
|
attribute specified, and has a <a href="#concept-select-size" title="concept-select-size">display size</a> of 1,
|
|
then the <code><a href="#the-select-element">select</a></code> element must have a <a href="#placeholder-label-option">placeholder
|
|
label option</a>.<div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: If the element has its
|
|
<code title="attr-select-required"><a href="#attr-select-required">required</a></code> attribute
|
|
specified, and either none of the <code><a href="#the-option-element">option</a></code> elements in
|
|
the <code><a href="#the-select-element">select</a></code> element's <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> have their
|
|
<a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to
|
|
true, or the only <code><a href="#the-option-element">option</a></code> element in the
|
|
<code><a href="#the-select-element">select</a></code> element's <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> with its
|
|
<a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to
|
|
true is the <a href="#placeholder-label-option">placeholder label option</a>, then the element
|
|
is <a href="#suffering-from-being-missing">suffering from being missing</a>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<p>If the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>
|
|
attribute is absent, and the element is not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>, then the user agent
|
|
should allow the user to pick an <code><a href="#the-option-element">option</a></code> element in its
|
|
<a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> that
|
|
is itself not <a href="#concept-option-disabled" title="concept-option-disabled">disabled</a>.
|
|
Upon this <code><a href="#the-option-element">option</a></code> element being <dfn id="concept-select-pick" title="concept-select-pick">picked</dfn> (either through a click, or
|
|
through unfocusing the element after changing its value, or through
|
|
a <a href="#using-the-option-element-to-define-a-command" title="option-command">menu command</a>, or through any
|
|
other mechanism), and before the relevant user interaction event
|
|
is queued (e.g. before the
|
|
<code title="event-click"><a href="#event-click">click</a></code> event), the user agent must
|
|
set the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of the
|
|
picked <code><a href="#the-option-element">option</a></code> element to true and then <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> that bubbles named
|
|
<code title="event-change">change</code> at the <code><a href="#the-select-element">select</a></code>
|
|
element, using the <a href="#user-interaction-task-source">user interaction task source</a> as the
|
|
task source.</p>
|
|
|
|
<p>If the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>
|
|
attribute is absent, whenever an <code><a href="#the-option-element">option</a></code> element in the
|
|
<code><a href="#the-select-element">select</a></code> element's <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> has its
|
|
<a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to
|
|
true, and whenever an <code><a href="#the-option-element">option</a></code> element with its <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to true
|
|
is added to the <code><a href="#the-select-element">select</a></code> element's <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>, the user
|
|
agent must set the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of all the
|
|
other <code><a href="#the-option-element">option</a></code> element in its <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> to
|
|
false.</p>
|
|
|
|
<p>If the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>
|
|
attribute is absent and the element's <a href="#concept-select-size" title="concept-select-size">display size</a> is greater than 1,
|
|
then the user agent should also allow the user to request that the
|
|
<code><a href="#the-option-element">option</a></code> whose <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> is true, if
|
|
any, be unselected. Upon this request being conveyed to the user
|
|
agent, and before the relevant user interaction event is queued (e.g. before the <code title="event-click"><a href="#event-click">click</a></code> event), the user agent must set the
|
|
<a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of
|
|
that <code><a href="#the-option-element">option</a></code> element to false and then <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> that bubbles named
|
|
<code title="event-change">change</code> at the <code><a href="#the-select-element">select</a></code>
|
|
element, using the <a href="#user-interaction-task-source">user interaction task source</a> as the
|
|
task source.</p>
|
|
|
|
<p>If the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>
|
|
attribute is absent and the element's <a href="#concept-select-size" title="concept-select-size">display size</a> is 1, then whenever
|
|
there are no <code><a href="#the-option-element">option</a></code> elements in the <code><a href="#the-select-element">select</a></code>
|
|
element's <a href="#concept-select-option-list" title="concept-select-option-list">list of
|
|
options</a> that have their <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to true,
|
|
the user agent must set the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of the first
|
|
<code><a href="#the-option-element">option</a></code> element in the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> in
|
|
<a href="#tree-order">tree order</a> that is not <a href="#concept-option-disabled" title="concept-option-disabled">disabled</a>, if any, to
|
|
true.</p>
|
|
|
|
<p>If the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>
|
|
attribute is present, and the element is not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>, then the user agent
|
|
should allow the user to <dfn id="concept-select-toggle" title="concept-select-toggle">toggle</dfn> the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of the
|
|
<code><a href="#the-option-element">option</a></code> elements in its <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> that are
|
|
themselves not <a href="#concept-option-disabled" title="concept-option-disabled">disabled</a>
|
|
(either through a click, or through a <a href="#using-the-option-element-to-define-a-command" title="option-command">menu command</a>, or any other mechanism).
|
|
Upon the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of one or
|
|
more <code><a href="#the-option-element">option</a></code> elements being changed by the user, and
|
|
before the relevant user interaction event is queued (e.g. before a related <code title="event-click"><a href="#event-click">click</a></code> event), the user agent must
|
|
<a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a> that
|
|
bubbles named <code title="event-change">change</code> at the
|
|
<code><a href="#the-select-element">select</a></code> element, using the <a href="#user-interaction-task-source">user interaction task
|
|
source</a> as the task source.</p>
|
|
|
|
<p>The <a href="#concept-form-reset-control" title="concept-form-reset-control">reset
|
|
algorithm</a> for <code><a href="#the-select-element">select</a></code> elements is to go through
|
|
all the <code><a href="#the-option-element">option</a></code> elements in the element's <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>, and set
|
|
their <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a>
|
|
to true if the <code><a href="#the-option-element">option</a></code> element has a <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code> attribute, and false
|
|
otherwise.</p>
|
|
|
|
</div><p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-select-element">select</a></code> element with its
|
|
<a href="#form-owner">form owner</a>. The <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>
|
|
attribute represents the element's name. The <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> attribute is used to make
|
|
the control non-interactive and to prevent its value from being
|
|
submitted. The <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>
|
|
attribute controls focus.<dl class="domintro"><dt><var title="">select</var> . <code title="dom-select-type"><a href="#dom-select-type">type</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns "<code title="">select-multiple</code>" if the element
|
|
has a <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>
|
|
attribute, and "<code title="">select-one</code>"
|
|
otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">select</var> . <code title="dom-select-options"><a href="#dom-select-options">options</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns an <code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code> of the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">select</var> . <code title="dom-select-length"><a href="#dom-select-length">length</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dd>
|
|
<p>Returns the number of elements in the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>.</p>
|
|
<p>When set to a smaller number, truncates the number of <code><a href="#the-option-element">option</a></code> elements in the <code><a href="#the-select-element">select</a></code>.</p>
|
|
<p>When set to a greater number, adds new blank <code><a href="#the-option-element">option</a></code> elements to the <code><a href="#the-select-element">select</a></code>.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">select</var> . <code title="dom-select-item"><a href="#dom-select-item">item</a></code>(<var title="">index</var>)</dt>
|
|
<dt><var title="">select</var>[<var title="">index</var>]</dt>
|
|
<dd>
|
|
<p>Returns the item with index <var title="">index</var> from the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>. The items are sorted in <a href="#tree-order">tree order</a>.</p>
|
|
<p>Returns null if <var title="">index</var> is out of range.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> = <var title="">select</var> . <code title="dom-select-item"><a href="#dom-select-item">namedItem</a></code>(<var title="">name</var>)</dt>
|
|
<dd>
|
|
<p>Returns the item with <a href="#concept-id" title="concept-id">ID</a> or <code title="attr-option-name"><a href="#attr-option-name">name</a></code> <var title="">name</var> from the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>.</p>
|
|
<p>If there are multiple matching items, then a <code><a href="#nodelist">NodeList</a></code> object containing all those elements is returned.</p>
|
|
<p>Returns null if no element with that <a href="#concept-id" title="concept-id">ID</a> could be found.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">select</var> . <code title="dom-select-add"><a href="#dom-select-add">add</a></code>(<var title="">element</var> [, <var title="">before</var> ])</dt>
|
|
<dd>
|
|
<p>Inserts <var title="">element</var> before the node given by <var title="">before</var>.</p>
|
|
<p>The <var title="">before</var> argument can be a number, in
|
|
which case <var title="">element</var> is inserted before the item
|
|
with that number, or an element from the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>, in
|
|
which case <var title="">element</var> is inserted before that
|
|
element.</p>
|
|
<p>If <var title="">before</var> is omitted, null, or a number out
|
|
of range, then <var title="">element</var> will be added at the
|
|
end of the list.</p>
|
|
<p>This method will throw a <code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code>
|
|
exception if <var title="">element</var> is an ancestor of the
|
|
element into which it is to be inserted. If <var title="">element</var> is not an <code><a href="#the-option-element">option</a></code> or
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element, then the method does nothing.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">select</var> . <code title="dom-select-selectedOptions"><a href="#dom-select-selectedoptions">selectedOptions</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> that are
|
|
selected.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">select</var> . <code title="dom-select-selectedIndex"><a href="#dom-select-selectedindex">selectedIndex</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the index of the first selected item, if any, or
|
|
−1 if there is no selected item.</p>
|
|
|
|
<p>Can be set, to change the selection.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">select</var> . <code title="dom-select-value"><a href="#dom-select-value">value</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the
|
|
first selected item, if any, or the empty string if there is no
|
|
selected item.</p>
|
|
|
|
<p>Can be set, to change the selection.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-select-type" title="dom-select-type"><code>type</code></dfn> IDL
|
|
attribute, on getting, must return the string "<code title="">select-one</code>" if the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute is absent,
|
|
and the string "<code title="">select-multiple</code>" if the <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute is
|
|
present.</p>
|
|
|
|
<p>The <dfn id="dom-select-options" title="dom-select-options"><code>options</code></dfn>
|
|
IDL attribute must return an <code><a href="#htmloptionscollection">HTMLOptionsCollection</a></code>
|
|
rooted at the <code><a href="#the-select-element">select</a></code> node, whose filter matches the
|
|
elements in the <a href="#concept-select-option-list" title="concept-select-option-list">list of
|
|
options</a>.</p>
|
|
|
|
<p>The <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection is
|
|
also mirrored on the <code><a href="#htmlselectelement">HTMLSelectElement</a></code> object. The
|
|
<a href="#supported-property-indices">supported property indices</a> at any instant are the
|
|
indices supported by the object returned by the <code title="dom-select-options"><a href="#dom-select-options">options</a></code> attribute at that
|
|
instant.</p>
|
|
|
|
<p>The <dfn id="dom-select-length" title="dom-select-length"><code>length</code></dfn> IDL
|
|
attribute must return the number of nodes <a href="#represented-by-the-collection" title="represented
|
|
by the collection">represented</a> by the <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection. On setting, it
|
|
must act like the attribute of the same name on the <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection.</p>
|
|
|
|
<p>The <dfn id="dom-select-item" title="dom-select-item"><code>item(<var title="">index</var>)</code></dfn> method must return the value
|
|
returned by the method of the same name on the <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection, when invoked
|
|
with the same argument.</p>
|
|
|
|
<p>The <dfn id="dom-select-nameditem" title="dom-select-namedItem"><code>namedItem(<var title="">name</var>)</code></dfn> method must return the value
|
|
returned by the method of the same name on the <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection, when invoked
|
|
with the same argument.</p>
|
|
|
|
<p>Similarly, the <dfn id="dom-select-add" title="dom-select-add"><code>add()</code></dfn> and <dfn id="dom-select-remove" title="dom-select-remove"><code>remove()</code></dfn> methods must
|
|
act like their namesake methods on that same <code title="dom-select-options"><a href="#dom-select-options">options</a></code> collection.</p>
|
|
|
|
<p>The <dfn id="dom-select-selectedoptions" title="dom-select-selectedOptions"><code>selectedOptions</code></dfn>
|
|
IDL attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at
|
|
the <code><a href="#the-select-element">select</a></code> node, whose filter matches the elements in
|
|
the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>
|
|
that have their <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to
|
|
true.</p>
|
|
|
|
<p>The <dfn id="dom-select-selectedindex" title="dom-select-selectedIndex"><code>selectedIndex</code></dfn>
|
|
IDL attribute, on getting, must return the <a href="#concept-option-index" title="concept-option-index">index</a> of the first
|
|
<code><a href="#the-option-element">option</a></code> element in the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> in
|
|
<a href="#tree-order">tree order</a> that has its <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to true,
|
|
if any. If there isn't one, then it must return −1.</p>
|
|
|
|
<p>On setting, the <code title="dom-select-selectedIndex"><a href="#dom-select-selectedindex">selectedIndex</a></code> attribute must
|
|
set the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of all the
|
|
<code><a href="#the-option-element">option</a></code> elements in the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> to false,
|
|
and then the <code><a href="#the-option-element">option</a></code> element in the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> whose
|
|
<a href="#concept-option-index" title="concept-option-index">index</a> is the given new
|
|
value, if any, must have its <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to
|
|
true.</p>
|
|
|
|
<p>The <dfn id="dom-select-value" title="dom-select-value"><code>value</code></dfn> IDL
|
|
attribute, on getting, must return the <a href="#concept-option-value" title="concept-option-value">value</a> of the first
|
|
<code><a href="#the-option-element">option</a></code> element in the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> in
|
|
<a href="#tree-order">tree order</a> that has its <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to true,
|
|
if any. If there isn't one, then it must return the empty
|
|
string.</p>
|
|
|
|
<p>On setting, the <code title="dom-select-value"><a href="#dom-select-value">value</a></code>
|
|
attribute must set the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of all the
|
|
<code><a href="#the-option-element">option</a></code> elements in the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> to false,
|
|
and then the first <code><a href="#the-option-element">option</a></code> element in the <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>, in
|
|
<a href="#tree-order">tree order</a>, whose <a href="#concept-option-value" title="concept-option-value">value</a> is equal to the given new
|
|
value, if any, must have its <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to
|
|
true.</p>
|
|
|
|
<p>The <dfn id="dom-select-multiple" title="dom-select-multiple"><code>multiple</code></dfn>,
|
|
<dfn id="dom-select-required" title="dom-select-required"><code>required</code></dfn>, and
|
|
<dfn id="dom-select-size" title="dom-select-size"><code>size</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name. The <code title="dom-select-size"><a href="#dom-select-size">size</a></code> IDL
|
|
attribute is <a href="#limited-to-only-non-negative-numbers">limited to only non-negative numbers</a>, with
|
|
the default value zero (which for historical reasons is different
|
|
from the default value of the <code title="attr-select-size"><a href="#attr-select-size">size</a></code> content attribute that it
|
|
reflects).</p>
|
|
<p>The <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code>
|
|
attributes, and the <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
methods, are part of the <a href="#the-constraint-validation-api">constraint validation API</a>. The
|
|
<code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code> attribute provides a list
|
|
of the element's <code><a href="#the-label-element">label</a></code>s. The <code title="dom-fe-autofocus"><a href="#dom-fe-autofocus">autofocus</a></code>, <code title="dom-fe-disabled"><a href="#dom-fe-disabled">disabled</a></code>, <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code>, and <code title="dom-fe-name"><a href="#dom-fe-name">name</a></code> IDL attributes are part of the
|
|
element's forms API.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows how a <code><a href="#the-select-element">select</a></code> element
|
|
can be used to offer the user with a set of options from which the
|
|
user can select a single option. The default option is
|
|
preselected.</p>
|
|
|
|
<pre><p>
|
|
<label for="unittype">Select unit type:</label>
|
|
<select id="unittype" name="unittype">
|
|
<option value="1"> Miner </option>
|
|
<option value="2"> Puffer </option>
|
|
<option value="3" selected> Snipey </option>
|
|
<option value="4"> Max </option>
|
|
<option value="5"> Firebot </option>
|
|
</select>
|
|
</p></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here, the user is offered a set of options from which he can
|
|
select any number. By default, all five options are selected.</p>
|
|
|
|
<pre><p>
|
|
<label for="allowedunits">Select unit types to enable on this map:</label>
|
|
<select id="allowedunits" name="allowedunits" multiple>
|
|
<option value="1" selected> Miner </option>
|
|
<option value="2" selected> Puffer </option>
|
|
<option value="3" selected> Snipey </option>
|
|
<option value="4" selected> Max </option>
|
|
<option value="5" selected> Firebot </option>
|
|
</select>
|
|
</p></pre>
|
|
|
|
</div><h4 id="the-datalist-element"><span class="secno">4.10.10 </span>The <dfn><code>datalist</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Either: <a href="#phrasing-content">phrasing content</a>.</dd>
|
|
<dd>Or: Zero or more <code><a href="#the-option-element">option</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmldatalistelement">HTMLDataListElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-datalist-options" title="dom-datalist-options">options</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-datalist-element">datalist</a></code> element represents a set of
|
|
<code><a href="#the-option-element">option</a></code> elements that represent predefined options for
|
|
other controls. The contents of the element represents fallback
|
|
content for legacy user agents, intermixed with <code><a href="#the-option-element">option</a></code>
|
|
elements that represent the predefined options. In the rendering,
|
|
the <code><a href="#the-datalist-element">datalist</a></code> element <a href="#represents">represents</a>
|
|
nothing<span class="impl"> and it, along with its children, should
|
|
be hidden</span>.<p>The <code><a href="#the-datalist-element">datalist</a></code> element is hooked up to an
|
|
<code><a href="#the-input-element">input</a></code> element using the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute on the
|
|
<code><a href="#the-input-element">input</a></code> element.<p>Each <code><a href="#the-option-element">option</a></code> element that is a descendant of the
|
|
<code><a href="#the-datalist-element">datalist</a></code> element, that is not <a href="#concept-option-disabled" title="concept-option-disabled">disabled</a>, and whose <a href="#concept-option-value" title="concept-option-value">value</a> is a string that isn't the
|
|
empty string, represents a suggestion. Each suggestion has a <a href="#concept-option-value" title="concept-option-value">value</a> and a <a href="#concept-option-label" title="concept-option-label">label</a>.
|
|
|
|
<dl class="domintro"><dt><var title="">datalist</var> . <code title="dom-datalist-options"><a href="#dom-datalist-options">options</a></code></dt>
|
|
|
|
<dd>
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the <code>options</code> elements of the table.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-datalist-options" title="dom-datalist-options"><code>options</code></dfn>
|
|
IDL attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at
|
|
the <code><a href="#the-datalist-element">datalist</a></code> node, whose filter matches
|
|
<code><a href="#the-option-element">option</a></code> elements.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: If an element has a
|
|
<code><a href="#the-datalist-element">datalist</a></code> element ancestor, it is <a href="#barred-from-constraint-validation">barred from
|
|
constraint validation</a>.</p>
|
|
|
|
</div><h4 id="the-optgroup-element"><span class="secno">4.10.11 </span>The <dfn><code>optgroup</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-select-element">select</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Zero or more <code><a href="#the-option-element">option</a></code> elements.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-optgroup-disabled"><a href="#attr-optgroup-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-optgroup-label"><a href="#attr-optgroup-label">label</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmloptgroupelement">HTMLOptGroupElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-optgroup-disabled" title="dom-optgroup-disabled">disabled</a>;
|
|
attribute DOMString <a href="#dom-optgroup-label" title="dom-optgroup-label">label</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-optgroup-element">optgroup</a></code> element <a href="#represents">represents</a> a group of
|
|
<code><a href="#the-option-element">option</a></code> elements with a common label.<p>The element's group of <code><a href="#the-option-element">option</a></code> elements consists of
|
|
the <code><a href="#the-option-element">option</a></code> elements that are children of the
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element.<div class="impl">
|
|
|
|
<p>When showing <code><a href="#the-option-element">option</a></code> elements in <code><a href="#the-select-element">select</a></code>
|
|
elements, user agents should show the <code><a href="#the-option-element">option</a></code> elements
|
|
of such groups as being related to each other and separate from
|
|
other <code><a href="#the-option-element">option</a></code> elements.</p>
|
|
|
|
</div><p>The <dfn id="attr-optgroup-disabled" title="attr-optgroup-disabled"><code>disabled</code></dfn> attribute
|
|
is a <a href="#boolean-attribute">boolean attribute</a> and can be used to <a href="#concept-option-disabled" title="concept-option-disabled">disable</a> a group of
|
|
<code><a href="#the-option-element">option</a></code> elements together.<p>The <dfn id="attr-optgroup-label" title="attr-optgroup-label"><code>label</code></dfn>
|
|
attribute must be specified. Its value gives the name of the group,
|
|
for the purposes of the user interface. <span class="impl">User
|
|
agents should use this attribute's value when labelling the group of
|
|
<code><a href="#the-option-element">option</a></code> elements in a <code><a href="#the-select-element">select</a></code>
|
|
element.</span><div class="impl">
|
|
|
|
<p>The <dfn id="dom-optgroup-disabled" title="dom-optgroup-disabled"><code>disabled</code></dfn> and <dfn id="dom-optgroup-label" title="dom-optgroup-label"><code>label</code></dfn> attributes must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following snippet shows how a set of lessons from three
|
|
courses could be offered in a <code><a href="#the-select-element">select</a></code> drop-down
|
|
widget:</p>
|
|
|
|
<pre><form action="courseselector.dll" method="get">
|
|
<p>Which course would you like to watch today?
|
|
<p><label>Course:
|
|
<select name="c">
|
|
<optgroup label="8.01 Physics I: Classical Mechanics">
|
|
<option value="8.01.1">Lecture 01: Powers of Ten
|
|
<option value="8.01.2">Lecture 02: 1D Kinematics
|
|
<option value="8.01.3">Lecture 03: Vectors
|
|
<optgroup label="8.02 Electricity and Magnestism">
|
|
<option value="8.02.1">Lecture 01: What holds our world together?
|
|
<option value="8.02.2">Lecture 02: Electric Field
|
|
<option value="8.02.3">Lecture 03: Electric Flux
|
|
<optgroup label="8.03 Physics III: Vibrations and Waves">
|
|
<option value="8.03.1">Lecture 01: Periodic Phenomenon
|
|
<option value="8.03.2">Lecture 02: Beats
|
|
<option value="8.03.3">Lecture 03: Forced Oscillations with Damping
|
|
</select>
|
|
</label>
|
|
<p><input type=submit value="▶ Play">
|
|
</form></pre>
|
|
|
|
</div><h4 id="the-option-element"><span class="secno">4.10.12 </span>The <dfn><code>option</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As a child of a <code><a href="#the-select-element">select</a></code> element.</dd>
|
|
<dd>As a child of a <code><a href="#the-datalist-element">datalist</a></code> element.</dd>
|
|
<dd>As a child of an <code><a href="#the-optgroup-element">optgroup</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#text-content" title="text content">Text</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-option-disabled"><a href="#attr-option-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-option-label"><a href="#attr-option-label">label</a></code></dd>
|
|
<dd><code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code></dd>
|
|
<dd><code title="attr-option-value"><a href="#attr-option-value">value</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">[NamedConstructor=<a href="#dom-option" title="dom-option">Option</a>(),
|
|
NamedConstructor=<a href="#dom-option-t" title="dom-option-t">Option</a>(in DOMString text),
|
|
NamedConstructor=<a href="#dom-option-tv" title="dom-option-tv">Option</a>(in DOMString text, in DOMString value),
|
|
NamedConstructor=<a href="#dom-option-tvd" title="dom-option-tvd">Option</a>(in DOMString text, in DOMString value, in boolean defaultSelected),
|
|
NamedConstructor=<a href="#dom-option-tvds" title="dom-option-tvds">Option</a>(in DOMString text, in DOMString value, in boolean defaultSelected, in boolean selected)]
|
|
interface <dfn id="htmloptionelement">HTMLOptionElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-option-disabled" title="dom-option-disabled">disabled</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-option-form" title="dom-option-form">form</a>;
|
|
attribute DOMString <a href="#dom-option-label" title="dom-option-label">label</a>;
|
|
attribute boolean <a href="#dom-option-defaultselected" title="dom-option-defaultSelected">defaultSelected</a>;
|
|
attribute boolean <a href="#dom-option-selected" title="dom-option-selected">selected</a>;
|
|
attribute DOMString <a href="#dom-option-value" title="dom-option-value">value</a>;
|
|
|
|
attribute DOMString <a href="#dom-option-text" title="dom-option-text">text</a>;
|
|
readonly attribute long <a href="#dom-option-index" title="dom-option-index">index</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-option-element">option</a></code> element <a href="#represents">represents</a> an option
|
|
in a <code><a href="#the-select-element">select</a></code> element or as part of a list of suggestions
|
|
in a <code><a href="#the-datalist-element">datalist</a></code> element.<p>In certain circumstances described in the definition of the
|
|
<code><a href="#the-select-element">select</a></code> element, an <code><a href="#the-option-element">option</a></code> element can be a
|
|
<code><a href="#the-select-element">select</a></code> element's <a href="#placeholder-label-option">placeholder label option</a>.
|
|
A <a href="#placeholder-label-option">placeholder label option</a> does not represent an actual
|
|
option, but instead represents a label for the <code><a href="#the-select-element">select</a></code>
|
|
control.<p>The <dfn id="attr-option-disabled" title="attr-option-disabled"><code>disabled</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. An
|
|
<code><a href="#the-option-element">option</a></code> element is <dfn id="concept-option-disabled" title="concept-option-disabled">disabled</dfn> if its <code title="attr-option-disabled"><a href="#attr-option-disabled">disabled</a></code> attribute is present or
|
|
if it is a child of an <code><a href="#the-optgroup-element">optgroup</a></code> element whose <code title="attr-optgroup-disabled"><a href="#attr-optgroup-disabled">disabled</a></code> attribute is
|
|
present.<div class="impl">
|
|
|
|
<p>An <code><a href="#the-option-element">option</a></code> element that is <a href="#attr-option-disabled" title="attr-option-disabled">disabled</a> must prevent any <code title="event-click"><a href="#event-click">click</a></code> events that are <a href="#queue-a-task" title="queue
|
|
a task">queued</a> on the <a href="#user-interaction-task-source">user interaction task
|
|
source</a> from being dispatched on the element.</p>
|
|
|
|
</div><p>The <dfn id="attr-option-label" title="attr-option-label"><code>label</code></dfn>
|
|
attribute provides a label for element. The <dfn id="concept-option-label" title="concept-option-label">label</dfn> of an <code><a href="#the-option-element">option</a></code>
|
|
element is the value of the <code title="attr-option-label"><a href="#attr-option-label">label</a></code> attribute, if there is one,
|
|
or the <code><a href="#textcontent">textContent</a></code> of the element, if there isn't.<p>The <dfn id="attr-option-value" title="attr-option-value"><code>value</code></dfn>
|
|
attribute provides a value for element. The <dfn id="concept-option-value" title="concept-option-value">value</dfn> of an <code><a href="#the-option-element">option</a></code>
|
|
element is the value of the <code title="attr-option-value"><a href="#attr-option-value">value</a></code> attribute, if there is one,
|
|
or the <code><a href="#textcontent">textContent</a></code> of the element, if there isn't.<p>The <dfn id="attr-option-selected" title="attr-option-selected"><code>selected</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a>. It represents the
|
|
default <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> of the
|
|
element.<div class="impl">
|
|
|
|
<p>The <dfn id="concept-option-selectedness" title="concept-option-selectedness">selectedness</dfn>
|
|
of an <code><a href="#the-option-element">option</a></code> element is a boolean state, initially
|
|
false. Except where otherwise
|
|
specified, when the element is created, its <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> must be set
|
|
to true if the element has a <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code> attribute. Whenever an
|
|
<code><a href="#the-option-element">option</a></code> element's <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code> attribute is added, its
|
|
<a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> must
|
|
be set to true.</p>
|
|
|
|
<p class="note">The <code title="dom-option-tvd"><a href="#dom-option-tvd">Option()</a></code>
|
|
constructor with three or fewer arguments overrides the initial
|
|
state of the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> state to
|
|
always be false even if the third argument is true (implying that a
|
|
<code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code> attribute is to
|
|
be set). The fourth argument can be used to explicitly set the
|
|
initial <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> state when
|
|
using the constructor.</p>
|
|
|
|
|
|
|
|
</div><p>A <code><a href="#the-select-element">select</a></code> element whose <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute is not
|
|
specified must not have more than one descendant <code><a href="#the-option-element">option</a></code>
|
|
element with its <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code>
|
|
attribute set.<div class="impl">
|
|
|
|
<p>An <code><a href="#the-option-element">option</a></code> element's <dfn id="concept-option-index" title="concept-option-index">index</dfn> is the number of
|
|
<code><a href="#the-option-element">option</a></code> element that are in the same <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> but that
|
|
come before it in <a href="#tree-order">tree order</a>. If the
|
|
<code><a href="#the-option-element">option</a></code> element is not in a <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>, then the
|
|
<code><a href="#the-option-element">option</a></code> element's <a href="#concept-option-index" title="concept-option-index">index</a> is zero.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">option</var> . <code title="dom-option-selected"><a href="#dom-option-selected">selected</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element is selected, and false otherwise.</p>
|
|
|
|
<p>Can be set, to override the current state of the element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">option</var> . <code title="dom-option-index"><a href="#dom-option-index">index</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the index of the element in its <code><a href="#the-select-element">select</a></code>
|
|
element's <code title="dom-select-options"><a href="#dom-select-options">options</a></code>
|
|
list.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">option</var> . <code title="dom-option-form"><a href="#dom-option-form">form</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the element's <code><a href="#the-form-element">form</a></code> element, if any, or
|
|
null otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">option</var> . <code title="dom-option-text"><a href="#dom-option-text">text</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Same as <code><a href="#textcontent">textContent</a></code>, except that spaces are collapsed.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">option</var> = new <code title="dom-option"><a href="#dom-option">Option</a></code>( [ <var title="">text</var> [, <var title="">value</var> [, <var title="">defaultSelected</var> [, <var title="">selected</var> ] ] ] ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a new <code><a href="#the-option-element">option</a></code> element.</p>
|
|
|
|
<p>The <var title="">text</var> argument sets the contents of the element.</p>
|
|
<p>The <var title="">value</var> argument sets the <code title="attr-option-value"><a href="#attr-option-value">value</a></code> attribute.</p>
|
|
<p>The <var title="">defaultSelected</var> argument sets the <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code> attribute.</p>
|
|
<p>The <var title="">selected</var> argument sets whether or not the element is selected. If it is omitted, even if the <var title="">defaultSelected</var> argument is true, the element is not selected.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-option-disabled" title="dom-option-disabled"><code>disabled</code></dfn>
|
|
and <dfn id="dom-option-label" title="dom-option-label"><code>label</code></dfn> IDL
|
|
attributes must <a href="#reflect">reflect</a> the respective content
|
|
attributes of the same name. The <dfn id="dom-option-defaultselected" title="dom-option-defaultSelected"><code>defaultSelected</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code> content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-option-value" title="dom-option-value"><code>value</code></dfn> IDL
|
|
attribute, on getting, must return the value of the element's <code title="attr-option-value"><a href="#attr-option-value">value</a></code> content attribute, if it has
|
|
one, or else the value of the element's <code><a href="#textcontent">textContent</a></code> IDL
|
|
attribute. On setting, the element's <code title="attr-option-value"><a href="#attr-option-value">value</a></code> content attribute must be set
|
|
to the new value.</p>
|
|
|
|
<p>The <dfn id="dom-option-selected" title="dom-option-selected"><code>selected</code></dfn>
|
|
IDL attribute, on getting, must return true if the element's <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> is true, and
|
|
false otherwise. On setting, it must set the element's <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> to the new
|
|
value.</p>
|
|
|
|
<p>The <dfn id="dom-option-index" title="dom-option-index"><code>index</code></dfn> IDL
|
|
attribute must return the element's <a href="#concept-option-index" title="concept-option-index">index</a>.</p>
|
|
|
|
<p>The <dfn id="dom-option-text" title="dom-option-text"><code>text</code></dfn> IDL
|
|
attribute, on getting, must return the value of the
|
|
<code><a href="#textcontent">textContent</a></code> IDL attribute on the element with leading
|
|
and trailing <a href="#space-character" title="space character">space characters</a>
|
|
removed, and with any sequences of two or more <a href="#space-character" title="space
|
|
character">space characters</a> replaced by a single U+0020 SPACE
|
|
character. On setting, it must act as if the
|
|
<code><a href="#textcontent">textContent</a></code> IDL attribute on the element had been set
|
|
to the new value.</p>
|
|
|
|
<p>The <dfn id="dom-option-form" title="dom-option-form"><code>form</code></dfn> IDL
|
|
attribute's behavior depends on whether the <code><a href="#the-option-element">option</a></code>
|
|
element is in a <code><a href="#the-select-element">select</a></code> element or not. If the
|
|
<code><a href="#the-option-element">option</a></code> has a <code><a href="#the-select-element">select</a></code> element as its parent,
|
|
or has a <code><a href="#the-colgroup-element">colgroup</a></code> element as its parent and that
|
|
<code><a href="#the-colgroup-element">colgroup</a></code> element has a <code><a href="#the-select-element">select</a></code> element as
|
|
its parent, then the <code title="dom-option-form"><a href="#dom-option-form">form</a></code> IDL
|
|
attribute must return the same value as the <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> IDL attribute on that
|
|
<code><a href="#the-select-element">select</a></code> element. Otherwise, it must return null.</p>
|
|
|
|
<p>Several constructors are provided for creating
|
|
<code><a href="#htmloptionelement">HTMLOptionElement</a></code> objects (in addition to the factory
|
|
methods from DOM Core such as <code title="">createElement()</code>): <dfn id="dom-option" title="dom-option"><code>Option()</code></dfn>, <dfn id="dom-option-t" title="dom-option-t"><code>Option(<var title="">text</var>)</code></dfn>, <dfn id="dom-option-tv" title="dom-option-tv"><code>Option(<var title="">text</var>, <var title="">value</var>)</code></dfn>, <dfn id="dom-option-tvd" title="dom-option-tvd"><code>Option(<var title="">text</var>, <var title="">value</var>, <var title="">defaultSelected</var>)</code></dfn>, and <dfn id="dom-option-tvds" title="dom-option-tvds"><code>Option(<var title="">text</var>, <var title="">value</var>, <var title="">defaultSelected</var>, <var title="">selected</var>)</code></dfn>. When invoked as constructors,
|
|
these must return a new <code><a href="#htmloptionelement">HTMLOptionElement</a></code> object (a new
|
|
<code><a href="#the-option-element">option</a></code> element). If the <var title="">text</var>
|
|
argument is present, the new object must have as its only child a
|
|
<code><a href="#node">Node</a></code> with node type <code title="">TEXT_NODE</code> (3)
|
|
whose data is the value of that argument. If the <var title="">value</var> argument is present, the new object must have a
|
|
<code title="attr-option-value"><a href="#attr-option-value">value</a></code> attribute set with the
|
|
value of the argument as its value. If the <var title="">defaultSelected</var> argument is present and true, the new
|
|
object must have a <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code> attribute set with no
|
|
value. If the <var title="">selected</var> argument is present and
|
|
true, the new object must have its <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> set to true;
|
|
otherwise the fourth argument is absent or false, and the <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> must be set
|
|
to false, even if the <var title="">defaultSelected</var> argument
|
|
is present and true. The element's document must be the <a href="#active-document">active
|
|
document</a> of the <a href="#browsing-context">browsing context</a> of the
|
|
<code><a href="#window">Window</a></code> object on which the interface object of the
|
|
invoked constructor is found.</p>
|
|
|
|
</div><h4 id="the-textarea-element"><span class="secno">4.10.13 </span>The <dfn><code>textarea</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dd><a href="#category-listed" title="category-listed">Listed</a>, <a href="#category-label" title="category-label">labelable</a>, <a href="#category-submit" title="category-submit">submittable</a>, and <a href="#category-reset" title="category-reset">resettable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#text-content" title="text content">Text</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code></dd>
|
|
<dd><code title="attr-textarea-cols"><a href="#attr-textarea-cols">cols</a></code></dd>
|
|
<dd><code title="attr-textarea-dirname"><a href="#attr-textarea-dirname">dirname</a></code></dd>
|
|
<dd><code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength">maxlength</a></code></dd>
|
|
<dd><code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></dd>
|
|
<dd><code title="attr-textarea-placeholder"><a href="#attr-textarea-placeholder">placeholder</a></code></dd>
|
|
<dd><code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">readonly</a></code></dd>
|
|
<dd><code title="attr-textarea-required"><a href="#attr-textarea-required">required</a></code></dd>
|
|
<dd><code title="attr-textarea-rows"><a href="#attr-textarea-rows">rows</a></code></dd>
|
|
<dd><code title="attr-textarea-wrap"><a href="#attr-textarea-wrap">wrap</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmltextareaelement">HTMLTextAreaElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-fe-autofocus" title="dom-fe-autofocus">autofocus</a>;
|
|
attribute unsigned long <a href="#dom-textarea-cols" title="dom-textarea-cols">cols</a>;
|
|
attribute DOMString <a href="#dom-textarea-dirname" title="dom-textarea-dirName">dirName</a>;
|
|
attribute boolean <a href="#dom-fe-disabled" title="dom-fe-disabled">disabled</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
attribute long <a href="#dom-textarea-maxlength" title="dom-textarea-maxLength">maxLength</a>;
|
|
attribute DOMString <a href="#dom-fe-name" title="dom-fe-name">name</a>;
|
|
attribute DOMString <a href="#dom-textarea-placeholder" title="dom-textarea-placeholder">placeholder</a>;
|
|
attribute boolean <a href="#dom-textarea-readonly" title="dom-textarea-readOnly">readOnly</a>;
|
|
attribute boolean <a href="#dom-textarea-required" title="dom-textarea-required">required</a>;
|
|
attribute unsigned long <a href="#dom-textarea-rows" title="dom-textarea-rows">rows</a>;
|
|
attribute DOMString <a href="#dom-textarea-wrap" title="dom-textarea-wrap">wrap</a>;
|
|
|
|
readonly attribute DOMString <a href="#dom-textarea-type" title="dom-textarea-type">type</a>;
|
|
attribute DOMString <a href="#dom-textarea-defaultvalue" title="dom-textarea-defaultValue">defaultValue</a>;
|
|
attribute DOMString <a href="#dom-textarea-value" title="dom-textarea-value">value</a>;
|
|
readonly attribute unsigned long <a href="#dom-textarea-textlength" title="dom-textarea-textLength">textLength</a>;
|
|
|
|
readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
|
|
readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
|
|
readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
|
|
boolean <a href="#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
|
|
void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
|
|
|
|
readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
|
|
|
|
void <a href="#dom-textarea-input-select" title="dom-textarea/input-select">select</a>();
|
|
attribute unsigned long <a href="#dom-textarea-input-selectionstart" title="dom-textarea/input-selectionStart">selectionStart</a>;
|
|
attribute unsigned long <a href="#dom-textarea-input-selectionend" title="dom-textarea/input-selectionEnd">selectionEnd</a>;
|
|
attribute DOMString <a href="#dom-textarea-input-selectiondirection" title="dom-textarea/input-selectionDirection">selectionDirection</a>;
|
|
void <a href="#dom-textarea-input-setselectionrange" title="dom-textarea/input-setSelectionRange">setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-textarea-element">textarea</a></code> element <a href="#represents">represents</a> a
|
|
multiline plain text edit control<span class="impl"> for the
|
|
element's <dfn id="concept-textarea-raw-value" title="concept-textarea-raw-value">raw
|
|
value</dfn></span>. The contents of the control represent the
|
|
control's default value.<div class="impl">
|
|
|
|
<p>The <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw value</a> of
|
|
a <code><a href="#the-textarea-element">textarea</a></code> control must be initially the empty
|
|
string.</p>
|
|
|
|
<p>A newline in a <code><a href="#the-textarea-element">textarea</a></code> element, and in its <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw value</a>, should separate
|
|
paragraphs for the purposes of the Unicode bidirectional algorithm.
|
|
This requirement may be implemented indirectly through the style
|
|
layer. For example, an HTML+CSS user agent could implement these
|
|
requirements by implementing the CSS 'unicode-bidi' property. <a href="#refsBIDI">[BIDI]</a> <a href="#refsCSS">[CSS]</a></p>
|
|
|
|
</div><p>The <dfn id="attr-textarea-readonly" title="attr-textarea-readonly"><code>readonly</code></dfn> attribute
|
|
is a <a href="#boolean-attribute">boolean attribute</a> used to control whether the text
|
|
can be edited by the user or not.<div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: If the <code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">readonly</a></code> attribute is
|
|
specified on a <code><a href="#the-textarea-element">textarea</a></code> element, the element is
|
|
<a href="#barred-from-constraint-validation">barred from constraint validation</a>.</p>
|
|
|
|
<p>A <code><a href="#the-textarea-element">textarea</a></code> element is <dfn id="concept-textarea-mutable" title="concept-textarea-mutable">mutable</dfn> if it is neither
|
|
<a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a> nor has a <code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">readonly</a></code> attribute
|
|
specified.</p>
|
|
|
|
<p>When a <code><a href="#the-textarea-element">textarea</a></code> is <a href="#concept-textarea-mutable" title="concept-textarea-mutable">mutable</a>, its <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw value</a> should be
|
|
editable by the user: the user agent should allow the user to edit,
|
|
insert, and remove text, and to insert and remove line breaks in the
|
|
form of U+000A LINE FEED (LF) characters. Any time the user causes
|
|
the element's <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw
|
|
value</a> to change, the user agent must <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> that bubbles named
|
|
<code title="event-input">input</code> at the <code><a href="#the-textarea-element">textarea</a></code>
|
|
element. User agents may wait for a suitable break in the user's
|
|
interaction before queuing the task; for example, a user agent could
|
|
wait for the user to have not hit a key for 100ms, so as to only
|
|
fire the event when the user pauses, instead of continuously for
|
|
each keystroke.</p>
|
|
<p>A <code><a href="#the-textarea-element">textarea</a></code> element has a <dfn id="concept-textarea-dirty" title="concept-textarea-dirty">dirty value flag</dfn>, which must be
|
|
initially set to false, and must be set to true whenever the user
|
|
interacts with the control in a way that changes the <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw value</a>.</p>
|
|
|
|
<p>When the <code><a href="#the-textarea-element">textarea</a></code> element's <code><a href="#textcontent">textContent</a></code>
|
|
IDL attribute changes value, if the element's <a href="#concept-textarea-dirty" title="concept-textarea-dirty">dirty value flag</a> is false,
|
|
then the element's <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw
|
|
value</a> must be set to the value of the element's
|
|
<code><a href="#textcontent">textContent</a></code> IDL attribute.</p>
|
|
|
|
<p>The <a href="#concept-form-reset-control" title="concept-form-reset-control">reset
|
|
algorithm</a> for <code><a href="#the-textarea-element">textarea</a></code> elements is to set the
|
|
element's <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">value</a> to
|
|
the value of the element's <code><a href="#textcontent">textContent</a></code> IDL
|
|
attribute.</p>
|
|
|
|
|
|
|
|
<p>If the element is <a href="#concept-textarea-mutable" title="concept-textarea-mutable">mutable</a>, the user agent
|
|
should allow the user to change the writing direction of the
|
|
element, setting it either to a left-to-right writing direction or a
|
|
right-to-left writing direction. If the user does so, the user agent
|
|
must then run the following steps:</p>
|
|
|
|
<ol><li><p>Set the element's <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code>
|
|
attribute to "<code title="attr-dir-ltr"><a href="#attr-dir-ltr">ltr</a></code>" if the user
|
|
selected a left-to-right writing direction, and "<code title="attr-dir-rtl"><a href="#attr-dir-rtl">rtl</a></code>" if the user selected a
|
|
right-to-left writing direction.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that bubbles named <code title="event-input">input</code> at the <code><a href="#the-textarea-element">textarea</a></code>
|
|
element.</li>
|
|
|
|
</ol></div><p>The <dfn id="attr-textarea-cols" title="attr-textarea-cols"><code>cols</code></dfn>
|
|
attribute specifies the expected maximum number of characters per
|
|
line. If the <code title="attr-textarea-cols"><a href="#attr-textarea-cols">cols</a></code> attribute
|
|
is specified, its value must be a <a href="#valid-non-negative-integer">valid non-negative
|
|
integer</a> greater than zero. <span class="impl">If applying the
|
|
<a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</a> to the
|
|
attribute's value results in a number greater than zero, then the
|
|
element's <dfn id="attr-textarea-cols-value" title="attr-textarea-cols-value">character
|
|
width</dfn> is that value; otherwise, it is 20.</span><div class="impl">
|
|
|
|
<p>The user agent may use the <code><a href="#the-textarea-element">textarea</a></code> element's <a href="#attr-textarea-cols-value" title="attr-textarea-cols-value">character width</a> as a hint to
|
|
the user as to how many characters the server prefers per line
|
|
(e.g. for visual user agents by making the width of the control be
|
|
that many characters). In visual renderings, the user agent should
|
|
wrap the user's input in the rendering so that each line is no wider
|
|
than this number of characters.</p>
|
|
|
|
</div><p>The <dfn id="attr-textarea-rows" title="attr-textarea-rows"><code>rows</code></dfn>
|
|
attribute specifies the number of lines to show. If the <code title="attr-textarea-rows"><a href="#attr-textarea-rows">rows</a></code> attribute is specified, its
|
|
value must be a <a href="#valid-non-negative-integer">valid non-negative integer</a> greater than
|
|
zero. <span class="impl">If applying the <a href="#rules-for-parsing-non-negative-integers">rules for parsing
|
|
non-negative integers</a> to the attribute's value results in a
|
|
number greater than zero, then the element's <dfn id="attr-textarea-rows-value" title="attr-textarea-rows-value">character height</dfn> is that
|
|
value; otherwise, it is 2.</span><div class="impl">
|
|
|
|
<p>Visual user agents should set the height of the control to the
|
|
number of lines given by <a href="#attr-textarea-rows-value" title="attr-textarea-rows-value">character height</a>.</p>
|
|
|
|
</div><p>The <dfn id="attr-textarea-wrap" title="attr-textarea-wrap"><code>wrap</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">enumerated attribute</a> with two keywords
|
|
and states: the <dfn id="attr-textarea-wrap-soft" title="attr-textarea-wrap-soft"><code>soft</code></dfn> keyword
|
|
which maps to the <a href="#attr-textarea-wrap-soft-state" title="attr-textarea-wrap-soft-state">Soft</a> state, and the
|
|
<dfn id="attr-textarea-wrap-hard" title="attr-textarea-wrap-hard"><code>hard</code></dfn> keyword
|
|
which maps to the <a href="#attr-textarea-wrap-hard-state" title="attr-textarea-wrap-hard-state">Hard</a> state. The
|
|
<i>missing value default</i> is the <a href="#attr-textarea-wrap-soft-state" title="attr-textarea-wrap-soft-state">Soft</a> state.<p>The <dfn id="attr-textarea-wrap-soft-state" title="attr-textarea-wrap-soft-state">Soft</dfn> state
|
|
indicates that the text in the <code><a href="#the-textarea-element">textarea</a></code> is not to be
|
|
wrapped when it is submitted (though it can still be wrapped in the
|
|
rendering).<p>The <dfn id="attr-textarea-wrap-hard-state" title="attr-textarea-wrap-hard-state">Hard</dfn> state
|
|
indicates that the text in the <code><a href="#the-textarea-element">textarea</a></code> is to have
|
|
newlines added by the user agent so that the text is wrapped when it
|
|
is submitted.<p>If the element's <code title="attr-textarea-wrap"><a href="#attr-textarea-wrap">wrap</a></code>
|
|
attribute is in the <a href="#attr-textarea-wrap-hard-state" title="attr-textarea-wrap-hard-state">Hard</a> state, the <code title="attr-textarea-cols"><a href="#attr-textarea-cols">cols</a></code> attribute must be
|
|
specified.</p><div class="impl">
|
|
|
|
<p>The element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is
|
|
defined to be the element's <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw value</a> with the
|
|
following transformation applied:</p>
|
|
|
|
<ol><li><p>Replace every occurrence of a U+000D CARRIAGE RETURN (CR)
|
|
character not followed by a U+000A LINE FEED (LF) character, and
|
|
every occurrence of a U+000A LINE FEED (LF) character not preceded
|
|
by a U+000D CARRIAGE RETURN (CR) character, by a two-character
|
|
string consisting of a U+000D CARRIAGE RETURN U+000A LINE FEED
|
|
(CRLF) character pair.</li>
|
|
|
|
<li><p>If the element's <code title="attr-textarea-wrap"><a href="#attr-textarea-wrap">wrap</a></code> attribute is in the <a href="#attr-textarea-wrap-hard-state" title="attr-textarea-wrap-hard-state">Hard</a> state, insert
|
|
U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pairs
|
|
into the string using a UA-defined algorithm so that each line has
|
|
no more than <a href="#attr-textarea-cols-value" title="attr-textarea-cols-value">character
|
|
width</a> characters. For the purposes of this requirement,
|
|
lines are delimited by the start of the string, the end of the
|
|
string, and U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF)
|
|
character pairs.</li>
|
|
|
|
</ol></div><p>The <dfn id="attr-textarea-maxlength" title="attr-textarea-maxlength"><code>maxlength</code></dfn>
|
|
attribute is a <a href="#attr-fe-maxlength" title="attr-fe-maxlength">form control <code title="">maxlength</code> attribute</a> controlled by the
|
|
<code><a href="#the-textarea-element">textarea</a></code> element's <a href="#concept-textarea-dirty" title="concept-textarea-dirty">dirty value flag</a>.<p>If the <code><a href="#the-textarea-element">textarea</a></code> element has a <a href="#maximum-allowed-value-length">maximum allowed
|
|
value length</a>, then the element's children must be such that
|
|
the <a href="#code-point-length">code-point length</a> of the value of the element's
|
|
<code><a href="#textcontent">textContent</a></code> IDL attribute is equal to or less than the
|
|
element's <a href="#maximum-allowed-value-length">maximum allowed value length</a>.<p>The <dfn id="attr-textarea-required" title="attr-textarea-required"><code>required</code></dfn> attribute
|
|
is a <a href="#boolean-attribute">boolean attribute</a>. When specified, the user will
|
|
be required to enter a value before submitting the form.<div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: If the element has its
|
|
<code title="attr-textarea-required"><a href="#attr-textarea-required">required</a></code> attribute
|
|
specified, and the element is <a href="#concept-textarea-mutable" title="concept-textarea-mutable">mutable</a>, and the element's
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> is the empty string,
|
|
then the element is <a href="#suffering-from-being-missing">suffering from being missing</a>.</p>
|
|
|
|
</div><p>The <dfn id="attr-textarea-placeholder" title="attr-textarea-placeholder"><code>placeholder</code></dfn>
|
|
attribute represents a hint (a word or short phrase) intended to aid
|
|
the user with data entry. A hint could be a sample value or a brief
|
|
description of the expected format. The attribute, if specified,
|
|
must have a value that contains no U+000A LINE FEED (LF) or U+000D
|
|
CARRIAGE RETURN (CR) characters.<p class="note">For a longer hint or other advisory text, the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute is more appropriate.<p>The <code title="attr-textarea-placeholder"><a href="#attr-textarea-placeholder">placeholder</a></code>
|
|
attribute should not be used as an alternative to a
|
|
<code><a href="#the-label-element">label</a></code>.<div class="impl">
|
|
|
|
<p>User agents should present this hint to the user, after having
|
|
<a href="#strip-line-breaks" title="strip line breaks">stripped line breaks</a> from it,
|
|
when the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is
|
|
the empty string and the control is not focused (e.g. by displaying
|
|
it inside a blank unfocused control).</p>
|
|
|
|
</div><p>The <dfn id="attr-textarea-dirname" title="attr-textarea-dirname"><code>dirname</code></dfn>
|
|
attribute is a <a href="#form-control-dirname-attribute">form control <code title="">dirname</code>
|
|
attribute</a>.<p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-textarea-element">textarea</a></code> element with its
|
|
<a href="#form-owner">form owner</a>. The <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>
|
|
attribute represents the element's name. The <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> attribute is used to make
|
|
the control non-interactive and to prevent its value from being
|
|
submitted. The <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>
|
|
attribute controls focus.<dl class="domintro"><dt><var title="">textarea</var> . <code title="attr-textarea-type">type</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the string "<code title="">textarea</code>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">textarea</var> . <code title="attr-textarea-value">value</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current value of the element.</p>
|
|
|
|
<p>Can be set, to change the value.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-textarea-cols" title="dom-textarea-cols"><code>cols</code></dfn>, <dfn id="dom-textarea-placeholder" title="dom-textarea-placeholder"><code>placeholder</code></dfn>,
|
|
<dfn id="dom-textarea-required" title="dom-textarea-required"><code>required</code></dfn>, <dfn id="dom-textarea-rows" title="dom-textarea-rows"><code>rows</code></dfn>, and <dfn id="dom-textarea-wrap" title="dom-textarea-wrap"><code>wrap</code></dfn> attributes must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name. The <code title="dom-textarea-cols"><a href="#dom-textarea-cols">cols</a></code> and <code title="dom-textarea-rows"><a href="#dom-textarea-rows">rows</a></code> attributes are <a href="#limited-to-only-non-negative-numbers-greater-than-zero">limited
|
|
to only non-negative numbers greater than zero</a>. The <code title="dom-textarea-cols"><a href="#dom-textarea-cols">cols</a></code> attribute's default value is
|
|
20. The <code title="dom-textarea-rows"><a href="#dom-textarea-rows">rows</a></code> attribute's
|
|
default value is 2. The <dfn id="dom-textarea-dirname" title="dom-textarea-dirName"><code>dirName</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-textarea-dirname"><a href="#attr-textarea-dirname">dirname</a></code> content attribute. The
|
|
<dfn id="dom-textarea-maxlength" title="dom-textarea-maxLength"><code>maxLength</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength">maxlength</a></code> content attribute,
|
|
<a href="#limited-to-only-non-negative-numbers">limited to only non-negative numbers</a>. The <dfn id="dom-textarea-readonly" title="dom-textarea-readOnly"><code>readOnly</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">readonly</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-textarea-type" title="dom-textarea-type"><code>type</code></dfn> IDL
|
|
attribute must return the value "<code title="">textarea</code>".</p>
|
|
|
|
<p>The <dfn id="dom-textarea-defaultvalue" title="dom-textarea-defaultValue"><code>defaultValue</code></dfn>
|
|
IDL attribute must act like the element's <code><a href="#textcontent">textContent</a></code>
|
|
IDL attribute.</p>
|
|
|
|
<p>The <dfn id="dom-textarea-value" title="dom-textarea-value"><code>value</code></dfn>
|
|
attribute must, on getting, return the element's <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw value</a>; on setting, it
|
|
must set the element's <a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw
|
|
value</a> to the new value.</p>
|
|
|
|
<p>The <dfn id="dom-textarea-textlength" title="dom-textarea-textLength"><code>textLength</code></dfn> IDL
|
|
attribute must return the <a href="#code-point-length">code-point length</a> of the
|
|
element's <a href="#concept-fe-value" title="concept-fe-value">value</a>.</p>
|
|
|
|
<p>The <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code>
|
|
attributes, and the <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
methods, are part of the <a href="#the-constraint-validation-api">constraint validation API</a>. The
|
|
<code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code> attribute provides a list
|
|
of the element's <code><a href="#the-label-element">label</a></code>s. The <code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select()</a></code>, <code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>,
|
|
<code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>,
|
|
<code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>,
|
|
and <code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>
|
|
methods and attributes expose the element's text selection. The
|
|
<code title="dom-fe-autofocus"><a href="#dom-fe-autofocus">autofocus</a></code>, <code title="dom-fe-disabled"><a href="#dom-fe-disabled">disabled</a></code>, <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code>, and <code title="dom-fe-name"><a href="#dom-fe-name">name</a></code> IDL attributes are part of the
|
|
element's forms API.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is an example of a <code><a href="#the-textarea-element">textarea</a></code> being used for
|
|
unrestricted free-form text input in a form:</p>
|
|
|
|
<pre><p>If you have any comments, please let us know: <textarea cols=80 name=comments></textarea></p></pre>
|
|
|
|
<p>To specify a maximum length for the comments, one can use
|
|
the <code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength">maxlength</a></code>
|
|
attribute:</p>
|
|
|
|
<pre><p>If you have any short comments, please let us know: <textarea cols=80 name=comments maxlength=200></textarea></p></pre>
|
|
|
|
<p>To give a default value, text can be included inside the element:</p>
|
|
|
|
<pre><p>If you have any comments, please let us know: <textarea cols=80 name=comments>You rock!</textarea></p></pre>
|
|
|
|
<p>To have the browser submit <a href="#the-directionality">the directionality</a> of
|
|
the element along with the value, the <code title="attr-textarea-dirname"><a href="#attr-textarea-dirname">dirname</a></code> attribute can be
|
|
specified:</p>
|
|
|
|
<pre><p>If you have any comments, please let us know (you may use either English or Hebrew for your comments):
|
|
<textarea cols=80 name=comments dirname=comments.dir></textarea></p></pre>
|
|
|
|
</div><h4 id="the-keygen-element"><span class="secno">4.10.14 </span>The <dfn><code>keygen</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dd><a href="#category-listed" title="category-listed">Listed</a>, <a href="#category-label" title="category-label">labelable</a>, <a href="#category-submit" title="category-submit">submittable</a>, and <a href="#category-reset" title="category-reset">resettable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code></dd>
|
|
<dd><code title="attr-keygen-challenge"><a href="#attr-keygen-challenge">challenge</a></code></dd>
|
|
<dd><code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-keygen-keytype"><a href="#attr-keygen-keytype">keytype</a></code></dd>
|
|
<dd><code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlkeygenelement">HTMLKeygenElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-fe-autofocus" title="dom-fe-autofocus">autofocus</a>;
|
|
attribute DOMString <a href="#dom-keygen-challenge" title="dom-keygen-challenge">challenge</a>;
|
|
attribute boolean <a href="#dom-fe-disabled" title="dom-fe-disabled">disabled</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
attribute DOMString <a href="#dom-keygen-keytype" title="dom-keygen-keytype">keytype</a>;
|
|
attribute DOMString <a href="#dom-fe-name" title="dom-fe-name">name</a>;
|
|
|
|
readonly attribute DOMString <a href="#dom-keygen-type" title="dom-keygen-type">type</a>;
|
|
|
|
readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
|
|
readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
|
|
readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
|
|
boolean <a href="#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
|
|
void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
|
|
|
|
readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-keygen-element">keygen</a></code> element <a href="#represents">represents</a> a key
|
|
pair generator control. When the control's form is submitted, the
|
|
private key is stored in the local keystore, and the public key is
|
|
packaged and sent to the server.<p>The <dfn id="attr-keygen-challenge" title="attr-keygen-challenge"><code>challenge</code></dfn> attribute
|
|
may be specified. Its value will be packaged with the submitted
|
|
key.<p>The <dfn id="attr-keygen-keytype" title="attr-keygen-keytype"><code>keytype</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">enumerated attribute</a>. The following
|
|
table lists the keywords and states for the attribute — the
|
|
keywords in the left column map to the states listed in the cell in
|
|
the second column on the same row as the keyword. User agents are
|
|
not required to support these values, and must only recognize values
|
|
whose corresponding algorithms they support.<table><thead><tr><th> Keyword <th> State
|
|
<tbody><tr><td> <code title="">rsa</code>
|
|
<td> <i title="">RSA</i>
|
|
</table><p>The <i>invalid value default</i> state is the <i title="">unknown</i> state. The <i>missing value default</i> state
|
|
is the <i title="">RSA</i> state, if it is supported, or the <i title="">unknown</i> state otherwise.<p class="note">This specification does not specify what key types
|
|
user agents are to support — it is possible for a user agent
|
|
to not support any key types at all.<div class="impl">
|
|
|
|
<p>The user agent may expose a user interface for each
|
|
<code><a href="#the-keygen-element">keygen</a></code> element to allow the user to configure settings
|
|
of the element's key pair generator, e.g. the key length.</p>
|
|
|
|
<p>The <a href="#concept-form-reset-control" title="concept-form-reset-control">reset
|
|
algorithm</a> for <code><a href="#the-keygen-element">keygen</a></code> elements is to set these
|
|
various configuration settings back to their defaults.</p>
|
|
|
|
<p>The element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is the
|
|
string returned from the following algorithm:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Use the appropriate step from the following list:</p>
|
|
|
|
<dl class="switch"><dt>If the <code title="attr-keygen-keytype"><a href="#attr-keygen-keytype">keytype</a></code>
|
|
attribute is in the <i title="">RSA</i> state</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Generate an RSA key pair using the settings given by the
|
|
user, if appropriate, using the <code title="">md5WithRSAEncryption</code> RSA signature algorithm
|
|
(the signature algorithm with MD5 and the RSA encryption
|
|
algorithm) referenced in section 2.2.1 ("RSA Signature
|
|
Algorithm") of RFC 3279, and defined in RFC 2313. <a href="#refsRFC3279">[RFC3279]</a> <a href="#refsRFC2313">[RFC2313]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise, the <code title="attr-keygen-keytype"><a href="#attr-keygen-keytype">keytype</a></code> attribute is in the <i title="">unknown</i> state</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The given key type is not supported. Return the empty string
|
|
and abort this algorithm.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>Let <var title="">private key</var> be the generated private key.</p>
|
|
|
|
<p>Let <var title="">public key</var> be the generated public key.</p>
|
|
|
|
<p>Let <var title="">signature algorithm</var> be the selected
|
|
signature algorithm.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the element has a <code title="attr-keygen-challenge"><a href="#attr-keygen-challenge">challenge</a></code> attribute, then let
|
|
<var title="">challenge</var> be that attribute's value.
|
|
Otherwise, let <var title="">challenge</var> be the empty
|
|
string.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">algorithm</var> be an ASN.1 <code title="">AlgorithmIdentifier</code> structure as defined by
|
|
RFC 5280, with the <code title="">algorithm</code> field giving the
|
|
ASN.1 OID used to identify <var title="">signature
|
|
algorithm</var>, using the OIDs defined in section 2.2 ("Signature
|
|
Algorithms") of RFC 3279, and the <code title="">parameters</code>
|
|
field set up as required by RFC 3279 for <code title="">AlgorithmIdentifier</code> structures for that
|
|
algorithm. <a href="#refsX690">[X690]</a> <a href="#refsRFC5280">[RFC5280]</a> <a href="#refsRFC3279">[RFC3279]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">spki</var> be an ASN.1 <code title="">SubjectPublicKeyInfo</code> structure as defined by
|
|
RFC 5280, with the <code title="">algorithm</code> field set to the
|
|
<var title="">algorithm</var> structure from the previous step,
|
|
and the <code title="">subjectPublicKey</code> field set to the
|
|
BIT STRING value resulting from ASN.1 DER encoding the <var title="">public key</var>. <a href="#refsX690">[X690]</a> <a href="#refsRFC5280">[RFC5280]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">publicKeyAndChallenge</var> be an ASN.1
|
|
<code><a href="#publickeyandchallenge">PublicKeyAndChallenge</a></code> structure as defined below,
|
|
with the <code title="">spki</code> field set to the <var title="">spki</var> structure from the previous step, and the
|
|
<code title="">challenge</code> field set to the string <var title="">challenge</var> obtained earlier. <a href="#refsX690">[X690]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">signature</var> be the BIT STRING value
|
|
resulting from ASN.1 DER encoding the signature generated by
|
|
applying the <var title="">signature algorithm</var> to the byte
|
|
string obtained by ASN.1 DER encoding the <var title="">publicKeyAndChallenge</var> structure, using <var title="">private key</var> as the signing key. <a href="#refsX690">[X690]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">signedPublicKeyAndChallenge</var> be an ASN.1
|
|
<code><a href="#signedpublickeyandchallenge">SignedPublicKeyAndChallenge</a></code> structure as defined
|
|
below, with the <code title="">publicKeyAndChallenge</code> field
|
|
set to the <var title="">publicKeyAndChallenge</var> structure,
|
|
the <code title="">signatureAlgorithm</code> field set to the <var title="">algorithm</var> structure, and the <code title="">signature</code> field set to the BIT STRING <var title="">signature</var> from the previous step. <a href="#refsX690">[X690]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Return the result of base64 encoding the result of ASN.1 DER
|
|
encoding the <var title="">signedPublicKeyAndChallenge</var>
|
|
structure. <a href="#refsRFC4648">[RFC4648]</a> <a href="#refsX690">[X690]</a></p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The data objects used by the above algorithm are defined as
|
|
follows. These definitions use the same "ASN.1-like" syntax defined
|
|
by RFC 5280. <a href="#refsRFC5280">[RFC5280]</a></p>
|
|
|
|
<pre class="asn"><dfn id="publickeyandchallenge">PublicKeyAndChallenge</dfn> ::= SEQUENCE {
|
|
spki <span>SubjectPublicKeyInfo</span>,
|
|
challenge IA5STRING
|
|
}
|
|
|
|
<dfn id="signedpublickeyandchallenge">SignedPublicKeyAndChallenge</dfn> ::= SEQUENCE {
|
|
publicKeyAndChallenge <a href="#publickeyandchallenge">PublicKeyAndChallenge</a>,
|
|
signatureAlgorithm <span>AlgorithmIdentifier</span>,
|
|
signature BIT STRING
|
|
}</pre>
|
|
|
|
<hr><p><strong>Constraint validation</strong>: The <code><a href="#the-keygen-element">keygen</a></code>
|
|
element is <a href="#barred-from-constraint-validation">barred from constraint validation</a>.</p>
|
|
|
|
</div><p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-keygen-element">keygen</a></code> element with its
|
|
<a href="#form-owner">form owner</a>. The <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>
|
|
attribute represents the element's name. The <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> attribute is used to make
|
|
the control non-interactive and to prevent its value from being
|
|
submitted. The <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>
|
|
attribute controls focus.<dl class="domintro"><dt><var title="">keygen</var> . <code title="attr-keygen-type">type</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the string "<code title="">keygen</code>".</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-keygen-challenge" title="dom-keygen-challenge"><code>challenge</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
<p>The <dfn id="dom-keygen-keytype" title="dom-keygen-keytype"><code>keytype</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>.</p>
|
|
|
|
<p>The <dfn id="dom-keygen-type" title="dom-keygen-type"><code>type</code></dfn> IDL
|
|
attribute must return the value "<code title="">keygen</code>".</p>
|
|
|
|
<p>The <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code>
|
|
attributes, and the <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
methods, are part of the <a href="#the-constraint-validation-api">constraint validation API</a>. The
|
|
<code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code> attribute provides a list
|
|
of the element's <code><a href="#the-label-element">label</a></code>s. The <code title="dom-fe-autofocus"><a href="#dom-fe-autofocus">autofocus</a></code>, <code title="dom-fe-disabled"><a href="#dom-fe-disabled">disabled</a></code>, <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code>, and <code title="dom-fe-name"><a href="#dom-fe-name">name</a></code> IDL attributes are part of the
|
|
element's forms API.</p>
|
|
|
|
</div><p class="note">This specification does not specify how the private
|
|
key generated is to be used. It is expected that after receiving the
|
|
<code><a href="#signedpublickeyandchallenge">SignedPublicKeyAndChallenge</a></code> (SPKAC) structure, the
|
|
server will generate a client certificate and offer it back to the
|
|
user for download; this certificate, once downloaded and stored in
|
|
the key store along with the private key, can then be used to
|
|
authenticate to services that use TLS and certificate
|
|
authentication.</p><div class="example">
|
|
|
|
<p>To generate a key pair, add the private key to the user's key
|
|
store, and submit the public key to the server, markup such as the
|
|
following can be used:</p>
|
|
|
|
<pre><form action="processkey.cgi" method="post" enctype="multipart/form-data">
|
|
<p><keygen name="key"></p>
|
|
<p><input type=submit value="Submit key..."></p>
|
|
</form></pre>
|
|
|
|
<p>The server will then receive a form submission with a packaged
|
|
RSA public key as the value of "<code title="">key</code>". This
|
|
can then be used for various purposes, such as generating a client
|
|
certificate, as mentioned above.</p>
|
|
|
|
</div><h4 id="the-output-element"><span class="secno">4.10.15 </span>The <dfn><code>output</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#category-listed" title="category-listed">Listed</a>, <a href="#category-label" title="category-label">labelable</a>, and <a href="#category-reset" title="category-reset">resettable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-output-for"><a href="#attr-output-for">for</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dd><code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmloutputelement">HTMLOutputElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
[PutForwards=<a href="#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</a>] readonly attribute <a href="#domsettabletokenlist">DOMSettableTokenList</a> <a href="#dom-output-htmlfor" title="dom-output-htmlFor">htmlFor</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
attribute DOMString <a href="#dom-fe-name" title="dom-fe-name">name</a>;
|
|
|
|
readonly attribute DOMString <a href="#dom-output-type" title="dom-output-type">type</a>;
|
|
attribute DOMString <a href="#dom-output-defaultvalue" title="dom-output-defaultValue">defaultValue</a>;
|
|
attribute DOMString <a href="#dom-output-value" title="dom-output-value">value</a>;
|
|
|
|
readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
|
|
readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
|
|
readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
|
|
boolean <a href="#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
|
|
void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
|
|
|
|
readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-output-element">output</a></code> element <a href="#represents">represents</a> the result of a
|
|
calculation.<p>The <dfn id="attr-output-for" title="attr-output-for"><code>for</code></dfn> content
|
|
attribute allows an explicit relationship to be made between the
|
|
result of a calculation and the elements that represent the values
|
|
that went into the calculation or that otherwise influenced the
|
|
calculation. The <code title="attr-output-for"><a href="#attr-output-for">for</a></code> attribute,
|
|
if specified, must contain a string consisting of an <a href="#unordered-set-of-unique-space-separated-tokens">unordered
|
|
set of unique space-separated tokens</a> that are
|
|
<a href="#case-sensitive">case-sensitive</a>, each of which must have the value of an
|
|
<a href="#concept-id" title="concept-id">ID</a> of an element in the same
|
|
<code><a href="#document">Document</a></code>.<p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-output-element">output</a></code> element with its
|
|
<a href="#form-owner">form owner</a>. The <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>
|
|
attribute represents the element's name.<div class="impl">
|
|
|
|
<p>The element has a <dfn id="concept-output-mode" title="concept-output-mode">value mode
|
|
flag</dfn> which is either <i title="concept-output-mode-value">value</i> or <i title="concept-output-mode-default">default</i>. Initially, the
|
|
<a href="#concept-output-mode" title="concept-output-mode">value mode flag</a> must be set
|
|
to <i title="concept-output-mode-default">default</i>.</p>
|
|
|
|
<p>The element also has a <dfn id="concept-output-defaultvalue" title="concept-output-defaultValue">default value</dfn>. Initially,
|
|
the <a href="#concept-output-defaultvalue" title="concept-output-defaultValue">default value</a>
|
|
must be the empty string.</p>
|
|
|
|
<p>When the <a href="#concept-output-mode" title="concept-output-mode">value mode flag</a>
|
|
is in mode <i title="concept-output-mode-default">default</i>, the
|
|
contents of the element represent both the value of the element and
|
|
its <a href="#concept-output-defaultvalue" title="concept-output-defaultValue">default
|
|
value</a>. When the <a href="#concept-output-mode" title="concept-output-mode">value mode
|
|
flag</a> is in mode <i title="concept-output-mode-value">value</i>, the contents of the
|
|
element represent the value of the element only, and the <a href="#concept-output-defaultvalue" title="concept-output-defaultValue">default value</a> is only
|
|
accessible using the <code title="dom-output-defaultValue"><a href="#dom-output-defaultvalue">defaultValue</a></code> IDL
|
|
attribute.</p>
|
|
|
|
<p>Whenever the element's descendants are changed in any way, if the
|
|
<a href="#concept-output-mode" title="concept-output-mode">value mode flag</a> is in mode
|
|
<i title="concept-output-mode-default">default</i>, the element's
|
|
<a href="#concept-output-defaultvalue" title="concept-output-defaultValue">default value</a> must
|
|
be set to the value of the element's <code><a href="#textcontent">textContent</a></code> IDL
|
|
attribute.</p>
|
|
|
|
<p>The <a href="#concept-form-reset-control" title="concept-form-reset-control">reset
|
|
algorithm</a> for <code><a href="#the-output-element">output</a></code> elements is to set the
|
|
element's <a href="#concept-output-mode" title="concept-output-mode">value mode flag</a>
|
|
to <i title="concept-output-mode-default">default</i> and then to
|
|
set the element's <code><a href="#textcontent">textContent</a></code> IDL attribute to the
|
|
value of the element's <a href="#concept-output-defaultvalue" title="concept-output-defaultValue">default value</a> (thus
|
|
replacing the element's child nodes).</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">output</var> . <code title="dom-output-value"><a href="#dom-output-value">value</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the element's current value.</p>
|
|
|
|
<p>Can be set, to change the value.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">output</var> . <code title="dom-output-defaultValue"><a href="#dom-output-defaultvalue">defaultValue</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the element's current default value.</p>
|
|
|
|
<p>Can be set, to change the default value.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">output</var> . <code title="dom-output-type"><a href="#dom-output-type">type</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the string "<code title="">output</code>".</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-output-value" title="dom-output-value"><code>value</code></dfn> IDL
|
|
attribute must act like the element's <code><a href="#textcontent">textContent</a></code> IDL
|
|
attribute, except that on setting, in addition, before the child
|
|
nodes are changed, the element's <a href="#concept-output-mode" title="concept-output-mode">value mode flag</a> must be set to <i title="concept-output-mode-value">value</i>.</p>
|
|
|
|
<p>The <dfn id="dom-output-defaultvalue" title="dom-output-defaultValue"><code>defaultValue</code></dfn> IDL
|
|
attribute, on getting, must return the element's <a href="#concept-output-defaultvalue" title="concept-output-defaultValue">default value</a>. On
|
|
setting, the attribute must set the element's <a href="#concept-output-defaultvalue" title="concept-output-defaultValue">default value</a>, and, if
|
|
the element's <a href="#concept-output-mode" title="concept-output-mode">value mode
|
|
flag</a> is in the mode <i title="concept-output-mode-default">default</i>, set the element's
|
|
<code><a href="#textcontent">textContent</a></code> IDL attribute as well.</p>
|
|
|
|
<p>The <dfn id="dom-output-type" title="dom-output-type"><code>type</code></dfn>
|
|
attribute must return the string "<code title="">output</code>".</p>
|
|
|
|
<p>The <dfn id="dom-output-htmlfor" title="dom-output-htmlFor"><code>htmlFor</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the <code title="attr-output-for"><a href="#attr-output-for">for</a></code> content attribute.</p>
|
|
|
|
<p>The <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code>, <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code>, and <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code>
|
|
attributes, and the <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity()</a></code> and <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
methods, are part of the <a href="#the-constraint-validation-api">constraint validation API</a>. The
|
|
<code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code> attribute provides a list
|
|
of the element's <code><a href="#the-label-element">label</a></code>s. The <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> and <code title="dom-fe-name"><a href="#dom-fe-name">name</a></code> IDL attributes are part of the
|
|
element's forms API.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: <code><a href="#the-output-element">output</a></code>
|
|
elements are always <a href="#barred-from-constraint-validation">barred from constraint
|
|
validation</a>.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>A simple calculator could use <code><a href="#the-output-element">output</a></code> for its
|
|
display of calculated results:</p>
|
|
|
|
<pre><form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber">
|
|
<input name=a type=number step=any> +
|
|
<input name=b type=number step=any> =
|
|
<output name=o></output>
|
|
</form></pre>
|
|
|
|
</div><h4 id="the-progress-element"><span class="secno">4.10.16 </span>The <dfn><code>progress</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#category-label" title="category-label">Labelable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>, but there must be no <code><a href="#the-progress-element">progress</a></code> element descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-progress-value"><a href="#attr-progress-value">value</a></code></dd>
|
|
<dd><code title="attr-progress-max"><a href="#attr-progress-max">max</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlprogresselement">HTMLProgressElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute double <a href="#dom-progress-value" title="dom-progress-value">value</a>;
|
|
attribute double <a href="#dom-progress-max" title="dom-progress-max">max</a>;
|
|
readonly attribute double <a href="#dom-progress-position" title="dom-progress-position">position</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-progress-element">progress</a></code> element <a href="#represents">represents</a> 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>There are two attributes that determine the current task
|
|
completion represented by the element. The <dfn id="attr-progress-value" title="attr-progress-value"><code>value</code></dfn> attribute
|
|
specifies how much of the task has been completed, and the <dfn id="attr-progress-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 class="note">To make an determinate progress bar, add a <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute with the current
|
|
progress (either a number from 0.0 to 1.0, or, if the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute is specified, a
|
|
number from 0 to the value of the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute. To make an
|
|
indeterminate progress bar, remove the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute.<p>Authors are encouraged to also include the current value and the
|
|
maximum value inline as text inside the element, so that the
|
|
progress is made available to users of legacy user agents.<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>
|
|
<p>Progress: <progress id="p" max=100><span>0</span>%</progress></p>
|
|
<script>
|
|
var progressBar = document.getElementById('p');
|
|
function updateProgress(newValue) {
|
|
progressBar.value = newValue;
|
|
progressBar.getElementsByTagName('span')[0].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>The <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> and <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attributes, when present, must
|
|
have values that are <a href="#valid-floating-point-number" title="valid floating point number">valid
|
|
floating point numbers</a>. The <code title="attr-progress-value"><a href="#attr-progress-value">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="#attr-progress-max">max</a></code>
|
|
attribute, if present, or 1.0, otherwise. The <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute, if present, must
|
|
have a value greater than zero.<p class="note">The <code><a href="#the-progress-element">progress</a></code> 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
|
|
<code><a href="#the-progress-element">progress</a></code> would be inappropriate. Instead, the
|
|
<code><a href="#the-meter-element">meter</a></code> element is available for such use cases.<div class="impl">
|
|
|
|
<p><strong>User agent requirements</strong>: If the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute is omitted, then
|
|
the progress bar is an indeterminate progress bar. Otherwise, it is
|
|
a determinate progress bar.</p>
|
|
|
|
<p>If the progress bar is a determinate progress bar and the element
|
|
has a <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute, the user
|
|
agent must parse the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code>
|
|
attribute's value according to the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating
|
|
point number values</a>. If this does not result in an error, and
|
|
if the parsed value is greater than zero, then the <dfn id="concept-progress-maximum" title="concept-progress-maximum">maximum value</dfn> of the progress
|
|
bar is that value. Otherwise, if the element has no <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute, or if it has one but
|
|
parsing it resulted in an error, or if the parsed value was less
|
|
than or equal to zero, then the <a href="#concept-progress-maximum" title="concept-progress-maximum">maximum value</a> of the
|
|
progress bar is 1.0.</p>
|
|
|
|
<p>If the progress bar is a determinate progress bar, user agents
|
|
must parse the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code>
|
|
attribute's value according to the <a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating
|
|
point number values</a>. If this does not result in an error, and
|
|
if the parsed value is less than the <a href="#concept-progress-maximum" title="concept-progress-maximum">maximum value</a> and greater
|
|
than zero, then the <dfn id="concept-progress-value" title="concept-progress-value">current
|
|
value</dfn> of the progress bar is that parsed value. Otherwise, if
|
|
the parsed value was greater than or equal to the <a href="#concept-progress-maximum" title="concept-progress-maximum">maximum value</a>, then the
|
|
<a href="#concept-progress-value" title="concept-progress-value">current value</a> of the
|
|
progress bar is the <a href="#concept-progress-maximum" title="concept-progress-maximum">maximum
|
|
value</a> of the progress bar. Otherwise, if parsing the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute's value resulted
|
|
in an error, or a number less than or equal to zero, then the <a href="#concept-progress-value" title="concept-progress-value">current value</a> of the
|
|
progress bar is zero.</p>
|
|
|
|
<p><strong>UA requirements for showing the progress bar</strong>:
|
|
When representing a <code><a href="#the-progress-element">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 <a href="#concept-progress-value" title="concept-progress-value">current
|
|
value</a> relative to the <a href="#concept-progress-maximum" title="concept-progress-maximum">maximum value</a>.</p>
|
|
|
|
<p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-progress-element">progress</a></code> element with its
|
|
<a href="#form-owner">form owner</a>.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">progress</var> . <code title="dom-progress-position"><a href="#dom-progress-position">position</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>For a determinate progress bar (one with known current and
|
|
maximum values), returns the result of dividing the current value
|
|
by the maximum value.</p>
|
|
|
|
<p>For an indeterminate progress bar, returns −1.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>If the progress bar is an indeterminate progress bar, then the
|
|
<dfn id="dom-progress-position" title="dom-progress-position"><code>position</code></dfn> IDL
|
|
attribute must return −1. Otherwise, it must return the
|
|
result of dividing the <a href="#concept-progress-value" title="concept-progress-value">current value</a> by the <a href="#concept-progress-maximum" title="concept-progress-maximum">maximum value</a>.</p>
|
|
|
|
<p>If the progress bar is an indeterminate progress bar, then the
|
|
<dfn id="dom-progress-value" title="dom-progress-value"><code>value</code></dfn> IDL
|
|
attribute, on getting, must return 0. Otherwise, it must return the
|
|
<a href="#concept-progress-value" title="concept-progress-value">current value</a>. On
|
|
setting, the given value must be converted to the <a href="#best-representation-of-the-number-as-a-floating-point-number">best
|
|
representation of the number as a floating point number</a> and
|
|
then the <code title="dom-progress-value"><a href="#dom-progress-value">value</a></code> content
|
|
attribute must be set to that string.</p>
|
|
|
|
<p class="note">Setting the <code title="dom-progress-value"><a href="#dom-progress-value">value</a></code> IDL attribute to itself when
|
|
the corresponding content attribute is absent would change the
|
|
progress bar from an indeterminate progress bar to a determinate
|
|
progress bar with no progress.</p>
|
|
|
|
<p>The <dfn id="dom-progress-max" title="dom-progress-max"><code>max</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name. The default value for <code title="dom-progress-max"><a href="#dom-progress-max">max</a></code> is 1.0.</p>
|
|
|
|
<p>The <code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code> attribute provides
|
|
a list of the element's <code><a href="#the-label-element">label</a></code>s. The <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> IDL attribute is part of the
|
|
element's forms API.</p>
|
|
|
|
</div><h4 id="the-meter-element"><span class="secno">4.10.17 </span>The <dfn><code>meter</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dd><a href="#category-label" title="category-label">Labelable</a> <a href="#form-associated-element">form-associated element</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>, but there must be no <code><a href="#the-meter-element">meter</a></code> element descendants.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-meter-value"><a href="#attr-meter-value">value</a></code></dd>
|
|
<dd><code title="attr-meter-min"><a href="#attr-meter-min">min</a></code></dd>
|
|
<dd><code title="attr-meter-max"><a href="#attr-meter-max">max</a></code></dd>
|
|
<dd><code title="attr-meter-low"><a href="#attr-meter-low">low</a></code></dd>
|
|
<dd><code title="attr-meter-high"><a href="#attr-meter-high">high</a></code></dd>
|
|
<dd><code title="attr-meter-optimum"><a href="#attr-meter-optimum">optimum</a></code></dd>
|
|
<dd><code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlmeterelement">HTMLMeterElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute double <a href="#dom-meter-value" title="dom-meter-value">value</a>;
|
|
attribute double <a href="#dom-meter-min" title="dom-meter-min">min</a>;
|
|
attribute double <a href="#dom-meter-max" title="dom-meter-max">max</a>;
|
|
attribute double <a href="#dom-meter-low" title="dom-meter-low">low</a>;
|
|
attribute double <a href="#dom-meter-high" title="dom-meter-high">high</a>;
|
|
attribute double <a href="#dom-meter-optimum" title="dom-meter-optimum">optimum</a>;
|
|
readonly attribute <a href="#htmlformelement">HTMLFormElement</a> <a href="#dom-fae-form" title="dom-fae-form">form</a>;
|
|
readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-meter-element">meter</a></code> element <a href="#represents">represents</a> 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>This is also known as a gauge.<p class="note">The <code><a href="#the-meter-element">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="#the-progress-element">progress</a></code> element.<p class="note">The <code><a href="#the-meter-element">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>There are six attributes that determine the semantics of the
|
|
gauge represented by the element.<p>The <dfn id="attr-meter-min" title="attr-meter-min"><code>min</code></dfn> attribute
|
|
specifies the lower bound of the range, and the <dfn id="attr-meter-max" title="attr-meter-max"><code>max</code></dfn> attribute specifies
|
|
the upper bound. The <dfn id="attr-meter-value" title="attr-meter-value"><code>value</code></dfn> attribute
|
|
specifies the value to have the gauge indicate as the "measured"
|
|
value.<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="attr-meter-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="attr-meter-high" title="attr-meter-high"><code>high</code></dfn> attribute specifies
|
|
the range that is considered to be the "high" part. The <dfn id="attr-meter-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><span class="impl"><strong>Authoring
|
|
requirements</strong>:</span> The <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code> attribute must be
|
|
specified. The <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code>, <code title="attr-meter-min"><a href="#attr-meter-min">min</a></code>, <code title="attr-meter-low"><a href="#attr-meter-low">low</a></code>, <code title="attr-meter-high"><a href="#attr-meter-high">high</a></code>, <code title="attr-meter-max"><a href="#attr-meter-max">max</a></code>, and <code title="attr-meter-optimum"><a href="#attr-meter-optimum">optimum</a></code> attributes, when present,
|
|
must have values that are <a href="#valid-floating-point-number" title="valid floating point
|
|
number">valid floating point numbers</a>.<p>In addition, the attributes' values are further constrained:<p>Let <var title="">value</var> be the <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code> attribute's number.<p>If the <code title="attr-meter-min"><a href="#attr-meter-min">min</a></code> attribute
|
|
attribute is specified, then let <var title="">minimum</var> be that
|
|
attribute's value; otherwise, let it be zero.<p>If the <code title="attr-meter-max"><a href="#attr-meter-max">max</a></code> attribute
|
|
attribute is specified, then let <var title="">maximum</var> be that
|
|
attribute's value; otherwise, let it be 1.0.<p>The following inequalities must hold, as applicable:<ul class="brief"><li><var title="">minimum</var> ≤ <var title="">value</var> ≤ <var title="">maximum</var></li>
|
|
<li><var title="">minimum</var> ≤ <code title="attr-meter-low"><a href="#attr-meter-low">low</a></code> ≤ <var title="">maximum</var> (if <code title="attr-meter-low"><a href="#attr-meter-low">low</a></code> is specified)</li>
|
|
<li><var title="">minimum</var> ≤ <code title="attr-meter-high"><a href="#attr-meter-high">high</a></code> ≤ <var title="">maximum</var> (if <code title="attr-meter-high"><a href="#attr-meter-high">high</a></code> is specified)</li>
|
|
<li><var title="">minimum</var> ≤ <code title="attr-meter-optimum"><a href="#attr-meter-optimum">optimum</a></code> ≤ <var title="">maximum</var> (if <code title="attr-meter-optimum"><a href="#attr-meter-optimum">optimum</a></code> is specified)</li>
|
|
<li><code title="attr-meter-low"><a href="#attr-meter-low">low</a></code> ≤ <code title="attr-meter-high"><a href="#attr-meter-high">high</a></code> (if both <code title="attr-meter-low"><a href="#attr-meter-low">low</a></code> and <code title="attr-meter-high"><a href="#attr-meter-high">high</a></code> are specified)</li>
|
|
</ul><p class="note">If no minimum or maximum is specified, then the
|
|
range is assumed to be 0..1, and the value thus has to be within
|
|
that range.<p>Authors are encouraged to include a textual representation of the
|
|
gauge's state in the element's contents, for users of user agents
|
|
that do not support the <code><a href="#the-meter-element">meter</a></code> element.<div class="example">
|
|
|
|
<p>The following examples show three gauges that would all be
|
|
three-quarters full:</p>
|
|
|
|
<pre>Storage space usage: <meter value=6 max=8>6 blocks used (out of 8 total)</meter>
|
|
Voter turnout: <meter value=0.75><img alt="75%" src="graph75.png"></meter>
|
|
Tickets sold: <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>
|
|
|
|
<pre class="bad"><p>The grapefruit pie had a radius of <meter value=12>12cm</meter>
|
|
and a height of <meter value=2>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="#the-meter-element">meter</a></code> element, but the units may be specified in the
|
|
<code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute in free-form text.<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><div class="impl">
|
|
|
|
<p><strong>User agent requirements</strong>: User agents must parse
|
|
the <code title="attr-meter-min"><a href="#attr-meter-min">min</a></code>, <code title="attr-meter-max"><a href="#attr-meter-max">max</a></code>, <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code>, <code title="attr-meter-low"><a href="#attr-meter-low">low</a></code>, <code title="attr-meter-high"><a href="#attr-meter-high">high</a></code>, and <code title="attr-meter-optimum"><a href="#attr-meter-optimum">optimum</a></code> attributes using the
|
|
<a href="#rules-for-parsing-floating-point-number-values">rules for parsing floating point number values</a>.</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 <dfn id="concept-meter-minimum" title="concept-meter-minimum">minimum value</dfn></dt>
|
|
|
|
<dd>
|
|
<p>If the <code title="attr-meter-min"><a href="#attr-meter-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 <dfn id="concept-meter-maximum" title="concept-meter-maximum">maximum value</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <code title="attr-meter-max"><a href="#attr-meter-max">max</a></code> attribute is
|
|
specified and a value could be parsed out of it, the maximum value
|
|
is that value. Otherwise, the maximum value is 1.0.</p>
|
|
|
|
<p>If the maximum value would be less than the minimum value, then
|
|
the maximum value is actually the same as the minimum value.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="concept-meter-actual" title="concept-meter-actual">actual value</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code> attribute is
|
|
specified and a value could be parsed out of it, then that value
|
|
is the actual value. Otherwise, the actual value is zero.</p>
|
|
|
|
<p>If the actual value would be 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 actual value would be greater than
|
|
the maximum value, then the actual value is the maximum value.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="concept-meter-low" title="concept-meter-low">low boundary</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <code title="attr-meter-low"><a href="#attr-meter-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 low boundary is then less than the minimum value, then
|
|
the low boundary is actually the same as the minimum
|
|
value. Similarly, if the low boundary is greater than the maximum
|
|
value, then it is actually the maximum value instead.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="concept-meter-high" title="concept-meter-high">high boundary</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <code title="attr-meter-high"><a href="#attr-meter-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 high boundary is then less than the low boundary, then
|
|
the high boundary is actually the same as the low
|
|
boundary. Similarly, if the high boundary is greater than the
|
|
maximum value, then it is actually the maximum value instead.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="concept-meter-optimum" title="concept-meter-optimum">optimum point</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the <code title="attr-meter-optimum"><a href="#attr-meter-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 will 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="#the-meter-element">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><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." height="178" src="sample-meter.png" width="332"></p>
|
|
</div><p>User agents <span class="impl">may</span> combine the value of
|
|
the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute and the other
|
|
attributes to provide context-sensitive help or inline text
|
|
detailing the actual values.<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 <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
|
|
explicitly associate the <code><a href="#the-meter-element">meter</a></code> element with its
|
|
<a href="#form-owner">form owner</a>.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-meter-value" title="dom-meter-value"><code>value</code></dfn> IDL
|
|
attribute, on getting, must return the <a href="#concept-meter-actual" title="concept-meter-actual">actual value</a>. On setting, the
|
|
given value must be converted to the <a href="#best-representation-of-the-number-as-a-floating-point-number">best representation of
|
|
the number as a floating point number</a> and then the <code title="dom-meter-value"><a href="#dom-meter-value">value</a></code> content attribute must be set
|
|
to that string.</p>
|
|
|
|
<p>The <dfn id="dom-meter-min" title="dom-meter-min"><code>min</code></dfn>, <dfn id="dom-meter-max" title="dom-meter-max"><code>max</code></dfn>, <dfn id="dom-meter-low" title="dom-meter-low"><code>low</code></dfn>, <dfn id="dom-meter-high" title="dom-meter-high"><code>high</code></dfn>, and <dfn id="dom-meter-optimum" title="dom-meter-optimum"><code>optimum</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name.</p>
|
|
|
|
<p>The <code title="dom-lfe-labels"><a href="#dom-lfe-labels">labels</a></code> attribute provides
|
|
a list of the element's <code><a href="#the-label-element">label</a></code>s. The <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code> IDL attribute is part of the
|
|
element's forms API.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows how a gauge could fall back to
|
|
localized or pretty-printed text.</p>
|
|
|
|
<pre><p>Disk usage: <meter min=0 value=170261928 max=233257824>170 261 928 bytes used
|
|
out of 233 257 824 bytes available</meter></p></pre>
|
|
|
|
</div><h4 id="association-of-controls-and-forms"><span class="secno">4.10.18 </span>Association of controls and forms</h4><p>A <a href="#form-associated-element">form-associated element</a> can have a relationship
|
|
with a <code><a href="#the-form-element">form</a></code> element, which is called the element's
|
|
<dfn id="form-owner">form owner</dfn>. If a <a href="#form-associated-element">form-associated element</a> is
|
|
not associated with a <code><a href="#the-form-element">form</a></code> element, its <a href="#form-owner">form
|
|
owner</a> is said to be null.<p>A <a href="#form-associated-element">form-associated element</a> is, by default, associated
|
|
with its <span class="impl">nearest</span> ancestor
|
|
<code><a href="#the-form-element">form</a></code> element<span class="impl"> (as described
|
|
below)</span>, but may have a <dfn id="attr-fae-form" title="attr-fae-form"><code>form</code></dfn> attribute specified to
|
|
override this.<p class="note">This feature allows authors to work around the lack
|
|
of support for nested <code><a href="#the-form-element">form</a></code> elements.<p>If a <a href="#form-associated-element">form-associated element</a> has a <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute specified, then that
|
|
attribute's value must be the <a href="#concept-id" title="concept-id">ID</a> of a <code><a href="#the-form-element">form</a></code> element in
|
|
the element's owner <code><a href="#document">Document</a></code>.<div class="impl">
|
|
|
|
<p class="note">The rules in this section are complicated by the
|
|
fact that although conforming documents will never contain nested
|
|
<code><a href="#the-form-element">form</a></code> elements, it is quite possible (e.g. using a
|
|
script that performs DOM manipulation) to generate documents that
|
|
have such nested elements. They are also complicated by rules in the
|
|
HTML parser that, for historical reasons, can result in a
|
|
<a href="#form-associated-element">form-associated element</a> being associated with a
|
|
<code><a href="#the-form-element">form</a></code> element that is not its ancestor.</p>
|
|
|
|
<p>When a <a href="#form-associated-element">form-associated element</a> is created, its
|
|
<a href="#form-owner">form owner</a> must be initialized to null (no owner).</p>
|
|
|
|
<p>When a <a href="#form-associated-element">form-associated element</a> is to be <dfn id="concept-form-association" title="concept-form-association">associated</dfn> with a form, its
|
|
<a href="#form-owner">form owner</a> must be set to that form.</p>
|
|
|
|
<p>When a <a href="#form-associated-element">form-associated element</a>'s ancestor chain
|
|
changes, e.g. because it or one of its ancestors was <a href="#insert-an-element-into-a-document" title="insert an element into a document">inserted</a> or <a href="#remove-an-element-from-a-document" title="remove an element from a document">removed</a> from a
|
|
<code><a href="#document">Document</a></code>, then the user agent must <a href="#reset-the-form-owner">reset the form
|
|
owner</a> of that element. <span class="note">The <a href="#html-parser">HTML
|
|
parser</a> overrides this requirement when inserting form
|
|
controls.</span></p>
|
|
|
|
<p>When a <a href="#form-associated-element">form-associated element</a>'s <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is set, changed, or
|
|
removed, then the user agent must <a href="#reset-the-form-owner">reset the form owner</a>
|
|
of that element.</p>
|
|
|
|
<p>When a <a href="#form-associated-element">form-associated element</a> has a <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute and the <a href="#concept-id" title="concept-id">ID</a> of any of the
|
|
elements in the <code><a href="#document">Document</a></code> changes, then the user agent
|
|
must <a href="#reset-the-form-owner">reset the form owner</a> of that <a href="#form-associated-element">form-associated
|
|
element</a>.</p>
|
|
|
|
<p>When a <a href="#form-associated-element">form-associated element</a> has a <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute and an element with an
|
|
<a href="#concept-id" title="concept-id">ID</a> is <a href="#insert-an-element-into-a-document" title="insert an element into a document">inserted
|
|
into</a> or <a href="#remove-an-element-from-a-document" title="remove an element from a
|
|
document">removed from</a> the <code><a href="#document">Document</a></code>, then the
|
|
user agent must <a href="#reset-the-form-owner">reset the form owner</a> of that
|
|
<a href="#form-associated-element">form-associated element</a>.</p>
|
|
|
|
<p>When the user agent is to <dfn id="reset-the-form-owner">reset the form owner</dfn> of a
|
|
<a href="#form-associated-element">form-associated element</a>, it must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>If the element's <a href="#form-owner">form owner</a> is not null, and
|
|
the element's <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> content
|
|
attribute is not present, and the element's <a href="#form-owner">form owner</a>
|
|
is its nearest <code><a href="#the-form-element">form</a></code> element ancestor after the change
|
|
to the ancestor chain, then do nothing, and abort these
|
|
steps.</li>
|
|
|
|
<li><p>Let the element's <a href="#form-owner">form owner</a> be null.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the element has a <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>
|
|
content attribute, then run these substeps:</p>
|
|
|
|
<ol><li><p>If the first element <a href="#in-a-document" title="in a Document">in the
|
|
<code>Document</code></a> to have an <a href="#concept-id" title="concept-id">ID</a> that is <a href="#case-sensitive" title="case-sensitive">case-sensitively</a> equal to the
|
|
element's <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> content
|
|
attribute's value is a <code><a href="#the-form-element">form</a></code> element, then <a href="#concept-form-association" title="concept-form-association">associate</a> the
|
|
<a href="#form-associated-element">form-associated element</a> with that <code><a href="#the-form-element">form</a></code>
|
|
element.</li>
|
|
|
|
<li><p>Abort the "reset the form owner" steps.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Otherwise, if the <a href="#form-associated-element">form-associated element</a> in
|
|
question has an ancestor <code><a href="#the-form-element">form</a></code> element, then <a href="#concept-form-association" title="concept-form-association">associate</a> the
|
|
<a href="#form-associated-element">form-associated element</a> with the nearest such ancestor
|
|
<code><a href="#the-form-element">form</a></code> element.</li>
|
|
|
|
<li><p>Otherwise, the element is left unassociated.</li>
|
|
|
|
</ol><div class="example">
|
|
|
|
<p>In the following non-conforming snippet:</p>
|
|
|
|
<pre class="bad">...
|
|
<form id="a">
|
|
<div id="b"></div>
|
|
</form>
|
|
<script>
|
|
document.getElementById('b').innerHTML =
|
|
'<table><tr><td><form id="c"><input id="d"></table>' +
|
|
'<input id="e">';
|
|
</script>
|
|
...</pre>
|
|
|
|
<p>The <a href="#form-owner">form owner</a> of "d" would be the inner nested
|
|
form "c", while the <a href="#form-owner">form owner</a> of "e" would be the
|
|
outer form "a".</p>
|
|
|
|
<p>This happens as follows: First, the "e" node gets associated
|
|
with "c" in the <a href="#html-parser">HTML parser</a>. Then, the <code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code> algorithm moves the nodes
|
|
from the temporary document to the "b" element. At this point, the
|
|
nodes see their ancestor chain change, and thus all the "magic"
|
|
associations done by the parser are reset to normal ancestor
|
|
associations.</p>
|
|
|
|
<p>This example is a non-conforming document, though, as it is a
|
|
violation of the content models to nest <code><a href="#the-form-element">form</a></code>
|
|
elements.</p>
|
|
|
|
</div>
|
|
|
|
</div><dl class="domintro"><dt><var title="">element</var> . <code title="dom-fae-form"><a href="#dom-fae-form">form</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the element's <a href="#form-owner">form owner</a>.</p>
|
|
|
|
<p>Returns null if there isn't one.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p><a href="#form-associated-element" title="form-associated element">Form-associated
|
|
elements</a> have a <dfn id="dom-fae-form" title="dom-fae-form"><code>form</code></dfn> IDL attribute, which,
|
|
on getting, must return the element's <a href="#form-owner">form owner</a>, or
|
|
null if there isn't one.</p>
|
|
|
|
</div><h4 id="attributes-common-to-form-controls"><span class="secno">4.10.19 </span><dfn>Attributes common to form controls</dfn></h4><h5 id="naming-form-controls"><span class="secno">4.10.19.1 </span>Naming form controls</h5><p>The <dfn id="attr-fe-name" title="attr-fe-name"><code>name</code></dfn> content
|
|
attribute gives the name of the form control, as used in <a href="#form-submission">form
|
|
submission</a> and in the <code><a href="#the-form-element">form</a></code> element's <code title="dom-form-elements"><a href="#dom-form-elements">elements</a></code> object. If the attribute
|
|
is specified, its value must not be the empty string.<p>Any non-empty value for <code title="attr-form-name"><a href="#attr-form-name">name</a></code>
|
|
is allowed, but the names "<code title="attr-fe-name-charset"><a href="#attr-fe-name-charset">_charset_</a></code>" and "<code title="attr-fe-name-isindex"><a href="#attr-fe-name-isindex">isindex</a></code>" are special:<dl><dt><dfn id="attr-fe-name-isindex" title="attr-fe-name-isindex"><code>isindex</code></dfn></dt>
|
|
<dd>
|
|
<p>This value, if used as the name of a <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> control that is the first
|
|
control in a form that is submitted using the <code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</a></code>
|
|
mechanism, causes the submission to only include the value of this
|
|
control, with no name.</p>
|
|
</dd>
|
|
|
|
<dt><dfn id="attr-fe-name-charset" title="attr-fe-name-charset"><code>_charset_</code></dfn></dt>
|
|
<dd>
|
|
<p>This value, if used as the name of a <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> control with no <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, is automatically
|
|
given a value during submission consisting of the submission
|
|
character encoding.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-fe-name" title="dom-fe-name"><code>name</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> content attribute.</p>
|
|
|
|
</div><h5 id="enabling-and-disabling-form-controls"><span class="secno">4.10.19.2 </span>Enabling and disabling form controls</h5><p>The <dfn id="attr-fe-disabled" title="attr-fe-disabled"><code>disabled</code></dfn>
|
|
content attribute is a <a href="#boolean-attribute">boolean attribute</a>.<p>A form control is <dfn id="concept-fe-disabled" title="concept-fe-disabled">disabled</dfn>
|
|
if its <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> attribute is
|
|
set, or if it is a descendant of a <code><a href="#the-fieldset-element">fieldset</a></code> element
|
|
whose <code title="attr-fieldset-disabled"><a href="#attr-fieldset-disabled">disabled</a></code> attribute
|
|
is set and is <em>not</em> a descendant of that
|
|
<code><a href="#the-fieldset-element">fieldset</a></code> element's first <code><a href="#the-legend-element">legend</a></code> element
|
|
child, if any.<div class="impl">
|
|
|
|
<p>A form control that is <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a> must prevent any <code title="event-click"><a href="#event-click">click</a></code> events that are <a href="#queue-a-task" title="queue
|
|
a task">queued</a> on the <a href="#user-interaction-task-source">user interaction task
|
|
source</a> from being dispatched on the element.</p>
|
|
|
|
<p><strong>Constraint validation</strong>: If an element is <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>, it is <a href="#barred-from-constraint-validation">barred from
|
|
constraint validation</a>.</p>
|
|
|
|
<p>The <dfn id="dom-fe-disabled" title="dom-fe-disabled"><code>disabled</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code> content attribute.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="a-form-control-s-value"><span class="secno">4.10.19.3 </span>A form control's value</h5>
|
|
|
|
<p>Form controls have a <dfn id="concept-fe-value" title="concept-fe-value">value</dfn>
|
|
and a <dfn id="concept-fe-checked" title="concept-fe-checked">checkedness</dfn>. (The latter
|
|
is only used by <code><a href="#the-input-element">input</a></code> elements.) These are used to
|
|
describe how the user interacts with the control.</p>
|
|
|
|
<p>To define the behaviour of constraint validation in the face of
|
|
the <code><a href="#the-input-element">input</a></code> element's <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute,
|
|
<code><a href="#the-input-element">input</a></code> elements can also have separately defined <dfn id="concept-fe-values" title="concept-fe-values">value<em>s</em></dfn>.</p>
|
|
|
|
</div><h5 id="autofocusing-a-form-control"><span class="secno">4.10.19.4 </span>Autofocusing a form control</h5><p>The <dfn id="attr-fe-autofocus" title="attr-fe-autofocus"><code>autofocus</code></dfn>
|
|
content attribute allows the author to indicate that a control is to
|
|
be focused as soon as the page is loaded, allowing the user to just
|
|
start typing without having to manually focus the main control.<p>The <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code> attribute is
|
|
a <a href="#boolean-attribute">boolean attribute</a>.<p>There must not be more than one element in the document with the
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code> attribute
|
|
specified.<div class="impl">
|
|
|
|
<p>When an element with the <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code> attribute specified is
|
|
<a href="#insert-an-element-into-a-document" title="insert an element into a document">inserted into a
|
|
document</a>, user agents should run the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">target</var> be the element's
|
|
<code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li><p>If <var title="">target</var> has no <a href="#browsing-context">browsing
|
|
context</a>, abort these steps.</li>
|
|
|
|
<li><p>If <var title="">target</var>'s <a href="#browsing-context">browsing
|
|
context</a> has no <a href="#top-level-browsing-context">top-level browsing context</a> (e.g.
|
|
it is a <a href="#nested-browsing-context">nested browsing context</a> with no <a href="#parent-browsing-context">parent
|
|
browsing context</a>), abort these steps.</li>
|
|
|
|
<li><p>If <var title="">target</var>'s <a href="#browsing-context">browsing
|
|
context</a> had the <a href="#sandboxed-automatic-features-browsing-context-flag">sandboxed automatic features browsing
|
|
context flag</a> set when <var title="">target</var> was
|
|
created, abort these steps.</li>
|
|
|
|
<li><p>If <var title="">target</var>'s <a href="#origin">origin</a> is not
|
|
the <a href="#same-origin" title="same origin">same</a> as the
|
|
<a href="#origin">origin</a> of the <code><a href="#document">Document</a></code> of the currently
|
|
focused element in <var title="">target</var>'s <a href="#top-level-browsing-context">top-level
|
|
browsing context</a>, abort these steps.</li>
|
|
|
|
<li><p>If <var title="">target</var>'s <a href="#origin">origin</a> is not
|
|
the <a href="#same-origin" title="same origin">same</a> as the
|
|
<a href="#origin">origin</a> of the <a href="#active-document">active document</a> of <var title="">target</var>'s <a href="#top-level-browsing-context">top-level browsing context</a>,
|
|
abort these steps.</li>
|
|
|
|
<li><p>If the user agent has already reached the last step of this
|
|
list of steps in response to an element being <a href="#insert-an-element-into-a-document" title="insert
|
|
an element into a document">inserted</a> into a
|
|
<code><a href="#document">Document</a></code> whose <a href="#top-level-browsing-context">top-level browsing
|
|
context</a>'s <a href="#active-document">active document</a> is the same as <var title="">target</var>'s <a href="#top-level-browsing-context">top-level browsing context</a>'s
|
|
<a href="#active-document">active document</a>, abort these steps.</li>
|
|
|
|
<li><p>If the user has indicated (for example, by starting to type
|
|
in a form control) that he does not wish focus to be changed, then
|
|
optionally abort these steps.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> that checks to see if the element
|
|
is <a href="#focusable">focusable</a>, and if so, runs the <a href="#focusing-steps">focusing
|
|
steps</a> for that element. User agents may also change the
|
|
scrolling position of the document, or perform some other action
|
|
that brings the element to the user's attention. The <a href="#task-source">task
|
|
source</a> for this task is the <a href="#dom-manipulation-task-source">DOM manipulation task
|
|
source</a>.</li>
|
|
|
|
</ol><p class="note">Focusing the control does not imply that the user
|
|
agent must focus the browser window if it has lost focus.</p>
|
|
|
|
<p>The <dfn id="dom-fe-autofocus" title="dom-fe-autofocus"><code>autofocus</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
</div><div class="example">
|
|
<p>In the following snippet, the text control would be focused when
|
|
the document was loaded.</p>
|
|
<pre><input maxlength="256" name="q" value="" autofocus>
|
|
<input type="submit" value="Search"></pre>
|
|
</div><h5 id="limiting-user-input-length"><span class="secno">4.10.19.5 </span>Limiting user input length</h5><p>A <dfn id="attr-fe-maxlength" title="attr-fe-maxlength">form control <code title="">maxlength</code> attribute</dfn>, controlled by a <var title="">dirty value flag</var>, declares a limit on the number of
|
|
characters a user can input.<p>If an element has its <a href="#attr-fe-maxlength" title="attr-fe-maxlength">form
|
|
control <code title="">maxlength</code> attribute</a> specified,
|
|
the attribute's value must be a <a href="#valid-non-negative-integer">valid non-negative
|
|
integer</a>. If the attribute is specified and applying the
|
|
<a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</a> to its value
|
|
results in a number, then that number is the element's <dfn id="maximum-allowed-value-length">maximum
|
|
allowed value length</dfn>. If the attribute is omitted or parsing
|
|
its value results in an error, then there is no <a href="#maximum-allowed-value-length">maximum
|
|
allowed value length</a>.<div class="impl">
|
|
|
|
<p><strong>Constraint validation</strong>: If an element has a
|
|
<a href="#maximum-allowed-value-length">maximum allowed value length</a>, its <var title="">dirty
|
|
value flag</var> is true, its <a href="#concept-fe-value" title="concept-fe-value">value</a> was last changed by a user
|
|
edit (as opposed to a change made by a script), and the
|
|
<a href="#code-point-length">code-point length</a> of the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> is greater than the element's
|
|
<a href="#maximum-allowed-value-length">maximum allowed value length</a>, then the element is
|
|
<a href="#suffering-from-being-too-long">suffering from being too long</a>.</p>
|
|
|
|
<p>User agents may prevent the user from causing the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> to be set to a value whose
|
|
<a href="#code-point-length">code-point length</a> is greater than the element's
|
|
<a href="#maximum-allowed-value-length">maximum allowed value length</a>.</p>
|
|
|
|
</div><h5 id="form-submission-0"><span class="secno">4.10.19.6 </span>Form submission</h5><p><dfn id="attributes-for-form-submission">Attributes for form submission</dfn> can be specified both
|
|
on <code><a href="#the-form-element">form</a></code> elements and on <a href="#concept-submit-button" title="concept-submit-button">submit buttons</a> (elements that
|
|
represent buttons that submit forms, e.g. an <code><a href="#the-input-element">input</a></code>
|
|
element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is
|
|
in the <a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a>
|
|
state).
|
|
|
|
<p>The <a href="#attributes-for-form-submission">attributes for form submission</a> that may be
|
|
specified on <code><a href="#the-form-element">form</a></code> elements are <code title="attr-fs-action"><a href="#attr-fs-action">action</a></code>, <code title="attr-fs-enctype"><a href="#attr-fs-enctype">enctype</a></code>, <code title="attr-fs-method"><a href="#attr-fs-method">method</a></code>, <code title="attr-fs-novalidate"><a href="#attr-fs-novalidate">novalidate</a></code>, and <code title="attr-fs-target"><a href="#attr-fs-target">target</a></code>.<p>The corresponding <a href="#attributes-for-form-submission">attributes for form submission</a>
|
|
that may be specified on <a href="#concept-submit-button" title="concept-submit-button">submit
|
|
buttons</a> are <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>, <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>. When omitted, they
|
|
default to the values given on the corresponding attributes on the
|
|
<code><a href="#the-form-element">form</a></code> element.<hr><p>The <dfn id="attr-fs-action" title="attr-fs-action"><code>action</code></dfn> and
|
|
<dfn id="attr-fs-formaction" title="attr-fs-formaction"><code>formaction</code></dfn>
|
|
content attributes, if specified, must have a value that is a
|
|
<a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</a>.<p>The <dfn id="concept-fs-action" title="concept-fs-action">action</dfn> of an element is
|
|
the value of the element's <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code> attribute, if the
|
|
element is a <a href="#concept-submit-button" title="concept-submit-button">submit
|
|
button</a> and has such an attribute, or the value of its
|
|
<a href="#form-owner">form owner</a>'s <code title="attr-fs-action"><a href="#attr-fs-action">action</a></code>
|
|
attribute, if <em>it</em> has one, or else the empty string.<hr><p>The <dfn id="attr-fs-method" title="attr-fs-method"><code>method</code></dfn> and
|
|
<dfn id="attr-fs-formmethod" title="attr-fs-formmethod"><code>formmethod</code></dfn>
|
|
content attributes are <a href="#enumerated-attribute" title="enumerated attribute">enumerated
|
|
attributes</a> with the following keywords and states:<ul><li>The keyword <dfn id="attr-fs-method-get-keyword" title="attr-fs-method-GET-keyword"><code>get</code></dfn>, mapping
|
|
to the state <dfn id="attr-fs-method-get" title="attr-fs-method-GET">GET</dfn>, indicating
|
|
the HTTP GET method.</li>
|
|
|
|
<li>The keyword <dfn id="attr-fs-method-post-keyword" title="attr-fs-method-POST-keyword"><code>post</code></dfn>, mapping
|
|
to the state <dfn id="attr-fs-method-post" title="attr-fs-method-POST">POST</dfn>, indicating
|
|
the HTTP POST method.</li>
|
|
|
|
</ul><p>The <i>missing value default</i> for these attributes is the
|
|
<a href="#attr-fs-method-get" title="attr-fs-method-GET">GET</a> state.<p>The <dfn id="concept-fs-method" title="concept-fs-method">method</dfn> of an element is
|
|
one of those states. If the element is a <a href="#concept-submit-button" title="concept-submit-button">submit button</a> and has a <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code> attribute, then the
|
|
element's <a href="#concept-fs-method" title="concept-fs-method">method</a> is that
|
|
attribute's state; otherwise, it is the <a href="#form-owner">form owner</a>'s
|
|
<code title="attr-fs-method"><a href="#attr-fs-method">method</a></code> attribute's state.<hr><p>The <dfn id="attr-fs-enctype" title="attr-fs-enctype"><code>enctype</code></dfn> and
|
|
<dfn id="attr-fs-formenctype" title="attr-fs-formenctype"><code>formenctype</code></dfn>
|
|
content attributes are <a href="#enumerated-attribute" title="enumerated attribute">enumerated
|
|
attributes</a> with the following keywords and states:<ul><li>The "<dfn id="attr-fs-enctype-urlencoded" title="attr-fs-enctype-urlencoded"><code>application/x-www-form-urlencoded</code></dfn>" keyword and corresponding state.</li>
|
|
<li>The "<dfn id="attr-fs-enctype-formdata" title="attr-fs-enctype-formdata"><code>multipart/form-data</code></dfn>" keyword and corresponding state.</li>
|
|
<li>The "<dfn id="attr-fs-enctype-text" title="attr-fs-enctype-text"><code>text/plain</code></dfn>" keyword and corresponding state.</li>
|
|
</ul><p>The <i>missing value default</i> for these attributes is the
|
|
<code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</a></code>
|
|
state.<p>The <dfn id="concept-fs-enctype" title="concept-fs-enctype">enctype</dfn> of an element
|
|
is one of those three states. If the element is a <a href="#concept-submit-button" title="concept-submit-button">submit button</a> and has a <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code> attribute, then the
|
|
element's <a href="#concept-fs-enctype" title="concept-fs-enctype">enctype</a> is that
|
|
attribute's state; otherwise, it is the <a href="#form-owner">form owner</a>'s
|
|
<code title="attr-fs-enctype"><a href="#attr-fs-enctype">enctype</a></code> attribute's state.<hr><p>The <dfn id="attr-fs-target" title="attr-fs-target"><code>target</code></dfn> and
|
|
<dfn id="attr-fs-formtarget" title="attr-fs-formtarget"><code>formtarget</code></dfn>
|
|
content attributes, if specified, must have values that are <a href="#valid-browsing-context-name-or-keyword" title="valid browsing context name or keyword">valid browsing
|
|
context names or keywords</a>.<p>The <dfn id="concept-fs-target" title="concept-fs-target">target</dfn> of an element is
|
|
the value of the element's <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code> attribute, if the
|
|
element is a <a href="#concept-submit-button" title="concept-submit-button">submit
|
|
button</a> and has such an attribute; or the value of its
|
|
<a href="#form-owner">form owner</a>'s <code title="attr-fs-target"><a href="#attr-fs-target">target</a></code>
|
|
attribute, if <em>it</em> has such an attribute; or, if the
|
|
<code><a href="#document">Document</a></code> contains a <code><a href="#the-base-element">base</a></code> element with a
|
|
<code title="attr-base-target"><a href="#attr-base-target">target</a></code> attribute, then the
|
|
value of the <code title="attr-base-target"><a href="#attr-base-target">target</a></code> attribute
|
|
of the first such <code><a href="#the-base-element">base</a></code> element; or, if there is no such
|
|
element, the empty string.</p><hr><p>The <dfn id="attr-fs-novalidate" title="attr-fs-novalidate"><code>novalidate</code></dfn>
|
|
and <dfn id="attr-fs-formnovalidate" title="attr-fs-formnovalidate"><code>formnovalidate</code></dfn>
|
|
content attributes are <a href="#boolean-attribute" title="boolean attribute">boolean
|
|
attributes</a>. If present, they indicate that the form is not to
|
|
be validated during submission.<p>The <dfn id="concept-fs-novalidate" title="concept-fs-novalidate">no-validate state</dfn> of
|
|
an element is true if the element is a <a href="#concept-submit-button" title="concept-submit-button">submit button</a> and the element's
|
|
<code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code> attribute
|
|
is present, or if the element's <a href="#form-owner">form owner</a>'s <code title="attr-fs-novalidate"><a href="#attr-fs-novalidate">novalidate</a></code> attribute is present,
|
|
and false otherwise.<div class="example">
|
|
|
|
<p>This attribute is useful to include "save" buttons on forms that
|
|
have validation constraints, to allow users to save their progress
|
|
even though they haven't fully entered the data in the form. The
|
|
following example shows a simple form that has two required
|
|
fields. There are three buttons: one to submit the form, which
|
|
requires both fields to be filled in; one to save the form so that
|
|
the user can come back and fill it in later; and one to cancel the
|
|
form altogether.</p>
|
|
|
|
<pre><form action="editor.cgi" method="post">
|
|
<p><label>Name: <input required name=fn></label></p>
|
|
<p><label>Essay: <textarea required name=essay></textarea></label></p>
|
|
<p><input type=submit name=submit value="Submit essay"></p>
|
|
<p><input type=submit formnovalidate name=save value="Save essay"></p>
|
|
<p><input type=submit formnovalidate name=cancel value="Cancel"></p>
|
|
</form></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<hr><p>The <dfn id="dom-fs-action" title="dom-fs-action"><code>action</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name, except that on getting, when the content attribute is
|
|
missing or its value is the empty string, <a href="#the-document-s-address">the document's
|
|
address</a> must be returned instead. The <dfn id="dom-fs-target" title="dom-fs-target"><code>target</code></dfn> IDL attribute must
|
|
<a href="#reflect">reflect</a> the content attribute of the same name. The
|
|
<dfn id="dom-fs-method" title="dom-fs-method"><code>method</code></dfn> and <dfn id="dom-fs-enctype" title="dom-fs-enctype"><code>enctype</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>. The <dfn id="dom-fs-encoding" title="dom-fs-encoding"><code>encoding</code></dfn> IDL attribute
|
|
must <a href="#reflect">reflect</a> the <code title="attr-fs-enctype"><a href="#attr-fs-enctype">enctype</a></code> content attribute,
|
|
<a href="#limited-to-only-known-values">limited to only known values</a>. The <dfn id="dom-fs-novalidate" title="dom-fs-noValidate"><code>noValidate</code></dfn> IDL
|
|
attribute must reflect the <code title="attr-fs-novalidate"><a href="#attr-fs-novalidate">novalidate</a></code> content attribute. The
|
|
<dfn id="dom-fs-formaction" title="dom-fs-formAction"><code>formAction</code></dfn> IDL
|
|
attribute must reflect the <code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code> content attribute,
|
|
except that on getting, when the content attribute is missing or its
|
|
value is the empty string, <a href="#the-document-s-address">the document's address</a> must
|
|
be returned instead. The <dfn id="dom-fs-formenctype" title="dom-fs-formEnctype"><code>formEnctype</code></dfn> IDL
|
|
attribute must reflect the <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code> content attribute,
|
|
<a href="#limited-to-only-known-values">limited to only known values</a>. The <dfn id="dom-fs-formmethod" title="dom-fs-formMethod"><code>formMethod</code></dfn> IDL
|
|
attribute must reflect the <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code> content attribute,
|
|
<a href="#limited-to-only-known-values">limited to only known values</a>. The <dfn id="dom-fs-formnovalidate" title="dom-fs-formNoValidate"><code>formNoValidate</code></dfn> IDL
|
|
attribute must reflect the <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code> content
|
|
attribute. The <dfn id="dom-fs-formtarget" title="dom-fs-formTarget"><code>formTarget</code></dfn> IDL
|
|
attribute must reflect the <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code> content attribute.
|
|
|
|
</div><h5 id="submitting-element-directionality"><span class="secno">4.10.19.7 </span>Submitting element directionality</h5><p>A <dfn id="form-control-dirname-attribute">form control <code title="">dirname</code> attribute</dfn>
|
|
on a form control element enables the submission of <a href="#the-directionality">the
|
|
directionality</a> of the element, and gives the name of the
|
|
field that contains this value during <a href="#form-submission">form submission</a>.
|
|
If such an attribute is specified, its value must not be the empty
|
|
string.<h4 id="textFieldSelection"><span class="secno">4.10.20 </span>APIs for the text field selections</h4><p>The <code><a href="#the-input-element">input</a></code> and <code><a href="#the-textarea-element">textarea</a></code> elements define
|
|
the following members in their DOM interfaces for handling their
|
|
selection:<pre class="idl extract"> void <a href="#dom-textarea-input-select" title="dom-textarea/input-select">select</a>();
|
|
attribute unsigned long <a href="#dom-textarea-input-selectionstart" title="dom-textarea/input-selectionStart">selectionStart</a>;
|
|
attribute unsigned long <a href="#dom-textarea-input-selectionend" title="dom-textarea/input-selectionEnd">selectionEnd</a>;
|
|
attribute DOMString <a href="#dom-textarea-input-selectiondirection" title="dom-textarea/input-selectionDirection">selectionDirection</a>;
|
|
void <a href="#dom-textarea-input-setselectionrange" title="dom-textarea/input-setSelectionRange">setSelectionRange</a>(in unsigned long start, in unsigned long end, in optional DOMString direction);</pre><p>These methods and attributes expose and control the selection of
|
|
<code><a href="#the-input-element">input</a></code> and <code><a href="#the-textarea-element">textarea</a></code> text fields.<dl class="domintro"><dt><var title="">element</var> . <code title="dom-textarea/input-select"><a href="#dom-textarea-input-select">select</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Selects everything in the text field.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-textarea/input-selecionStart">selectionStart</code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the offset to the start of the selection.</p>
|
|
|
|
<p>Can be set, to change the start of the selection.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-textarea/input-selecionEnd">selectionEnd</code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the offset to the end of the selection.</p>
|
|
|
|
<p>Can be set, to change the end of the selection.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-textarea/input-selecionDirection">selectionDirection</code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current direction of the selection.</p>
|
|
|
|
<p>Can be set, to change the direction of the selection.</p>
|
|
|
|
<p>The possible values are "<code title="">forward</code>", "<code title="">backward</code>", and "<code title="">none</code>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange</a></code>(<var title="">start</var>, <var title="">end</var> [, <var title="">direction</var>] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Changes the selection to cover the given substring in the given direction. If the direction is omitted, it will be reset to be the platform default (none or forward).</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>When these methods and attributes are used with
|
|
<code><a href="#the-input-element">input</a></code> elements while they don't apply, they must raise
|
|
an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception. Otherwise, they must
|
|
act as described below.</p>
|
|
|
|
<p>For <code><a href="#the-input-element">input</a></code> elements, these methods and attributes
|
|
must operate on the element's <a href="#concept-fe-value" title="concept-fe-value">value</a>. For <code><a href="#the-textarea-element">textarea</a></code>
|
|
elements, these methods and attributes must operate on the element's
|
|
<a href="#concept-textarea-raw-value" title="concept-textarea-raw-value">raw value</a>.</p>
|
|
|
|
<p>Where possible, user interface features for changing the text
|
|
selection in <code><a href="#the-input-element">input</a></code> and <code><a href="#the-textarea-element">textarea</a></code> elements
|
|
must be implemented in terms of the DOM API described in this
|
|
section, so that, e.g., all the same events fire.</p>
|
|
|
|
|
|
<p>The selections of <code><a href="#the-input-element">input</a></code> and <code><a href="#the-textarea-element">textarea</a></code>
|
|
elements have a <i>direction</i>, which is either <i>forward</i>,
|
|
<i>backward</i>, or <i>none</i>. This direction is set when the user
|
|
manipulates the selection. The exact meaning of the selection
|
|
direction depends on the platform.</p>
|
|
|
|
<p class="note">On Windows, the direction indicates the position of
|
|
the caret relative to the selection: a <i>forward</i> selection has
|
|
the caret at the end of the selection and a <i>backward</i>
|
|
selection has the caret at the start of the selection. Windows has
|
|
no <i>none</i> direction. On Mac, the direction indicates which end
|
|
of the selection is affected when the user adjusts the size of the
|
|
selection using the arrow keys with the Shift modifier: the forward
|
|
direction means the end of the selection is modified, and the
|
|
backwards direction means the start of the selection is modified.
|
|
The none direction is the default on Mac, it indicates that no
|
|
particular direction has yet been selected. The user sets the
|
|
direction implicitly when first adjusting the selection, based on
|
|
which directional arrow key was used.</p>
|
|
|
|
|
|
<p>The <dfn id="dom-textarea-input-select" title="dom-textarea/input-select"><code>select()</code></dfn> method
|
|
must cause the contents of the text field to be fully selected, with
|
|
the selection direction being none, if the platform support
|
|
selections with the direction <i>none</i>, or otherwise
|
|
<i>forward</i>. The user agent must then <a href="#queue-a-task">queue a task</a>
|
|
to <a href="#fire-a-simple-event">fire a simple event</a> that bubbles named <code title="event-select">select</code> at the element, using the
|
|
<a href="#user-interaction-task-source">user interaction task source</a> as the task source.</p>
|
|
|
|
|
|
<p>The <dfn id="dom-textarea-input-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="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>
|
|
method had been called, with the new value as the first argument;
|
|
the current value of the <code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>
|
|
attribute as the second argument, unless the current value of the
|
|
<code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code> is
|
|
less than the new value, in which case the second argument must also
|
|
be the new value; and the current value of the <code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>
|
|
as the third argument.</p>
|
|
|
|
|
|
<p>The <dfn id="dom-textarea-input-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="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>
|
|
method had been called, with the current value of the <code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>
|
|
attribute as the first argument, the new value as the second
|
|
argument, and the current value of the <code title="dom-textarea/input-selectionDirection"><a href="#dom-textarea-input-selectiondirection">selectionDirection</a></code>
|
|
as the third argument.</p>
|
|
|
|
|
|
<p>The <dfn id="dom-textarea-input-selectiondirection" title="dom-textarea/input-selectionDirection"><code>selectionDirection</code></dfn>
|
|
attribute must, on getting, return the string corresponding to the
|
|
current selection direction: if the direction is <i>forward</i>,
|
|
"<code title="">forward</code>"; if the direction is
|
|
<i>backward</i>, "<code title="">backward</code>"; and otherwise,
|
|
"<code title="">none</code>".</p>
|
|
|
|
<p>On setting, it must act as if the <code title="dom-textarea/input-setSelectionRange"><a href="#dom-textarea-input-setselectionrange">setSelectionRange()</a></code>
|
|
method had been called, with the current value of the <code title="dom-textarea/input-selectionStart"><a href="#dom-textarea-input-selectionstart">selectionStart</a></code>
|
|
attribute as the first argument, the current value of the <code title="dom-textarea/input-selectionEnd"><a href="#dom-textarea-input-selectionend">selectionEnd</a></code>
|
|
attribute as the first argument, and the new value as the third
|
|
argument.</p>
|
|
|
|
|
|
<p>The <dfn id="dom-textarea-input-setselectionrange" title="dom-textarea/input-setSelectionRange"><code>setSelectionRange(<var title="">start</var>, <var title="">end</var>, <var title="">direction</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 title="">(<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>. The direction of the selection
|
|
must be set to <i>backward</i> if <var title="">direction</var> is a
|
|
<a href="#case-sensitive">case-sensitive</a> match for the string "<code title="">backward</code>", <i>forward</i> if <var title="">direction</var> is a <a href="#case-sensitive">case-sensitive</a> match for
|
|
the string "<code title="">forward</code>" or if the platform does
|
|
not support selections with the direction <i>none</i>, and
|
|
<i>none</i> otherwise (including if the argument is omitted). The
|
|
user agent must then <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> that bubbles named <code title="event-select">select</code> at the element, using the
|
|
<a href="#user-interaction-task-source">user interaction task source</a> as the task source.</p>
|
|
|
|
|
|
<p>All elements to which this API applies have either a selection or
|
|
a text entry cursor position at all times (even for elements that
|
|
are not <a href="#being-rendered">being rendered</a>). User agents should follow
|
|
platform conventions to determine their initial state.</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.<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><a href="#the-input-element">input</a></code>
|
|
or <code><a href="#the-textarea-element">textarea</a></code> element.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>To add some text at the start of a text control, while
|
|
maintaining the text selection, the three attributes must be
|
|
preserved:</p>
|
|
|
|
<pre>var oldStart = control.selectionStart;
|
|
var oldEnd = control.selectionEnd;
|
|
var oldDirection = control.selectionDirection;
|
|
var prefix = "http://";
|
|
control.value = prefix + control.value;
|
|
control.setSelectionRange(oldStart + prefix.length, oldEnd + prefix.length, oldDirection);</pre>
|
|
|
|
<p>...where <var title="">control</var> is the <code><a href="#the-input-element">input</a></code>
|
|
or <code><a href="#the-textarea-element">textarea</a></code> element.</p>
|
|
|
|
</div><h4 id="constraints"><span class="secno">4.10.21 </span>Constraints</h4><h5 id="definitions"><span class="secno">4.10.21.1 </span>Definitions</h5><div class="impl">
|
|
|
|
<p>A <a href="#category-listed" title="category-listed">listed form-associated
|
|
element</a> is a <dfn id="candidate-for-constraint-validation">candidate for constraint validation</dfn>
|
|
except when a condition has <dfn id="barred-from-constraint-validation" title="barred from constraint
|
|
validation">barred the element from constraint
|
|
validation</dfn>. (For example, an element is <a href="#barred-from-constraint-validation">barred from
|
|
constraint validation</a> if it is an <code><a href="#the-output-element">output</a></code> or
|
|
<code><a href="#the-fieldset-element">fieldset</a></code> element.)</p>
|
|
|
|
<p>An element can have a <dfn id="custom-validity-error-message">custom validity error message</dfn>
|
|
defined. Initially, an element must have its <a href="#custom-validity-error-message">custom validity
|
|
error message</a> set to the empty string. When its value is not
|
|
the empty string, the element is <a href="#suffering-from-a-custom-error">suffering from a custom
|
|
error</a>. It can be set using the <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
method. The user agent should use the <a href="#custom-validity-error-message">custom validity error
|
|
message</a> when alerting the user to the problem with the
|
|
control.</p>
|
|
|
|
<p>An element can be constrained in various ways. The following is
|
|
the list of <dfn id="validity-states">validity states</dfn> that a form control can be
|
|
in, making the control invalid for the purposes of constraint
|
|
validation. (The definitions below are non-normative; other parts of
|
|
this specification define more precisely when each state applies or
|
|
does not.)</p>
|
|
|
|
<dl><dt> <dfn id="suffering-from-being-missing">Suffering from being missing</dfn> </dt>
|
|
|
|
<dd> <p>When a control has no <a href="#concept-fe-value" title="concept-fe-value">value</a> but has a <code title="">required</code> attribute (<code><a href="#the-input-element">input</a></code> <code title="attr-input-required"><a href="#attr-input-required">required</a></code>, <code><a href="#the-select-element">select</a></code>
|
|
<code title="attr-select-required"><a href="#attr-select-required">required</a></code>,
|
|
<code><a href="#the-textarea-element">textarea</a></code> <code title="attr-textarea-required"><a href="#attr-textarea-required">required</a></code>), or, in the case of
|
|
an element in a <i><a href="#radio-button-group">radio button group</a></i>, any of the other
|
|
elements in the group has a <code title="attr-input-required"><a href="#attr-input-required">required</a></code> attribute. </dd>
|
|
|
|
<dt> <dfn id="suffering-from-a-type-mismatch">Suffering from a type mismatch</dfn> </dt>
|
|
|
|
<dd> <p>When a control that allows arbitrary user
|
|
input has a <a href="#concept-fe-value" title="concept-fe-value">value</a> that is not
|
|
in the correct syntax (<a href="#e-mail-state" title="attr-input-type-email">E-mail</a>, <a href="#url-state" title="attr-input-type-url">URL</a>). </dd>
|
|
|
|
<dt> <dfn id="suffering-from-a-pattern-mismatch">Suffering from a pattern mismatch</dfn> </dt>
|
|
|
|
<dd> <p>When a control has a <a href="#concept-fe-value" title="concept-fe-value">value</a> that doesn't satisfy the
|
|
<code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute.</dd>
|
|
|
|
<dt> <dfn id="suffering-from-being-too-long">Suffering from being too long</dfn> </dt>
|
|
|
|
<dd> <p>When a control has a <a href="#concept-fe-value" title="concept-fe-value">value</a> that is too long for the
|
|
<a href="#attr-fe-maxlength" title="attr-fe-maxlength">form control <code title="">maxlength</code> attribute</a> (<code><a href="#the-input-element">input</a></code>
|
|
<code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>,
|
|
<code><a href="#the-textarea-element">textarea</a></code> <code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength">maxlength</a></code>). </dd>
|
|
|
|
<dt> <dfn id="suffering-from-an-underflow">Suffering from an underflow</dfn> </dt>
|
|
|
|
<dd> <p>When a control has a <a href="#concept-fe-value" title="concept-fe-value">value</a> that is too low for the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute.</dd>
|
|
|
|
<dt> <dfn id="suffering-from-an-overflow">Suffering from an overflow</dfn> </dt>
|
|
|
|
<dd> <p>When a control has a <a href="#concept-fe-value" title="concept-fe-value">value</a> that is too high for the
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code> attribute.</dd>
|
|
|
|
<dt> <dfn id="suffering-from-a-step-mismatch">Suffering from a step mismatch</dfn> </dt>
|
|
|
|
<dd> <p>When a control has a <a href="#concept-fe-value" title="concept-fe-value">value</a> that doesn't fit the rules
|
|
given by the <code title="attr-input-step"><a href="#attr-input-step">step</a></code>
|
|
attribute.</dd>
|
|
|
|
<dt> <dfn id="suffering-from-a-custom-error">Suffering from a custom error</dfn> </dt>
|
|
|
|
<dd> <p>When a control's <a href="#custom-validity-error-message">custom validity error
|
|
message</a> (as set by the element's <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code>
|
|
method) is not the empty string.</p> </dd>
|
|
|
|
</dl><p class="note">An element can still suffer from these states even
|
|
when the element is <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>; thus these states can
|
|
be represented in the DOM even if validating the form during
|
|
submission wouldn't indicate a problem to the user.</p>
|
|
|
|
<p>An element <dfn id="concept-fv-valid" title="concept-fv-valid">satisfies its
|
|
constraints</dfn> if it is not suffering from any of the above
|
|
<a href="#validity-states">validity states</a>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="constraint-validation"><span class="secno">4.10.21.2 </span>Constraint validation</h5>
|
|
|
|
<p>When the user agent is required to <dfn id="statically-validate-the-constraints">statically validate the
|
|
constraints</dfn> of <code><a href="#the-form-element">form</a></code> element <var title="">form</var>, it must run the following steps, which return
|
|
either a <i>positive</i> result (all the controls in the form are
|
|
valid) or a <i>negative</i> result (there are invalid controls)
|
|
along with a (possibly empty) list of elements that are invalid and
|
|
for which no script has claimed responsibility:</p>
|
|
|
|
<ol><li><p>Let <var title="">controls</var> be a list of all the <a href="#category-submit" title="category-submit">submittable elements</a> whose
|
|
<a href="#form-owner">form owner</a> is <var title="">form</var>, in <a href="#tree-order">tree
|
|
order</a>.</li>
|
|
|
|
<li><p>Let <var title="">invalid controls</var> be an initially
|
|
empty list of elements.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each element <var title="">field</var> in <var title="">controls</var>, in <a href="#tree-order">tree order</a>, run the
|
|
following substeps:</p>
|
|
|
|
<ol><li><p>If <var title="">field</var> is not a <a href="#candidate-for-constraint-validation">candidate for
|
|
constraint validation</a>, then move on to the next
|
|
element.</li>
|
|
|
|
<li><p>Otherwise, if <var title="">field</var> <a href="#concept-fv-valid" title="concept-fv-valid">satisfies its constraints</a>, then
|
|
move on to the next element.</li>
|
|
|
|
<li><p>Otherwise, add <var title="">field</var> to <var title="">invalid controls</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>If <var title="">invalid controls</var> is empty, then
|
|
return a <i>positive</i> result and abort these steps.</li>
|
|
|
|
<li><p>Let <var title="">unhandled invalid controls</var> be an
|
|
initially empty list of elements.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each element <var title="">field</var> in <var title="">invalid controls</var>, if any, in <a href="#tree-order">tree
|
|
order</a>, run the following substeps:</p>
|
|
|
|
<ol><li><p><a href="#fire-a-simple-event">Fire a simple event</a> named <code title="event-invalid">invalid</code> that is cancelable at <var title="">field</var>.</li>
|
|
|
|
<li><p>If the event was not canceled, then add <var title="">field</var> to <var title="">unhandled invalid
|
|
controls</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Return a <i>negative</i> result with the list of elements in
|
|
the <var title="">unhandled invalid controls</var> list.</li>
|
|
|
|
</ol><p>If a user agent is to <dfn id="interactively-validate-the-constraints">interactively validate the
|
|
constraints</dfn> of <code><a href="#the-form-element">form</a></code> element <var title="">form</var>, then the user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p><a href="#statically-validate-the-constraints">Statically validate the constraints</a> of <var title="">form</var>, and let <var title="">unhandled invalid
|
|
controls</var> be the list of elements returned if the result was
|
|
<i>negative</i>.</li>
|
|
|
|
<li><p>If the result was <i>positive</i>, then return that result
|
|
and abort these steps.</li>
|
|
|
|
<li><p>Report the problems with the constraints of at least one of
|
|
the elements given in <var title="">unhandled invalid
|
|
controls</var> to the user. User agents may focus one of those
|
|
elements in the process, by running the <a href="#focusing-steps">focusing steps</a>
|
|
for that element, and may change the scrolling position of the
|
|
document, or perform some other action that brings the element to
|
|
the user's attention. User agents may report more than one
|
|
constraint violation. User agents may coalesce related constraint
|
|
violation reports if appropriate (e.g. if multiple radio buttons in
|
|
a <a href="#radio-button-group" title="radio button group">group</a> are marked as
|
|
required, only one error need be reported). If one of the controls
|
|
is not <a href="#being-rendered">being rendered</a> (e.g. it has the <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute set) then user agents
|
|
may report a script error.</li>
|
|
|
|
<li><p>Return a <i>negative</i> result.</li>
|
|
|
|
</ol></div><h5 id="the-constraint-validation-api"><span class="secno">4.10.21.3 </span>The <dfn>constraint validation API</dfn></h5><dl class="domintro"><dt><var title="">element</var> . <code title="dom-cva-willValidate"><a href="#dom-cva-willvalidate">willValidate</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element will be validated when the form is submitted; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity</a></code>(<var title="">message</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Sets a custom error, so that the element would fail to
|
|
validate. The given message is the message to be shown to the user
|
|
when reporting the problem to the user.</p>
|
|
|
|
<p>If the argument is the empty string, clears the custom error.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-valueMissing"><a href="#dom-validitystate-valuemissing">valueMissing</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element has no value but is a required field; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-typeMismatch"><a href="#dom-validitystate-typemismatch">typeMismatch</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element's value is not in the correct syntax; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-patternMismatch"><a href="#dom-validitystate-patternmismatch">patternMismatch</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element's value doesn't match the provided pattern; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-tooLong"><a href="#dom-validitystate-toolong">tooLong</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element's value is longer than the provided maximum length; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-rangeUnderflow"><a href="#dom-validitystate-rangeunderflow">rangeUnderflow</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element's value is lower than the provided minimum; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-rangeOverflow"><a href="#dom-validitystate-rangeoverflow">rangeOverflow</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element's value is higher than the provided maximum; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-stepMismatch"><a href="#dom-validitystate-stepmismatch">stepMismatch</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element's value doesn't fit the rules given by the <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-customError"><a href="#dom-validitystate-customerror">customError</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element has a custom error; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> . <code title="dom-validitystate-valid"><a href="#dom-validitystate-valid">valid</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element's value has no validity problems; false otherwise.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">valid</var> = <var title="">element</var> . <code title="dom-cva-checkValidatity"><a href="#dom-cva-checkvalidatity">checkValidity</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element's value has no validity problems;
|
|
false otherwise. Fires an <code title="event-invalid">invalid</code> event at the element in the
|
|
latter case.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-cva-validationMessage"><a href="#dom-cva-validationmessage">validationMessage</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the error message that would be shown to the user if
|
|
the element was to be checked for validity.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-cva-willvalidate" title="dom-cva-willValidate"><code>willValidate</code></dfn>
|
|
attribute must return true if an element is a <a href="#candidate-for-constraint-validation">candidate for
|
|
constraint validation</a>, and false otherwise (i.e. false if any
|
|
conditions are <a href="#barred-from-constraint-validation" title="barred from constraint
|
|
validation">barring it from constraint validation</a>).</p>
|
|
|
|
<p>The <dfn id="dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity"><code>setCustomValidity(<var title="">message</var>)</code></dfn>, when invoked, must set the
|
|
<a href="#custom-validity-error-message">custom validity error message</a> to the value of the given
|
|
<var title="">message</var> argument.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, a script checks the value of a form
|
|
control each time it is edited, and whenever it is not a valid
|
|
value, uses the <code title="dom-cva-setCustomValidity"><a href="#dom-cva-setcustomvalidity">setCustomValidity()</a></code> method
|
|
to set an appropriate message.</p>
|
|
|
|
<pre><label>Feeling: <input name=f type="text" oninput="check(this)"></label>
|
|
<script>
|
|
function check(input) {
|
|
if (input.value == "good" ||
|
|
input.value == "fine" ||
|
|
input.value == "tired") {
|
|
input.setCustomValidity('"' + input.value + '" is not a feeling.');
|
|
} else {
|
|
// input is fine -- reset the error message
|
|
input.setCustomValidity('');
|
|
}
|
|
}
|
|
</script></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<p>The <dfn id="dom-cva-validity" title="dom-cva-validity"><code>validity</code></dfn>
|
|
attribute must return a <code><a href="#validitystate">ValidityState</a></code> object that
|
|
represents the <a href="#validity-states">validity states</a> of the element. This
|
|
object is <a href="#live">live</a>, and the same object must be returned
|
|
each time the element's <code title="dom-cva-validity"><a href="#dom-cva-validity">validity</a></code> attribute is retrieved.</p>
|
|
|
|
<pre class="idl">interface <dfn id="validitystate">ValidityState</dfn> {
|
|
readonly attribute boolean <a href="#dom-validitystate-valuemissing" title="dom-ValidityState-valueMissing">valueMissing</a>;
|
|
readonly attribute boolean <a href="#dom-validitystate-typemismatch" title="dom-ValidityState-typeMismatch">typeMismatch</a>;
|
|
readonly attribute boolean <a href="#dom-validitystate-patternmismatch" title="dom-ValidityState-patternMismatch">patternMismatch</a>;
|
|
readonly attribute boolean <a href="#dom-validitystate-toolong" title="dom-ValidityState-tooLong">tooLong</a>;
|
|
readonly attribute boolean <a href="#dom-validitystate-rangeunderflow" title="dom-ValidityState-rangeUnderflow">rangeUnderflow</a>;
|
|
readonly attribute boolean <a href="#dom-validitystate-rangeoverflow" title="dom-ValidityState-rangeOverflow">rangeOverflow</a>;
|
|
readonly attribute boolean <a href="#dom-validitystate-stepmismatch" title="dom-ValidityState-stepMismatch">stepMismatch</a>;
|
|
readonly attribute boolean <a href="#dom-validitystate-customerror" title="dom-ValidityState-customError">customError</a>;
|
|
readonly attribute boolean <a href="#dom-validitystate-valid" title="dom-ValidityState-valid">valid</a>;
|
|
};</pre>
|
|
|
|
<p>A <code><a href="#validitystate">ValidityState</a></code> object has the following
|
|
attributes. On getting, they must return true if the corresponding
|
|
condition given in the following list is true, and false
|
|
otherwise.</p>
|
|
|
|
<dl><dt><dfn id="dom-validitystate-valuemissing" title="dom-ValidityState-valueMissing"><code>valueMissing</code></dfn></dt>
|
|
<dd> <p>The control is <a href="#suffering-from-being-missing">suffering from being missing</a>.</p> </dd>
|
|
|
|
<dt><dfn id="dom-validitystate-typemismatch" title="dom-ValidityState-typeMismatch"><code>typeMismatch</code></dfn></dt>
|
|
<dd> <p>The control is <a href="#suffering-from-a-type-mismatch">suffering from a type mismatch</a>.</p> </dd>
|
|
|
|
<dt><dfn id="dom-validitystate-patternmismatch" title="dom-ValidityState-patternMismatch"><code>patternMismatch</code></dfn></dt>
|
|
<dd> <p>The control is <a href="#suffering-from-a-pattern-mismatch">suffering from a pattern mismatch</a>.</p> </dd>
|
|
|
|
<dt><dfn id="dom-validitystate-toolong" title="dom-ValidityState-tooLong"><code>tooLong</code></dfn></dt>
|
|
<dd> <p>The control is <a href="#suffering-from-being-too-long">suffering from being too long</a>.</p> </dd>
|
|
|
|
<dt><dfn id="dom-validitystate-rangeunderflow" title="dom-ValidityState-rangeUnderflow"><code>rangeUnderflow</code></dfn></dt>
|
|
<dd> <p>The control is <a href="#suffering-from-an-underflow">suffering from an underflow</a>.</p> </dd>
|
|
|
|
<dt><dfn id="dom-validitystate-rangeoverflow" title="dom-ValidityState-rangeOverflow"><code>rangeOverflow</code></dfn></dt>
|
|
<dd> <p>The control is <a href="#suffering-from-an-overflow">suffering from an overflow</a>.</p> </dd>
|
|
|
|
<dt><dfn id="dom-validitystate-stepmismatch" title="dom-ValidityState-stepMismatch"><code>stepMismatch</code></dfn></dt>
|
|
<dd> <p>The control is <a href="#suffering-from-a-step-mismatch">suffering from a step mismatch</a>.</p> </dd>
|
|
|
|
<dt><dfn id="dom-validitystate-customerror" title="dom-ValidityState-customError"><code>customError</code></dfn></dt>
|
|
<dd> <p>The control is <a href="#suffering-from-a-custom-error">suffering from a custom error</a>.</p> </dd>
|
|
|
|
<dt><dfn id="dom-validitystate-valid" title="dom-ValidityState-valid"><code>valid</code></dfn></dt>
|
|
<dd> <p>None of the other conditions are true.</p> </dd>
|
|
|
|
</dl><p>When the <dfn id="dom-cva-checkvalidatity" title="dom-cva-checkValidatity"><code>checkValidity()</code></dfn>
|
|
method is invoked, if the element is a <a href="#candidate-for-constraint-validation">candidate for
|
|
constraint validation</a> and does not <a href="#concept-fv-valid" title="concept-fv-valid">satisfy its constraints</a>, the user
|
|
agent must <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-invalid">invalid</code> that is cancelable (but in this
|
|
case has no default action) at the element and return
|
|
false. Otherwise, it must only return true without doing anything
|
|
else.</p>
|
|
|
|
<p>The <dfn id="dom-cva-validationmessage" title="dom-cva-validationMessage"><code>validationMessage</code></dfn>
|
|
attribute must return the empty string if the element is not a
|
|
<a href="#candidate-for-constraint-validation">candidate for constraint validation</a> or if it is one but
|
|
it <a href="#concept-fv-valid" title="concept-fv-valid">satisfies its constraints</a>;
|
|
otherwise, it must return a suitably localized message that the user
|
|
agent would show the user if this were the only form control with a
|
|
validity constraint problem. If the user agent would not actually
|
|
show a textual message in such a situation (e.g. it would show a
|
|
graphical cue instead), then the attribute must return a suitably
|
|
localized message that expresses (one or more of) the validity
|
|
constraint(s) that the control does not satisfy. If the element is a
|
|
<a href="#candidate-for-constraint-validation">candidate for constraint validation</a> and is
|
|
<a href="#suffering-from-a-custom-error">suffering from a custom error</a>, then the <a href="#custom-validity-error-message">custom
|
|
validity error message</a> should be present in the return
|
|
value.</p>
|
|
|
|
</div><h5 id="security-forms"><span class="secno">4.10.21.4 </span>Security</h5><p id="security-0">Servers should not rely on client-side
|
|
validation. Client-side validation can be intentionally bypassed by
|
|
hostile users, and unintentionally bypassed by users of older user
|
|
agents or automated tools that do not implement these features. The
|
|
constraint validation features are only intended to improve the user
|
|
experience, not to provide any kind of security mechanism.<h4 id="form-submission"><span class="secno">4.10.22 </span><dfn>Form submission</dfn></h4><div class="impl">
|
|
|
|
<h5 id="introduction-2"><span class="secno">4.10.22.1 </span>Introduction</h5>
|
|
|
|
</div><p><i>This section is non-normative.</i><p>When a form is submitted, the data in the form is converted into
|
|
the structure specified by the <a href="#concept-fs-enctype" title="concept-fs-enctype">enctype</a>, and then sent to the
|
|
destination specified by the <a href="#concept-fs-action" title="concept-fs-action">action</a> using the given <a href="#concept-fs-method" title="concept-fs-method">method</a>.<p>For example, take the following form:<pre><form action="/find.cgi" method=get>
|
|
<input type=text name=t>
|
|
<input type=search name=q>
|
|
<input type=submit>
|
|
</form></pre><p>If the user types in "cats" in the first field and "fur" in the
|
|
second, and then hits the submit button, then the user agent will
|
|
load <code title="">/find.cgi?t=cats&q=fur</code>.<p>On the other hand, consider this form:<pre><form action="/find.cgi" method=post enctype="multipart/form-data">
|
|
<input type=text name=t>
|
|
<input type=search name=q>
|
|
<input type=submit>
|
|
</form></pre><p>Given the same user input, the result on submission is quite
|
|
different: the user agent instead does an HTTP POST to the given
|
|
URL, with as the entity body something like the following text:<pre>------kYFrd4jNJEgCervE
|
|
Content-Disposition: form-data; name="t"
|
|
|
|
cats
|
|
------kYFrd4jNJEgCervE
|
|
Content-Disposition: form-data; name="q"
|
|
|
|
fur
|
|
------kYFrd4jNJEgCervE--</pre><div class="impl">
|
|
|
|
<h5 id="implicit-submission"><span class="secno">4.10.22.2 </span>Implicit submission</h5>
|
|
|
|
<p>User agents may establish a <a href="#concept-button" title="concept-button">button</a> in each form as being the
|
|
form's <dfn id="default-button">default button</dfn>. This should be the first <a href="#concept-submit-button" title="concept-submit-button">submit button</a> in <a href="#tree-order">tree
|
|
order</a> whose <a href="#form-owner">form owner</a> is that <code><a href="#the-form-element">form</a></code>
|
|
element, but user agents may pick another button if another would be
|
|
more appropriate for the platform. If the platform supports letting
|
|
the user submit a form implicitly (for example, on some platforms
|
|
hitting the "enter" key while a text field is focused implicitly
|
|
submits the form), then doing so must cause the form's <a href="#default-button">default
|
|
button</a>'s <a href="#activation-behavior">activation behavior</a>, if any, to be
|
|
run.</p>
|
|
|
|
<p class="note">Consequently, if the <a href="#default-button">default button</a> is
|
|
<a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>, the form is not
|
|
submitted when such an implicit submission mechanism is used. (A
|
|
button has no <a href="#activation-behavior">activation behavior</a> when disabled.)</p>
|
|
|
|
<p>If the form has no <a href="#concept-submit-button" title="concept-submit-button">submit
|
|
button</a>, then the implicit submission mechanism must just
|
|
<a href="#concept-form-submit" title="concept-form-submit">submit</a> the
|
|
<code><a href="#the-form-element">form</a></code> element from the <code><a href="#the-form-element">form</a></code> element
|
|
itself.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="form-submission-algorithm"><span class="secno">4.10.22.3 </span>Form submission algorithm</h5>
|
|
|
|
<p>When a <code><a href="#the-form-element">form</a></code> element <var title="">form</var> is <dfn id="concept-form-submit" title="concept-form-submit">submitted</dfn> from an element <var title="">submitter</var> (typically a button), optionally with a
|
|
<var title="">scripted-submit</var> flag set, the user agent must
|
|
run the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">form document</var> be the <var title="">form</var>'s <code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li id="sandboxSubmitBlocked"><p>If <var title="">form
|
|
document</var> has no associated <a href="#browsing-context">browsing context</a> or
|
|
its <a href="#browsing-context">browsing context</a> had its <a href="#sandboxed-forms-browsing-context-flag">sandboxed forms
|
|
browsing context flag</a> set when the <code><a href="#document">Document</a></code> was
|
|
created, then abort these steps without doing anything.</li>
|
|
|
|
<li><p>Let <var title="">form browsing context</var> be the
|
|
<a href="#browsing-context">browsing context</a> of <var title="">form
|
|
document</var>.</li>
|
|
|
|
<li><p>If <var title="">form</var> is already being submitted
|
|
(i.e. the form was <a href="#concept-form-submit" title="concept-form-submit">submitted</a> again while processing
|
|
the events fired from the next two steps, probably from a script
|
|
redundantly calling the <code title="dom-form-submit"><a href="#dom-form-submit">submit()</a></code> method on <var title="">form</var>), then abort these steps. This doesn't affect
|
|
the earlier instance of this algorithm.</li>
|
|
|
|
|
|
|
|
<li><p>If the <var title="">scripted-submit</var> flag is not set,
|
|
and the <var title="">submitter</var> element's <a href="#concept-fs-novalidate" title="concept-fs-novalidate">no-validate state</a> is false,
|
|
then <a href="#interactively-validate-the-constraints">interactively validate the constraints</a> of <var title="">form</var> and examine the result: if the result is
|
|
negative (the constraint validation concluded that there were
|
|
invalid fields and probably informed the user of this) then abort
|
|
these steps.</li>
|
|
|
|
<li><p>If the <var title="">scripted-submit</var> flag is not set,
|
|
then <a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named
|
|
<code title="event-submit">submit</code>, at <var title="">form</var>. If the event's default action is prevented
|
|
(i.e. if the event is canceled) then abort these steps. Otherwise,
|
|
continue (effectively the default action is to perform the
|
|
submission).</li>
|
|
|
|
|
|
|
|
|
|
<li><p>Let <var title="">form data set</var> be the result of
|
|
<a href="#constructing-the-form-data-set">constructing the form data set</a> for <var title="">form</var>.</li>
|
|
|
|
<li><p>Let <var title="">action</var> be the <var title="">submitter</var> element's <a href="#concept-fs-action" title="concept-fs-action">action</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">action</var> is the empty string, let <var title="">action</var> be <a href="#the-document-s-address">the document's address</a> of
|
|
the <var title="">form document</var>.</p>
|
|
|
|
<p class="note">This step is a <a href="#willful-violation">willful violation</a> of
|
|
RFC 3986, which would require base URL processing here. This
|
|
violation is motivated by a desire for compatibility with legacy
|
|
content. <a href="#refsRFC3986">[RFC3986]</a></p>
|
|
|
|
|
|
</li>
|
|
|
|
<li><p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the
|
|
<a href="#url">URL</a> <var title="">action</var>, relative to the <var title="">submitter</var> element. If this fails, abort these
|
|
steps. Otherwise, let <var title="">action</var> be the resulting
|
|
<a href="#absolute-url">absolute URL</a>.</li>
|
|
|
|
<li><p>Let <var title="">scheme</var> be the <a href="#url-scheme" title="url-scheme"><scheme></a> of the resulting
|
|
<a href="#absolute-url">absolute URL</a>.</li>
|
|
|
|
<li><p>Let <var title="">enctype</var> be the <var title="">submitter</var> element's <a href="#concept-fs-enctype" title="concept-fs-enctype">enctype</a>.</li>
|
|
|
|
<li><p>Let <var title="">method</var> be the <var title="">submitter</var> element's <a href="#concept-fs-method" title="concept-fs-method">method</a>.</li>
|
|
|
|
<li><p>Let <var title="">target</var> be the <var title="">submitter</var> element's <a href="#concept-fs-target" title="concept-fs-target">target</a>.</li>
|
|
|
|
<li><p>If the user indicated a specific <a href="#browsing-context">browsing
|
|
context</a> to use when submitting the form, then let <var title="">target browsing context</var> be that <a href="#browsing-context">browsing
|
|
context</a>. Otherwise, apply <a href="#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">the rules for choosing a
|
|
browsing context given a browsing context name</a> using <var title="">target</var> as the name and <var title="">form browsing
|
|
context</var> as the context in which the algorithm is executed,
|
|
and let <var title="">target browsing context</var> be the
|
|
resulting <a href="#browsing-context">browsing context</a>.</li>
|
|
|
|
<li><p>If <var title="">target browsing context</var> was created
|
|
in the previous step, or if the <var title="">form document</var>
|
|
has not yet <a href="#completely-loaded">completely loaded</a>, then let <var title="">replace</var> be true. Otherwise, let it be
|
|
false.</li>
|
|
|
|
<li>
|
|
|
|
<p>Select the appropriate row in the table below based on the
|
|
value of <var title="">scheme</var> as given by the first cell of
|
|
each row. Then, select the appropriate cell on that row based on
|
|
the value of <var title="">method</var> as given in the first cell
|
|
of each column. Then, jump to the steps named in that cell and
|
|
defined below the table.</p>
|
|
|
|
<table><thead><tr><td>
|
|
<th> <a href="#attr-fs-method-get" title="attr-fs-method-GET">GET</a>
|
|
<th> <a href="#attr-fs-method-post" title="attr-fs-method-POST">POST</a>
|
|
<tbody><tr><th> <code title="">http</code>
|
|
<td> <a href="#submit-mutate-action" title="submit-mutate-action">Mutate action URL</a>
|
|
<td> <a href="#submit-body" title="submit-body">Submit as entity body</a>
|
|
<tr><th> <code title="">https</code>
|
|
<td> <a href="#submit-mutate-action" title="submit-mutate-action">Mutate action URL</a>
|
|
<td> <a href="#submit-body" title="submit-body">Submit as entity body</a>
|
|
<tr><th> <code title="">ftp</code>
|
|
<td> <a href="#submit-get-action" title="submit-get-action">Get action URL</a>
|
|
<td> <a href="#submit-get-action" title="submit-get-action">Get action URL</a>
|
|
<tr><th> <code title="">javascript</code>
|
|
<td> <a href="#submit-get-action" title="submit-get-action">Get action URL</a>
|
|
<td> <a href="#submit-get-action" title="submit-get-action">Get action URL</a>
|
|
<tr><th> <code title="">data</code>
|
|
<td> <a href="#submit-get-action" title="submit-get-action">Get action URL</a>
|
|
<td> <a href="#submit-data-post" title="submit-data-post">Post to data:</a>
|
|
<tr><th> <code title="">mailto</code>
|
|
<td> <a href="#submit-mailto-headers" title="submit-mailto-headers">Mail with headers</a>
|
|
<td> <a href="#submit-mailto-body" title="submit-mailto-body">Mail as body</a>
|
|
</table><p>If <var title="">scheme</var> is not one of those listed in
|
|
this table, then the behavior is not defined by this
|
|
specification. User agents should, in the absence of another
|
|
specification defining this, act in a manner analogous to that
|
|
defined in this specification for similar schemes.</p>
|
|
|
|
<p>The behaviors are as follows:</p>
|
|
|
|
<dl><dt><dfn id="submit-mutate-action" title="submit-mutate-action">Mutate action URL</dfn>
|
|
<dd>
|
|
|
|
<p>Let <var title="">query</var> be the result of encoding the
|
|
<var title="">form data set</var> using the <a href="#application-x-www-form-urlencoded-encoding-algorithm"><code title="">application/x-www-form-urlencoded</code> encoding
|
|
algorithm</a>, interpreted as a US-ASCII string.</p>
|
|
|
|
|
|
<p>Let <var title="">destination</var> be a new <a href="#url">URL</a>
|
|
that is equal to the <var title="">action</var> except that its
|
|
<a href="#url-query" title="url-query"><query></a> component is
|
|
replaced by <var title="">query</var> (adding a U+003F QUESTION
|
|
MARK character (?) if appropriate).</p>
|
|
|
|
<p><a href="#navigate">Navigate</a> <var title="">target
|
|
browsing context</var> to <var title="">destination</var>. If
|
|
<var title="">replace</var> is true, then <var title="">target
|
|
browsing context</var> must be navigated with <a href="#replacement-enabled">replacement
|
|
enabled</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="submit-body" title="submit-body">Submit as entity body</dfn>
|
|
<dd>
|
|
|
|
<p>Let <var title="">entity body</var> be the result of encoding
|
|
the <var title="">form data set</var> using the
|
|
<a href="#appropriate-form-encoding-algorithm">appropriate form encoding algorithm</a>.</p>
|
|
|
|
<p>Let <var title="">MIME type</var> be determined as
|
|
follows:</p>
|
|
|
|
<dl><dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</a></code></dt>
|
|
|
|
<dd>Let <var title="">MIME type</var> be "<code title="">application/x-www-form-urlencoded</code>".</dd>
|
|
|
|
<dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-formdata"><a href="#attr-fs-enctype-formdata">multipart/form-data</a></code></dt>
|
|
|
|
<dd>Let <var title="">MIME type</var> be the concatenation of
|
|
the string "<code title="">multipart/form-data;</code>", a
|
|
U+0020 SPACE character, the string "<code title="">boundary=</code>", and the <a href="#multipart-form-data-boundary-string"><code title="">multipart/form-data</code> boundary string</a>
|
|
generated by the <a href="#multipart-form-data-encoding-algorithm"><code title="">multipart/form-data</code> encoding
|
|
algorithm</a>.</dd>
|
|
|
|
<dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-text"><a href="#attr-fs-enctype-text">text/plain</a></code></dt>
|
|
|
|
<dd>Let <var title="">MIME type</var> be "<code title="">text/plain</code>".</dd>
|
|
|
|
</dl><p>Otherwise, <a href="#navigate">navigate</a> <var title="">target browsing context</var> to <var title="">action</var> using the HTTP method given by <var title="">method</var> and with <var title="">entity body</var>
|
|
as the entity body, of type <var title="">MIME type</var>. If
|
|
<var title="">replace</var> is true, then <var title="">target
|
|
browsing context</var> must be navigated with <a href="#replacement-enabled">replacement
|
|
enabled</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="submit-get-action" title="submit-get-action">Get action URL</dfn>
|
|
<dd>
|
|
|
|
<p><a href="#navigate">Navigate</a> <var title="">target
|
|
browsing context</var> to <var title="">action</var>. If <var title="">replace</var> is true, then <var title="">target
|
|
browsing context</var> must be navigated with <a href="#replacement-enabled">replacement
|
|
enabled</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="submit-data-post" title="submit-data-post">Post to data:</dfn>
|
|
<dd>
|
|
|
|
<p>Let <var title="">data</var> be the result of encoding the
|
|
<var title="">form data set</var> using the <a href="#appropriate-form-encoding-algorithm">appropriate
|
|
form encoding algorithm</a>.</p>
|
|
|
|
<p>If <var title="">action</var> contains the string "<code title="">%%%%</code>" (four U+0025 PERCENT SIGN characters),
|
|
then %-escape all bytes in <var title="">data</var> that, if
|
|
interpreted as US-ASCII, do not match the <code title="">unreserved</code> production in the URI Generic Syntax,
|
|
and then, treating the result as a US-ASCII string, further
|
|
%-escape all the U+0025 PERCENT SIGN characters in the resulting
|
|
string and replace the first occurrence of "<code title="">%%%%</code>" in <var title="">action</var> with the
|
|
resulting double-escaped string. <a href="#refsRFC3986">[RFC3986]</a></p>
|
|
|
|
<p>Otherwise, if <var title="">action</var> contains the string
|
|
"<code title="">%%</code>" (two U+0025 PERCENT SIGN characters
|
|
in a row, but not four), then %-escape all characters in <var title="">data</var> that, if interpreted as US-ASCII, do not
|
|
match the <code title="">unreserved</code> production in the URI
|
|
Generic Syntax, and then, treating the result as a US-ASCII
|
|
string, replace the first occurrence of "<code title="">%%</code>" in <var title="">action</var> with the
|
|
resulting escaped string. <a href="#refsRFC3986">[RFC3986]</a></p>
|
|
|
|
<p><a href="#navigate">Navigate</a> <var title="">target
|
|
browsing context</var> to the potentially modified <var title="">action</var> (which will be a <a href="#data-protocol" title="data
|
|
protocol"><code title="">data:</code> URL</a>). If <var title="">replace</var> is true, then <var title="">target
|
|
browsing context</var> must be navigated with <a href="#replacement-enabled">replacement
|
|
enabled</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="submit-mailto-headers" title="submit-mailto-headers">Mail with headers</dfn>
|
|
<dd>
|
|
|
|
<p>Let <var title="">headers</var> be the resulting encoding the
|
|
<var title="">form data set</var> using the <a href="#application-x-www-form-urlencoded-encoding-algorithm"><code title="">application/x-www-form-urlencoded</code> encoding
|
|
algorithm</a>, interpreted as a US-ASCII string.</p>
|
|
|
|
<p>Replace occurrences of U+002B PLUS SIGN characters (+) in
|
|
<var title="">headers</var> with the string "<code title="">%20</code>".</p>
|
|
|
|
<p>Let <var title="">destination</var> consist of all the
|
|
characters from the first character in <var title="">action</var> to the character immediately before the
|
|
first U+003F QUESTION MARK character (?), if any, or the end of
|
|
the string if there are none.</p>
|
|
|
|
<p>Append a single U+003F QUESTION MARK character (?) to <var title="">destination</var>.</p>
|
|
|
|
<p>Append <var title="">headers</var> to <var title="">destination</var>.</p>
|
|
|
|
<p><a href="#navigate">Navigate</a> <var title="">target
|
|
browsing context</var> to <var title="">destination</var>. If
|
|
<var title="">replace</var> is true, then <var title="">target
|
|
browsing context</var> must be navigated with <a href="#replacement-enabled">replacement
|
|
enabled</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="submit-mailto-body" title="submit-mailto-body">Mail as body</dfn>
|
|
<dd>
|
|
|
|
<p>Let <var title="">body</var> be the resulting encoding the
|
|
<var title="">form data set</var> using the <a href="#appropriate-form-encoding-algorithm">appropriate
|
|
form encoding algorithm</a> and then %-escaping all the bytes
|
|
in the resulting byte string that, when interpreted as US-ASCII,
|
|
do not match the <code title="">unreserved</code> production in
|
|
the URI Generic Syntax. <a href="#refsRFC3986">[RFC3986]</a></p>
|
|
|
|
<p>Let <var title="">destination</var> have the same value as
|
|
<var title="">action</var>.</p>
|
|
|
|
<p>If <var title="">destination</var> does not contain a U+003F
|
|
QUESTION MARK character (?), append a single U+003F QUESTION
|
|
MARK character (?) to <var title="">destination</var>. Otherwise, append a single U+0026
|
|
AMPERSAND character (&).</p>
|
|
|
|
<p>Append the string "<code title="">body=</code>" to <var title="">destination</var>.</p>
|
|
|
|
<p>Append <var title="">body</var>, interpreted as a US-ASCII
|
|
string, to <var title="">destination</var>.</p>
|
|
|
|
<p><a href="#navigate">Navigate</a> <var title="">target
|
|
browsing context</var> to <var title="">destination</var>. If
|
|
<var title="">replace</var> is true, then <var title="">target
|
|
browsing context</var> must be navigated with <a href="#replacement-enabled">replacement
|
|
enabled</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The <dfn id="appropriate-form-encoding-algorithm">appropriate form encoding algorithm</dfn> is
|
|
determined as follows:</p>
|
|
|
|
<dl><dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</a></code></dt>
|
|
|
|
<dd>Use the <a href="#application-x-www-form-urlencoded-encoding-algorithm"><code title="">application/x-www-form-urlencoded</code> encoding
|
|
algorithm</a>.</dd>
|
|
|
|
<dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-formdata"><a href="#attr-fs-enctype-formdata">multipart/form-data</a></code></dt>
|
|
|
|
<dd>Use the <a href="#multipart-form-data-encoding-algorithm"><code title="">multipart/form-data</code> encoding
|
|
algorithm</a>.</dd>
|
|
|
|
<dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-text"><a href="#attr-fs-enctype-text">text/plain</a></code></dt>
|
|
|
|
<dd>Use the <a href="#text-plain-encoding-algorithm"><code title="">text/plain</code> encoding
|
|
algorithm</a>.</dd>
|
|
|
|
</dl></li>
|
|
|
|
</ol><h5 id="constructing-form-data-set"><span class="secno">4.10.22.4 </span>Constructing the form data set</h5>
|
|
|
|
<p>The algorithm to <dfn id="constructing-the-form-data-set" title="constructing the form data
|
|
set">construct the form data set</dfn> for a form <var title="">form</var> is as follows:</p>
|
|
|
|
<ol><li><p>Let <var title="">controls</var> be a list of all the <a href="#category-submit" title="category-submit">submittable elements</a> whose
|
|
<a href="#form-owner">form owner</a> is <var title="">form</var>, in <a href="#tree-order">tree
|
|
order</a>.</li>
|
|
|
|
<li><p>Let the <var title="">form data set</var> be a list of
|
|
name-value-type tuples, initially empty.</li>
|
|
|
|
<li>
|
|
|
|
<p><i>Loop</i>: For each element <var title="">field</var> in <var title="">controls</var>, in <a href="#tree-order">tree order</a>, run the
|
|
following substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If any of the following conditions are met, then skip these
|
|
substeps for this element:</p>
|
|
|
|
<ul><li>The <var title="">field</var> element has a
|
|
<code><a href="#the-datalist-element">datalist</a></code> element ancestor.</li>
|
|
|
|
<li>The <var title="">field</var> element is <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>.</li>
|
|
|
|
<li>The <var title="">field</var> element is a <a href="#concept-button" title="concept-button">button</a> but it is not <var title="">submitter</var>.</li>
|
|
|
|
<li>The <var title="">field</var> element is an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state and
|
|
whose <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> is
|
|
false.</li>
|
|
|
|
<li>The <var title="">field</var> element is an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a> state and
|
|
whose <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> is
|
|
false.</li>
|
|
|
|
<li>The <var title="">field</var> element is not an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, and
|
|
either the <var title="">field</var> element does not have a
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute specified, or
|
|
its <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute's value is
|
|
the empty string.</li>
|
|
|
|
<li>The <var title="">field</var> element is an
|
|
<code><a href="#the-object-element">object</a></code> element that is not using a
|
|
<a href="#plugin">plugin</a>.</li>
|
|
|
|
</ul><p>Otherwise, process <var title="">field</var> as follows:</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">type</var> be the value of the <code title="">type</code> IDL attribute of <var title="">field</var>.</li>
|
|
<li>
|
|
|
|
<p>If the <var title="">field</var> element is an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state,
|
|
then run these further nested substeps:</p>
|
|
|
|
<ol><li><p>If the <var title="">field</var> element has a <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute specified and its
|
|
value is not the empty string, let <var title="">name</var> be
|
|
that value followed by a single U+002E FULL STOP character (.).
|
|
Otherwise, let <var title="">name</var> be the empty
|
|
string.</li>
|
|
|
|
<li><p>Let <var title="">name<sub title="">x</sub></var> be the
|
|
string consisting of the concatenation of <var title="">name</var> and a single U+0078 LATIN SMALL LETTER X
|
|
character (x).</li>
|
|
|
|
<li><p>Let <var title="">name<sub title="">y</sub></var> be the
|
|
string consisting of the concatenation of <var title="">name</var> and a single U+0079 LATIN SMALL LETTER Y
|
|
character (y).</li>
|
|
|
|
<li><p>The <var title="">field</var> element is <var title="">submitter</var>, and before this algorithm was invoked
|
|
the user <a href="#concept-input-type-image-coordinate" title="concept-input-type-image-coordinate">indicated a
|
|
coordinate</a>. Let <var title="">x</var> be the <var title="">x</var>-component of the coordinate selected by the
|
|
user, and let <var title="">y</var> be the <var title="">y</var>-component of the coordinate selected by the
|
|
user.</li>
|
|
|
|
<li><p>Append an entry to the <var title="">form data set</var>
|
|
with the name <var title="">name<sub title="">x</sub></var>,
|
|
the value <var title="">x</var>, and the type <var title="">type</var>.</li>
|
|
|
|
<li><p>Append an entry to the <var title="">form data set</var>
|
|
with the name <var title="">name<sub title="">y</sub></var> and
|
|
the value <var title="">y</var>, and the type <var title="">type</var>.</li>
|
|
|
|
<li><p>Skip the remaining substeps for this element: if there
|
|
are any more elements in <var title="">controls</var>, return
|
|
to the top of the <i>loop</i> step, otherwise, jump to the
|
|
<i>end</i> step below.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Let <var title="">name</var> be the value of the <var title="">field</var> element's <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute.</li>
|
|
|
|
<li><p>If the <var title="">field</var> element is a
|
|
<code><a href="#the-select-element">select</a></code> element, then for each <code><a href="#the-option-element">option</a></code>
|
|
element in the <code><a href="#the-select-element">select</a></code> element whose <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> is true,
|
|
append an entry to the <var title="">form data set</var> with the
|
|
<var title="">name</var> as the name, the <a href="#concept-option-value" title="concept-option-value">value</a> of the
|
|
<code><a href="#the-option-element">option</a></code> element as the value, and <var title="">type</var> as the type.</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, if the <var title="">field</var> element is an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state or the
|
|
<a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a> state,
|
|
then run these further nested substeps:</p>
|
|
|
|
<ol><li><p>If the <var title="">field</var> element has a <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute specified, then
|
|
let <var title="">value</var> be the value of that attribute;
|
|
otherwise, let <var title="">value</var> be the string
|
|
"<code title="">on</code>".</li>
|
|
|
|
<li><p>Append an entry to the <var title="">form data set</var>
|
|
with <var title="">name</var> as the name, <var title="">value</var> as the value, and <var title="">type</var>
|
|
as the type.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Otherwise, if the <var title="">field</var> element is an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#file-upload-state" title="attr-input-type-file">File Upload</a> state, then for
|
|
each file <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected</a> in the
|
|
<code><a href="#the-input-element">input</a></code> element, append an entry to the <var title="">form data set</var> with the <var title="">name</var> as
|
|
the name, the file (consisting of the name, the type, and the
|
|
body) as the value, and <var title="">type</var> as the type. If
|
|
there are no <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>,
|
|
then append an entry to the <var title="">form data set</var>
|
|
with the <var title="">name</var> as the name, the empty string
|
|
as the value, and <code>application/octet-stream</code> as the
|
|
type.</li>
|
|
|
|
|
|
<li><p>Otherwise, if the <var title="">field</var> element is an
|
|
<code><a href="#the-object-element">object</a></code> element: try to obtain a form submission
|
|
value from the <a href="#plugin">plugin</a>,
|
|
and if that is successful, append an entry to the <var title="">form data set</var> with <var title="">name</var> as the
|
|
name, the returned form submission value as the value, and the
|
|
string "<code title="">object</code>" as the type.</li>
|
|
|
|
<li><p>Otherwise, append an entry to the <var title="">form data
|
|
set</var> with <var title="">name</var> as the name, the <a href="#concept-fe-value" title="concept-fe-value">value</a> of the <var title="">field</var> element as the value, and <var title="">type</var> as the type.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the element has a <a href="#form-control-dirname-attribute">form control <code title="">dirname</code> attribute</a>, and that attribute's
|
|
value is not the empty string, then run these substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">dirname</var> be the value of the
|
|
element's <code title="">dirname</code> attribute.</li>
|
|
|
|
<li><p>Let <var title="">dir</var> be the string "<code title="">ltr</code>" if <a href="#the-directionality">the directionality</a> of the
|
|
element is '<a href="#concept-ltr" title="concept-ltr">ltr</a>', and "<code title="">rtl</code>" otherwise (i.e. when <a href="#the-directionality">the
|
|
directionality</a> of the element is '<a href="#concept-rtl" title="concept-rtl">rtl</a>').</li>
|
|
|
|
<li><p>Append an entry to the <var title="">form data set</var>
|
|
with <var title="">dirname</var> as the name, <var title="">dir</var> as the value, and the string "<code title="">direction</code>" as the type.</li>
|
|
|
|
</ol><p class="note">An element can only have a <a href="#form-control-dirname-attribute">form control
|
|
<code title="">dirname</code> attribute</a> if it is a
|
|
<code><a href="#the-textarea-element">textarea</a></code> element or an <code><a href="#the-input-element">input</a></code> element
|
|
whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in
|
|
either the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state
|
|
or the <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a>
|
|
state.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p><i>End</i>: Return the <var title="">form data
|
|
step</var>.</li>
|
|
|
|
</ol><h5 id="url-encoded-form-data"><span class="secno">4.10.22.5 </span>URL-encoded form data</h5>
|
|
|
|
<p>The <dfn id="application-x-www-form-urlencoded-encoding-algorithm"><code title="">application/x-www-form-urlencoded</code> encoding
|
|
algorithm</dfn> is as follows:</p>
|
|
|
|
<ol><li><p>Let <var title="">result</var> be the empty string.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <code><a href="#the-form-element">form</a></code> element has an <code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code> attribute,
|
|
then, taking into account the characters found in the <var title="">form data set</var>'s names and values, and the character
|
|
encodings supported by the user agent, select a character encoding
|
|
from the list given in the <code><a href="#the-form-element">form</a></code>'s <code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code> attribute
|
|
that is an <a href="#ascii-compatible-character-encoding">ASCII-compatible character encoding</a>. If
|
|
none of the encodings are supported, or if none are listed, then
|
|
let the selected character encoding be UTF-8.</p>
|
|
|
|
<p>Otherwise, if the <a href="#document-s-character-encoding">document's character encoding</a> is
|
|
an <a href="#ascii-compatible-character-encoding">ASCII-compatible character encoding</a>, then that is
|
|
the selected character encoding.</p>
|
|
|
|
<p>Otherwise, let the selected character encoding be UTF-8.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">charset</var> be the <a href="#preferred-mime-name">preferred MIME
|
|
name</a> of the selected character encoding.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each entry in the <var title="">form data set</var>,
|
|
perform these substeps:</p>
|
|
|
|
<ol><li><p>If the entry's name is "<code title="attr-fe-name-charset"><a href="#attr-fe-name-charset">_charset_</a></code>"
|
|
and its type is "<code title="">hidden</code>", replace its value
|
|
with <var title="">charset</var>.</li>
|
|
|
|
<li><p>If the entry's type is "<code title="">file</code>",
|
|
replace its value with the file's filename only.</li>
|
|
<li><p>For each character in the entry's name and value that
|
|
cannot be expressed using the selected character encoding,
|
|
replace the character by a string consisting of a U+0026
|
|
AMPERSAND character (&), a U+0023 NUMBER SIGN character (#),
|
|
one or more characters in the range U+0030 DIGIT ZERO (0) to
|
|
U+0039 DIGIT NINE (9) representing the Unicode code point of the
|
|
character in base ten, and finally a U+003B SEMICOLON character
|
|
(;).</li>
|
|
|
|
|
|
<li>
|
|
|
|
<p>For each character in the entry's name and value, apply the
|
|
appropriate subsubsteps from the following list:</p>
|
|
|
|
<dl class="switch"><dt>The character is a U+0020 SPACE character</dt>
|
|
|
|
<dd>Replace the character with a single U+002B PLUS SIGN
|
|
character (+).</dd>
|
|
|
|
|
|
|
|
|
|
<dt>If the character isn't in the range U+0020, U+002A,
|
|
U+002D, U+002E, U+0030 to U+0039, U+0041 to U+005A, U+005F,
|
|
U+0061 to U+007A</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Replace the character with a string formed as follows:</p>
|
|
|
|
<ol><li><p>Let <var title="">s</var> be an empty string.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each byte <var title="">b</var> of the character when
|
|
expressed in the selected character encoding in turn, run
|
|
the appropriate subsubsubstep from the list below:</p>
|
|
|
|
<dl class="switch"><dt>If the byte is in the range 0x20, 0x2A, 0x2D, 0x2E,
|
|
0x30 to 0x39, 0x41 to 0x5A, 0x5F, 0x61 to 0x7A</dt>
|
|
|
|
<dd><p>Append to <var title="">s</var> the Unicode
|
|
character with the code point equal to the byte.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>Append to the string a U+0025 PERCENT SIGN character
|
|
(%) followed by two characters in the ranges U+0030 DIGIT
|
|
ZERO (0) to U+0039 DIGIT NINE (9) and U+0041 LATIN CAPITAL
|
|
LETTER A to U+0046 LATIN CAPITAL LETTER F representing the
|
|
hexadecimal value of the byte (zero-padded if
|
|
necessary).</dd>
|
|
|
|
</dl></li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>Leave the character as is.</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>If the entry's name is "<code title="attr-fe-name-isindex"><a href="#attr-fe-name-isindex">isindex</a></code>",
|
|
its type is "<code title="">text</code>", and this is the first
|
|
entry in the <var title="">form data set</var>, then append the
|
|
value to <var title="">result</var> and skip the rest of the
|
|
substeps for this entry, moving on to the next entry, if any, or
|
|
the next step in the overall algorithm otherwise.</li>
|
|
|
|
<li><p>If this is not the first entry, append a single U+0026
|
|
AMPERSAND character (&) to <var title="">result</var>.</li>
|
|
|
|
<li><p>Append the entry's name to <var title="">result</var>.</li>
|
|
|
|
<li><p>Append a single U+003D EQUALS SIGN character (=) to <var title="">result</var>.</li>
|
|
|
|
<li><p>Append the entry's value to <var title="">result</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Encode <var title="">result</var> as US-ASCII and return the
|
|
resulting byte stream.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h5 id="multipart-form-data"><span class="secno">4.10.22.6 </span>Multipart form data</h5>
|
|
|
|
|
|
|
|
|
|
|
|
<p>The <dfn id="multipart-form-data-encoding-algorithm"><code title="">multipart/form-data</code> encoding
|
|
algorithm</dfn> is as follows:</p>
|
|
|
|
<ol><li><p>Let <var title="">result</var> be the empty string.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the algorithm was invoked with an explicit character
|
|
encoding, let the selected character encoding be that encoding.
|
|
(This algorithm is used by other specifications, which provide an
|
|
explicit character encoding to avoid the dependency on the
|
|
<code><a href="#the-form-element">form</a></code> element described in the next paragraph.)</p>
|
|
|
|
<p>Otherwise, if the <code><a href="#the-form-element">form</a></code> element has an <code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code> attribute,
|
|
then, taking into account the characters found in the <var title="">form data set</var>'s names and values, and the character
|
|
encodings supported by the user agent, select a character encoding
|
|
from the list given in the <code><a href="#the-form-element">form</a></code>'s <code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code> attribute
|
|
that is an <a href="#ascii-compatible-character-encoding">ASCII-compatible character encoding</a>. If
|
|
none of the encodings are supported, or if none are listed, then
|
|
let the selected character encoding be UTF-8.</p>
|
|
|
|
<p>Otherwise, if the <a href="#document-s-character-encoding">document's character encoding</a> is
|
|
an <a href="#ascii-compatible-character-encoding">ASCII-compatible character encoding</a>, then that is
|
|
the selected character encoding.</p>
|
|
|
|
<p>Otherwise, let the selected character encoding be UTF-8.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">charset</var> be the <a href="#preferred-mime-name">preferred MIME
|
|
name</a> of the selected character encoding.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each entry in the <var title="">form data set</var>,
|
|
perform these substeps:</p>
|
|
|
|
<ol><li><p>If the entry's name is "<code title="attr-fe-name-charset"><a href="#attr-fe-name-charset">_charset_</a></code>" and its type is
|
|
"<code title="">hidden</code>", replace its value with <var title="">charset</var>.</li>
|
|
|
|
|
|
<li><p>For each character in the entry's name and value that
|
|
cannot be expressed using the selected character encoding,
|
|
replace the character by a string consisting of a U+0026
|
|
AMPERSAND character (&), a U+0023 NUMBER SIGN character (#),
|
|
one or more characters in the range U+0030 DIGIT ZERO (0) to
|
|
U+0039 DIGIT NINE (9) representing the Unicode code point of the
|
|
character in base ten, and finally a U+003B SEMICOLON character
|
|
(;).</li>
|
|
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>Encode the (now mutated) <var title="">form data set</var>
|
|
using the rules described by RFC 2388, <cite>Returning Values from
|
|
Forms: <code title="">multipart/form-data</code></cite>, and
|
|
return the resulting byte stream. <a href="#refsRFC2388">[RFC2388]</a></p>
|
|
|
|
<p>Each entry in the <var title="">form data set</var> is a
|
|
<i>field</i>, the name of the entry is the <i>field name</i> and
|
|
the value of the entry is the <i>field value</i>.</p>
|
|
|
|
<p>The order of parts must be the same as the order of fields in
|
|
the <var title="">form data set</var>. Multiple entries with the
|
|
same name must be treated as distinct fields.</p>
|
|
|
|
<p class="note">In particular, this means that multiple files
|
|
submitted as part of a single <code title=""><input type=file multiple></code> element
|
|
will result in each file having its own field; the "sets of files"
|
|
feature ("<code title="">multipart/mixed</code>") of RFC 2388 is
|
|
not used.</p>
|
|
|
|
<p>The parts of the generated <code title="">multipart/form-data</code> resource that correspond to
|
|
non-file fields must not have a <code><a href="#content-type">Content-Type</a></code> header
|
|
specified. Their names and values must be encoded using the
|
|
character encoding selected above (field names in particular do
|
|
not get converted to a 7-bit safe encoding as suggested in RFC
|
|
2388).</p>
|
|
|
|
<p>The boundary used by the user agent in generating the return
|
|
value of this algorithm is the <dfn id="multipart-form-data-boundary-string"><code title="">multipart/form-data</code> boundary string</dfn>. (This
|
|
value is used to generate the MIME type of the form submission
|
|
payload generated by this algorithm.)</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h5 id="plain-text-form-data"><span class="secno">4.10.22.7 </span>Plain text form data</h5>
|
|
|
|
<p>The <dfn id="text-plain-encoding-algorithm"><code title="">text/plain</code> encoding
|
|
algorithm</dfn> is as follows:</p>
|
|
|
|
<ol><li><p>Let <var title="">result</var> be the empty string.</li>
|
|
|
|
<li>
|
|
|
|
|
|
<p>If the <code><a href="#the-form-element">form</a></code> element has an <code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code> attribute,
|
|
then, taking into account the characters found in the <var title="">form data set</var>'s names and values, and the character
|
|
encodings supported by the user agent, select a character encoding
|
|
from the list given in the <code><a href="#the-form-element">form</a></code>'s <code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code> attribute.
|
|
If none of the encodings are supported, or if none are listed,
|
|
then let the selected character encoding be UTF-8.</p>
|
|
|
|
<p>Otherwise, the selected character encoding is the
|
|
<a href="#document-s-character-encoding">document's character encoding</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">charset</var> be the <a href="#preferred-mime-name">preferred MIME
|
|
name</a> of the selected character encoding.</li>
|
|
|
|
<li><p>If the entry's name is "<code title="attr-fe-name-charset"><a href="#attr-fe-name-charset">_charset_</a></code>" and its type is
|
|
"<code title="">hidden</code>", replace its value with <var title="">charset</var>.</li>
|
|
|
|
<li><p>If the entry's type is "<code title="">file</code>", replace
|
|
its value with the file's filename only.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each entry in the <var title="">form data set</var>,
|
|
perform these substeps:</p>
|
|
|
|
<ol><li><p>Append the entry's name to <var title="">result</var>.</li>
|
|
|
|
<li><p>Append a single U+003D EQUALS SIGN character (=) to <var title="">result</var>.</li>
|
|
|
|
<li><p>Append the entry's value to <var title="">result</var>.</li>
|
|
|
|
<li><p>Append a U+000D CARRIAGE RETURN (CR) U+000A LINE FEED (LF)
|
|
character pair to <var title="">result</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Encode <var title="">result</var> using the selected
|
|
character encoding and return the resulting byte stream.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h4 id="resetting-a-form"><span class="secno">4.10.23 </span>Resetting a form</h4>
|
|
|
|
<p>When a <code><a href="#the-form-element">form</a></code> element <var title="">form</var> is <dfn id="concept-form-reset" title="concept-form-reset">reset</dfn>, the user agent must
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-reset">reset</code>, that is cancelable, at <var title="">form</var>, and then, if that event is not canceled, must
|
|
invoke the <a href="#concept-form-reset-control" title="concept-form-reset-control">reset
|
|
algorithm</a> of each <a href="#category-reset" title="category-reset">resettable
|
|
element</a> whose <a href="#form-owner">form owner</a> is <var title="">form</var>.</p>
|
|
|
|
<p>Each <a href="#category-reset" title="category-reset">resettable element</a>
|
|
defines its own <dfn id="concept-form-reset-control" title="concept-form-reset-control">reset
|
|
algorithm</dfn>. Changes made to form controls as part of these
|
|
algorithms do not count as changes caused by the user (and thus,
|
|
e.g., do not cause <code title="event-input">input</code> events to
|
|
fire).</p>
|
|
|
|
</div><h3 id="interactive-elements"><span class="secno">4.11 </span>Interactive elements</h3><h4 id="the-details-element"><span class="secno">4.11.1 </span>The <dfn><code>details</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#sectioning-root">Sectioning root</a>.</dd>
|
|
<dd><a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>One <code><a href="#the-summary-element">summary</a></code> element followed by <a href="#flow-content">flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-details-open"><a href="#attr-details-open">open</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmldetailselement">HTMLDetailsElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-details-open" title="dom-details-open">open</a>;
|
|
};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-details-element">details</a></code> element <a href="#represents">represents</a> a
|
|
disclosure widget from which the user can obtain additional
|
|
information or controls.<p class="note">The <code><a href="#the-details-element">details</a></code> element is not appropriate
|
|
for footnotes. Please see <a href="#footnotes">the section on
|
|
footnotes</a> for details on how to mark up footnotes.<p>The <span class="impl">first</span> <code><a href="#the-summary-element">summary</a></code> element
|
|
child of the element, if any, <a href="#represents">represents</a> the summary or
|
|
legend of the details. <span class="impl">If there is no child
|
|
<code><a href="#the-summary-element">summary</a></code> element, the user agent should provide its own
|
|
legend (e.g. "Details").</span><p>The <dfn id="attr-details-open" title="attr-details-open"><code>open</code></dfn>
|
|
content attribute is a <a href="#boolean-attribute">boolean attribute</a>. If present,
|
|
it indicates that the details are to be shown to the user. If the
|
|
attribute is absent, the details are not to be shown.<div class="impl">
|
|
|
|
<p>When the element is created, if the attribute is absent, the
|
|
details should be hidden; if the attribute is absent, the details
|
|
should be shown. Subsequently, 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 agent should allow the user to request that the details
|
|
be shown or hidden. To honor a request for the details to be shown,
|
|
the user agent must set the <code title="attr-details-open"><a href="#attr-details-open">open</a></code> attribute on the element to
|
|
the value <code title="">open</code>. To honor a request for the
|
|
details to be hidden, the user agent must remove the <code title="attr-details-open"><a href="#attr-details-open">open</a></code> attribute from the
|
|
element.</p>
|
|
|
|
<p>The <dfn id="dom-details-open" title="dom-details-open"><code>open</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-details-open"><a href="#attr-details-open">open</a></code> content attribute.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following example shows the <code><a href="#the-details-element">details</a></code> element
|
|
being used to hide technical details in a progress report.</p>
|
|
|
|
<pre><section class="progress window">
|
|
<h1>Copying "Really Achieving Your Childhood Dreams"</h1>
|
|
<details>
|
|
<summary>Copying... <progress max="375505392" value="97543282"></progress> 25%</summary>
|
|
<dl>
|
|
<dt>Transfer rate:</dt> <dd>452KB/s</dd>
|
|
<dt>Local filename:</dt> <dd>/home/rpausch/raycd.m4v</dd>
|
|
<dt>Remote filename:</dt> <dd>/var/www/lectures/raycd.m4v</dd>
|
|
<dt>Duration:</dt> <dd>01:16:27</dd>
|
|
<dt>Color profile:</dt> <dd>SD (6-1-6)</dd>
|
|
<dt>Dimensions:</dt> <dd>320×240</dd>
|
|
</dl>
|
|
</details>
|
|
</section></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following shows how a <code><a href="#the-details-element">details</a></code> element can be
|
|
used to hide some controls by default:</p>
|
|
|
|
<pre><details>
|
|
<summary><label for=fn>Name & Extension:</label></summary>
|
|
<p><input type=text id=fn name=fn value="Pillar Magazine.pdf">
|
|
<p><label><input type=checkbox name=ext checked> Hide extension</label>
|
|
</details></pre>
|
|
|
|
<p>One could use this in conjunction with other <code><a href="#the-details-element">details</a></code>
|
|
in a list to allow the user to collapse a set of fields down to a
|
|
small set of headings, with the ability to open each one.</p>
|
|
|
|
<p class="details-example"><img alt="" height="611" src="sample-details-1.png" width="345"><img alt="" height="666" src="sample-details-2.png" width="345"></p>
|
|
|
|
<p>In these examples, the summary really just summarises what the
|
|
controls can change, and not the actual values, which is less than
|
|
ideal.</p>
|
|
|
|
</div><h4 id="the-summary-element"><span class="secno">4.11.2 </span>The <dfn><code>summary</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd>None.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>As the first child of a <code><a href="#the-details-element">details</a></code> element.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>Uses <code><a href="#htmlelement">HTMLElement</a></code>.</dd>
|
|
</dl><p>The <code><a href="#the-summary-element">summary</a></code> element <a href="#represents">represents</a> a
|
|
summary, caption, or legend for the rest of the contents of the
|
|
<code><a href="#the-summary-element">summary</a></code> element's parent <code><a href="#the-details-element">details</a></code>
|
|
element<span class="impl">, if any</span>.<h4 id="the-command-element"><span class="secno">4.11.3 </span>The <dfn id="the-command"><code>command</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#metadata-content">Metadata content</a>.</dd>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd><a href="#phrasing-content">Phrasing content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#metadata-content">metadata content</a> is expected.</dd>
|
|
<dd>Where <a href="#phrasing-content">phrasing content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Empty.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-command-type"><a href="#attr-command-type">type</a></code></dd>
|
|
<dd><code title="attr-command-label"><a href="#attr-command-label">label</a></code></dd>
|
|
<dd><code title="attr-command-icon"><a href="#attr-command-icon">icon</a></code></dd>
|
|
<dd><code title="attr-command-disabled"><a href="#attr-command-disabled">disabled</a></code></dd>
|
|
<dd><code title="attr-command-checked"><a href="#attr-command-checked">checked</a></code></dd>
|
|
<dd><code title="attr-command-radiogroup"><a href="#attr-command-radiogroup">radiogroup</a></code></dd>
|
|
|
|
<dd>Also, the <code title="attr-command-title"><a href="#attr-command-title">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="#dom-command-type" title="dom-command-type">type</a>;
|
|
attribute DOMString <a href="#dom-command-label" title="dom-command-label">label</a>;
|
|
attribute DOMString <a href="#dom-command-icon" title="dom-command-icon">icon</a>;
|
|
attribute boolean <a href="#dom-command-disabled" title="dom-command-disabled">disabled</a>;
|
|
attribute boolean <a href="#dom-command-checked" title="dom-command-checked">checked</a>;
|
|
attribute DOMString <a href="#dom-command-radiogroup" title="dom-command-radiogroup">radiogroup</a>;};</pre>
|
|
</dd>
|
|
</dl><p>The <code><a href="#the-command-element">command</a></code> element represents a command that the user
|
|
can invoke.<p>A command can be part of a context menu or toolbar, using the
|
|
<code><a href="#the-menu-element">menu</a></code> element, or can be put anywhere else in the page,
|
|
to define a keyboard shortcut.</p><p>The <dfn id="attr-command-type" 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>The attribute is an <a href="#enumerated-attribute">enumerated attribute</a> with three
|
|
keywords and states. The "<dfn id="attr-command-type-keyword-command" title="attr-command-type-keyword-command"><code>command</code></dfn>"
|
|
keyword maps to the <a href="#attr-command-type-state-command" title="attr-command-type-state-command">Command</a> state, the
|
|
"<dfn id="attr-command-type-keyword-checkbox" title="attr-command-type-keyword-checkbox"><code>checkbox</code></dfn>"
|
|
keyword maps to the <a href="#attr-command-type-state-checkbox" title="attr-command-type-state-checkbox">Checkbox</a> state, and
|
|
the "<dfn id="attr-command-type-keyword-radio" title="attr-command-type-keyword-radio"><code>radio</code></dfn>"
|
|
keyword maps to the <a href="#attr-command-type-state-radio" title="attr-command-type-state-radio">Radio</a> state. The
|
|
<i>missing value default</i> is the <a href="#attr-command-type-state-command" title="attr-command-type-state-command">Command</a> state.<dl><dt>The <dfn id="attr-command-type-state-command" title="attr-command-type-state-command">Command</dfn> state</dt>
|
|
|
|
<dd><p>The element <a href="#represents">represents</a> a normal command with an associated action.</dd>
|
|
|
|
<dt>The <dfn id="attr-command-type-state-checkbox" title="attr-command-type-state-checkbox">Checkbox</dfn> state</dt>
|
|
|
|
<dd><p>The element <a href="#represents">represents</a> a state or option that can be toggled.</dd>
|
|
|
|
<dt>The <dfn id="attr-command-type-state-radio" title="attr-command-type-state-radio">Radio</dfn> state</dt>
|
|
|
|
<dd><p>The element <a href="#represents">represents</a> a selection of one item from a list of items.</dd>
|
|
|
|
</dl><p>The <dfn id="attr-command-label" title="attr-command-label"><code>label</code></dfn>
|
|
attribute gives the name of the command, as shown to the user. The
|
|
<code title="attr-command-label"><a href="#attr-command-label">label</a></code> attribute must be
|
|
specified and must have a value that is not the empty string.<p>The <dfn id="attr-command-title" 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>The <dfn id="attr-command-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
|
|
<a href="#valid-non-empty-url-potentially-surrounded-by-spaces">valid non-empty URL potentially surrounded by
|
|
spaces</a>. <span class="impl">To obtain the <a href="#absolute-url">absolute
|
|
URL</a> of the icon when the attribute's value is not the empty
|
|
string, the attribute's value must be <a href="#resolve-a-url" title="resolve a
|
|
url">resolved</a> relative to the element. When the attribute is
|
|
absent, or its value is the empty string, or <a href="#resolve-a-url" title="resolve a
|
|
url">resolving</a> its value fails, there is no icon.</span></p><p>The <dfn id="attr-command-disabled" title="attr-command-disabled"><code>disabled</code></dfn> attribute
|
|
is a <a href="#boolean-attribute">boolean attribute</a> that, if present, indicates that
|
|
the command is not available in the current state.<p class="note">The distinction between <code title="attr-command-disabled"><a href="#attr-command-disabled">disabled</a></code> and <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> is subtle. A command would be
|
|
disabled if, in the same context, it could be enabled if only
|
|
certain aspects of the situation were changed. A command would 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>The <dfn id="attr-command-checked" title="attr-command-checked"><code>checked</code></dfn>
|
|
attribute is a <a href="#boolean-attribute">boolean attribute</a> that, if present,
|
|
indicates that the command is selected. The attribute must be
|
|
omitted unless the <code title="attr-command-type"><a href="#attr-command-type">type</a></code>
|
|
attribute is in either the <a href="#attr-command-type-state-checkbox" title="attr-command-type-state-checkbox">Checkbox</a> state or
|
|
the <a href="#attr-command-type-state-radio" title="attr-command-type-state-radio">Radio</a>
|
|
state.<p>The <dfn id="attr-command-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="#attr-command-type">type</a></code> attribute has the value "<code title="">radio</code>". The scope of the name is the child list of
|
|
the parent element. The attribute must be omitted unless the <code title="attr-command-type"><a href="#attr-command-type">type</a></code> attribute is in the <a href="#attr-command-type-state-radio" title="attr-command-type-state-radio">Radio</a> state.</p><div class="impl">
|
|
|
|
<p>The <dfn id="dom-command-type" title="dom-command-type"><code>type</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name, <a href="#limited-to-only-known-values">limited to only known values</a>.</p>
|
|
|
|
<p>The <dfn id="dom-command-label" title="dom-command-label"><code>label</code></dfn>, <dfn id="dom-command-icon" title="dom-command-icon"><code>icon</code></dfn>, <dfn id="dom-command-disabled" title="dom-command-disabled"><code>disabled</code></dfn>, <dfn id="dom-command-checked" title="dom-command-checked"><code>checked</code></dfn>, and <dfn id="dom-command-radiogroup" title="dom-command-radiogroup"><code>radiogroup</code></dfn> IDL attributes must <a href="#reflect">reflect</a> the respective content
|
|
attributes of the same name.</p>
|
|
|
|
<p>The element's <a href="#activation-behavior">activation behavior</a> depends on the
|
|
value of the <code title="attr-command-type"><a href="#attr-command-type">type</a></code> attribute
|
|
of the element, as follows:</p>
|
|
|
|
<dl class="switch"><dt>If the <code title="attr-command-type"><a href="#attr-command-type">type</a></code> attribute is
|
|
in the <a href="#attr-command-type-state-checkbox" title="attr-command-type-state-checkbox">Checkbox</a> state</dt>
|
|
|
|
<dd><p>If the element has a <code title="attr-command-checked"><a href="#attr-command-checked">checked</a></code> attribute, the UA must
|
|
remove that attribute. Otherwise, the UA must add a <code title="attr-command-checked"><a href="#attr-command-checked">checked</a></code> attribute, with the
|
|
literal value <code title="">checked</code>. The UA must then
|
|
<a href="#fire-a-click-event">fire a <code title="event-click">click</code> event</a> at the
|
|
element.</dd>
|
|
|
|
|
|
<dt>If the <code title="attr-command-type"><a href="#attr-command-type">type</a></code> attribute is
|
|
in the <a href="#attr-command-type-state-radio" title="attr-command-type-state-radio">Radio</a> state</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="#the-command-element">command</a></code> element, if that element has a <code title="attr-command-radiogroup"><a href="#attr-command-radiogroup">radiogroup</a></code> attribute whose
|
|
value exactly matches the current element's (treating missing <code title="attr-command-radiogroup"><a href="#attr-command-radiogroup">radiogroup</a></code> attributes as if
|
|
they were the empty string), and has a <code title="attr-command-checked"><a href="#attr-command-checked">checked</a></code> attribute, must remove
|
|
that attribute.</p>
|
|
|
|
<p>Then, the element's <code title="attr-command-checked"><a href="#attr-command-checked">checked</a></code> attribute attribute
|
|
must be set to the literal value <code title="">checked</code> and
|
|
the user agent must <a href="#fire-a-click-event">fire a <code title="event-click">click</code>
|
|
event</a> at the element.</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>The element has no <a href="#activation-behavior">activation behavior</a>.</dd>
|
|
|
|
</dl><p class="note">Firing a synthetic <code title="event-click"><a href="#event-click">click</a></code> event at the element does not cause
|
|
any of the actions described above to happen.</p>
|
|
|
|
|
|
</div><p class="note"><code><a href="#the-command-element">command</a></code> elements are not rendered
|
|
unless they <a href="#the-menu-element" title="menu">form part of a menu</a>.<div class="example">
|
|
|
|
<p>Here is an example of a toolbar with three buttons that let the
|
|
user toggle between left, center, and right alignment. One could
|
|
imagine such a toolbar as part of a text editor. The toolbar also
|
|
has a separator followed by another button labeled "Publish",
|
|
though that button is disabled.</p>
|
|
|
|
<pre><menu type="toolbar">
|
|
<command type="radio" radiogroup="alignment" checked="checked"
|
|
label="Left" icon="icons/alL.png" onclick="setAlign('left')">
|
|
<command type="radio" radiogroup="alignment"
|
|
label="Center" icon="icons/alC.png" onclick="setAlign('center')">
|
|
<command type="radio" radiogroup="alignment"
|
|
label="Right" icon="icons/alR.png" onclick="setAlign('right')">
|
|
<hr>
|
|
<command type="command" disabled
|
|
label="Publish" icon="icons/pub.png" onclick="publish()">
|
|
</menu></pre>
|
|
|
|
</div><h4 id="the-menu-element"><span class="secno">4.11.4 </span>The <dfn id="menus"><code>menu</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
|
|
<dd><a href="#flow-content">Flow content</a>.</dd>
|
|
<dd>If the element's <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute is in the <a href="#toolbar-state" title="toolbar state">toolbar</a> state: <a href="#interactive-content">Interactive content</a>.</dd>
|
|
<dt>Contexts in which this element can be used:</dt>
|
|
<dd>Where <a href="#flow-content">flow content</a> is expected.</dd>
|
|
<dt>Content model:</dt>
|
|
<dd>Either: Zero or more <code><a href="#the-li-element">li</a></code> elements.</dd>
|
|
<dd>Or: <a href="#flow-content">Flow content</a>.</dd>
|
|
<dt>Content attributes:</dt>
|
|
<dd><a href="#global-attributes">Global attributes</a></dd>
|
|
<dd><code title="attr-menu-type"><a href="#attr-menu-type">type</a></code></dd>
|
|
<dd><code title="attr-menu-label"><a href="#attr-menu-label">label</a></code></dd>
|
|
<dt>DOM interface:</dt>
|
|
<dd>
|
|
<pre class="idl">interface <dfn id="htmlmenuelement">HTMLMenuElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-menu-type" title="dom-menu-type">type</a>;
|
|
attribute DOMString <a href="#dom-menu-label" title="dom-menu-label">label</a>;
|
|
};</pre>
|
|
</dl><p>The <code><a href="#the-menu-element">menu</a></code> element represents a list of commands.</p><p>The <dfn id="attr-menu-type" title="attr-menu-type"><code>type</code></dfn> attribute
|
|
is an <a href="#enumerated-attribute">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="context-menu-state" 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="toolbar-state" title="toolbar state">toolbar</dfn> state, in which the
|
|
element is declaring a toolbar. The attribute may also be
|
|
omitted. The <i>missing value default</i> is the <dfn id="list-state" 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 toolbar.<p>If a <code><a href="#the-menu-element">menu</a></code> element's <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute is in the <a href="#context-menu-state" title="context menu state">context menu</a> state, then the
|
|
element <a href="#represents">represents</a> the commands of a context menu, and
|
|
the user can only interact with the commands if that context menu is
|
|
activated.<p>If a <code><a href="#the-menu-element">menu</a></code> element's <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute is in the <a href="#toolbar-state" title="toolbar state">toolbar</a> state, then the element
|
|
<a href="#represents">represents</a> a list of active commands that the user can
|
|
immediately interact with.<p>If a <code><a href="#the-menu-element">menu</a></code> element's <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute is in the <a href="#list-state" title="list state">list</a> state, then the element either
|
|
<a href="#represents">represents</a> an unordered list of items (each represented
|
|
by an <code><a href="#the-li-element">li</a></code> element), each of which represents a command
|
|
that the user can perform or activate, or, if the element has no
|
|
<code><a href="#the-li-element">li</a></code> element children, <a href="#flow-content">flow content</a>
|
|
describing available commands.<p>The <dfn id="attr-menu-label" 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="#attr-menu-label">label</a></code> attribute for the submenu's
|
|
menu label.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-menu-type" title="dom-menu-type"><code>type</code></dfn> and <dfn id="dom-menu-label" title="dom-menu-label"><code>label</code></dfn> IDL attributes must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
</div><h5 id="menus-intro"><span class="secno">4.11.4.1 </span>Introduction</h5><p><i>This section is non-normative.</i><p>The <code><a href="#the-menu-element">menu</a></code> element is used to define context menus and
|
|
toolbars.<p>For example, the following represents a toolbar with three menu
|
|
buttons on it, each of which has a dropdown menu with a series of
|
|
options:<pre><menu type="toolbar">
|
|
<li>
|
|
<menu label="File">
|
|
<button type="button" onclick="fnew()">New...</button>
|
|
<button type="button" onclick="fopen()">Open...</button>
|
|
<button type="button" onclick="fsave()">Save</button>
|
|
<button type="button" onclick="fsaveas()">Save as...</button>
|
|
</menu>
|
|
</li>
|
|
<li>
|
|
<menu label="Edit">
|
|
<button type="button" onclick="ecopy()">Copy</button>
|
|
<button type="button" onclick="ecut()">Cut</button>
|
|
<button type="button" onclick="epaste()">Paste</button>
|
|
</menu>
|
|
</li>
|
|
<li>
|
|
<menu label="Help">
|
|
<li><a href="help.html">Help</a></li>
|
|
<li><a href="about.html">About</a></li>
|
|
</menu>
|
|
</li>
|
|
</menu></pre><p>In a supporting user agent, this might look like this:<p><img alt="A toolbar with three buttons, labeled 'File', 'Edit', and 'Help'; where if you select the 'Edit' button you get a drop-down menu with three more options, 'Copy', 'Cut', and 'Paste'." height="101" src="sample-toolbar-1.png" width="303"><p>In a legacy user agent, the above would look like a bulleted list
|
|
with three items, the first of which has four buttons, the second of
|
|
which has three, and the third of which has two nested bullet points
|
|
with two items consisting of links.<hr><p>The following implements a similar toolbar, with a single button
|
|
whose values, when selected, redirect the user to Web sites.<pre><form action="redirect.cgi">
|
|
<menu type="toolbar">
|
|
<label for="goto">Go to...</label>
|
|
<menu label="Go">
|
|
<select id="goto">
|
|
<option value="" selected="selected"> Select site: </option>
|
|
<option value="http://www.apple.com/"> Apple </option>
|
|
<option value="http://www.mozilla.org/"> Mozilla </option>
|
|
<option value="http://www.opera.com/"> Opera </option>
|
|
</select>
|
|
<span><input type="submit" value="Go"></span>
|
|
</menu>
|
|
</menu>
|
|
</form></pre><p>The behavior in supporting user agents is similar to the example
|
|
above, but here the legacy behavior consists of a single
|
|
<code><a href="#the-select-element">select</a></code> element with a submit button. The submit button
|
|
doesn't appear in the toolbar, because it is not a direct child of
|
|
the <code><a href="#the-menu-element">menu</a></code> element or of its <code><a href="#the-li-element">li</a></code>
|
|
children.<div class="impl">
|
|
|
|
<h5 id="building-menus-and-toolbars"><span class="secno">4.11.4.2 </span><dfn>Building menus and toolbars</dfn></h5>
|
|
|
|
<p>A menu (or toolbar) consists of a list of zero or more of the
|
|
following components:</p>
|
|
|
|
<ul class="brief"><li><a href="#concept-command" 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="#the-menu-element">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 behavior depends on what the
|
|
node is, as follows:</p>
|
|
|
|
<dl class="switch"><dt>An element that <a href="#concept-command" title="concept-command">defines a command</a></dt>
|
|
|
|
<dd>Append the command to the menu, respecting its <a href="#concept-facet" title="concept-facet">facets</a>. </dd>
|
|
|
|
|
|
<dt>An <code><a href="#the-hr-element">hr</a></code> element</dt>
|
|
<dt>An <code><a href="#the-option-element">option</a></code> element that has a <code title="attr-option-value"><a href="#attr-option-value">value</a></code> attribute set to the empty
|
|
string, and has a <code title="attr-option-disabled"><a href="#attr-option-disabled">disabled</a></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="#the-li-element">li</a></code> element</dt>
|
|
<dt>A <code><a href="#the-label-element">label</a></code> element</dt>
|
|
|
|
<dd>Iterate over the children of the element.</dd>
|
|
|
|
|
|
<dt>A <code><a href="#the-menu-element">menu</a></code> element with no <code title="attr-menu-label"><a href="#attr-menu-label">label</a></code> attribute</dt>
|
|
<dt>A <code><a href="#the-select-element">select</a></code> element</dt>
|
|
|
|
<dd>Append a separator to the menu, then iterate over the children
|
|
of the <code><a href="#the-menu-element">menu</a></code> or <code><a href="#the-select-element">select</a></code> element, then
|
|
append another separator.</dd>
|
|
|
|
|
|
|
|
|
|
<dt>A <code><a href="#the-menu-element">menu</a></code> element with a <code title="attr-menu-label"><a href="#attr-menu-label">label</a></code> attribute</dt>
|
|
<dt>An <code><a href="#the-optgroup-element">optgroup</a></code> element with a <code title="attr-menu-label"><a href="#attr-menu-label">label</a></code> attribute</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="#ignore">Ignore</a> the node.</dd>
|
|
|
|
</dl><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>Except for separators, 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></div><h5 id="context-menus"><span class="secno">4.11.4.3 </span><dfn>Context menus</dfn></h5><p>The <dfn id="attr-contextmenu" title="attr-contextmenu"><code>contextmenu</code></dfn>
|
|
attribute gives the element's <a href="#context-menus" title="context menus">context
|
|
menu</a>. The value must be the <a href="#concept-id" title="concept-id">ID</a> of a <code><a href="#the-menu-element">menu</a></code> element
|
|
in the DOM. <span class="impl">If the node that would be obtained by
|
|
the invoking the <code title="dom-Document-getElementById"><a href="#dom-document-getelementbyid">getElementById()</a></code> method
|
|
using the attribute's value as the only argument is null or not a
|
|
<code><a href="#the-menu-element">menu</a></code> element, then the element has no assigned context
|
|
menu. Otherwise, the element's assigned context menu is the element
|
|
so identified.</span><div class="impl">
|
|
|
|
<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
|
|
user agent must apply the appropriate rules from the following
|
|
list:</p>
|
|
|
|
<dl class="switch"><dt>If the user requested a context menu using a pointing device</dt>
|
|
|
|
<dd><p>The user agent must dispatch an event with the name <code title="event-contextmenu">contextmenu</code>, that bubbles and is
|
|
cancelable, and that uses the <code><a href="#mouseevent">MouseEvent</a></code> interface, at
|
|
the element for which the menu was requested. The context
|
|
information of the event must be set to the same values as the last
|
|
<code><a href="#mouseevent">MouseEvent</a></code> user interaction event that was dispatched
|
|
as part of the gesture that that was interpreted as a request for
|
|
the context menu.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>The user agent must <a href="#fire-a-synthetic-mouse-event" title="fire a synthetic mouse
|
|
event">fire a synthetic mouse event named <code title="event-contextmenu">contextmenu</code></a> that bubbles
|
|
and is cancelable at the element for which the menu was
|
|
requested.</dd>
|
|
|
|
</dl><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 or one of its ancestors has a context menu
|
|
assigned (using the <code title="attr-contextmenu"><a href="#attr-contextmenu">contextmenu</a></code> attribute) or not. If
|
|
there is no context menu assigned, the default action must be for
|
|
the user agent to show its default context menu, if it has one.</p>
|
|
|
|
<p>If the element or one of its ancestors <em>does</em> have a
|
|
context menu assigned, then the user agent must <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-show">show</code> at the
|
|
<code><a href="#the-menu-element">menu</a></code> element of the context menu of the nearest
|
|
ancestor (including the element itself) with one assigned.</p>
|
|
|
|
|
|
<p>The default action of <em>this</em> event is that the user agent
|
|
must show a context menu <a href="#building-menus-and-toolbars" title="building menus and
|
|
toolbars">built</a> from the <code><a href="#the-menu-element">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 <a href="#concept-command" title="concept-command">command</a>, then the UA must invoke
|
|
that command's <a href="#command-facet-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 as constructed
|
|
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="dom-contextmenu" title="dom-contextMenu"><code>contextMenu</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the <code title="attr-contextmenu"><a href="#attr-contextmenu">contextmenu</a></code> content attribute.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Here is an example of a context menu for an input control:</p>
|
|
|
|
<pre><form name="npc">
|
|
<label>Character name: <input name=char type=text contextmenu=namemenu required></label>
|
|
<menu type=context id=namemenu>
|
|
<command label="Pick random name" onclick="document.forms.npc.elements.char.value = getRandomName()">
|
|
<command label="Prefill other fields based on name" onclick="prefillFields(document.forms.npc.elements.char.value)">
|
|
</menu>
|
|
</form></pre>
|
|
|
|
<p>This adds two items to the control's context menu, one called
|
|
"Pick random name", and one called "Prefill other fields based on
|
|
name". They invoke scripts that are not shown in the example
|
|
above.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="toolbars"><span class="secno">4.11.4.4 </span><dfn>Toolbars</dfn></h5>
|
|
|
|
<p>When a <code><a href="#the-menu-element">menu</a></code> element has a <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute in the <a href="#toolbar-state" title="toolbar state">toolbar</a> state, then the user agent
|
|
must <a href="#building-menus-and-toolbars" title="building menus and toolbars">build</a> the
|
|
menu for that <code><a href="#the-menu-element">menu</a></code> element, and use the result in the
|
|
rendering.</p>
|
|
|
|
<p>The user agent must reflect changes made to the
|
|
<code><a href="#the-menu-element">menu</a></code>'s DOM, by immediately <a href="#building-menus-and-toolbars" title="building menus
|
|
and toolbars">rebuilding</a> the menu.</p>
|
|
|
|
</div><h4 id="commands"><span class="secno">4.11.5 </span>Commands</h4><p>A <dfn id="concept-command" title="concept-command">command</dfn> is the abstraction
|
|
behind menu items, buttons, and links.<p id="facets">Commands are defined to have the following
|
|
<dfn id="concept-facet" title="concept-facet">facets</dfn>:<dl><dt><dfn id="command-facet-type" 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="#command-facet-checkedstate" 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="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a>.</dd>
|
|
|
|
<dt><dfn id="command-facet-id" 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-command">anonymous command</dfn>.</dd>
|
|
|
|
<dt><dfn id="command-facet-label" title="command-facet-Label">Label</dfn></dt>
|
|
|
|
<dd>The name of the command as seen by the user.</dd>
|
|
|
|
<dt><dfn id="command-facet-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="command-facet-icon" title="command-facet-Icon">Icon</dfn></dt>
|
|
|
|
<dd>An <a href="#absolute-url">absolute URL</a> identifying a graphical image that
|
|
represents the action. A command might not have an Icon.</dd>
|
|
<dt><dfn id="command-facet-accesskey" title="command-facet-AccessKey">Access Key</dfn></dt>
|
|
|
|
<dd>A key combination selected by the user agent that triggers the
|
|
command. A command might not have an Access Key.</dd>
|
|
|
|
<dt><dfn id="command-facet-hiddenstate" 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="command-facet-disabledstate" title="command-facet-DisabledState">Disabled State</dfn></dt>
|
|
|
|
<dd>Whether the command is relevant and can be triggered or not.</dd>
|
|
|
|
<dt><dfn id="command-facet-checkedstate" title="command-facet-CheckedState">Checked State</dfn></dt>
|
|
|
|
<dd>Whether the command is checked or not.</dd>
|
|
|
|
<dt><dfn id="command-facet-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 <a href="#url">URL</a> to which to
|
|
<a href="#navigate">navigate</a>, or a form submission.</dd>
|
|
|
|
|
|
</dl><p>These facets are exposed on elements using the <dfn id="command-api">command
|
|
API</dfn>:<dl class="domintro"><dt><var title="">element</var> . <code title="dom-command-ro-commandType"><a href="#dom-command-ro-commandtype">commandType</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the <a href="#command-facet-type" title="command-facet-Type">Type</a> facet of the command.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-id"><a href="#dom-id">id</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the <a href="#command-facet-id" title="command-facet-ID">ID</a> facet of the command.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-command-ro-label"><a href="#dom-command-ro-label">label</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the <a href="#command-facet-label" title="command-facet-Label">Label</a> facet of the command.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-title"><a href="#dom-title">title</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> facet of the command.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-command-ro-icon"><a href="#dom-command-ro-icon">icon</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> facet of the command.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-accessKeyLabel"><a href="#dom-accesskeylabel">accessKeyLabel</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the <a href="#command-facet-accesskey" title="command-facet-AccessKey">Access Key</a> facet of the command.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-hidden"><a href="#dom-hidden">hidden</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the state of the element's <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute, which is generally
|
|
equivalent to the <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden
|
|
State</a> facet of the command. For <code><a href="#the-label-element">label</a></code> and
|
|
<code><a href="#the-legend-element">legend</a></code> elements (used in conjunction with the <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> attribute), the <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a> facet is
|
|
derived from another element (the one that the <a href="#assigned-access-key">assigned
|
|
access key</a> will trigger), and cannot be directly accessed
|
|
from the element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-command-ro-disabled"><a href="#dom-command-ro-disabled">disabled</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled State</a> facet of the command.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-command-ro-checked"><a href="#dom-command-ro-checked">checked</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Exposes the <a href="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a> facet of the command.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-click"><a href="#dom-click">click</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Triggers the <a href="#command-facet-action" title="command-facet-Action">Action</a> of the command.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-command-ro-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="">checkbox</code>", depending on whether the <a href="#command-facet-type" title="command-facet-Type">Type</a> of the command defined by the
|
|
element is "command", "radio", or "checkbox" respectively. If the
|
|
element does not define a command, it must return null.</p>
|
|
|
|
<p>The <dfn id="dom-command-ro-label" title="dom-command-ro-label"><code>label</code></dfn>
|
|
attribute must return the command's <a href="#command-facet-label" title="command-facet-Label">Label</a>, or null if the element
|
|
does not define a command or does not specify a <a href="#command-facet-label" title="command-facet-Label">Label</a>. This attribute will be
|
|
shadowed by the <code title="">label</code> IDL attribute on
|
|
various elements.</p>
|
|
|
|
<p>The <dfn id="dom-command-ro-icon" title="dom-command-ro-icon"><code>icon</code></dfn>
|
|
attribute must return the <a href="#absolute-url">absolute URL</a> of the command's
|
|
<a href="#command-facet-icon" 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="#dom-command-icon">icon</a></code> IDL attribute on
|
|
<code><a href="#the-command-element">command</a></code> elements.</p>
|
|
|
|
<p>The <dfn id="dom-command-ro-disabled" title="dom-command-ro-disabled"><code>disabled</code></dfn>
|
|
attribute must return true if the command's <a href="#command-facet-disabledstate" 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="#command-facet-hiddenstate" 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> IDL attribute on various elements.</p>
|
|
|
|
<p>The <dfn id="dom-command-ro-checked" title="dom-command-ro-checked"><code>checked</code></dfn> attribute
|
|
must return true if the command's <a href="#command-facet-checkedstate" 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> IDL attribute on <code><a href="#the-input-element">input</a></code> and
|
|
<code><a href="#the-command-element">command</a></code> elements.</p>
|
|
|
|
|
|
<p class="note">The <a href="#command-facet-id" title="command-facet-ID">ID</a> facet
|
|
is exposed by the <code title="dom-id"><a href="#dom-id">id</a></code> IDL attribute,
|
|
the <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> facet is exposed by
|
|
the <code title="dom-title"><a href="#dom-title">title</a></code> IDL attribute, the <a href="#command-facet-accesskey" title="command-facet-AccessKey">AccessKey</a> facet is exposed by
|
|
the <code title="dom-accessKeyLabel"><a href="#dom-accesskeylabel">accessKeyLabel</a></code> IDL
|
|
attribute, and the <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden
|
|
State</a> facet is exposed by the <code title="dom-hidden"><a href="#dom-hidden">hidden</a></code> IDL attribute.</p>
|
|
|
|
</div><hr><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-commands"><a href="#dom-document-commands">commands</a></code></dt>
|
|
<dd>
|
|
<p>Returns an <code><a href="#htmlcollection">HTMLCollection</a></code> of the elements in the
|
|
<code><a href="#document">Document</a></code> that define commands and have IDs.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-commands" 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="#htmlcollection">HTMLCollection</a></code> rooted at the <code><a href="#document">Document</a></code>
|
|
node, whose filter matches only elements that <a href="#concept-command" title="concept-command">define commands</a> and have <a href="#command-facet-id" title="command-facet-ID">IDs</a>.</p>
|
|
|
|
</div><hr><p>User agents may expose the <a href="#concept-command" title="concept-command">commands</a> whose <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a> facet is false
|
|
(visible), e.g. in the user agent's menu bar. User agents are
|
|
encouraged to do this especially for commands that have <a href="#command-facet-accesskey" title="command-facet-AccessKey">Access Keys</a>, as a way to
|
|
advertise those keys to the user.<div class="impl">
|
|
|
|
<h5 id="using-the-a-element-to-define-a-command"><span class="secno">4.11.5.1 </span><dfn title="a-command">Using the <code>a</code> element to define a command</dfn></h5>
|
|
|
|
<p>An <code><a href="#the-a-element">a</a></code> element with an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute <a href="#concept-command" title="concept-command">defines a command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-type" title="command-facet-Type">Type</a> of the command
|
|
is "command".</p>
|
|
|
|
<p>The <a href="#command-facet-id" title="command-facet-ID">ID</a> of the command is
|
|
the value of the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute of the
|
|
element, if the attribute is present and not empty. Otherwise the
|
|
command is an <a href="#anonymous-command">anonymous command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-label" title="command-facet-Label">Label</a> of the command
|
|
is the string given by the element's <code><a href="#textcontent">textContent</a></code> IDL
|
|
attribute.</p>
|
|
|
|
<p>The <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> of the command
|
|
is the value of the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute
|
|
of the element. If the attribute is not present, the <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> is the empty string.</p>
|
|
|
|
<p>The <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> of the command
|
|
is the <a href="#absolute-url">absolute URL</a> obtained from <a href="#resolve-a-url" title="resolve
|
|
a url">resolving</a> the value of the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute of the first
|
|
<code><a href="#the-img-element">img</a></code> element descendant of the element, relative to that
|
|
element, if there is such an element and resolving its attribute is
|
|
successful. Otherwise, there is no <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> for the command.</p>
|
|
|
|
<p>The <a href="#command-facet-accesskey" title="command-facet-AccessKey">AccessKey</a> of the
|
|
command is the element's <a href="#assigned-access-key">assigned access key</a>, if
|
|
any.</p>
|
|
|
|
<p>The <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a>
|
|
of the command is true (hidden) if the element has a <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled
|
|
State</a> facet of the command is always false. (The command is
|
|
always enabled.)</p>
|
|
|
|
<p>The <a href="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a>
|
|
of the command is always false. (The command is never checked.)</p>
|
|
|
|
<p>The <a href="#command-facet-action" title="command-facet-Action">Action</a> of the
|
|
command is to <a href="#fire-a-click-event" title="fire a click event">fire a <code title="event-click">click</code> event</a> at the element.</p>
|
|
|
|
|
|
<h5 id="using-the-button-element-to-define-a-command"><span class="secno">4.11.5.2 </span><dfn title="button-command">Using the <code>button</code> element to define a command</dfn></h5>
|
|
|
|
<p>A <code><a href="#the-button-element">button</a></code> element always <a href="#concept-command" title="concept-command">defines a command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-type" title="command-facet-Type">Type</a>, <a href="#command-facet-id" title="command-facet-ID">ID</a>, <a href="#command-facet-label" title="command-facet-Label">Label</a>, <a href="#command-facet-hint" title="command-facet-Hint">Hint</a>, <a href="#command-facet-icon" title="command-facet-Icon">Icon</a>, <a href="#command-facet-accesskey" title="command-facet-AccessKey">Access Key</a>, <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a>, <a href="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a>, and <a href="#command-facet-action" title="command-facet-Action">Action</a> facets of the command are
|
|
determined <a href="#using-the-a-element-to-define-a-command" title="a-command">as for <code>a</code>
|
|
elements</a> (see the previous section).</p>
|
|
|
|
<p>The <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled
|
|
State</a> of the command mirrors the <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a> state of the button.</p>
|
|
|
|
|
|
<h5 id="using-the-input-element-to-define-a-command"><span class="secno">4.11.5.3 </span><dfn title="input-command">Using the <code>input</code> element to define a command</dfn></h5>
|
|
|
|
<p>An <code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in one of the <a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a>, <a href="#reset-button-state" title="attr-input-type-reset">Reset Button</a>, <a href="#image-button-state" title="attr-input-type-image">Image Button</a>, <a href="#button-state" title="attr-input-type-button">Button</a>, <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a>, or <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> states <a href="#concept-command" title="concept-command">defines a command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-type" title="command-facet-Type">Type</a> of the command
|
|
is "radio" if the <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute is in the <code title="attr-input-type-radio"><a href="#radio-button-state">Radio
|
|
Button</a></code> state, "checkbox" if the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <code title="attr-input-type-checkbox"><a href="#checkbox-state">Checkbox</a></code> state, and
|
|
"command" otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-id" title="command-facet-ID">ID</a> of the command is
|
|
the value of the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute of the
|
|
element, if the attribute is present and not empty. Otherwise the
|
|
command is an <a href="#anonymous-command">anonymous command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-label" title="command-facet-Label">Label</a> of the command
|
|
depends on the Type of the command:</p>
|
|
|
|
<p>If the <a href="#command-facet-type" title="command-facet-Type">Type</a> is "command",
|
|
then it is the string given by the <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if any, and a
|
|
UA-dependent, locale-dependent value that the UA uses to label the
|
|
button itself if the attribute is absent.</p>
|
|
|
|
<p>Otherwise, the <a href="#command-facet-type" title="command-facet-Type">Type</a> is
|
|
"radio" or "checkbox". If the element is a <a href="#labeled-control">labeled
|
|
control</a>, the <code><a href="#textcontent">textContent</a></code> of the first
|
|
<code><a href="#the-label-element">label</a></code> element in <a href="#tree-order">tree order</a> whose
|
|
<a href="#labeled-control">labeled control</a> is the element in question is the <a href="#command-facet-label" title="command-facet-Label">Label</a> (in DOM terms, this is the
|
|
string given by <code><var title="">element</var>.labels[0].textContent</code>). Otherwise,
|
|
the value of the <code title="attr-input-value"><a href="#attr-input-value">value</a></code>
|
|
attribute, if present, is the <a href="#command-facet-label" title="command-facet-Label">Label</a>. Otherwise, the <a href="#command-facet-label" title="command-facet-Label">Label</a> is the empty string.</p>
|
|
|
|
<p>The <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> of the command
|
|
is the value of the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute
|
|
of the <code><a href="#the-input-element">input</a></code> element. If the attribute is not present, the
|
|
<a href="#command-facet-hint" title="command-facet-Hint">Hint</a> is the empty
|
|
string.</p>
|
|
|
|
<p>If the element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image
|
|
Button</a> state, and the element has a <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute, and that attribute's
|
|
value can be successfully <a href="#resolve-a-url" title="resolve a
|
|
url">resolved</a> relative to the element, then the <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> of the command is the
|
|
<a href="#absolute-url">absolute URL</a> obtained from resolving that attribute
|
|
that way. Otherwise, there is no <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> for the command.</p>
|
|
|
|
<p>The <a href="#command-facet-accesskey" title="command-facet-AccessKey">AccessKey</a> of the
|
|
command is the element's <a href="#assigned-access-key">assigned access key</a>, if
|
|
any.</p>
|
|
|
|
<p>The <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a>
|
|
of the command is true (hidden) if the element has a <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled
|
|
State</a> of the command mirrors the <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a> state of the
|
|
control.</p>
|
|
|
|
<p>The <a href="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a>
|
|
of the command is true if the command is of <a href="#command-facet-type" title="command-facet-Type">Type</a> "radio" or "checkbox" and the
|
|
element is <a href="#concept-fe-checked" title="concept-fe-checked">checked</a>
|
|
attribute, and false otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-action" title="command-facet-Action">Action</a> of the
|
|
command, if the element has a defined <a href="#activation-behavior">activation
|
|
behavior</a>, is to <a href="#run-synthetic-click-activation-steps">run synthetic click activation
|
|
steps</a> on the element. Otherwise, it is just to <a href="#fire-a-click-event">fire a
|
|
<code title="event-click">click</code> event</a> at the
|
|
element.</p>
|
|
|
|
|
|
<h5 id="using-the-option-element-to-define-a-command"><span class="secno">4.11.5.4 </span><dfn title="option-command">Using the <code>option</code> element to define a command</dfn></h5>
|
|
|
|
<p>An <code><a href="#the-option-element">option</a></code> element with an ancestor
|
|
<code><a href="#the-select-element">select</a></code> element and either no <code title="attr-option-value"><a href="#attr-option-value">value</a></code> attribute or a <code title="attr-option-value"><a href="#attr-option-value">value</a></code> attribute that is not the
|
|
empty string <a href="#concept-command" title="concept-command">defines a
|
|
command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-type" title="command-facet-Type">Type</a> of the command
|
|
is "radio" if the <code><a href="#the-option-element">option</a></code>'s nearest ancestor
|
|
<code><a href="#the-select-element">select</a></code> element has no <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute, and
|
|
"checkbox" if it does.</p>
|
|
|
|
<p>The <a href="#command-facet-id" title="command-facet-ID">ID</a> of the command is
|
|
the value of the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute of the
|
|
element, if the attribute is present and not empty. Otherwise the
|
|
command is an <a href="#anonymous-command">anonymous command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-label" title="command-facet-Label">Label</a> of the command
|
|
is the value of the <code><a href="#the-option-element">option</a></code> element's <code title="attr-option-label"><a href="#attr-option-label">label</a></code> attribute, if there is one,
|
|
or the value of the <code><a href="#the-option-element">option</a></code> element's
|
|
<code><a href="#textcontent">textContent</a></code> IDL attribute if there isn't.</p>
|
|
|
|
<p>The <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> of the command
|
|
is the string given by the element's <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute, if any, and the empty
|
|
string if the attribute is absent.</p>
|
|
|
|
<p>There is no <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> for the
|
|
command.</p>
|
|
|
|
<p>The <a href="#command-facet-accesskey" title="command-facet-AccessKey">AccessKey</a> of the
|
|
command is the element's <a href="#assigned-access-key">assigned access key</a>, if
|
|
any.</p>
|
|
|
|
<p>The <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a>
|
|
of the command is true (hidden) if the element has a <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled
|
|
State</a> of the command is true (disabled) if the element is
|
|
<a href="#concept-option-disabled" title="concept-option-disabled">disabled</a> or if its
|
|
nearest ancestor <code><a href="#the-select-element">select</a></code> element is <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a>
|
|
of the command is true (checked) if the element's <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> is true, and
|
|
false otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-action" title="command-facet-Action">Action</a> of the
|
|
command depends on its <a href="#command-facet-type" title="command-facet-Type">Type</a>. If the command is of <a href="#command-facet-type" title="command-facet-Type">Type</a> "radio" then it must <a href="#concept-select-pick" title="concept-select-pick">pick</a> the <code><a href="#the-option-element">option</a></code>
|
|
element. Otherwise, it must <a href="#concept-select-toggle" title="concept-select-toggle">toggle</a> the <code><a href="#the-option-element">option</a></code>
|
|
element.</p>
|
|
|
|
|
|
<h5 id="using-the-command-element-to-define-a-command"><span class="secno">4.11.5.5 </span>Using the <dfn title="command-element"><code>command</code></dfn> element to define
|
|
a command</h5>
|
|
|
|
<p>A <code><a href="#the-command-element">command</a></code> element <a href="#concept-command" title="concept-command">defines a command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-type" title="command-facet-Type">Type</a> of the command
|
|
is "radio" if the <code><a href="#the-command-element">command</a></code>'s <code title="attr-command-type"><a href="#attr-command-type">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="#command-facet-id" title="command-facet-ID">ID</a> of the command is
|
|
the value of the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute of the
|
|
element, if the attribute is present and not empty. Otherwise the
|
|
command is an <a href="#anonymous-command">anonymous command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-label" title="command-facet-Label">Label</a> of the command
|
|
is the value of the element's <code title="attr-command-label"><a href="#attr-command-label">label</a></code> attribute, if there is one,
|
|
or the empty string if it doesn't.</p>
|
|
|
|
<p>The <a href="#command-facet-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="#attr-command-title">title</a></code> attribute, if any, and the
|
|
empty string if the attribute is absent.</p>
|
|
|
|
<p>The <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> for the command
|
|
is the <a href="#absolute-url">absolute URL</a> obtained from <a href="#resolve-a-url" title="resolve
|
|
a url">resolving</a> the value of the element's <code title="attr-command-icon"><a href="#attr-command-icon">icon</a></code> attribute, relative to the
|
|
element, if it has such an attribute and resolving it is
|
|
successful. Otherwise, there is no <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> for the command.</p>
|
|
|
|
<p>The <a href="#command-facet-accesskey" title="command-facet-AccessKey">AccessKey</a> of the
|
|
command is the element's <a href="#assigned-access-key">assigned access key</a>, if
|
|
any.</p>
|
|
|
|
<p>The <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a>
|
|
of the command is true (hidden) if the element has a <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled
|
|
State</a> of the command is true (disabled) if the element has a
|
|
<code title="attr-command-disabled"><a href="#attr-command-disabled">disabled</a></code> attribute, and
|
|
false otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-checkedstate" 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="#attr-command-checked">checked</a></code> attribute, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-action" title="command-facet-Action">Action</a> of the
|
|
command, if the element has a defined <a href="#activation-behavior">activation
|
|
behavior</a>, is to <a href="#run-synthetic-click-activation-steps">run synthetic click activation
|
|
steps</a> on the element. Otherwise, it is just to <a href="#fire-a-click-event">fire a
|
|
<code title="event-click">click</code> event</a> at the
|
|
element.</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h5 id="using-the-accesskey-attribute-on-a-label-element-to-define-a-command"><span class="secno">4.11.5.6 </span><dfn title="label-command">Using the <code title="attr-accesskey">accesskey</code> attribute on a <code>label</code> element to define a command</dfn></h5>
|
|
|
|
<p>A <code><a href="#the-label-element">label</a></code> element that has an <a href="#assigned-access-key">assigned access
|
|
key</a> and a <a href="#labeled-control">labeled control</a> and whose
|
|
<a href="#labeled-control">labeled control</a> <a href="#concept-command" title="concept-command">defines a
|
|
command</a>, itself <a href="#concept-command" title="concept-command">defines a
|
|
command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-type" title="command-facet-Type">Type</a> of the command
|
|
is "command".</p>
|
|
|
|
<p>The <a href="#command-facet-id" title="command-facet-ID">ID</a> of the command is
|
|
the value of the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute of the
|
|
element, if the attribute is present and not empty. Otherwise the
|
|
command is an <a href="#anonymous-command">anonymous command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-label" title="command-facet-Label">Label</a> of the command
|
|
is the string given by the element's <code><a href="#textcontent">textContent</a></code> IDL
|
|
attribute.</p>
|
|
|
|
<p>The <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> of the command
|
|
is the value of the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute
|
|
of the element.</p>
|
|
|
|
<p>There is no <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> for the
|
|
command.</p>
|
|
|
|
<p>The <a href="#command-facet-accesskey" title="command-facet-AccessKey">AccessKey</a> of the
|
|
command is the element's <a href="#assigned-access-key">assigned access key</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a>,
|
|
<a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled State</a>, and
|
|
<a href="#command-facet-action" title="command-facet-Action">Action</a> facets of the
|
|
command are the same as the respective facets of the element's
|
|
<a href="#labeled-control">labeled control</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a>
|
|
of the command is always false. (The command is never checked.)</p>
|
|
|
|
|
|
|
|
<h5 id="using-the-accesskey-attribute-on-a-legend-element-to-define-a-command"><span class="secno">4.11.5.7 </span><dfn title="legend-command">Using the <code title="attr-accesskey">accesskey</code> attribute on a <code>legend</code> element to define a command</dfn></h5>
|
|
|
|
<p>A <code><a href="#the-legend-element">legend</a></code> element that has an <a href="#assigned-access-key">assigned access
|
|
key</a> and is a child of a <code><a href="#the-fieldset-element">fieldset</a></code> element that
|
|
has a descendant that is not a descendant of the <code><a href="#the-legend-element">legend</a></code>
|
|
element and is neither a <code><a href="#the-label-element">label</a></code> element nor a
|
|
<code><a href="#the-legend-element">legend</a></code> element but that <a href="#concept-command" title="concept-command">defines a command</a>, itself <a href="#concept-command" title="concept-command">defines a command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-type" title="command-facet-Type">Type</a> of the command
|
|
is "command".</p>
|
|
|
|
<p>The <a href="#command-facet-id" title="command-facet-ID">ID</a> of the command is
|
|
the value of the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute of the
|
|
element, if the attribute is present and not empty. Otherwise the
|
|
command is an <a href="#anonymous-command">anonymous command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-label" title="command-facet-Label">Label</a> of the command
|
|
is the string given by the element's <code><a href="#textcontent">textContent</a></code> IDL
|
|
attribute.</p>
|
|
|
|
<p>The <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> of the command
|
|
is the value of the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute
|
|
of the element.</p>
|
|
|
|
<p>There is no <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> for the
|
|
command.</p>
|
|
|
|
<p>The <a href="#command-facet-accesskey" title="command-facet-AccessKey">AccessKey</a> of the
|
|
command is the element's <a href="#assigned-access-key">assigned access key</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a>,
|
|
<a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled State</a>, and
|
|
<a href="#command-facet-action" title="command-facet-Action">Action</a> facets of the
|
|
command are the same as the respective facets of the first element
|
|
in <a href="#tree-order">tree order</a> that is a descendant of the parent of the
|
|
<code><a href="#the-legend-element">legend</a></code> element that <a href="#concept-command" title="concept-command">defines a command</a> but is not a
|
|
descendant of the <code><a href="#the-legend-element">legend</a></code> element and is neither a
|
|
<code><a href="#the-label-element">label</a></code> nor a <code><a href="#the-legend-element">legend</a></code> element.</p>
|
|
|
|
<p>The <a href="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a>
|
|
of the command is always false. (The command is never checked.)</p>
|
|
|
|
|
|
|
|
<h5 id="using-the-accesskey-attribute-to-define-a-command-on-other-elements"><span class="secno">4.11.5.8 </span><dfn title="accesskey-command">Using the <code title="attr-accesskey">accesskey</code> attribute to define a command on other elements</dfn></h5>
|
|
|
|
<p>An element that has an <a href="#assigned-access-key">assigned access key</a> <a href="#concept-command" title="concept-command">defines a command</a>.</p>
|
|
|
|
<p>If one of the other sections that define elements that <a href="#concept-command" title="concept-command">define commands</a> define that this
|
|
element <a href="#concept-command" title="concept-command">defines a command</a>, then
|
|
that section applies to this element, and this section does
|
|
not. Otherwise, this section applies to that element.</p>
|
|
|
|
<p>The <a href="#command-facet-type" title="command-facet-Type">Type</a> of the command
|
|
is "command".</p>
|
|
|
|
<p>The <a href="#command-facet-id" title="command-facet-ID">ID</a> of the command is
|
|
the value of the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute of the
|
|
element, if the attribute is present and not empty. Otherwise the
|
|
command is an <a href="#anonymous-command">anonymous command</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-label" title="command-facet-Label">Label</a> of the command
|
|
depends on the element. If the element is a <a href="#labeled-control">labeled
|
|
control</a>, the <code><a href="#textcontent">textContent</a></code> of the first
|
|
<code><a href="#the-label-element">label</a></code> element in <a href="#tree-order">tree order</a> whose
|
|
<a href="#labeled-control">labeled control</a> is the element in question is the <a href="#command-facet-label" title="command-facet-Label">Label</a> (in DOM terms, this is the
|
|
string given by <code><var title="">element</var>.labels[0].textContent</code>). Otherwise, the
|
|
<a href="#command-facet-label" title="command-facet-Label">Label</a> is the
|
|
<code><a href="#textcontent">textContent</a></code> of the element itself.</p>
|
|
|
|
<p>The <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> of the command
|
|
is the value of the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute
|
|
of the element. If the attribute is not present, the <a href="#command-facet-hint" title="command-facet-Hint">Hint</a> is the empty string.</p>
|
|
|
|
<p>There is no <a href="#command-facet-icon" title="command-facet-Icon">Icon</a> for the
|
|
command.</p>
|
|
|
|
<p>The <a href="#command-facet-accesskey" title="command-facet-AccessKey">AccessKey</a> of the
|
|
command is the element's <a href="#assigned-access-key">assigned access key</a>.</p>
|
|
|
|
<p>The <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden State</a>
|
|
of the command is true (hidden) if the element has a <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled
|
|
State</a> facet of the command is always false. (The command is
|
|
always enabled.)</p>
|
|
|
|
<p>The <a href="#command-facet-checkedstate" title="command-facet-CheckedState">Checked State</a>
|
|
of the command is always false. (The command is never checked.)</p>
|
|
|
|
<p>The <a href="#command-facet-action" title="command-facet-Action">Action</a> of the
|
|
command is to run the following steps:</p>
|
|
|
|
<ol><li>If the element is <a href="#focusable">focusable</a>, run the
|
|
<a href="#focusing-steps">focusing steps</a> for the element.</li>
|
|
|
|
<li>If the element has a defined <a href="#activation-behavior">activation behavior</a>,
|
|
<a href="#run-synthetic-click-activation-steps">run synthetic click activation steps</a> on the
|
|
element.</li>
|
|
|
|
<li>Otherwise, if the element does not have a defined
|
|
<a href="#activation-behavior">activation behavior</a>, <a href="#fire-a-click-event">fire a <code title="event-click">click</code> event</a> at the element.</li>
|
|
|
|
</ol></div><h3 id="links"><span class="secno">4.12 </span>Links</h3><h4 id="introduction-3"><span class="secno">4.12.1 </span>Introduction</h4><p>Links are a conceptual construct, created by <code><a href="#the-a-element">a</a></code>,
|
|
<code><a href="#the-area-element">area</a></code>, and <code><a href="#the-link-element">link</a></code> elements, that <a href="#represents" title="represents">represent</a> a connection between two
|
|
resources, one of which is the current <code><a href="#document">Document</a></code>. There
|
|
are two kinds of links in HTML:<dl><dt><dfn id="external-resource-link" title="external resource link">Links to external
|
|
resources</dfn></dt>
|
|
|
|
<dd><p>These are links to resources that are to be used to augment
|
|
the current document, generally automatically processed by the user
|
|
agent.</dd>
|
|
|
|
<dt><dfn id="hyperlink" title="hyperlink">Hyperlinks</dfn></dt>
|
|
|
|
<dd><p>These are links to other resources that are generally
|
|
exposed to the user by the user agent so that the user can cause
|
|
the user agent to <a href="#navigate">navigate</a> to those resources, e.g. to
|
|
visit them in a browser or download them.</dd>
|
|
|
|
</dl><p>For <code><a href="#the-link-element">link</a></code> elements with an <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute and a <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute, links must be created
|
|
for the keywords of the <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code>
|
|
attribute, as defined for those keywords in the <a href="#linkTypes">link types</a> section.<p>Similarly, for <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements with
|
|
an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute and a
|
|
<code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code> attribute, links must be
|
|
created for the keywords of the <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code> attribute as defined for those
|
|
keywords in the <a href="#linkTypes">link types</a> section. Unlike
|
|
<code><a href="#the-link-element">link</a></code> elements, however, <code><a href="#the-a-element">a</a></code> and
|
|
<code><a href="#the-area-element">area</a></code> element with an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute that either do not
|
|
have a <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code> attribute, or
|
|
whose <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code> attribute has no
|
|
keywords that are defined as specifying <a href="#hyperlink" title="hyperlink">hyperlinks</a>, must also create a
|
|
<a href="#hyperlink">hyperlink</a>. This implied hyperlink has no special
|
|
meaning (it has no <a href="#linkTypes">link type</a>) beyond
|
|
linking the element's document to the resource given by the
|
|
element's <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>
|
|
attribute.<p>A <a href="#hyperlink">hyperlink</a> can have one or more <dfn id="hyperlink-annotation" title="hyperlink annotation">hyperlink annotations</dfn> that modify
|
|
the processing semantics of that hyperlink.<h4 id="links-created-by-a-and-area-elements"><span class="secno">4.12.2 </span>Links created by <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements</h4><p>The <dfn id="attr-hyperlink-href" title="attr-hyperlink-href"><code>href</code></dfn>
|
|
attribute on <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements must have
|
|
a value that is a <a href="#valid-url-potentially-surrounded-by-spaces">valid URL potentially surrounded by
|
|
spaces</a>.<p class="note">The <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>
|
|
attribute on <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements is not
|
|
required; when those elements do not have <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attributes they do not
|
|
create hyperlinks.<p>The <dfn id="attr-hyperlink-target" title="attr-hyperlink-target"><code>target</code></dfn>
|
|
attribute, if present, must be a <a href="#valid-browsing-context-name-or-keyword">valid browsing context name
|
|
or keyword</a>. It gives the name of the <a href="#browsing-context">browsing
|
|
context</a> that will be used. <span class="impl">User agents use
|
|
this name when <a href="#following-hyperlinks">following hyperlinks</a>.</span><p>The <dfn id="attr-hyperlink-rel" title="attr-hyperlink-rel"><code>rel</code></dfn>
|
|
attribute on <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements controls
|
|
what kinds of links the elements create. The attribue's value must
|
|
be a <a href="#set-of-space-separated-tokens">set of space-separated tokens</a>. The <a href="#linkTypes">allowed keywords and their meanings</a> are
|
|
defined below.<p>The <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code> attribute has
|
|
no default value. If the attribute is omitted or if none of the
|
|
values in the attribute are recognized by the user agent, then the
|
|
document has no particular relationship with the destination
|
|
resource other than there being a hyperlink between the two.<p>The <dfn id="attr-hyperlink-media" 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 <a href="#valid-media-query">valid
|
|
media query</a>. The default, if the <code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code> attribute is omitted, is
|
|
"<code title="">all</code>".<p>The <dfn id="attr-hyperlink-hreflang" title="attr-hyperlink-hreflang"><code>hreflang</code></dfn>
|
|
attribute on <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements that
|
|
create <a href="#hyperlink" title="hyperlink">hyperlinks</a>, if present, gives
|
|
the language of the linked resource. It is purely advisory. The
|
|
value must be a valid BCP 47 language tag. <a href="#refsBCP47">[BCP47]</a> <span class="impl">User agents must
|
|
not consider this attribute authoritative — upon fetching the
|
|
resource, user agents must use only language information associated
|
|
with the resource to determine its language, not metadata included
|
|
in the link to the resource.</span><p>The <dfn id="attr-hyperlink-type" title="attr-hyperlink-type"><code>type</code></dfn>
|
|
attribute, if present, gives the <a href="#mime-type">MIME type</a> of the
|
|
linked resource. It is purely advisory. The value must be a
|
|
<a href="#valid-mime-type">valid MIME type</a>. <span class="impl">User agents must
|
|
not consider the <code title="attr-hyperlink-type"><a href="#attr-hyperlink-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.</span><div class="impl">
|
|
|
|
<h4 id="following-hyperlinks"><span class="secno">4.12.3 </span><dfn>Following hyperlinks</dfn></h4>
|
|
|
|
<p>When a user <em>follows a hyperlink</em> created by an element,
|
|
the user agent must <a href="#resolve-a-url" title="resolve a url">resolve</a> the
|
|
<a href="#url">URL</a> given by the <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute of that element,
|
|
relative to that element, and if that is successful, must
|
|
<a href="#navigate">navigate</a> a <a href="#browsing-context">browsing
|
|
context</a> to the resulting <a href="#absolute-url">absolute URL</a>. In the
|
|
case of server-side image maps, that <a href="#absolute-url">absolute URL</a> must
|
|
have its <var><a href="#hyperlink-suffix">hyperlink suffix</a></var> appended to it before the
|
|
navigation is started.</p>
|
|
|
|
<p>If <a href="#resolve-a-url" title="resolve a url">resolving</a> the
|
|
<a href="#url">URL</a> fails, the user agent may report the error to the
|
|
user in a user-agent-specific manner, may
|
|
<a href="#navigate">navigate</a> to an error page to
|
|
report the error, or may ignore the error and do nothing.</p>
|
|
|
|
<p>If the user indicated a specific <a href="#browsing-context">browsing context</a>
|
|
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 <a href="#browsing-context">browsing context</a> that is
|
|
navigated.</p>
|
|
|
|
<p>Otherwise, if the element is an <code><a href="#the-a-element">a</a></code> or
|
|
<code><a href="#the-area-element">area</a></code> element that has a <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code> attribute, then the
|
|
<a href="#browsing-context">browsing context</a> that is navigated must be chosen by
|
|
applying <a href="#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">the rules for choosing a browsing context given a
|
|
browsing context name</a>, using the value of the <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code> attribute as the
|
|
browsing context name. If these rules result in the creation of a
|
|
new <a href="#browsing-context">browsing context</a>, it must be navigated with
|
|
<a href="#replacement-enabled">replacement enabled</a>.</p>
|
|
|
|
<p>Otherwise, if the hyperlink is a <a href="#rel-sidebar-hyperlink" 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 element is an <code><a href="#the-a-element">a</a></code> or
|
|
<code><a href="#the-area-element">area</a></code> element with no <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code> attribute, but the
|
|
<code><a href="#document">Document</a></code> contains a <code><a href="#the-base-element">base</a></code> element with a
|
|
<code title="attr-base-target"><a href="#attr-base-target">target</a></code> attribute, then the
|
|
browsing context that is navigated must be chosen by applying
|
|
<a href="#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">the rules for choosing a browsing context given a browsing
|
|
context name</a>, using the value of the <code title="attr-base-target"><a href="#attr-base-target">target</a></code> attribute of the first such
|
|
<code><a href="#the-base-element">base</a></code> element as the browsing context name. If these
|
|
rules result in the creation of a new <a href="#browsing-context">browsing context</a>,
|
|
it must be navigated with <a href="#replacement-enabled">replacement enabled</a>.</p>
|
|
|
|
|
|
<p>Otherwise, the browsing context that must be navigated is the
|
|
same browsing context as the one which the element itself is in.</p>
|
|
|
|
<p>The navigation must be done with the <a href="#browsing-context">browsing
|
|
context</a> that contains the <code><a href="#document">Document</a></code> object with
|
|
which the element in question is associated as the <a href="#source-browsing-context">source
|
|
browsing context</a>.</p>
|
|
|
|
</div><h4 id="linkTypes"><span class="secno">4.12.4 </span>Link types</h4><p>The following table summarizes 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>In this section, the term <i>referenced document</i> refers to
|
|
the resource identified by the element representing the link, and
|
|
the term <i>current document</i> refers to the resource within
|
|
which the element representing the link finds itself.<div class="impl">
|
|
|
|
<p>To determine which link types apply to a <code><a href="#the-link-element">link</a></code>,
|
|
<code><a href="#the-a-element">a</a></code>, or <code><a href="#the-area-element">area</a></code> element, the element's <code title="">rel</code> attribute must be <a href="#split-a-string-on-spaces" title="split a string on
|
|
spaces">split on spaces</a>. The resulting tokens are the link
|
|
types that apply to that element.</p>
|
|
|
|
</div><p>Except where otherwise specified, a keyword must not be specified
|
|
more than once per <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>
|
|
attribute.<p>The link types that contain no U+003A COLON characters (:),
|
|
including all those defined in this specification, are <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> values<span class="impl">, and must be
|
|
compared as such</span>.<p class="example">Thus, <code title="">rel="next"</code> is the
|
|
same as <code title="">rel="NEXT"</code>.<table><thead><tr><th rowspan="2">Link type</th>
|
|
<th colspan="2">Effect on...</th>
|
|
<th rowspan="2">Brief description</th>
|
|
<tr><th><code><a href="#the-link-element">link</a></code></th>
|
|
<th><code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code></th>
|
|
<tbody><tr><td><code title="rel-alternate"><a href="#rel-alternate">alternate</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td>Gives alternate representations of the current document.</td>
|
|
<tr><td><code title="rel-author"><a href="#link-type-author">author</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td>Gives a link to the current document's author.</td>
|
|
<tr><td><code title="rel-bookmark"><a href="#link-type-bookmark">bookmark</a></code></td>
|
|
<td><em>not allowed</em></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td>Gives the permalink for the nearest ancestor section.</td>
|
|
</tr><tr><td><code title="rel-external"><a href="#link-type-external">external</a></code></td>
|
|
<td><em>not allowed</em></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td>Indicates that the referenced document is not part of the same site as the current document.</td>
|
|
<tr><td><code title="rel-help"><a href="#link-type-help">help</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td>Provides a link to context-sensitive help.</td>
|
|
<tr><td><code title="rel-icon"><a href="#rel-icon">icon</a></code></td>
|
|
<td><a href="#external-resource-link" 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><td><code title="rel-license"><a href="#link-type-license">license</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td>Indicates that the main content of the current document is covered by the copyright license described by the referenced document.</td>
|
|
<tr><td><code title="rel-next"><a href="#link-type-next">next</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">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><td><code title="rel-nofollow"><a href="#link-type-nofollow">nofollow</a></code></td>
|
|
<td><em>not allowed</em></td>
|
|
<td><a href="#hyperlink-annotation" title="hyperlink annotation">Annotation</a></td>
|
|
<td>Indicates that the current document's original author or publisher does not endorse the referenced document.</td>
|
|
<tr><td><code title="rel-noreferrer"><a href="#link-type-noreferrer">noreferrer</a></code></td>
|
|
<td><em>not allowed</em></td>
|
|
<td><a href="#hyperlink-annotation" title="hyperlink annotation">Annotation</a></td>
|
|
<td>Requires that the user agent not send an HTTP <code title="http-referer">Referer</code> (sic) header if the user follows the hyperlink.</td>
|
|
<tr><td><code title="rel-pingback"><a href="#link-type-pingback">pingback</a></code></td>
|
|
<td><a href="#external-resource-link" 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><td><code title="rel-prefetch"><a href="#link-type-prefetch">prefetch</a></code></td>
|
|
<td><a href="#external-resource-link" title="external resource link">External Resource</a></td>
|
|
<td><a href="#external-resource-link" title="external resource link">External Resource</a></td>
|
|
<td>Specifies that the target resource should be preemptively cached.</td>
|
|
<tr><td><code title="rel-prev"><a href="#link-type-prev">prev</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">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><td><code title="rel-search"><a href="#link-type-search">search</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">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><td><code title="rel-sidebar"><a href="#link-type-sidebar">sidebar</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">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><td><code title="rel-stylesheet"><a href="#link-type-stylesheet">stylesheet</a></code></td>
|
|
<td><a href="#external-resource-link" title="external resource link">External Resource</a></td>
|
|
<td><em>not allowed</em></td>
|
|
<td>Imports a stylesheet.</td>
|
|
<tr><td><code title="rel-tag"><a href="#link-type-tag">tag</a></code></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td><a href="#hyperlink">Hyperlink</a></td>
|
|
<td>Gives a tag (identified by the given address) that applies to the current document.</td>
|
|
</table><div class="impl">
|
|
|
|
<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>
|
|
|
|
</div><h5 id="rel-alternate"><span class="secno">4.12.4.1 </span>Link type "<dfn title="rel-alternate"><code>alternate</code></dfn>"</h5><p>The <code title="rel-alternate"><a href="#rel-alternate">alternate</a></code> keyword may be
|
|
used with <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements.<p>The meaning of this keyword depends on the values of the other
|
|
attributes.<dl class="switch"><dt>If the element is a <code><a href="#the-link-element">link</a></code> element and the <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code> attribute also contains the
|
|
keyword <code title="rel-stylesheet"><a href="#link-type-stylesheet">stylesheet</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="rel-alternate"><a href="#rel-alternate">alternate</a></code> keyword
|
|
modifies the meaning of the <code title="rel-stylesheet"><a href="#link-type-stylesheet">stylesheet</a></code> keyword in the way
|
|
described for that keyword. The <code title="rel-alternate"><a href="#rel-alternate">alternate</a></code> keyword does not create a
|
|
link of its own.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>The <code title="rel-alternate"><a href="#rel-alternate">alternate</a></code> keyword is
|
|
used with the <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code>
|
|
attribute set to the value <code title="">application/rss+xml</code> or the value <code title="">application/atom+xml</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The keyword creates a <a href="#hyperlink">hyperlink</a> referencing a
|
|
syndication feed (though not necessarily syndicating exactly the
|
|
same content as the current page).</p>
|
|
|
|
<div class="impl">
|
|
|
|
<p>The first <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, or <code><a href="#the-area-element">area</a></code>
|
|
element in the document (in tree order) with the <code title="rel-alternate"><a href="#rel-alternate">alternate</a></code> keyword used with the <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code> attribute set to the value
|
|
<code title="">application/rss+xml</code> or the value <code title="">application/atom+xml</code> must be treated as the default
|
|
syndication feed for the purposes of feed autodiscovery.</p>
|
|
|
|
<div class="example">
|
|
<p>The following <code><a href="#the-link-element">link</a></code> element gives the syndication
|
|
feed for the current page:</p>
|
|
<pre><link rel="alternate" type="application/atom+xml" 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="alternate" type="application/atom+xml">Recently Visited Planets</a></li>
|
|
<li><a href="known-bad-planets.xml" rel="alternate" type="application/atom+xml">Known Bad Planets</a></li>
|
|
<li><a href="unexplored-planets.xml" rel="alternate" type="application/atom+xml">Unexplored Planets</a></li>
|
|
</ul></pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The keyword creates a <a href="#hyperlink">hyperlink</a> referencing 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="#attr-hyperlink-media">media</a></code>, <code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code>, and <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code> attributes.</p>
|
|
|
|
<p>If the <code title="rel-alternate"><a href="#rel-alternate">alternate</a></code> keyword is
|
|
used with the <code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">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="#rel-alternate">alternate</a></code> keyword is
|
|
used with the <code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">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="#rel-alternate">alternate</a></code> keyword is
|
|
used with the <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">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="#attr-hyperlink-media">media</a></code>, <code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code>, and <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code> attributes can be combined
|
|
when specified with the <code title="rel-alternate"><a href="#rel-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>This relationship is transitive — that is, if a document
|
|
links to two other documents with the link type "<code title="rel-alternate"><a href="#rel-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>
|
|
|
|
</dd>
|
|
|
|
</dl><h5 id="link-type-author"><span class="secno">4.12.4.2 </span>Link type "<dfn title="rel-author"><code>author</code></dfn>"</h5><p>The <code title="rel-author"><a href="#link-type-author">author</a></code> keyword may be
|
|
used with <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates a <a href="#hyperlink">hyperlink</a>.<p>For <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements, the <code title="rel-author"><a href="#link-type-author">author</a></code> keyword indicates that the
|
|
referenced document provides further information about the author of
|
|
the nearest <code><a href="#the-article-element">article</a></code> element ancestor of the element
|
|
defining the hyperlink, if there is one, or of the page as a whole,
|
|
otherwise.<p>For <code><a href="#the-link-element">link</a></code> elements, the <code title="rel-author"><a href="#link-type-author">author</a></code> keyword indicates that the
|
|
referenced document provides further information about the author
|
|
for the page as a whole.<p class="note">The "referenced document" can be, and often is, a
|
|
<code title="">mailto:</code> URL giving the e-mail address of the
|
|
author. <a href="#refsMAILTO">[MAILTO]</a><div class="impl">
|
|
|
|
<p><strong>Synonyms</strong>: For historical reasons, user agents
|
|
must also treat <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and
|
|
<code><a href="#the-area-element">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="#link-type-author">author</a></code> keyword specified as a link
|
|
relationship.</p>
|
|
|
|
</div><h5 id="link-type-bookmark"><span class="secno">4.12.4.3 </span>Link type "<dfn title="rel-bookmark"><code>bookmark</code></dfn>"</h5><p>The <code title="rel-bookmark"><a href="#link-type-bookmark">bookmark</a></code> keyword may be
|
|
used with <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements. This
|
|
keyword creates a <a href="#hyperlink">hyperlink</a>.<p>The <code title="rel-bookmark"><a href="#link-type-bookmark">bookmark</a></code> keyword gives a
|
|
permalink for the nearest ancestor <code><a href="#the-article-element">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="#the-article-element">article</a></code> elements.<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-type-external"><span class="secno">4.12.4.4 </span>Link type "<dfn title="rel-external"><code>external</code></dfn>"</h5><p>The <code title="rel-external"><a href="#link-type-external">external</a></code> keyword may be
|
|
used with <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements. This
|
|
keyword creates a <a href="#hyperlink">hyperlink</a>.<p>The <code title="rel-external"><a href="#link-type-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.<h5 id="link-type-help"><span class="secno">4.12.4.5 </span>Link type "<dfn title="rel-help"><code>help</code></dfn>"</h5><p>The <code title="rel-help"><a href="#link-type-help">help</a></code> keyword may be used with
|
|
<code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates a <a href="#hyperlink">hyperlink</a>.<p>For <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements, the <code title="rel-help"><a href="#link-type-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.<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="#the-link-element">link</a></code> elements, the <code title="rel-help"><a href="#link-type-help">help</a></code> keyword indicates that the referenced
|
|
document provides help for the page as a whole.<h5 id="rel-icon"><span class="secno">4.12.4.6 </span>Link type "<dfn title="rel-icon"><code>icon</code></dfn>"</h5><p>The <code title="rel-icon"><a href="#rel-icon">icon</a></code> keyword may be used with
|
|
<code><a href="#the-link-element">link</a></code> elements. This keyword creates an <a href="#external-resource-link" title="external resource link">external resource link</a>.<div class="impl">
|
|
|
|
<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>
|
|
|
|
</div><p>Icons could be auditory icons, visual icons, or other kinds of
|
|
icons. <span class="impl">If multiple icons are provided, the user
|
|
agent must select the most appropriate icon according to the <code title="attr-link-type"><a href="#attr-link-type">type</a></code>, <code title="attr-link-media"><a href="#attr-link-media">media</a></code>, and <code title="attr-link-sizes"><a href="#attr-link-sizes">sizes</a></code> attributes. If there are
|
|
multiple equally appropriate icons, user agents must use the last
|
|
one declared in <a href="#tree-order">tree order</a>. 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.</span><div class="impl">
|
|
|
|
<p>There is no default type for resources given by the <code title="rel-icon"><a href="#rel-icon">icon</a></code> keyword. However, for the purposes of
|
|
<a href="#concept-link-type-sniffing">determining the type of the
|
|
resource</a>, user agents must expect the resource to be an image.</p>
|
|
|
|
</div><p>The <dfn id="attr-link-sizes" title="attr-link-sizes"><code>sizes</code></dfn>
|
|
attribute gives the sizes of icons for visual media.<p>If specified, the attribute must have a value that is an
|
|
<a href="#unordered-set-of-unique-space-separated-tokens">unordered set of unique space-separated tokens</a>, which
|
|
are <a href="#ascii-case-insensitive">ASCII case-insensitive</a>. The values must all be
|
|
either an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string
|
|
"<code title="attr-link-sizes-any"><a href="#attr-link-sizes-any">any</a></code>", or a value that
|
|
consists of two <a href="#valid-non-negative-integer" title="valid non-negative integer">valid
|
|
non-negative integers</a> 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 or U+0058 LATIN CAPITAL LETTER X character.<p>The keywords represent icon sizes.<div class="impl">
|
|
|
|
<p>To parse and process the attribute's value, the user agent must
|
|
first <a href="#split-a-string-on-spaces" title="split a string on spaces">split the attribute's
|
|
value on spaces</a>, and must then parse each resulting keyword
|
|
to determine what it represents.</p>
|
|
|
|
</div><p>The <dfn id="attr-link-sizes-any" title="attr-link-sizes-any"><code>any</code></dfn> keyword
|
|
represents that the resource contains a scalable icon, e.g. as
|
|
provided by an SVG image.<div class="impl">
|
|
|
|
<p>Other keywords must be further parsed as follows to determine
|
|
what they represent:</p>
|
|
|
|
<ul><li><p>If the keyword doesn't contain exactly one U+0078 LATIN
|
|
SMALL LETTER X or U+0058 LATIN CAPITAL LETTER X character, then
|
|
this keyword doesn't represent anything. Abort these steps for that
|
|
keyword.</li>
|
|
|
|
<li><p>Let <var title="">width string</var> be the string before
|
|
the "<code title="">x</code>" or "<code title="">X</code>".</li>
|
|
|
|
<li><p>Let <var title="">height string</var> be the string after
|
|
the "<code title="">x</code>" or "<code title="">X</code>".</li>
|
|
|
|
<li><p>If either <var title="">width string</var> or <var title="">height string</var> 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.</li>
|
|
|
|
<li><p>Apply the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative
|
|
integers</a> to <var title="">width string</var> to obtain <var title="">width</var>.</li>
|
|
|
|
<li><p>Apply the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative
|
|
integers</a> to <var title="">height string</var> to obtain <var title="">height</var>.</li>
|
|
|
|
<li><p>The keyword represents that the resource contains a bitmap
|
|
icon with a width of <var title="">width</var> device pixels and a
|
|
height of <var title="">height</var> device pixels.</li>
|
|
|
|
</ul></div><p>The keywords specified on the <code title="attr-link-sizes"><a href="#attr-link-sizes">sizes</a></code> attribute must not represent
|
|
icon sizes that are not actually available in the linked
|
|
resource.<div class="impl">
|
|
|
|
<p>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.</p>
|
|
|
|
<p>In the absence of a <code><a href="#the-link-element">link</a></code> with the <code title="rel-icon"><a href="#rel-icon">icon</a></code> keyword, for <code><a href="#document">Document</a></code>s
|
|
obtained over HTTP or HTTPS, user agents may instead attempt to
|
|
<a href="#fetch">fetch</a> and use an icon with the <a href="#absolute-url">absolute
|
|
URL</a> obtained by resolving the <a href="#url">URL</a> "<code title="">/favicon.ico</code>" against <a href="#the-document-s-address">the document's
|
|
address</a>, as if the page had declared that icon using the
|
|
<code title="rel-icon"><a href="#rel-icon">icon</a></code> keyword.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following snippet shows the top part of an application with
|
|
several icons.</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>lsForums — Inbox</title>
|
|
<link rel=icon href=favicon.png sizes="16x16" type="image/png">
|
|
<link rel=icon href=windows.ico sizes="32x32 48x48" type="image/vnd.microsoft.icon">
|
|
<link rel=icon href=mac.icns sizes="128x128 512x512 8192x8192 32768x32768">
|
|
<link rel=icon href=iphone.png sizes="57x57" type="image/png">
|
|
<link rel=icon href=gnome.svg sizes="any" type="image/svg+xml">
|
|
<link rel=stylesheet href=lsforums.css>
|
|
<script src=lsforums.js></script>
|
|
<meta name=application-name content="lsForums">
|
|
</head>
|
|
<body>
|
|
...</pre>
|
|
|
|
</div><h5 id="link-type-license"><span class="secno">4.12.4.7 </span>Link type "<dfn title="rel-license"><code>license</code></dfn>"</h5><p>The <code title="rel-license"><a href="#link-type-license">license</a></code> keyword may be used
|
|
with <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates a <a href="#hyperlink">hyperlink</a>.<p>The <code title="rel-license"><a href="#link-type-license">license</a></code> keyword indicates
|
|
that the referenced document provides the copyright license terms
|
|
under which the main content of the current document is
|
|
provided.<p>This specification does not specify how to distinguish between
|
|
the main content of a document and content that is not deemed to be
|
|
part of that main content. The distinction should be made clear to
|
|
the user.<div class="example">
|
|
|
|
<p>Consider a photo sharing site. A page on that site might
|
|
describe and show a photograph, and the page might be marked up as
|
|
follows:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Exampl Pictures: Kissat</title>
|
|
<link rel="stylesheet" href="/style/default">
|
|
</head>
|
|
<body>
|
|
<h1>Kissat</h1>
|
|
<nav>
|
|
<a href="../">Return to photo index</a>
|
|
</nav>
|
|
<figure>
|
|
<img src="/pix/39627052_fd8dcd98b5.jpg">
|
|
<figcaption>Kissat</figcaption>
|
|
</figure>
|
|
<p>One of them has six toes!</p>
|
|
<p><small><a rel="license" href="http://www.opensource.org/licenses/mit-license.php">MIT Licensed</a></small></p>
|
|
<footer>
|
|
<a href="/">Home</a> | <a href="../">Photo index</a>
|
|
<p><small>© copyright 2009 Exampl Pictures. All Rights Reserved.</small></p>
|
|
</footer>
|
|
</body>
|
|
</html></pre>
|
|
|
|
<p>In this case the <code title="rel-license"><a href="#link-type-license">license</a></code>
|
|
applies to just the photo (the main content of the document), not
|
|
the whole document. In particular not the design of the page
|
|
itself, which is covered by the copyright given at the bottom of
|
|
the document. This could be made clearer in the styling
|
|
(e.g. making the license link prominently positioned near the
|
|
photograph, while having the page copyright in light small text at
|
|
the foot of the page.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<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="#link-type-license">license</a></code> keyword.</p>
|
|
|
|
</div><h5 id="link-type-nofollow"><span class="secno">4.12.4.8 </span>Link type "<dfn title="rel-nofollow"><code>nofollow</code></dfn>"</h5><p>The <code title="rel-nofollow"><a href="#link-type-nofollow">nofollow</a></code> keyword may be
|
|
used with <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements. This
|
|
keyword does not create a <a href="#hyperlink">hyperlink</a>, but <a href="#hyperlink-annotation" title="hyperlink annotation">annotates</a> any other hyperlinks
|
|
created by the element (the implied hyperlink, if no other keywords
|
|
create one).<p>The <code title="rel-nofollow"><a href="#link-type-nofollow">nofollow</a></code> keyword indicates
|
|
that the link is not endorsed by the original author or publisher of
|
|
the page, or that the link to the referenced document was included
|
|
primarily because of a commercial relationship between people
|
|
affiliated with the two pages.<h5 id="link-type-noreferrer"><span class="secno">4.12.4.9 </span>Link type "<dfn title="rel-noreferrer"><code>noreferrer</code></dfn>"</h5><p>The <code title="rel-noreferrer"><a href="#link-type-noreferrer">noreferrer</a></code> keyword may be
|
|
used with <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code> elements. This
|
|
keyword does not create a <a href="#hyperlink">hyperlink</a>, but <a href="#hyperlink-annotation" title="hyperlink annotation">annotates</a> any other hyperlinks
|
|
created by the element (the implied hyperlink, if no other keywords
|
|
create one).<p>It indicates that no referrer information is to be leaked when
|
|
following the link.<div class="impl">
|
|
|
|
<p>If a user agent follows a link defined by an <code><a href="#the-a-element">a</a></code> or
|
|
<code><a href="#the-area-element">area</a></code> element that has the <code title="rel-noreferrer"><a href="#link-type-noreferrer">noreferrer</a></code> keyword, the user agent
|
|
must not include a <code title="http-referer">Referer</code> (sic)
|
|
HTTP header (<a href="#concept-http-equivalent-headers" title="concept-http-equivalent-headers">or
|
|
equivalent</a> for other protocols) in the request.</p>
|
|
|
|
<p>This keyword also <a href="#noopener">causes the <code title="dom-opener">opener</code> attribute to remain null</a> if the
|
|
hyperlink creates a new <a href="#browsing-context">browsing context</a>.</p>
|
|
|
|
</div><h5 id="link-type-pingback"><span class="secno">4.12.4.10 </span>Link type "<dfn title="rel-pingback"><code>pingback</code></dfn>"</h5><p>The <code title="rel-pingback"><a href="#link-type-pingback">pingback</a></code> keyword may be
|
|
used with <code><a href="#the-link-element">link</a></code> elements. This keyword creates an <a href="#external-resource-link" title="external resource link">external resource link</a>.<p>For the semantics of the <code title="rel-pingback"><a href="#link-type-pingback">pingback</a></code> keyword, see the Pingback 1.0
|
|
specification. <a href="#refsPINGBACK">[PINGBACK]</a><h5 id="link-type-prefetch"><span class="secno">4.12.4.11 </span>Link type "<dfn title="rel-prefetch"><code>prefetch</code></dfn>"</h5><p>The <code title="rel-prefetch"><a href="#link-type-prefetch">prefetch</a></code> keyword may be
|
|
used with <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates an <a href="#external-resource-link" title="external resource
|
|
link">external resource link</a>.<p>The <code title="rel-prefetch"><a href="#link-type-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>There is no default type for resources given by the <code title="rel-prefetch"><a href="#link-type-prefetch">prefetch</a></code> keyword.<h5 id="link-type-search"><span class="secno">4.12.4.12 </span>Link type "<dfn title="rel-search"><code>search</code></dfn>"</h5><p>The <code title="rel-search"><a href="#link-type-search">search</a></code> keyword may be used
|
|
with <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates a <a href="#hyperlink">hyperlink</a>.<p>The <code title="rel-search"><a href="#link-type-search">search</a></code> keyword indicates that
|
|
the referenced document provides an interface specifically for
|
|
searching the document and its related resources.<p class="note">OpenSearch description documents can be used with
|
|
<code><a href="#the-link-element">link</a></code> elements and the <code title="rel-search"><a href="#link-type-search">search</a></code> link type to enable user agents to
|
|
autodiscover search interfaces. <a href="#refsOPENSEARCH">[OPENSEARCH]</a><h5 id="link-type-sidebar"><span class="secno">4.12.4.13 </span>Link type "<dfn title="rel-sidebar"><code>sidebar</code></dfn>"</h5><p>The <code title="rel-sidebar"><a href="#link-type-sidebar">sidebar</a></code> keyword may be used
|
|
with <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates a <a href="#hyperlink">hyperlink</a>.<p>The <code title="rel-sidebar"><a href="#link-type-sidebar">sidebar</a></code> keyword indicates
|
|
that the referenced document, if retrieved, is intended to be shown
|
|
in a <a href="#secondary-browsing-context">secondary browsing context</a> (if possible), instead
|
|
of in the current <a href="#browsing-context">browsing context</a>.<p>A <a href="#hyperlink">hyperlink</a> with the <code title="rel-sidebar"><a href="#link-type-sidebar">sidebar</a></code> keyword specified is a <dfn id="rel-sidebar-hyperlink" title="rel-sidebar-hyperlink">sidebar hyperlink</dfn>.<h5 id="link-type-stylesheet"><span class="secno">4.12.4.14 </span>Link type "<dfn title="rel-stylesheet"><code>stylesheet</code></dfn>"</h5><p>The <code title="rel-stylesheet"><a href="#link-type-stylesheet">stylesheet</a></code> keyword may be
|
|
used with <code><a href="#the-link-element">link</a></code> elements. This keyword creates an <a href="#external-resource-link" title="external resource link">external resource link</a> that
|
|
contributes to the <a href="#styling">styling processing model</a>.<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>If the <code title="rel-alternate"><a href="#rel-alternate">alternate</a></code> keyword is
|
|
also specified on the <code><a href="#the-link-element">link</a></code> element, then <dfn id="the-link-is-an-alternative-stylesheet">the link
|
|
is an alternative stylesheet</dfn>; in this case, the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute must be specified on the
|
|
<code><a href="#the-link-element">link</a></code> element, with a non-empty value.<p>The default type for resources given by the <code title="rel-stylesheet"><a href="#link-type-stylesheet">stylesheet</a></code> keyword is <code title="">text/css</code>.<div class="impl">
|
|
|
|
<p>The appropriate time to <a href="#concept-link-obtain" title="concept-link-obtain">obtain</a> the resource is when the
|
|
<a href="#external-resource-link" title="external resource link">external resource link</a>
|
|
is created or when its element is <a href="#insert-an-element-into-a-document" title="insert an element
|
|
into a document">inserted into a document</a>, whichever happens
|
|
last. If the resource is <a href="#the-link-is-an-alternative-stylesheet" title="the link is an alternative
|
|
stylesheet">an alternative stylesheet</a> then the user agent may
|
|
defer obtaining the resource until it is part of the <span>preferred
|
|
style sheet set</span>. <a href="#refsCSSOM">[CSSOM]</a></p>
|
|
<p><strong>Quirk</strong>: If the document has been set to
|
|
<a href="#quirks-mode">quirks mode</a>, has the <a href="#same-origin">same origin</a> as the
|
|
<a href="#url">URL</a> of the external resource<!-- CVE-2010-0654 -->, and
|
|
the <a href="#content-type" title="Content-Type">Content-Type metadata</a> of the
|
|
external resource is not a supported style sheet type, the user
|
|
agent must instead assume it to be <code title="">text/css</code>.</p>
|
|
|
|
</div><h5 id="link-type-tag"><span class="secno">4.12.4.15 </span>Link type "<dfn title="rel-tag"><code>tag</code></dfn>"</h5><p>The <code title="rel-tag"><a href="#link-type-tag">tag</a></code> keyword may be used
|
|
with <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates a <a href="#hyperlink">hyperlink</a>.<p>The <code title="rel-tag"><a href="#link-type-tag">tag</a></code> keyword indicates that the
|
|
<em>tag</em> that the referenced document represents applies to the
|
|
current document.<p class="note">Since it indicates that the tag <em>applies to the
|
|
current document</em>, it would be inappropriate to use this keyword
|
|
in the markup of a <a href="#tag-cloud">tag cloud</a>, which lists
|
|
the popular tag across a set of pages.<h5 id="sequential-link-types"><span class="secno">4.12.4.16 </span>Sequential link types</h5><p>Some documents form part of a sequence of documents.<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>A document may be part of multiple sequences.<h6 id="link-type-next"><span class="secno">4.12.4.16.1 </span>Link type "<dfn title="rel-next"><code>next</code></dfn>"</h6><p>The <code title="rel-next"><a href="#link-type-next">next</a></code> keyword may be used with
|
|
<code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates a <a href="#hyperlink">hyperlink</a>.<p>The <code title="rel-next"><a href="#link-type-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.<h6 id="link-type-prev"><span class="secno">4.12.4.16.2 </span>Link type "<dfn title="rel-prev"><code>prev</code></dfn>"</h6><p>The <code title="rel-prev"><a href="#link-type-prev">prev</a></code> keyword may be used with
|
|
<code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code>
|
|
elements. This keyword creates a <a href="#hyperlink">hyperlink</a>.<p>The <code title="rel-prev"><a href="#link-type-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.<div class="impl">
|
|
|
|
<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="#link-type-prev">prev</a></code> keyword.</p>
|
|
|
|
</div><h5 id="other-link-types"><span class="secno">4.12.4.17 </span>Other link types</h5><p><dfn id="concept-rel-extensions" title="concept-rel-extensions">Extensions to the predefined
|
|
set of link types</dfn> may be registered in the <a href="http://microformats.org/wiki/existing-rel-values">Microformats wiki existing-rel-values page</a>. <a href="#refsMFREL">[MFREL]</a><p>Anyone is free to edit the <span title="">Microformats wiki
|
|
existing-rel-values page</span> at any time to add a type. Extension
|
|
types must be specified with the following information:<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>
|
|
|
|
<p>If the value contains a U+003A COLON character (:), it must
|
|
also be an <a href="#absolute-url">absolute URL</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Effect on... <code><a href="#the-link-element">link</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>One of the following:</p>
|
|
|
|
<dl><dt>Not allowed</dt>
|
|
|
|
<dd>The keyword must not be specified on <code><a href="#the-link-element">link</a></code>
|
|
elements.</dd>
|
|
|
|
<dt>Hyperlink</dt>
|
|
|
|
<dd>The keyword may be specified on a <code><a href="#the-link-element">link</a></code> element;
|
|
it creates a <a href="#hyperlink">hyperlink</a>.</dd>
|
|
|
|
<dt>External Resource</dt>
|
|
|
|
<dd>The keyword may be specified on a <code><a href="#the-link-element">link</a></code> element;
|
|
it creates an <a href="#external-resource-link">external resource link</a>.</dd>
|
|
|
|
</dl></dd>
|
|
|
|
|
|
<dt>Effect on... <code><a href="#the-a-element">a</a></code> and <code><a href="#the-area-element">area</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>One of the following:</p>
|
|
|
|
<dl><dt>Not allowed</dt>
|
|
|
|
<dd>The keyword must not be specified on <code><a href="#the-a-element">a</a></code> and
|
|
<code><a href="#the-area-element">area</a></code> elements.</dd>
|
|
|
|
<dt>Hyperlink</dt>
|
|
|
|
<dd>The keyword may be specified on <code><a href="#the-a-element">a</a></code> and
|
|
<code><a href="#the-area-element">area</a></code> elements; it creates a
|
|
<a href="#hyperlink">hyperlink</a>.</dd>
|
|
|
|
<dt>External Resource</dt>
|
|
|
|
<dd>The keyword may be specified on a <code><a href="#the-a-element">a</a></code> and
|
|
<code><a href="#the-area-element">area</a></code> elements; it creates an <a href="#external-resource-link">external resource
|
|
link</a>.</dd>
|
|
|
|
<dt>Hyperlink Annotation</dt>
|
|
|
|
<dd>The keyword may be specified on a <code><a href="#the-a-element">a</a></code> and
|
|
<code><a href="#the-area-element">area</a></code> elements; it <a href="#hyperlink-annotation" title="hyperlink
|
|
annotation">annotates</a> other <a href="#hyperlink" title="hyperlink">hyperlinks</a> created by the element.</dd>
|
|
|
|
</dl></dd>
|
|
|
|
|
|
<dt>Brief description</dt>
|
|
|
|
<dd><p>A short non-normative description of what the keyword's
|
|
meaning is.</dd>
|
|
|
|
|
|
<dt>Specification</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.</dd>
|
|
|
|
|
|
<dt>Synonyms</dt>
|
|
|
|
<dd><p>A list of other keyword values that have exactly the same
|
|
processing requirements. Authors should not use the values defined
|
|
to be synonyms, they are only intended to allow user agents to
|
|
support legacy content. Anyone may remove synonyms that are not
|
|
used in practice; only names that need to be processed as synonyms
|
|
for compatibility with legacy content are to be registered in this
|
|
way.</dd>
|
|
|
|
|
|
<dt>Status</dt>
|
|
|
|
<dd>
|
|
|
|
<p>One of the following:</p>
|
|
|
|
<dl><dt>Proposed</dt>
|
|
|
|
<dd>The keyword has not received wide peer review and
|
|
approval. Someone has proposed it and is, or soon will be, using
|
|
it.</dd>
|
|
|
|
<dt>Ratified</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 it in
|
|
incorrect ways.</dd>
|
|
|
|
<dt>Discontinued</dt>
|
|
|
|
<dd>The keyword 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
|
|
"specification" entries will give details of what authors should
|
|
use instead, if anything.</dd>
|
|
|
|
</dl><p>If a keyword is found to be redundant with existing values, it
|
|
should be removed and listed as a synonym for the existing
|
|
value.</p>
|
|
|
|
<p>If a keyword is registered in the "proposed" state for a
|
|
period of a month or more without being used or specified, then it
|
|
may be removed from the registry.</p>
|
|
|
|
<p>If a keyword is added with the "proposed" 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 "proposed" status and found to be harmful, then it should be
|
|
changed to "discontinued" status.</p>
|
|
|
|
<p>Anyone can change the status at any time, but should only do so
|
|
in accordance with the definitions above.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>Conformance checkers must use the information given on the <span title="">Microformats wiki existing-rel-values page</span> to
|
|
establish if a value is allowed or not: values defined in this
|
|
specification or marked as "proposed" or "ratified" must be accepted
|
|
when used on the elements for which they apply as described in the
|
|
"Effect on..." field, whereas values marked as "discontinued" or not
|
|
listed in either this specification or on the aforementioned page
|
|
must be rejected as invalid. Conformance checkers may cache this
|
|
information (e.g. for performance reasons or to avoid the use of
|
|
unreliable network connectivity).</p>
|
|
|
|
<p>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 "proposed" status.</p>
|
|
|
|
</div><p>Types defined as extensions in the <a href="http://microformats.org/wiki/existing-rel-values">Microformats
|
|
wiki existing-rel-values page</a> with the status "proposed" or
|
|
"ratified" may be used with the <code title="">rel</code> attribute
|
|
on <code><a href="#the-link-element">link</a></code>, <code><a href="#the-a-element">a</a></code>, and <code><a href="#the-area-element">area</a></code> elements
|
|
in accordance to the "Effect on..." field. <a href="#refsMFREL">[MFREL]</a><h3 id="common-idioms-without-dedicated-elements"><span class="secno">4.13 </span>Common idioms without dedicated elements</h3><h4 id="the-main-part-of-the-content"><span class="secno">4.13.1 </span>The main part of the content</h4><p>The main content of a page — not including headers and
|
|
footers, navigation links, sidebars, advertisements, and so forth
|
|
— can be marked up in a variety of ways, depending on the
|
|
needs of the author.<p>The simplest solution is to not mark up the main content at all,
|
|
and just leave it as implicit. Another way to think of this is that
|
|
the <code><a href="#the-body-element">body</a></code> elements marks up the main content of the
|
|
page, and the bits that aren't main content are excluded through the
|
|
use of more appropriate elements like <code><a href="#the-aside-element">aside</a></code> and
|
|
<code><a href="#the-nav-element">nav</a></code>.<div class="example">
|
|
|
|
<p>Here is a short Web page marked up along this minimalistic
|
|
school of thought. The main content is highlighted. Notice how all
|
|
the <em>other</em> content in the <code><a href="#the-body-element">body</a></code> is marked up
|
|
with elements to indicate that it's not part of the main content,
|
|
in this case <code><a href="#the-header-element">header</a></code>, <code><a href="#the-nav-element">nav</a></code>, and
|
|
<code><a href="#the-footer-element">footer</a></code>.</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title> My Toys </title>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>My toys</h1>
|
|
</header>
|
|
<nav>
|
|
<p><a href="/">Home</a></p>
|
|
<p><a href="/contact">Contact</a></p>
|
|
</nav>
|
|
<strong> <p>I really like my chained book and my telephone. I'm not such a
|
|
fan of my big ball.</p>
|
|
<p>Another toy I like is my mirror.</p></strong>
|
|
<footer>
|
|
<p>© copyright 2010 by the boy</p>
|
|
</footer>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><p>If the main content is an independent unit of content that one
|
|
could imagine syndicating independently, then the
|
|
<code><a href="#the-article-element">article</a></code> element would be appropriate to mark up the
|
|
main content of the document.<div class="example">
|
|
|
|
<p>The document in the previous example is here recast as a blog
|
|
post:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title> The Boy Blog: My Toys </title>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>The Boy Blog</h1>
|
|
</header>
|
|
<nav>
|
|
<p><a href="/">Home</a></p>
|
|
<p><a href="/contact">Contact</a></p>
|
|
</nav>
|
|
<strong> <article>
|
|
<header>
|
|
<h1>My toys</h1>
|
|
<p>Published <time pubdate datetime="2010-08-04">August 4th</time></p>
|
|
</header>
|
|
<p>I really like my chained book and my telephone. I'm not such a
|
|
fan of my big ball.</p>
|
|
<p>Another toy I like is my mirror.</p>
|
|
</article></strong>
|
|
<footer>
|
|
<p>© copyright 2010 by the boy</p>
|
|
</footer>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><p>If the main content is not an independent unit of content so much
|
|
as a section of a larger work, for instance a chapter, then the
|
|
<code><a href="#the-section-element">section</a></code> element would be appropriate to mark up the
|
|
main content of the document.<div class="example">
|
|
|
|
<p>Here is the same document, case as a chapter in an online
|
|
book:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title> Chapter 2: My Toys — The Book of the Boy </title>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>Chapter 2: My Toys</h1>
|
|
</header>
|
|
<nav>
|
|
<p><a href="/">Front Page</a></p>
|
|
<p><a href="/toc">Table of Contents</a></p>
|
|
<p><a href="/c1">Chapter 1</a> — <a href="/c3">Chapter 3</a></p>
|
|
</nav>
|
|
<strong> <section>
|
|
<p>I really like my chained book and my telephone. I'm not such a
|
|
fan of my big ball.</p>
|
|
<p>Another toy I like is my mirror.</p>
|
|
</section></strong>
|
|
<footer>
|
|
<p>© copyright 2010 by the boy</p>
|
|
</footer>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><p>If neither <code><a href="#the-article-element">article</a></code> nor <code><a href="#the-section-element">section</a></code> would be
|
|
appropriate, but the main content still needs an explicit element,
|
|
for example for styling purposes, then the <code><a href="#the-div-element">div</a></code> element
|
|
can be used.<div class="example">
|
|
|
|
<p>This is the same as the original example, but using
|
|
<code><a href="#the-div-element">div</a></code> for the main content instead of leaving it
|
|
implied:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title> My Toys </title>
|
|
<style>
|
|
body > div { background: navy; color: yellow; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1>My toys</h1>
|
|
</header>
|
|
<nav>
|
|
<p><a href="/">Home</a></p>
|
|
<p><a href="/contact">Contact</a></p>
|
|
</nav>
|
|
<strong> <div>
|
|
<p>I really like my chained book and my telephone. I'm not such a
|
|
fan of my big ball.</p>
|
|
<p>Another toy I like is my mirror.</p>
|
|
</div></strong>
|
|
<footer>
|
|
<p>© copyright 2010 by the boy</p>
|
|
</footer>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><h4 id="rel-up"><span class="secno">4.13.2 </span>Bread crumb navigation</h4><p>This specification does not provide a machine-readable way of
|
|
describing bread-crumb navigation menus. Authors are encouraged to
|
|
just use a series of links in a paragraph. The <code><a href="#the-nav-element">nav</a></code>
|
|
element can be used to mark the section containing these
|
|
paragraphs as being navigation blocks.<div class="example">
|
|
|
|
<p>In the following example, the current page can be reached via
|
|
two paths.</p>
|
|
|
|
<pre><nav>
|
|
<p>
|
|
<a href="/">Main</a> >
|
|
<a href="/products/">Products</a> >
|
|
<a href="/products/dishwashers/">Dishwashers</a> >
|
|
<a>Second hand</a>
|
|
</p>
|
|
<p>
|
|
<a href="/">Main</a> >
|
|
<a href="/second-hand/">Second hand</a> >
|
|
<a>Dishwashers</a>
|
|
</p>
|
|
</nav></pre>
|
|
|
|
</div><h4 id="tag-clouds"><span class="secno">4.13.3 </span>Tag clouds</h4><p id="tag-cloud">This specification does not define any markup
|
|
specifically for marking up lists of keywords that apply to a group
|
|
of pages (also known as <i>tag clouds</i>). In general, authors are
|
|
encouraged to either mark up such lists using <code><a href="#the-ul-element">ul</a></code>
|
|
elements with explicit inline counts that are then hidden and turned
|
|
into a presentational effect using a style sheet, or to use SVG.<div class="example">
|
|
|
|
<p>Here, three tags are included in a short tag cloud:</p>
|
|
|
|
<pre><style>
|
|
@media screen, print, handheld, tv {
|
|
/* should be ignored by non-visual browsers */
|
|
.tag-cloud > li > span { display: none; }
|
|
.tag-cloud > li { display: inline; }
|
|
.tag-cloud-1 { font-size: 0.7em; }
|
|
.tag-cloud-2 { font-size: 0.9em; }
|
|
.tag-cloud-3 { font-size: 1.1em; }
|
|
.tag-cloud-4 { font-size: 1.3em; }
|
|
.tag-cloud-5 { font-size: 1.5em; }
|
|
}
|
|
</style>
|
|
...
|
|
<ul class="tag-cloud">
|
|
<li class="tag-cloud-4"><a title="28 instances" href="/t/apple">apple</a> <span>(popular)</span>
|
|
<li class="tag-cloud-2"><a title="6 instances" href="/t/kiwi">kiwi</a> <span>(rare)</span>
|
|
<li class="tag-cloud-5"><a title="41 instances" href="/t/pear">pear</a> <span>(very popular)</span>
|
|
</ul></pre>
|
|
|
|
<p>The actual frequency of each tag is given using the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute. A CSS style sheet is
|
|
provided to convert the markup into a cloud of differently-sized
|
|
words, but for user agents that do not support CSS or are not
|
|
visual, the markup contains annotations like "(popular)" or
|
|
"(rare)" to categorize the various tags by frequency, thus enabling
|
|
all users to benefit from the information.</p>
|
|
|
|
<p>The <code><a href="#the-ul-element">ul</a></code> element is used (rather than
|
|
<code><a href="#the-ol-element">ol</a></code>) because the order is not particularly important:
|
|
while the list is in fact ordered alphabetically, it would convey
|
|
the same information if ordered by, say, the length of the tag.</p>
|
|
|
|
<p>The <code title="rel-tag"><a href="#link-type-tag">tag</a></code> <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>-keyword is <em>not</em> used
|
|
on these <code><a href="#the-a-element">a</a></code> elements because they do not represent tags
|
|
that apply to the page itself; they are just part of an index
|
|
listing the tags themselves.</p>
|
|
|
|
</div><h4 id="conversations"><span class="secno">4.13.4 </span>Conversations</h4><p>This specification does not define a specific element for marking
|
|
up conversations, meeting minutes, chat transcripts, dialogues in
|
|
screenplays, instant message logs, and other situations where
|
|
different players take turns in discourse.<p>Instead, authors are encouraged to mark up conversations using
|
|
<code><a href="#the-p-element">p</a></code> elements and punctuation. Authors who need to mark
|
|
the speaker for styling purposes are encouraged to use
|
|
<code><a href="#the-span-element">span</a></code> or <code><a href="#the-b-element">b</a></code>. Paragraphs with their text
|
|
wrapped in the <code><a href="#the-i-element">i</a></code> element can be used for marking up
|
|
stage directions.<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><p> Costello: Look, you gotta first baseman?
|
|
<p> Abbott: Certainly.
|
|
<p> Costello: Who's playing first?
|
|
<p> Abbott: That's right.
|
|
<p> Costello becomes exasperated.
|
|
<p> Costello: When you pay off the first baseman every month, who gets the money?
|
|
<p> Abbott: Every dollar of it.</pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following extract shows how an IM conversation log could be
|
|
marked up.</p>
|
|
|
|
<pre><p> <time>14:22</time> <b>egof</b> I'm not that nerdy, I've only seen 30% of the star trek episodes
|
|
<p> <time>14:23</time> <b>kaj</b> if you know what percentage of the star trek episodes you have seen, you are inarguably nerdy
|
|
<p> <time>14:23</time> <b>egof</b> it's unarguably
|
|
<p> <time>14:23</time> <i>* kaj blinks</i>
|
|
<p> <time>14:24</time> <b>kaj</b> you are not helping your case</pre>
|
|
|
|
|
|
</div><h4 id="footnotes"><span class="secno">4.13.5 </span>Footnotes</h4><p>HTML does not have a dedicated mechanism for marking up
|
|
footnotes. Here are the recommended alternatives.<hr><p>For short inline annotations, the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute should be used.<div class="example">
|
|
|
|
<p>In this example, two parts of a dialogue are annotated with
|
|
footnote-like content using the <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute.</p>
|
|
|
|
<pre><p> <b>Customer</b>: Hello! I wish to register a complaint. Hello. Miss?
|
|
<p> <b>Shopkeeper</b>: <strong><span title="Colloquial pronunciation of 'What do you'"</strong>
|
|
>Watcha</span> mean, miss?
|
|
<p> <b>Customer</b>: Uh, I'm sorry, I have a cold. I wish to make a complaint.
|
|
<p> <b>Shopkeeper</b>: Sorry, <span <strong>title="This is, of course, a lie."</strong>>we're
|
|
closing for lunch</span>.</pre>
|
|
|
|
</div><hr><p>For longer annotations, the <code><a href="#the-a-element">a</a></code> 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.<div class="example">
|
|
|
|
<p>In this example, a footnote in the dialogue links to a paragraph
|
|
below the dialogue. The paragraph then reciprocally links back to the
|
|
dialogue, allowing the user to return to the location of the
|
|
footnote.</p>
|
|
|
|
<pre><p> Announcer: Number 16: The <i>hand</i>.
|
|
<p> Interviewer: 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?
|
|
<p> Norman: I don't. <sup><a href="#fn1" id="r1">[1]</a></sup>
|
|
<p> Interviewer: You told me you did!
|
|
<em>...</em>
|
|
<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>
|
|
</section></pre>
|
|
|
|
</div><hr><p>For side notes, longer annotations that apply to entire sections
|
|
of the text rather than just specific words or sentences, the
|
|
<code><a href="#the-aside-element">aside</a></code> element should be used.<div class="example">
|
|
|
|
<p>In this example, a sidebar is given after a dialogue, giving it
|
|
some context.</p>
|
|
|
|
<pre><p> <span class="speaker">Customer</span>: I will not buy this record, it is scratched.
|
|
<p> <span class="speaker">Shopkeeper</span>: I'm sorry?
|
|
<p> <span class="speaker">Customer</span>: I will not buy this record, it is scratched.
|
|
<p> <span class="speaker">Shopkeeper</span>: No no no, this's'a tobacconist's.
|
|
<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></pre>
|
|
|
|
</div><hr><p>For figures or tables, footnotes can be included in the relevant
|
|
<code><a href="#the-figcaption-element">figcaption</a></code> or <code><a href="#the-caption-element">caption</a></code> element, or in
|
|
surrounding prose.<div class="example">
|
|
|
|
<p>In this example, a table has cells with footnotes
|
|
that are given in prose. A <code><a href="#the-figure-element">figure</a></code> element is used to
|
|
give a single legend to the combination of the table and its
|
|
footnotes.</p>
|
|
|
|
<pre><figure>
|
|
<figcaption>Table 1. Alternative activities for knights.</figcaption>
|
|
<table>
|
|
<tr>
|
|
<th> Activity
|
|
<th> Location
|
|
<th> Cost
|
|
<tr>
|
|
<td> Dance
|
|
<td> Wherever possible
|
|
<td> £0<sup><a href="#fn1">1</a></sup>
|
|
<tr>
|
|
<td> Routines, chorus scenes<sup><a href="#fn2">2</a></sup>
|
|
<td> Undisclosed
|
|
<td> Undisclosed
|
|
<tr>
|
|
<td> Dining<sup><a href="#fn3">3</a></sup>
|
|
<td> Camelot
|
|
<td> Cost of ham, jam, and spam<sup><a href="#fn4">4</a></sup>
|
|
</table>
|
|
<p id="fn1">1. Assumed.</p>
|
|
<p id="fn2">2. Footwork impeccable.</p>
|
|
<p id="fn3">3. Quality described as "well".</p>
|
|
<p id="fn4">4. A lot.</p>
|
|
</figure></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h3 id="matching-html-elements-using-selectors"><span class="secno">4.14 </span>Matching HTML elements using selectors</h3>
|
|
|
|
<h4 id="selectors"><span class="secno">4.14.1 </span>Case-sensitivity</h4>
|
|
|
|
<p>Attribute and element <em>names</em> of <a href="#html-elements">HTML
|
|
elements</a> in <a href="#html-documents">HTML documents</a> must be treated as
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a>.</p>
|
|
|
|
<p>Classes from the <code title="attr-class"><a href="#classes">class</a></code> attribute
|
|
of <a href="#html-elements">HTML elements</a> in documents that are in <a href="#quirks-mode">quirks
|
|
mode</a> must be treated as <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a>.</p>
|
|
|
|
<p>Attribute selectors on an <a href="#html-elements" title="HTML elements">HTML
|
|
element</a> in an <a href="#html-documents" title="HTML documents">HTML
|
|
document</a> must treat the <em>values</em> of attributes with
|
|
the following names as <a href="#ascii-case-insensitive">ASCII case-insensitive</a>, with one
|
|
exception as noted below:</p>
|
|
|
|
|
|
|
|
<ul class="brief"><li><code title="">accept</code>
|
|
<li><code title="">accept-charset</code>
|
|
<li><code title="">align</code>
|
|
<li><code title="">alink</code>
|
|
<li><code title="">axis</code>
|
|
<li><code title="">bgcolor</code>
|
|
<li><code title="">charset</code>
|
|
<li><code title="">checked</code>
|
|
<li><code title="">clear</code>
|
|
<li><code title="">codetype</code>
|
|
<li><code title="">color</code>
|
|
<li><code title="">compact</code>
|
|
<li><code title="">declare</code>
|
|
<li><code title="">defer</code>
|
|
<li><code title="">dir</code>
|
|
<li><code title="">direction</code>
|
|
<li><code title="">disabled</code>
|
|
<li><code title="">enctype</code>
|
|
<li><code title="">face</code>
|
|
<li><code title="">frame</code>
|
|
<li><code title="">hreflang</code>
|
|
<li><code title="">http-equiv</code>
|
|
<li><code title="">lang</code>
|
|
<li><code title="">language</code>
|
|
<li><code title="">link</code>
|
|
<li><code title="">media</code>
|
|
<li><code title="">method</code>
|
|
<li><code title="">multiple</code>
|
|
<li><code title="">nohref</code>
|
|
<li><code title="">noresize</code>
|
|
<li><code title="">noshade</code>
|
|
<li><code title="">nowrap</code>
|
|
<li><code title="">readonly</code>
|
|
<li><code title="">rel</code>
|
|
<li><code title="">rev</code>
|
|
<li><code title="">rules</code>
|
|
<li><code title="">scope</code>
|
|
<li><code title="">scrolling</code>
|
|
<li><code title="">selected</code>
|
|
<li><code title="">shape</code>
|
|
<li><code title="">target</code>
|
|
<li><code title="">text</code>
|
|
<li><code title="">type</code> (except as specified below)
|
|
<li><code title="">valign</code>
|
|
<li><code title="">valuetype</code>
|
|
<li><code title="">vlink</code>
|
|
</ul><p>All other attribute values on <a href="#html-elements">HTML elements</a> must be
|
|
treated as <a href="#case-sensitive">case-sensitive</a>.</p>
|
|
|
|
<p>The exception to the list above is the <code title="attr-ol-type"><a href="#attr-ol-type">type</a></code> attribute on <code><a href="#the-ol-element">ol</a></code>
|
|
elements, which must be treated as <a href="#case-sensitive">case-sensitive</a>.</p>
|
|
|
|
|
|
<h4 id="pseudo-classes"><span class="secno">4.14.2 </span>Pseudo-classes</h4>
|
|
|
|
<p>There are a number of dynamic selectors that can be used with
|
|
HTML. This section defines when these selectors match HTML
|
|
elements.</p>
|
|
|
|
<dl><dt><dfn id="selector-link" title="selector-link"><code>:link</code></dfn></dt>
|
|
<dt><dfn id="selector-visited" title="selector-visited"><code>:visited</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>All <code><a href="#the-a-element">a</a></code> elements that have an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute, all
|
|
<code><a href="#the-area-element">area</a></code> elements that have an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute, and all
|
|
<code><a href="#the-link-element">link</a></code> elements that have an <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute, must match one of
|
|
<code title="selector-link"><a href="#selector-link">:link</a></code> and <code title="selector-visited"><a href="#selector-visited">:visited</a></code>.</p>
|
|
|
|
<p>Other specifications might apply more specific rules regarding
|
|
how these elements are to match these pseudo-elements, to mitigate
|
|
some privacy concerns that apply with straightforward
|
|
implementations of this requirement.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><dfn id="selector-active" title="selector-active"><code>:active</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-active"><a href="#selector-active">:active</a></code> pseudo-class
|
|
is defined to match an element <q cite="http://dev.w3.org/csswg/selectors3/#the-user-action-pseudo-classes-hover-act">while
|
|
an element is <i>being activated</i> by the user</q>. For the
|
|
purposes of defining the <code title="selector-active"><a href="#selector-active">:active</a></code> pseudo-class only, an HTML
|
|
user agent must consider an element as <i>being activated</i> if
|
|
it is:</p>
|
|
|
|
<ul><li>
|
|
|
|
<p>An element falling into one of the following categories
|
|
between the time the user begins to indicate an intent to
|
|
trigger the element's <a href="#activation-behavior">activation behavior</a> and
|
|
either the time the user stops indicating an intent to trigger
|
|
the element's <a href="#activation-behavior">activation behavior</a>, or the time the
|
|
element's <a href="#activation-behavior">activation behavior</a> has finished running,
|
|
which ever comes first:</p>
|
|
|
|
<ul><li><code><a href="#the-a-element">a</a></code> elements that have an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-area-element">area</a></code> elements that have an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-link-element">link</a></code> elements that have an <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-button-element">button</a></code> elements that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a>, <a href="#image-button-state" title="attr-input-type-image">Image Button</a>, <a href="#reset-button-state" title="attr-input-type-reset">Reset Button</a>, or <a href="#button-state" title="attr-input-type-button">Button</a> state</li>
|
|
|
|
<li><code><a href="#the-command-element">command</a></code> elements that do not have a <code title="attr-command-disabled"><a href="#attr-command-disabled">disabled</a></code> attribute</li>
|
|
|
|
<li>elements that are <a href="#specially-focusable">specially focusable</a></li>
|
|
|
|
</ul><p class="example">For example, if the user is using a keyboard
|
|
to push a <code><a href="#the-button-element">button</a></code> element by pressing the space bar,
|
|
the element would match this pseudo-class in between the time
|
|
that the element received the <code title="event-keydown">keydown</code> event and the time the
|
|
element received the <code title="event-keyup">keyup</code>
|
|
event.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>An element that the user indicates using a pointing device
|
|
while that pointing device is in the "down" state (e.g. for a
|
|
mouse, between the time the mouse button is pressed and the time
|
|
it is depressed).</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>An element that has a descendant that is currently matching
|
|
the <code title="selector-active"><a href="#selector-active">:active</a></code>
|
|
pseudo-class.</p>
|
|
|
|
</li>
|
|
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="selector-enabled" title="selector-enabled"><code>:enabled</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-enabled"><a href="#selector-enabled">:enabled</a></code> pseudo-class
|
|
must match any element falling into one of the following
|
|
categories:</p>
|
|
|
|
<ul><li><code><a href="#the-a-element">a</a></code> elements that have an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-area-element">area</a></code> elements that have an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-link-element">link</a></code> elements that have an <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-button-element">button</a></code> elements that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute are not in the
|
|
<a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state and that
|
|
are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-select-element">select</a></code> elements that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-textarea-element">textarea</a></code> elements that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-optgroup-element">optgroup</a></code> elements that are not <span title="concept-optgroup-disabled">disabled</span></li>
|
|
|
|
<li><code><a href="#the-option-element">option</a></code> elements that are not <a href="#concept-option-disabled" title="concept-option-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-command-element">command</a></code> elements that do not have a <code title="attr-command-disabled"><a href="#attr-command-disabled">disabled</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-li-element">li</a></code> elements that are children of
|
|
<code><a href="#the-menu-element">menu</a></code> elements, and that have a child element that
|
|
defines a <a href="#concept-command" title="concept-command">command</a>, if the
|
|
first such element's <a href="#command-facet-disabledstate" title="command-facet-disabledstate">Disabled State</a> facet
|
|
is false (not disabled)</li>
|
|
|
|
<li><code><a href="#the-fieldset-element">fieldset</a></code> elements that do not have a <code title="attr-fieldset-disabled"><a href="#attr-fieldset-disabled">disabled</a></code> attribute</li>
|
|
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="selector-disabled" title="selector-disabled"><code>:disabled</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-disabled"><a href="#selector-disabled">:disabled</a></code>
|
|
pseudo-class must match any element falling into one of the
|
|
following categories:</p>
|
|
|
|
<ul><li><code><a href="#the-button-element">button</a></code> elements that are <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute are not in the
|
|
<a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state and that
|
|
are <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-select-element">select</a></code> elements that are <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-textarea-element">textarea</a></code> elements that are <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-optgroup-element">optgroup</a></code> elements that are <span title="concept-optgroup-disabled">disabled</span></li>
|
|
|
|
<li><code><a href="#the-option-element">option</a></code> elements that are <a href="#concept-option-disabled" title="concept-option-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-command-element">command</a></code> elements that have a <code title="attr-command-disabled"><a href="#attr-command-disabled">disabled</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-li-element">li</a></code> elements that are children of
|
|
<code><a href="#the-menu-element">menu</a></code> elements, and that have a child element that
|
|
defines a <a href="#concept-command" title="concept-command">command</a>, if the
|
|
first such element's <a href="#command-facet-disabledstate" title="command-facet-disabledstate">Disabled State</a> facet
|
|
is true (disabled)</li>
|
|
|
|
<li><code><a href="#the-fieldset-element">fieldset</a></code> elements that have a <code title="attr-fieldset-disabled"><a href="#attr-fieldset-disabled">disabled</a></code> attribute</li>
|
|
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="selector-checked" title="selector-checked"><code>:checked</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-checked"><a href="#selector-checked">:checked</a></code> pseudo-class
|
|
must match any element falling into one of the following
|
|
categories:</p>
|
|
|
|
<ul><li><code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state and whose
|
|
<a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> state is
|
|
true</li>
|
|
|
|
<li><code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a> state and whose
|
|
<a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> state is
|
|
true</li>
|
|
|
|
<li><code><a href="#the-option-element">option</a></code> elements whose <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> is
|
|
true</li>
|
|
|
|
<li><code><a href="#the-command-element">command</a></code> elements whose <code title="attr-command-type"><a href="#attr-command-type">type</a></code> attribute is in the <a href="#attr-command-type-state-checkbox" title="attr-command-type-state-checkbox">Checkbox</a> state
|
|
and that have a <code title="attr-command-checked"><a href="#attr-command-checked">checked</a></code>
|
|
attribute</li>
|
|
|
|
<li><code><a href="#the-command-element">command</a></code> elements whose <code title="attr-command-type"><a href="#attr-command-type">type</a></code> attribute is in the <a href="#attr-command-type-state-radio" title="attr-command-type-state-radio">Radio</a> state and that
|
|
have a <code title="attr-command-checked"><a href="#attr-command-checked">checked</a></code>
|
|
attribute</li>
|
|
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="selector-indeterminate" title="selector-indeterminate"><code>:indeterminate</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
|
|
|
|
<p>The <code title="selector-indeterminate"><a href="#selector-indeterminate">:indeterminate</a></code>
|
|
pseudo-class must match any element falling into one of the
|
|
following categories:</p>
|
|
|
|
<ul><li><code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state and whose
|
|
<code title="dom-input-indeterminate"><a href="#dom-input-indeterminate">indeterminate</a></code> IDL
|
|
attribute is set to true</li>
|
|
|
|
<li><code><a href="#the-progress-element">progress</a></code> elements with no <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> content attribute</li>
|
|
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="selector-default" title="selector-default"><code>:default</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-default"><a href="#selector-default">:default</a></code> pseudo-class
|
|
must match any element falling into one of the following
|
|
categories:</p>
|
|
|
|
<ul><li><code><a href="#the-button-element">button</a></code> elements that are their form's
|
|
<a href="#default-button">default button</a></li>
|
|
|
|
<li><code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a> or <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, and that
|
|
are their form's <a href="#default-button">default button</a></li>
|
|
|
|
<li><code><a href="#the-input-element">input</a></code> elements to which the <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code> attribute applies and
|
|
that have a <code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>
|
|
attribute</li>
|
|
|
|
<li><code><a href="#the-option-element">option</a></code> elements that have a <code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code> attribute</li>
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="selector-valid" title="selector-valid"><code>:valid</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-valid"><a href="#selector-valid">:valid</a></code> pseudo-class
|
|
must match all elements that are <a href="#candidate-for-constraint-validation" title="candidate for
|
|
constraint validation">candidates for constraint validation</a>
|
|
and that <a href="#concept-fv-valid" title="concept-fv-valid">satisfy their
|
|
constraints</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><dfn id="selector-invalid" title="selector-invalid"><code>:invalid</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-invalid"><a href="#selector-invalid">:invalid</a></code> pseudo-class
|
|
must match all elements that are <a href="#candidate-for-constraint-validation" title="candidate for
|
|
constraint validation">candidates for constraint validation</a>
|
|
but that do not <a href="#concept-fv-valid" title="concept-fv-valid">satisfy their
|
|
constraints</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><dfn id="selector-in-range" title="selector-in-range"><code>:in-range</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-in-range"><a href="#selector-in-range">:in-range</a></code>
|
|
pseudo-class must match all elements that are <a href="#candidate-for-constraint-validation" title="candidate for constraint validation">candidates for
|
|
constraint validation</a>, <a href="#have-range-limitations">have range limitations</a>,
|
|
and that are neither <a href="#suffering-from-an-underflow">suffering from an underflow</a> nor
|
|
<a href="#suffering-from-an-overflow">suffering from an overflow</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><dfn id="selector-out-of-range" title="selector-out-of-range"><code>:out-of-range</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-out-of-range"><a href="#selector-out-of-range">:out-of-range</a></code>
|
|
pseudo-class must match all elements that are <a href="#candidate-for-constraint-validation" title="candidate for constraint validation">candidates for
|
|
constraint validation</a>, <a href="#have-range-limitations">have range limitations</a>,
|
|
and that are either <a href="#suffering-from-an-underflow">suffering from an underflow</a> or
|
|
<a href="#suffering-from-an-overflow">suffering from an overflow</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><dfn id="selector-required" title="selector-required"><code>:required</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-required"><a href="#selector-required">:required</a></code>
|
|
pseudo-class must match any element falling into one of the
|
|
following categories:</p>
|
|
|
|
<ul><li><code><a href="#the-input-element">input</a></code> elements that are <i title="concept-input-required"><a href="#concept-input-required">required</a></i></li>
|
|
|
|
<li><code><a href="#the-select-element">select</a></code> elements that have a <code title="attr-select-required"><a href="#attr-select-required">required</a></code>
|
|
attribute</li>
|
|
|
|
<li><code><a href="#the-textarea-element">textarea</a></code> elements that have a <code title="attr-textarea-required"><a href="#attr-textarea-required">required</a></code>
|
|
attribute</li>
|
|
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="selector-optional" title="selector-optional"><code>:optional</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-optional"><a href="#selector-optional">:optional</a></code>
|
|
pseudo-class must match any element falling into one of the
|
|
following categories:</p>
|
|
|
|
<ul><li><code><a href="#the-input-element">input</a></code> elements to which the <code title="attr-input-required"><a href="#attr-input-required">required</a></code> attribute applies
|
|
that are not <i title="concept-input-required"><a href="#concept-input-required">required</a></i></li>
|
|
|
|
<li><code><a href="#the-select-element">select</a></code> elements that do not have a <code title="attr-select-required"><a href="#attr-select-required">required</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-textarea-element">textarea</a></code> elements that do not have a <code title="attr-textarea-required"><a href="#attr-textarea-required">required</a></code>
|
|
attribute</li>
|
|
|
|
</ul></dd>
|
|
|
|
|
|
<dt><dfn id="selector-read-only" title="selector-read-only"><code>:read-only</code></dfn></dt>
|
|
<dt><dfn id="selector-read-write" title="selector-read-write"><code>:read-write</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-read-write"><a href="#selector-read-write">:read-write</a></code>
|
|
pseudo-class must match any element falling into one of the
|
|
following categories:</p>
|
|
|
|
<ul><li><code><a href="#the-input-element">input</a></code> elements to which the <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute applies,
|
|
but that are not <i title="concept-input-immutable"><a href="#concept-input-immutable">immutable</a></i>
|
|
(i.e. that do not have the <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute specified
|
|
and that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>)</li>
|
|
|
|
<li><code><a href="#the-textarea-element">textarea</a></code> elements that do not have a <code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">readonly</a></code> attribute, and
|
|
that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li>elements that are <a href="#editable">editable</a> and are neither
|
|
<code><a href="#the-input-element">input</a></code> elemenst nor <code><a href="#the-textarea-element">textarea</a></code>
|
|
elements</li>
|
|
|
|
</ul><p>The <code title="selector-read-only"><a href="#selector-read-only">:read-only</a></code>
|
|
pseudo-class must match all other <a href="#html-elements">HTML elements</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><dfn id="selector-ltr" title="selector-ltr"><code>:ltr</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-ltr"><a href="#selector-ltr">:ltr</a></code> pseudo-class must
|
|
match all elements whose <a href="#the-directionality" title="the
|
|
directionality">directionality</a> is '<a href="#concept-ltr" title="concept-ltr">ltr</a>'.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="selector-rtl" title="selector-rtl"><code>:rtl</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <code title="selector-rtl"><a href="#selector-rtl">:rtl</a></code> pseudo-class must
|
|
match all elements whose <a href="#the-directionality" title="the
|
|
directionality">directionality</a> is '<a href="#concept-rtl" title="concept-rtl">rtl</a>'.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p class="note">Another section of this specification defines the
|
|
<i><a href="#target-element">target element</a></i> used with the <code title="selector-target">:target</code> pseudo-class.</p>
|
|
|
|
<p class="note">This specification does not define when an element
|
|
matches the <code title="selector-hover">:hover</code>, <code title="selector-focus">:focus</code>, or <code title="selector-lang()">:lang()</code> dynamic pseudo-classes, as
|
|
those are all defined in sufficient detail in a language-agnostic
|
|
fashion in the Selectors specification. <a href="#refsSELECTORS">[SELECTORS]</a></p>
|
|
|
|
</div><h2 id="browsers"><span class="secno">5 </span>Loading Web pages</h2><div class="impl">
|
|
|
|
<p>This section describes features that apply most directly to Web
|
|
browsers. Having said that, except where specified otherwise, the
|
|
requirements defined in this section <em>do</em> apply to all user
|
|
agents, whether they are Web browsers or not.</p>
|
|
|
|
</div><h3 id="windows"><span class="secno">5.1 </span>Browsing contexts</h3><p>A <dfn id="browsing-context">browsing context</dfn> is an environment in which
|
|
<code><a href="#document">Document</a></code> objects are presented to the user.<p class="note">A tab or window in a Web browser typically contains
|
|
a <a href="#browsing-context">browsing context</a>, as does an <code><a href="#the-iframe-element">iframe</a></code><span class="impl"> or <code><a href="#frame">frame</a></code>s in a
|
|
<code><a href="#frameset">frameset</a></code></span>.<p>Each <a href="#browsing-context">browsing context</a> has a corresponding
|
|
<code><a href="#windowproxy">WindowProxy</a></code> object.<p>A <a href="#browsing-context">browsing context</a> has a <a href="#session-history">session
|
|
history</a>, which lists the <code><a href="#document">Document</a></code> objects that
|
|
that <a href="#browsing-context">browsing context</a> has presented, is presenting, or
|
|
will present. At any time, one <code><a href="#document">Document</a></code> in each
|
|
<a href="#browsing-context">browsing context</a> is designated the <dfn id="active-document">active
|
|
document</dfn>.<p>Each <code><a href="#document">Document</a></code> is associated with a
|
|
<code><a href="#window">Window</a></code> object. A <a href="#browsing-context">browsing context</a>'s
|
|
<code><a href="#windowproxy">WindowProxy</a></code> object forwards everything to the
|
|
<a href="#browsing-context">browsing context</a>'s <a href="#active-document">active document</a>'s
|
|
<code><a href="#window">Window</a></code> object.<p class="note">In general, there is a 1-to-1 mapping from the
|
|
<code><a href="#window">Window</a></code> object to the <code><a href="#document">Document</a></code> object. In
|
|
one particular case, a <code><a href="#window">Window</a></code> can be reused for the
|
|
presentation of a second <code><a href="#document">Document</a></code> in the same
|
|
<a href="#browsing-context">browsing context</a>, such that the mapping is then
|
|
2-to-1. This occurs when a <a href="#browsing-context">browsing context</a> is <a href="#navigate" title="navigate">navigated</a> from the initial
|
|
<code><a href="#about:blank">about:blank</a></code> <code><a href="#document">Document</a></code> to another, with
|
|
<a href="#replacement-enabled">replacement enabled</a>.<p class="note">A <code><a href="#document">Document</a></code> does not necessarily have a
|
|
<a href="#browsing-context">browsing context</a> associated with it. In particular,
|
|
data mining tools are likely to never instantiate browsing
|
|
contexts.<hr><p>A <a href="#browsing-context">browsing context</a> can have a <dfn id="creator-browsing-context">creator browsing
|
|
context</dfn>, the <a href="#browsing-context">browsing context</a> that was
|
|
responsible for its creation. If a <a href="#browsing-context">browsing context</a> has
|
|
a <a href="#parent-browsing-context">parent browsing context</a>, then that is its
|
|
<a href="#creator-browsing-context">creator browsing context</a>. Otherwise, if the
|
|
<a href="#browsing-context">browsing context</a> has an <a href="#opener-browsing-context">opener browsing
|
|
context</a>, then <em>that</em> is its <a href="#creator-browsing-context">creator browsing
|
|
context</a>. Otherwise, the <a href="#browsing-context">browsing context</a> has no
|
|
<a href="#creator-browsing-context">creator browsing context</a>.<p>If a <a href="#browsing-context">browsing context</a> <var title="">A</var> has a
|
|
<a href="#creator-browsing-context">creator browsing context</a>, then the
|
|
<code><a href="#document">Document</a></code> that was the <a href="#active-document">active document</a> of
|
|
that <a href="#creator-browsing-context">creator browsing context</a> at the time <var title="">A</var> was created is the <dfn id="creator-document">creator
|
|
<code>Document</code></dfn>.<div class="impl">
|
|
|
|
<p>When a <a href="#browsing-context">browsing context</a> is first created, it must be
|
|
created with a single <code><a href="#document">Document</a></code> in its session history,
|
|
whose <a href="#the-document-s-address" title="the document's address">address</a> is
|
|
<code><a href="#about:blank">about:blank</a></code>, which is marked as being an <a href="#html-documents" title="HTML documents">HTML document</a>, and whose <a href="#document-s-character-encoding" title="document's character encoding">character encoding</a> is
|
|
UTF-8. The <code><a href="#document">Document</a></code> must have a single child
|
|
<code><a href="#the-html-element">html</a></code> node, which itself has a single child
|
|
<code><a href="#the-body-element">body</a></code> node.</p>
|
|
|
|
<p class="note">If the <a href="#browsing-context">browsing context</a> is created
|
|
specifically to be immediately navigated, then that initial
|
|
navigation will have <a href="#replacement-enabled">replacement enabled</a>.</p>
|
|
|
|
<p id="about-blank-origin">The <a href="#origin">origin</a> of the
|
|
<code><a href="#about:blank">about:blank</a></code> <code><a href="#document">Document</a></code> is set when the
|
|
<code><a href="#document">Document</a></code> is created. If the new <a href="#browsing-context">browsing
|
|
context</a> has a <a href="#creator-browsing-context">creator browsing context</a>, then the
|
|
<a href="#origin">origin</a> of the <code><a href="#about:blank">about:blank</a></code>
|
|
<code><a href="#document">Document</a></code> is the <a href="#origin">origin</a> of the
|
|
<a href="#creator-document">creator <code>Document</code></a>. Otherwise, the
|
|
<a href="#origin">origin</a> of the <code><a href="#about:blank">about:blank</a></code>
|
|
<code><a href="#document">Document</a></code> is a globally unique identifier assigned when
|
|
the new <a href="#browsing-context">browsing context</a> is created.</p>
|
|
|
|
</div><h4 id="nested-browsing-contexts"><span class="secno">5.1.1 </span>Nested browsing contexts</h4><p>Certain elements (for example, <code><a href="#the-iframe-element">iframe</a></code> elements) can
|
|
instantiate further <a href="#browsing-context" title="browsing context">browsing
|
|
contexts</a>. These are called <dfn id="nested-browsing-context" title="nested browsing
|
|
context">nested browsing contexts</dfn>. If a browsing context <var title="">P</var> has a <code><a href="#document">Document</a></code>s <var title="">D</var>
|
|
with an element <var title="">E</var> that nests another browsing
|
|
context <var title="">C</var> inside it, then <var title="">C</var>
|
|
is said to be <dfn id="browsing-context-nested-through" title="browsing context nested through">nested
|
|
through</dfn> <var title="">D</var>, and <var title="">E</var> is
|
|
said to be the <dfn id="browsing-context-container">browsing context container</dfn> of <var title="">C</var>. If the <a href="#browsing-context-container">browsing context container</a>
|
|
element <var title="">E</var> is <a href="#in-a-document" title="in a
|
|
Document">in</a> the <code><a href="#document">Document</a></code> <var title="">D</var>,
|
|
then <var title="">P</var> is said to be the <dfn id="parent-browsing-context">parent browsing
|
|
context</dfn> of <var title="">C</var> and <var title="">C</var> is
|
|
said to be a <dfn id="child-browsing-context">child browsing context</dfn> of <var title="">P</var>. Otherwise, the <a href="#nested-browsing-context">nested browsing
|
|
context</a> <var title="">C</var> has no <a href="#parent-browsing-context">parent browsing
|
|
context</a>.<p>A browsing context <var title="">A</var> is said to be an <dfn id="ancestor-browsing-context" title="ancestor browsing context">ancestor</dfn> of a browsing
|
|
context <var title="">B</var> if there exists a browsing context
|
|
<var title="">A'</var> that is a <a href="#child-browsing-context">child browsing context</a>
|
|
of <var title="">A</var> and that is itself an <a href="#ancestor-browsing-context" title="ancestor
|
|
browsing context">ancestor</a> of <var title="">B</var>, or if
|
|
there is a browsing context <var title="">P</var> that is a
|
|
<a href="#child-browsing-context">child browsing context</a> of <var title="">A</var> and
|
|
that is the <a href="#parent-browsing-context">parent browsing context</a> of <var title="">B</var>.<p>A browsing context that is not a <a href="#nested-browsing-context">nested browsing
|
|
context</a> has no <a href="#parent-browsing-context">parent browsing context</a>, and is
|
|
the <dfn id="top-level-browsing-context">top-level browsing context</dfn> of all the browsing
|
|
contexts for which it is an <a href="#ancestor-browsing-context">ancestor browsing
|
|
context</a>.<p>The transitive closure of <a href="#parent-browsing-context" title="parent browsing
|
|
context">parent browsing contexts</a> for a <a href="#nested-browsing-context">nested browsing
|
|
context</a> gives the list of <a href="#ancestor-browsing-context" title="ancestor browsing
|
|
context">ancestor browsing contexts</a>.<p>The <dfn id="list-of-the-descendant-browsing-contexts">list of the descendant browsing contexts</dfn> of a
|
|
<code><a href="#document">Document</a></code> <var title="">d</var> is the (ordered) list
|
|
returned by the following algorithm:<ol><li><p>Let <var title="">list</var> be an empty list.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each <a href="#child-browsing-context">child browsing context</a> of <var title="">d</var> that is <a href="#browsing-context-nested-through" title="browsing context nested
|
|
through">nested through</a> an element that is <a href="#in-a-document" title="in
|
|
a document">in the <code>Document</code></a> <var title="">d</var>, in the <a href="#tree-order">tree order</a> of the elements
|
|
nesting those <a href="#browsing-context" title="browsing context">browsing
|
|
contexts</a>, run these substeps:</p>
|
|
|
|
<ol><li><p>Append that <a href="#child-browsing-context">child browsing context</a> to the
|
|
list <var title="">list</var>.</p>
|
|
|
|
<li><p>Append the <a href="#list-of-the-descendant-browsing-contexts">list of the descendant browsing
|
|
contexts</a> of the <a href="#active-document">active document</a> of that
|
|
<a href="#child-browsing-context">child browsing context</a> to the list <var title="">list</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Return the constructed <var title="">list</var>.</li>
|
|
|
|
</ol><p>A <code><a href="#document">Document</a></code> is said to be <dfn id="fully-active">fully active</dfn>
|
|
when it is the <a href="#active-document">active document</a> of its <a href="#browsing-context">browsing
|
|
context</a>, and either its browsing context is a <a href="#top-level-browsing-context">top-level
|
|
browsing context</a>, or it has a <a href="#parent-browsing-context">parent browsing
|
|
context</a> and the <code><a href="#document">Document</a></code> <a href="#browsing-context-nested-through" title="browsing
|
|
context nested through">through which</a> it is <a href="#nested-browsing-context" title="nested browsing context">nested</a> is itself <a href="#fully-active">fully
|
|
active</a>.<p>Because they are nested through an element, <a href="#child-browsing-context" title="child
|
|
browsing context">child browsing contexts</a> are always tied to
|
|
a specific <code><a href="#document">Document</a></code> in their <a href="#parent-browsing-context">parent browsing
|
|
context</a>. User agents must not allow the user to interact with
|
|
<a href="#child-browsing-context" title="child browsing context">child browsing contexts</a>
|
|
of elements that are in <code><a href="#document">Document</a></code>s that are not
|
|
themselves <a href="#fully-active">fully active</a>.<p>A <a href="#nested-browsing-context">nested browsing context</a> can have a <a href="#seamless-browsing-context-flag">seamless
|
|
browsing context flag</a> set, if it is embedded through an
|
|
<code><a href="#the-iframe-element">iframe</a></code> element with a <code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">seamless</a></code> attribute.<p class="note">A <a href="#nested-browsing-context">nested browsing context</a> can in some
|
|
cases be taken out of its <a href="#parent-browsing-context">parent browsing context</a> (e.g.
|
|
if an <code><a href="#the-iframe-element">iframe</a></code> element is removed from its
|
|
<code><a href="#document">Document</a></code>). In such a situation, the <a href="#nested-browsing-context">nested
|
|
browsing context</a> has no <a href="#parent-browsing-context">parent browsing context</a>,
|
|
but it still has the same <a href="#browsing-context-container">browsing context container</a>
|
|
and is still <a href="#browsing-context-nested-through" title="browsing context nested through">nested
|
|
through</a> that element's <code><a href="#document">Document</a></code>. Such a
|
|
<a href="#nested-browsing-context">nested browsing context</a> is <em>not</em> a
|
|
<a href="#top-level-browsing-context">top-level browsing context</a>, and cannot contain
|
|
<code><a href="#document">Document</a></code>s that are <a href="#fully-active">fully active</a>.
|
|
Furthermore, if a <a href="#browsing-context-container">browsing context container</a> (such as
|
|
an <code><a href="#the-iframe-element">iframe</a></code>) is moved to another <code><a href="#document">Document</a></code>,
|
|
then the <a href="#parent-browsing-context">parent browsing context</a> of its <a href="#nested-browsing-context">nested
|
|
browsing context</a> will change.<h5 id="navigating-nested-browsing-contexts-in-the-dom"><span class="secno">5.1.1.1 </span>Navigating nested browsing contexts in the DOM</h5><dl class="domintro"><dt><var title="">window</var> . <code title="dom-top"><a href="#dom-top">top</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#windowproxy">WindowProxy</a></code> for the <a href="#top-level-browsing-context">top-level browsing context</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-parent"><a href="#dom-parent">parent</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#windowproxy">WindowProxy</a></code> for the <a href="#parent-browsing-context">parent browsing context</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-frameElement"><a href="#dom-frameelement">frameElement</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#element">Element</a></code> for the <a href="#browsing-context-container">browsing context container</a>.</p>
|
|
|
|
<p>Returns null if there isn't one.</p>
|
|
|
|
<p>Throws a <code><a href="#security_err">SECURITY_ERR</a></code> exception in cross-origin situations.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-top" title="dom-top"><code>top</code></dfn> IDL attribute on
|
|
the <code><a href="#window">Window</a></code> object of a <code><a href="#document">Document</a></code> in a
|
|
<a href="#browsing-context">browsing context</a> <var title="">b</var> must return the
|
|
<code><a href="#windowproxy">WindowProxy</a></code> object of its <a href="#top-level-browsing-context">top-level browsing
|
|
context</a> (which would be its own <code><a href="#windowproxy">WindowProxy</a></code>
|
|
object if it was a <a href="#top-level-browsing-context">top-level browsing context</a> itself),
|
|
if it has one, or its own <code><a href="#windowproxy">WindowProxy</a></code> object otherwise
|
|
(e.g. if it was a detached <a href="#nested-browsing-context">nested browsing
|
|
context</a>).</p>
|
|
|
|
<p>The <dfn id="dom-parent" title="dom-parent"><code>parent</code></dfn> IDL
|
|
attribute on the <code><a href="#window">Window</a></code> object of a
|
|
<code><a href="#document">Document</a></code> in a <a href="#browsing-context">browsing context</a> <var title="">b</var> must return the <code><a href="#windowproxy">WindowProxy</a></code> object of
|
|
the <a href="#parent-browsing-context">parent browsing context</a>, if there is one (i.e. if
|
|
<var title="">b</var> is a <a href="#child-browsing-context">child browsing context</a>), or
|
|
the <code><a href="#windowproxy">WindowProxy</a></code> object of the <a href="#browsing-context">browsing
|
|
context</a> <var title="">b</var> itself, otherwise (i.e. if it
|
|
is a <a href="#top-level-browsing-context">top-level browsing context</a> or a detached
|
|
<a href="#nested-browsing-context">nested browsing context</a>).</p>
|
|
|
|
<p>The <dfn id="dom-frameelement" title="dom-frameElement"><code>frameElement</code></dfn>
|
|
IDL attribute on the <code><a href="#window">Window</a></code> object of a
|
|
<code><a href="#document">Document</a></code> <var title="">d</var>, on getting, must run
|
|
the following algorithm:</p>
|
|
|
|
<ol><li><p>If <var title="">d</var> is not a <code><a href="#document">Document</a></code> in a
|
|
<a href="#nested-browsing-context">nested browsing context</a>, return null and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the <a href="#browsing-context-container">browsing context container</a>'s
|
|
<code><a href="#document">Document</a></code> does not have the <a href="#same-origin" title="same
|
|
origin">same</a> <a href="#effective-script-origin">effective script origin</a> as the
|
|
<a href="#entry-script">entry script</a>, then throw a <code><a href="#security_err">SECURITY_ERR</a></code>
|
|
exception.</li>
|
|
|
|
<li><p>Otherwise, return the <a href="#browsing-context-container">browsing context
|
|
container</a> for <var title="">b</var>.</li>
|
|
|
|
</ol></div><h4 id="auxiliary-browsing-contexts"><span class="secno">5.1.2 </span>Auxiliary browsing contexts</h4><p>It is possible to create new browsing contexts that are related
|
|
to a <a href="#top-level-browsing-context">top-level browsing context</a> without being nested
|
|
through an element. Such browsing contexts are called <dfn id="auxiliary-browsing-context" title="auxiliary browsing context">auxiliary browsing
|
|
contexts</dfn>. Auxiliary browsing contexts are always <a href="#top-level-browsing-context" title="top-level browsing context">top-level browsing
|
|
contexts</a>.<p>An <a href="#auxiliary-browsing-context">auxiliary browsing context</a> has an <dfn id="opener-browsing-context">opener
|
|
browsing context</dfn>, which is the <a href="#browsing-context">browsing context</a>
|
|
from which the <a href="#auxiliary-browsing-context">auxiliary browsing context</a> was
|
|
created.<h5 id="navigating-auxiliary-browsing-contexts-in-the-dom"><span class="secno">5.1.2.1 </span>Navigating auxiliary browsing contexts in the DOM</h5><p>The <dfn id="dom-opener" title="dom-opener"><code>opener</code></dfn> IDL
|
|
attribute on the <code><a href="#window">Window</a></code> object, on getting, must return
|
|
the <code><a href="#windowproxy">WindowProxy</a></code> object of the <a href="#browsing-context">browsing
|
|
context</a> from which the current <a href="#browsing-context">browsing context</a>
|
|
was created (its <a href="#opener-browsing-context">opener browsing context</a>), if there is
|
|
one, if it is still available, and if the current <a href="#browsing-context">browsing
|
|
context</a> has not <i><a href="#disowned-its-opener">disowned its opener</a></i>. On setting, if
|
|
the new value is null then the current <a href="#browsing-context">browsing context</a>
|
|
must <dfn id="disowned-its-opener" title="disowned its opener">disown its opener</dfn>; if
|
|
the new value is anything else then the user agent must ignore the
|
|
new value.<h4 id="secondary-browsing-contexts"><span class="secno">5.1.3 </span>Secondary browsing contexts</h4><p>User agents may support <dfn id="secondary-browsing-context" title="secondary browsing
|
|
context">secondary browsing contexts</dfn>, which are <a href="#browsing-context" title="browsing context">browsing contexts</a> that form part of
|
|
the user agent's interface, apart from the main content area.<div class="impl">
|
|
|
|
<h4 id="security-nav"><span class="secno">5.1.4 </span>Security</h4>
|
|
|
|
<p id="security-1">A <a href="#browsing-context">browsing context</a> <var title="">A</var> is <dfn id="allowed-to-navigate">allowed to navigate</dfn> a second
|
|
<a href="#browsing-context">browsing context</a> <var title="">B</var> if one of the
|
|
following conditions is true:</p>
|
|
|
|
<ul><li>Either the <a href="#origin">origin</a> of the <a href="#active-document">active
|
|
document</a> of <var title="">A</var> is the <a href="#same-origin" title="same
|
|
origin">same</a> as the <a href="#origin">origin</a> of the <a href="#active-document">active
|
|
document</a> of <var title="">B</var>, or</li>
|
|
|
|
<li>The browsing context <var title="">A</var> is a <a href="#nested-browsing-context">nested
|
|
browsing context</a> with a <a href="#top-level-browsing-context">top-level browsing
|
|
context</a>, and its <a href="#top-level-browsing-context">top-level browsing context</a> is
|
|
<var title="">B</var>, or</li>
|
|
|
|
<li>The browsing context <var title="">B</var> is an
|
|
<a href="#auxiliary-browsing-context">auxiliary browsing context</a> and <var title="">A</var>
|
|
is <a href="#allowed-to-navigate">allowed to navigate</a> <var title="">B</var>'s
|
|
<a href="#opener-browsing-context">opener browsing context</a>, or</li>
|
|
|
|
<li>The browsing context <var title="">B</var> is not a
|
|
<a href="#top-level-browsing-context">top-level browsing context</a>, but there exists an
|
|
<a href="#ancestor-browsing-context">ancestor browsing context</a> of <var title="">B</var>
|
|
whose <a href="#active-document">active document</a> has the <a href="#same-origin" title="same
|
|
origin">same</a> <a href="#origin">origin</a> as the <a href="#active-document">active
|
|
document</a> of <var title="">A</var> (possibly in fact being
|
|
<var title="">A</var> itself).</li>
|
|
|
|
</ul><hr><p>An element has a <dfn id="browsing-context-scope-origin">browsing context scope origin</dfn> if its
|
|
<code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> is a
|
|
<a href="#top-level-browsing-context">top-level browsing context</a> or if all of its
|
|
<code><a href="#document">Document</a></code>'s <a href="#ancestor-browsing-context" title="ancestor browsing
|
|
context">ancestor browsing contexts</a> all have <a href="#active-document" title="active document">active documents</a> whose
|
|
<a href="#origin">origin</a> are the <a href="#same-origin">same origin</a> as the
|
|
element's <code><a href="#document">Document</a></code>'s <a href="#origin">origin</a>. If an element
|
|
has a <a href="#browsing-context-scope-origin">browsing context scope origin</a>, then its value is
|
|
the <a href="#origin">origin</a> of the element's <code><a href="#document">Document</a></code>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="groupings-of-browsing-contexts"><span class="secno">5.1.5 </span>Groupings of browsing contexts</h4>
|
|
|
|
<p>Each <a href="#browsing-context">browsing context</a> is defined as having a list of
|
|
one or more <dfn id="directly-reachable-browsing-contexts">directly reachable browsing contexts</dfn>. These
|
|
are:</p>
|
|
|
|
<ul><li>The <a href="#browsing-context">browsing context</a> itself.</li>
|
|
|
|
<li>All the <a href="#browsing-context">browsing context</a>'s <a href="#child-browsing-context" title="child
|
|
browsing context">child browsing contexts</a>.</li>
|
|
|
|
<li>The <a href="#browsing-context">browsing context</a>'s <a href="#parent-browsing-context">parent browsing
|
|
context</a>.</li>
|
|
|
|
<li>All the <a href="#browsing-context" title="browsing context">browsing contexts</a>
|
|
that have the <a href="#browsing-context">browsing context</a> as their <a href="#opener-browsing-context">opener
|
|
browsing context</a>.</li>
|
|
|
|
<li>The <a href="#browsing-context">browsing context</a>'s <a href="#opener-browsing-context">opener browsing
|
|
context</a>.</li>
|
|
|
|
</ul><p>The transitive closure of all the <a href="#browsing-context" title="browsing
|
|
context">browsing contexts</a> that are <a href="#directly-reachable-browsing-contexts">directly reachable
|
|
browsing contexts</a> forms a <dfn id="unit-of-related-browsing-contexts">unit of related browsing
|
|
contexts</dfn>.</p>
|
|
|
|
<p>Each <a href="#unit-of-related-browsing-contexts">unit of related browsing contexts</a> is then
|
|
further divided into the smallest number of groups such that every
|
|
member of each group has an <a href="#active-document">active document</a> with an
|
|
<a href="#effective-script-origin">effective script origin</a> that, through appropriate
|
|
manipulation of the <code title="dom-document-domain"><a href="#dom-document-domain">document.domain</a></code> attribute, could
|
|
be made to be the same as other members of the group, but could not
|
|
be made the same as members of any other group. Each such group is a
|
|
<dfn id="unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing contexts</dfn>.</p>
|
|
|
|
<p>Each <a href="#unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing
|
|
contexts</a> can have a <dfn id="entry-script">entry script</dfn> which is used to
|
|
obtain, amongst other things, the <a href="#script-s-base-url">script's base URL</a> to
|
|
<a href="#resolve-a-url" title="resolve a url">resolve</a> relative <a href="#url" title="URL">URLs</a> used in scripts running in that <a href="#unit-of-related-similar-origin-browsing-contexts">unit
|
|
of related similar-origin browsing contexts</a>. Initially, there
|
|
is no <a href="#entry-script">entry script</a>. It is changed by the <a href="#jump-to-a-code-entry-point">jump to
|
|
a code entry-point</a> algorithm.</p>
|
|
|
|
<p class="note">There is at most one <a href="#event-loop">event loop</a> per
|
|
<a href="#unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing contexts</a>.</p>
|
|
|
|
</div><h4 id="browsing-context-names"><span class="secno">5.1.6 </span>Browsing context names</h4><p>Browsing contexts can have a <dfn id="browsing-context-name">browsing context name</dfn>. By
|
|
default, a browsing context has no name (its name is not set).<p>A <dfn id="valid-browsing-context-name">valid browsing context name</dfn> is any string with at
|
|
least one character that does not start with a U+005F LOW LINE
|
|
character. (Names starting with an underscore are reserved for
|
|
special keywords.)<p>A <dfn id="valid-browsing-context-name-or-keyword">valid browsing context name or keyword</dfn> is any string
|
|
that is either a <a href="#valid-browsing-context-name">valid browsing context name</a> or that is
|
|
an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for one of: <code title="">_blank</code>, <code title="">_self</code>, <code title="">_parent</code>, or <code title="">_top</code>.<div class="impl">
|
|
|
|
<p><dfn id="the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">The rules for choosing 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="#browsing-context">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>
|
|
|
|
<p>If the given browsing context name is <code title="">_self</code>, then this is an <dfn id="explicit-self-navigation-override">explicit
|
|
self-navigation override</dfn>, which overrides the behavior of
|
|
the <a href="#seamless-browsing-context-flag">seamless browsing context flag</a> set by the <code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">seamless</a></code> attribute on
|
|
<code><a href="#the-iframe-element">iframe</a></code> elements.</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-browsing-context"><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.</li>
|
|
|
|
<li><p>If the given browsing context name is <code title="">_top</code>, then the chosen browsing context must be the
|
|
<a href="#top-level-browsing-context">top-level browsing context</a> of the current one, if
|
|
there is one, or else the current browsing context.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the given browsing context name is not <code title="">_blank</code> and there exists a browsing context whose
|
|
<a href="#browsing-context-name" title="browsing context name">name</a> is the same as the
|
|
given browsing context name, and the current browsing context is
|
|
<a href="#allowed-to-navigate">allowed to navigate</a> that browsing context, and the
|
|
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>
|
|
|
|
<p>If the browsing context is chosen by this step to be the
|
|
current browsing context, then this is also an <a href="#explicit-self-navigation-override">explicit
|
|
self-navigation override</a>.</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">If the current browsing context had
|
|
the <a href="#sandboxed-navigation-browsing-context-flag">sandboxed navigation browsing context flag</a> set
|
|
when its <a href="#active-document">active document</a> was created.</dt>
|
|
|
|
<dd><p>The user agent may offer to create a new <a href="#top-level-browsing-context">top-level
|
|
browsing context</a> or reuse an existing <a href="#top-level-browsing-context">top-level
|
|
browsing context</a>. 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.</dd>
|
|
|
|
|
|
<dt id="noopener">If the user agent has been configured such that
|
|
in this instance it will create a new browsing context, and the
|
|
browsing context is being requested as part of <a href="#following-hyperlinks" title="following hyperlinks">following a hyperlink</a> whose
|
|
<a href="#linkTypes">link types</a> include the <code title="rel-noreferrer"><a href="#link-type-noreferrer">noreferrer</a></code> keyword</dt>
|
|
|
|
<dd><p>A new <a href="#top-level-browsing-context">top-level browsing context</a> must be
|
|
created. If the given browsing context name is not <code title="">_blank</code>, then the new top-level 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.</p>
|
|
|
|
<p class="note">If it is immediately <a href="#navigate" title="navigate">navigated</a>, then the navigation will be
|
|
done with <a href="#replacement-enabled">replacement enabled</a>.</dd>
|
|
|
|
|
|
<dt>If the user agent has been configured such that in this
|
|
instance it will create a new browsing context, and the <code title="rel-noreferrer"><a href="#link-type-noreferrer">noreferrer</a></code> keyword doesn't
|
|
apply</dt>
|
|
|
|
<dd><p>A new <a href="#auxiliary-browsing-context">auxiliary browsing context</a> must be
|
|
created, with the <a href="#opener-browsing-context">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.</p>
|
|
|
|
<p class="note">If it is immediately <a href="#navigate" title="navigate">navigated</a>, then the navigation will be
|
|
done with <a href="#replacement-enabled">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><p>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><p>There must not be a chosen browsing context.</dd>
|
|
|
|
</dl><p>User agent implementors are encouraged to provide a way for
|
|
users to configure the user agent to always reuse the current
|
|
browsing context.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><h3 id="the-window-object"><span class="secno">5.2 </span>The <code><a href="#window">Window</a></code> object</h3><pre class="idl">[ReplaceableNamedProperties]
|
|
interface <dfn id="window">Window</dfn> {
|
|
// the current browsing context
|
|
readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-window" title="dom-window">window</a>;
|
|
readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-self" title="dom-self">self</a>;
|
|
readonly attribute <a href="#document">Document</a> <a href="#dom-document" title="dom-document">document</a>;
|
|
attribute DOMString <a href="#dom-name" title="dom-name">name</a>;
|
|
[PutForwards=<a href="#dom-location-href" title="dom-location-href">href</a>] readonly attribute <a href="#location">Location</a> <a href="#dom-location" title="dom-location">location</a>;
|
|
readonly attribute <a href="#history-0">History</a> <a href="#dom-history" title="dom-history">history</a>;
|
|
[Replaceable] readonly attribute <a href="#barprop">BarProp</a> <a href="#dom-window-locationbar" title="dom-window-locationbar">locationbar</a>;
|
|
[Replaceable] readonly attribute <a href="#barprop">BarProp</a> <a href="#dom-window-menubar" title="dom-window-menubar">menubar</a>;
|
|
[Replaceable] readonly attribute <a href="#barprop">BarProp</a> <a href="#dom-window-personalbar" title="dom-window-personalbar">personalbar</a>;
|
|
[Replaceable] readonly attribute <a href="#barprop">BarProp</a> <a href="#dom-window-scrollbars" title="dom-window-scrollbars">scrollbars</a>;
|
|
[Replaceable] readonly attribute <a href="#barprop">BarProp</a> <a href="#dom-window-statusbar" title="dom-window-statusbar">statusbar</a>;
|
|
[Replaceable] readonly attribute <a href="#barprop">BarProp</a> <a href="#dom-window-toolbar" title="dom-window-toolbar">toolbar</a>; void <a href="#dom-window-close" title="dom-window-close">close</a>();
|
|
void <a href="#dom-window-stop" title="dom-window-stop">stop</a>();
|
|
void <a href="#dom-window-focus" title="dom-window-focus">focus</a>();
|
|
void <a href="#dom-window-blur" title="dom-window-blur">blur</a>();
|
|
|
|
// other browsing contexts
|
|
[Replaceable] readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-frames" title="dom-frames">frames</a>;
|
|
[Replaceable] readonly attribute unsigned long <a href="#dom-length" title="dom-length">length</a>;
|
|
readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-top" title="dom-top">top</a>;
|
|
attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-opener" title="dom-opener">opener</a>;
|
|
readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-parent" title="dom-parent">parent</a>;
|
|
readonly attribute <a href="#element">Element</a> <a href="#dom-frameelement" title="dom-frameElement">frameElement</a>;
|
|
<a href="#windowproxy">WindowProxy</a> <a href="#dom-open" title="dom-open">open</a>(in optional DOMString url, in optional DOMString target, in optional DOMString features, in optional DOMString replace);
|
|
<a href="#dom-window-item" title="dom-window-item">getter</a> <a href="#windowproxy">WindowProxy</a> (in unsigned long index);
|
|
<a href="#dom-window-nameditem" title="dom-window-namedItem">getter</a> any (in DOMString name);
|
|
|
|
// the user agent
|
|
readonly attribute <a href="#navigator">Navigator</a> <a href="#dom-navigator" title="dom-navigator">navigator</a>;
|
|
readonly attribute <a href="#applicationcache">ApplicationCache</a> <a href="#dom-applicationcache" title="dom-applicationCache">applicationCache</a>;
|
|
|
|
// user prompts
|
|
void <a href="#dom-alert" title="dom-alert">alert</a>(in DOMString message);
|
|
boolean <a href="#dom-confirm" title="dom-confirm">confirm</a>(in DOMString message);
|
|
DOMString <a href="#dom-prompt" title="dom-prompt">prompt</a>(in DOMString message, in optional DOMString default);
|
|
void <a href="#dom-print" title="dom-print">print</a>();
|
|
any <a href="#dom-showmodaldialog" title="dom-showModalDialog">showModalDialog</a>(in DOMString url, in optional any argument);
|
|
|
|
// <a href="#event-handler-idl-attributes">event handler IDL attributes</a>
|
|
attribute <a href="#function">Function</a> <a href="#handler-onabort" title="handler-onabort">onabort</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onafterprint" title="handler-window-onafterprint">onafterprint</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onbeforeprint" title="handler-window-onbeforeprint">onbeforeprint</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onbeforeunload" title="handler-window-onbeforeunload">onbeforeunload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onblur" title="handler-window-onblur">onblur</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncanplay" title="handler-oncanplay">oncanplay</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncanplaythrough" title="handler-oncanplaythrough">oncanplaythrough</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onchange" title="handler-onchange">onchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onclick" title="handler-onclick">onclick</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncontextmenu" title="handler-oncontextmenu">oncontextmenu</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oncuechange" title="handler-oncuechange">oncuechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondblclick" title="handler-ondblclick">ondblclick</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondrag" title="handler-ondrag">ondrag</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragend" title="handler-ondragend">ondragend</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragenter" title="handler-ondragenter">ondragenter</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragleave" title="handler-ondragleave">ondragleave</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragover" title="handler-ondragover">ondragover</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondragstart" title="handler-ondragstart">ondragstart</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondrop" title="handler-ondrop">ondrop</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ondurationchange" title="handler-ondurationchange">ondurationchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onemptied" title="handler-onemptied">onemptied</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onended" title="handler-onended">onended</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onerror" title="handler-window-onerror">onerror</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onfocus" title="handler-window-onfocus">onfocus</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onhashchange" title="handler-window-onhashchange">onhashchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oninput" title="handler-oninput">oninput</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-oninvalid" title="handler-oninvalid">oninvalid</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeydown" title="handler-onkeydown">onkeydown</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeypress" title="handler-onkeypress">onkeypress</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onkeyup" title="handler-onkeyup">onkeyup</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onload" title="handler-window-onload">onload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadeddata" title="handler-onloadeddata">onloadeddata</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadedmetadata" title="handler-onloadedmetadata">onloadedmetadata</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onloadstart" title="handler-onloadstart">onloadstart</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onmessage" title="handler-window-onmessage">onmessage</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousedown" title="handler-onmousedown">onmousedown</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousemove" title="handler-onmousemove">onmousemove</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseout" title="handler-onmouseout">onmouseout</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseover" title="handler-onmouseover">onmouseover</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmouseup" title="handler-onmouseup">onmouseup</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onmousewheel" title="handler-onmousewheel">onmousewheel</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onoffline" title="handler-window-onoffline">onoffline</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-ononline" title="handler-window-ononline">ononline</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onpause" title="handler-onpause">onpause</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onplay" title="handler-onplay">onplay</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onplaying" title="handler-onplaying">onplaying</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpagehide" title="handler-window-onpagehide">onpagehide</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpageshow" title="handler-window-onpageshow">onpageshow</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpopstate" title="handler-window-onpopstate">onpopstate</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onprogress" title="handler-onprogress">onprogress</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onratechange" title="handler-onratechange">onratechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onreadystatechange" title="handler-onreadystatechange">onreadystatechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onredo" title="handler-window-onredo">onredo</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onreset" title="handler-onreset">onreset</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onresize" title="handler-window-onresize">onresize</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onscroll" title="handler-onscroll">onscroll</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onseeked" title="handler-onseeked">onseeked</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onseeking" title="handler-onseeking">onseeking</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onselect" title="handler-onselect">onselect</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onshow" title="handler-onshow">onshow</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onstalled" title="handler-onstalled">onstalled</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onstorage" title="handler-window-onstorage">onstorage</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onsubmit" title="handler-onsubmit">onsubmit</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onsuspend" title="handler-onsuspend">onsuspend</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-ontimeupdate" title="handler-ontimeupdate">ontimeupdate</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onundo" title="handler-window-onundo">onundo</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onunload" title="handler-window-onunload">onunload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onvolumechange" title="handler-onvolumechange">onvolumechange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-onwaiting" title="handler-onwaiting">onwaiting</a>;
|
|
};
|
|
<a href="#window">Window</a> implements <a href="#eventtarget">EventTarget</a>;</pre><dl class="domintro"><dt><var title="">window</var> . <code title="dom-window"><a href="#dom-window">window</a></code></dt>
|
|
<dt><var title="">window</var> . <code title="dom-frames"><a href="#dom-frames">frames</a></code></dt>
|
|
<dt><var title="">window</var> . <code title="dom-self"><a href="#dom-self">self</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>These attributes all return <var title="">window</var>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">window</var> . <code title="dom-document"><a href="#dom-document">document</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <a href="#active-document">active document</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-defaultView"><a href="#dom-document-defaultview">defaultView</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#window">Window</a></code> object of the <a href="#active-document">active document</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-window" title="dom-window"><code>window</code></dfn>, <dfn id="dom-frames" title="dom-frames"><code>frames</code></dfn>, and <dfn id="dom-self" title="dom-self"><code>self</code></dfn> IDL attributes must all
|
|
return the <code><a href="#window">Window</a></code> object's <a href="#browsing-context">browsing
|
|
context</a>'s <code><a href="#windowproxy">WindowProxy</a></code> object.</p>
|
|
|
|
<p>The <dfn id="dom-document" title="dom-document"><code>document</code></dfn> IDL
|
|
attribute must return the <code><a href="#document">Document</a></code> object of the
|
|
<code><a href="#window">Window</a></code> object's <code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#active-document">active document</a>.</p>
|
|
|
|
<p>The <dfn id="dom-document-defaultview" title="dom-document-defaultView"><code>defaultView</code></dfn> IDL
|
|
attribute of the <code><a href="#htmldocument">HTMLDocument</a></code> interface must return the
|
|
<code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a>'s
|
|
<code><a href="#windowproxy">WindowProxy</a></code> object, if there is one, or null
|
|
otherwise.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="security-window"><span class="secno">5.2.1 </span>Security</h4>
|
|
|
|
<p id="security-2">User agents must raise a
|
|
<code><a href="#security_err">SECURITY_ERR</a></code> exception whenever any of the members of a
|
|
<code><a href="#window">Window</a></code> object are accessed by scripts whose
|
|
<a href="#effective-script-origin">effective script origin</a> is not the same as the
|
|
<code><a href="#window">Window</a></code> object's <code><a href="#document">Document</a></code>'s <a href="#effective-script-origin">effective
|
|
script origin</a>, with the following exceptions:</p>
|
|
|
|
<ul><li>The <code title="dom-location"><a href="#dom-location">location</a></code> object
|
|
|
|
<li>The <code title="dom-window-postMessage">postMessage()</code> method
|
|
|
|
<li>The <code title="dom-frames"><a href="#dom-frames">frames</a></code> attribute
|
|
|
|
<li>The <a href="#dynamic-nested-browsing-context-properties">dynamic nested browsing context properties</a>
|
|
|
|
</ul><p>When a script whose <a href="#effective-script-origin">effective script origin</a> is not
|
|
the same as the <code><a href="#window">Window</a></code> object's <code><a href="#document">Document</a></code>'s
|
|
<a href="#effective-script-origin">effective script origin</a> attempts to access that
|
|
<code><a href="#window">Window</a></code> object's methods or attributes, the user agent
|
|
must act as if any changes to the <code><a href="#window">Window</a></code> object's
|
|
properties, getters, setters, etc, were not present.</p>
|
|
|
|
<p>For members that return objects (including function objects),
|
|
each distinct <a href="#effective-script-origin">effective script origin</a> that is not the
|
|
same as the <code><a href="#window">Window</a></code> object's <code><a href="#document">Document</a></code>'s
|
|
<a href="#effective-script-origin">effective script origin</a> must be provided with a
|
|
separate set of objects. These objects must have the prototype chain
|
|
appropriate for the script for which the objects are created (not
|
|
those that would be appropriate for scripts whose <a href="#script-s-global-object">script's
|
|
global object</a> is the <code><a href="#window">Window</a></code> object in
|
|
question).</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For instance, if two frames containing <code><a href="#document">Document</a></code>s
|
|
from different <a href="#origin" title="origin">origins</a> access the same
|
|
<code><a href="#window">Window</a></code> object's <code title="dom-window-postMessage">postMessage()</code> method, they
|
|
will get distinct objects that are not equal.</p>
|
|
|
|
</div>
|
|
|
|
</div><h4 id="apis-for-creating-and-navigating-browsing-contexts-by-name"><span class="secno">5.2.2 </span>APIs for creating and navigating browsing contexts by name</h4><dl class="domintro"><dt><var title="">window</var> = <var title="">window</var> . <code title="dom-open"><a href="#dom-open">open</a></code>( [ <var title="">url</var> [, <var title="">target</var> [, <var title="">features</var> [, <var title="">replace</var> ] ] ] ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Opens a window to show <var title="">url</var> (defaults to
|
|
<code><a href="#about:blank">about:blank</a></code>), and returns it. The <var title="">target</var> argument gives the name of the new
|
|
window. If a window exists with that name already, it is
|
|
reused. The <var title="">replace</var> attribute, if true, means
|
|
that whatever page is currently open in that window will be
|
|
removed from the window's session history. The <var title="">features</var> argument is ignored.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-name"><a href="#dom-name">name</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the name of the window.</p>
|
|
|
|
<p>Can be set, to change the name.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-close"><a href="#dom-window-close">close</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Closes the window.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-stop"><a href="#dom-window-stop">stop</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Cancels the document load.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-open" 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="#browsing-context">browsing
|
|
context</a> or opening and navigating an <a href="#auxiliary-browsing-context">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>, must be a
|
|
<a href="#valid-non-empty-url">valid non-empty URL</a> for a page to load in the browsing
|
|
context. If no arguments are provided, or if the first argument is
|
|
the empty string, then the <var title="">url</var> argument defaults
|
|
to "<code><a href="#about:blank">about:blank</a></code>". The argument must be <a href="#resolve-a-url" title="resolve a url">resolved</a> to an <a href="#absolute-url">absolute
|
|
URL</a> (or an error), relative to the <a href="#entry-script">entry
|
|
script</a>'s <a href="#script-s-base-url" title="script's base URL">base URL</a>,
|
|
when the method is invoked.</p>
|
|
|
|
<p>The second argument, <var title="">target</var>, specifies the
|
|
<a href="#browsing-context-name" title="browsing context name">name</a> of the browsing
|
|
context that is to be navigated. It must be a <a href="#valid-browsing-context-name-or-keyword">valid browsing
|
|
context name or keyword</a>. If fewer than two arguments are
|
|
provided, then the <var title="">target</var> argument defaults to the
|
|
value "<code>_blank</code>".</p>
|
|
|
|
<p>The third argument, <var title="">features</var>, has no defined
|
|
effect and is mentioned for historical reasons only. User agents may
|
|
interpret this argument as instructions to set the size and position
|
|
of the browsing context, but are encouraged to instead ignore the
|
|
argument entirely.</p>
|
|
|
|
<p>The fourth argument, <var title="">replace</var>, specifies
|
|
whether or not the new page will <a href="#replacement-enabled" 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-history">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="#browsing-context">browsing context</a> to navigate by applying <a href="#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">the
|
|
rules for choosing a browsing context given a browsing context
|
|
name</a> using the <var title="">target</var> argument as the
|
|
name and the <a href="#browsing-context">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="#handler-onclick">onclick</a></code> handler uses the <code title="dom-open"><a href="#dom-open">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="#browsing-context">browsing context</a> to the
|
|
<a href="#absolute-url">absolute URL</a> (or error) obtained from <a href="#resolve-a-url" title="resolve a url">resolving</a> <var title="">url</var>
|
|
earlier. If the <var title="">replace</var> is true or if the
|
|
<a href="#browsing-context">browsing context</a> was just created as part of <a href="#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name">the
|
|
rules for choosing a browsing context given a browsing context
|
|
name</a>, then <a href="#replacement-enabled" title="replacement enabled">replacement must
|
|
be enabled</a>. The navigation must be done with the <a href="#script-s-browsing-context" title="script's browsing context">browsing context</a> of the
|
|
<a href="#entry-script">entry script</a> as the <a href="#source-browsing-context">source browsing
|
|
context</a>.</p>
|
|
|
|
<p>The method must return the <code><a href="#windowproxy">WindowProxy</a></code> object of the
|
|
<a href="#browsing-context">browsing context</a> that was navigated, or null if no
|
|
browsing context was navigated.</p>
|
|
|
|
<hr><p>The <dfn id="dom-name" 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="#browsing-context">browsing context</a>, and, on setting, set the
|
|
name of the <a href="#browsing-context">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>
|
|
|
|
<hr><p>The <dfn id="dom-window-close" title="dom-window-close"><code>close()</code></dfn>
|
|
method on <code><a href="#window">Window</a></code> objects should, if the corresponding
|
|
<a href="#browsing-context">browsing context</a> <var title="">A</var> is an
|
|
<a href="#auxiliary-browsing-context">auxiliary browsing context</a> that was created by a script
|
|
(as opposed to by an action of the user), and if the <a href="#script-s-browsing-context" title="script's browsing context">browsing context</a> of the
|
|
<a href="#concept-script" title="concept-script">script</a> that invokes the method
|
|
is <a href="#allowed-to-navigate">allowed to navigate</a> the <a href="#browsing-context">browsing
|
|
context</a> <var title="">A</var>, close the <a href="#browsing-context">browsing
|
|
context</a> <var title="">A</var> (and may <a href="#a-browsing-context-is-discarded" title="a
|
|
browsing context is discarded">discard</a> it too).</p>
|
|
|
|
<p>The <dfn id="dom-window-stop" title="dom-window-stop"><code>stop()</code></dfn> method
|
|
on <code><a href="#window">Window</a></code> objects should, if there is an existing
|
|
attempt to <a href="#navigate">navigate</a> the <a href="#browsing-context">browsing context</a>
|
|
and that attempt is not currently running the <a href="#unload-a-document">unload a
|
|
document</a> algorithm, cancel that <a href="#navigate" title="navigate">navigation</a> and any associated instances of
|
|
the <a href="#fetch" title="fetch">fetch algorithm</a>. Otherwise, it must
|
|
do nothing.</p>
|
|
|
|
</div><h4 id="accessing-other-browsing-contexts"><span class="secno">5.2.3 </span>Accessing other browsing contexts</h4><dl class="domintro"><dt><var title="">window</var> . <code title="dom-length"><a href="#dom-length">length</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the number of <a href="#child-browsing-context" title="child browsing
|
|
context">child browsing contexts</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var>[<var title="">index</var>]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the indicated <a href="#child-browsing-context">child browsing context</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-length" title="dom-length"><code>length</code></dfn> IDL
|
|
attribute on the <code><a href="#window">Window</a></code> interface must return the
|
|
number of <a href="#child-browsing-context" title="child browsing context">child browsing
|
|
contexts</a> that are <a href="#browsing-context-nested-through" title="browsing context nested
|
|
through">nested through</a> elements that are <a href="#in-a-document" title="in a
|
|
document">in the <code>Document</code></a> that is the
|
|
<a href="#active-document">active document</a> of that <code><a href="#window">Window</a></code> object, if
|
|
that <code><a href="#window">Window</a></code>'s <a href="#browsing-context">browsing context</a> shares the
|
|
same <a href="#event-loop">event loop</a> as the <a href="#script-s-browsing-context">script's browsing
|
|
context</a> of the <a href="#entry-script">entry script</a> accessing the IDL
|
|
attribute; otherwise, it must return zero.</p>
|
|
|
|
|
|
|
|
<p>The <a href="#supported-property-indices">supported property indices</a> on the
|
|
<code><a href="#window">Window</a></code> object at any instant are the numbers in the
|
|
range 0 .. <span title=""><var title="">n</var>-1</span>, where <var title="">n</var> is the number returned by the <code title="dom-length"><a href="#dom-length">length</a></code> IDL attribute. If <var title="">n</var> is zero then there are no <a href="#supported-property-indices">supported property
|
|
indices</a>.</p>
|
|
|
|
<p>To <dfn id="dom-window-item" title="dom-window-item">determine the value of an indexed
|
|
property</dfn> <var title="">index</var> of a <code><a href="#window">Window</a></code>
|
|
object, the user agent must return the <code><a href="#windowproxy">WindowProxy</a></code>
|
|
object of the <var title="">index</var>th <a href="#child-browsing-context">child browsing
|
|
context</a> of the <code><a href="#document">Document</a></code> that is nested through
|
|
an element that is <a href="#in-a-document" title="in a document">in the
|
|
<code>Document</code></a>, sorted in the <a href="#tree-order">tree order</a>
|
|
of the elements nesting those <a href="#browsing-context" title="browsing
|
|
context">browsing contexts</a>.</p>
|
|
|
|
<p>These properties are the <dfn id="dynamic-nested-browsing-context-properties">dynamic nested browsing context
|
|
properties</dfn>.</p>
|
|
|
|
</div><h4 id="named-access-on-the-window-object"><span class="secno">5.2.4 </span>Named access on the <code><a href="#window">Window</a></code> object</h4><dl class="domintro"><dt><var title="">window</var>[<var title="">name</var>]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the indicated element or collection of elements.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <code><a href="#window">Window</a></code> interface <span title="support named
|
|
properties">supports named properties</span>. The <a href="#supported-property-names">supported
|
|
property names</a> at any moment consist of:</p>
|
|
|
|
<ul><li>the value of the <code title="">name</code> content attribute
|
|
for all <code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-area-element">area</a></code>,
|
|
<code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-form-element">form</a></code>, <code><a href="#frame">frame</a></code>,
|
|
<code><a href="#frameset">frameset</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, and
|
|
<code><a href="#the-object-element">object</a></code> elements in the <a href="#active-document">active document</a>
|
|
that have a <code title="">name</code> content attribute, and</li>
|
|
|
|
<li>the value of the <code title="attr-id"><a href="#the-id-attribute">id</a></code> content
|
|
attribute of any <a href="#html-elements" title="HTML elements">HTML element</a> in
|
|
the <a href="#active-document">active document</a> with an <code title="attr-id"><a href="#the-id-attribute">id</a></code> content attribute.</li>
|
|
|
|
</ul><p class="critical">It is possible that this will change. Browser
|
|
vendors are considering limiting this behaviour to <a href="#quirks-mode">quirks
|
|
mode</a>. <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=11960">Read
|
|
more...</a></p>
|
|
|
|
<p>When <dfn id="dom-window-nameditem" title="dom-window-namedItem">the <code>Window</code>
|
|
object is indexed for property retrieval</dfn> using a name <var title="">name</var>, then the user agent must return the value
|
|
obtained using the following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">elements</var> be the list of <a href="#dom-window-nameditem-filter" title="dom-window-namedItem-filter">named elements</a> with the
|
|
name <var title="">name</var> in the <a href="#active-document">active document</a>.
|
|
|
|
<p class="note">There will be at least one such element, by
|
|
definition.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">elements</var> contains an <code><a href="#the-iframe-element">iframe</a></code>
|
|
element, then return the <code><a href="#windowproxy">WindowProxy</a></code> object of the
|
|
<a href="#nested-browsing-context">nested browsing context</a> represented by the first such
|
|
<code><a href="#the-iframe-element">iframe</a></code> element in <a href="#tree-order">tree order</a>, and abort
|
|
these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, if <var title="">elements</var> has only one
|
|
element, return that element and abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only <a href="#dom-window-nameditem-filter" title="dom-window-namedItem-filter">named elements</a> with
|
|
the name <var title="">name</var>.</p>
|
|
</li>
|
|
|
|
</ol><p><dfn id="dom-window-nameditem-filter" title="dom-window-nameditem-filter">Named elements</dfn>
|
|
with the name <var title="">name</var>, for the purposes of the
|
|
above algorithm, are those that are either:</p>
|
|
|
|
<ul><li><code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-area-element">area</a></code>,
|
|
<code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-form-element">form</a></code>, <code><a href="#frame">frame</a></code>,
|
|
<code><a href="#frameset">frameset</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, or
|
|
<code><a href="#the-object-element">object</a></code> elements that have a <code title="attr-name">name</code> content attribute whose value is <var title="">name</var>, or</li>
|
|
|
|
<li><a href="#html-elements">HTML elements</a> that have an <code title="attr-id"><a href="#the-id-attribute">id</a></code> content attribute whose value is <var title="">name</var>.</li>
|
|
|
|
</ul></div><div class="impl">
|
|
|
|
<h4 id="garbage-collection-and-browsing-contexts"><span class="secno">5.2.5 </span>Garbage collection and browsing contexts</h4>
|
|
|
|
<p>A <a href="#browsing-context">browsing context</a> has a strong reference to each of
|
|
its <code><a href="#document">Document</a></code>s and its <code><a href="#windowproxy">WindowProxy</a></code> object,
|
|
and the user agent itself has a strong reference to its <a href="#top-level-browsing-context" title="top-level browsing context">top-level browsing
|
|
contexts</a>.</p>
|
|
|
|
<p>A <code><a href="#document">Document</a></code> has a strong reference to its
|
|
<code><a href="#window">Window</a></code> object.</p>
|
|
|
|
<p class="note">A <code><a href="#window">Window</a></code> object <a href="#implied-strong-reference" title="implied
|
|
strong reference">has a strong reference</a> to its
|
|
<code><a href="#document">Document</a></code> object through its <code title="dom-document"><a href="#dom-document">document</a></code> attribute. Thus, references
|
|
from other scripts to either of those objects will keep both
|
|
alive. Similarly, both <code><a href="#document">Document</a></code> and <code><a href="#window">Window</a></code>
|
|
objects have <a href="#implied-strong-reference" title="implied strong reference">implied strong
|
|
references</a> to the <code><a href="#windowproxy">WindowProxy</a></code> object.</p>
|
|
|
|
<p>Each <a href="#concept-script" title="concept-script">script</a> has a strong
|
|
reference to its <a href="#script-s-browsing-context" title="script's browsing context">browsing
|
|
context</a> and its <a href="#script-s-document" title="script's
|
|
document">document</a>.</p>
|
|
|
|
<p>When a <a href="#browsing-context">browsing context</a> is to <dfn id="discard-a-document">discard a
|
|
<code>Document</code></dfn>, the user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>Set the <code><a href="#document">Document</a></code>'s <var title="concept-document-salvageable">salvageable</var> state to
|
|
false.</li>
|
|
|
|
<li><p>Run any <a href="#unloading-document-cleanup-steps">unloading document cleanup steps</a> for
|
|
the <code><a href="#document">Document</a></code> that are defined by this specification
|
|
and <a href="#other-applicable-specifications">other applicable specifications</a>.</li>
|
|
|
|
<li><p>Remove any <a href="#concept-task" title="concept-task">tasks</a>
|
|
associated with the <code><a href="#document">Document</a></code> in any <a href="#task-source">task
|
|
source</a>, without running those tasks.</li>
|
|
|
|
<li><p><a href="#a-browsing-context-is-discarded" title="a browsing context is discarded">Discard</a>
|
|
all the <a href="#child-browsing-context" title="child browsing context">child browsing
|
|
contexts</a> of the <code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li><p>Lose the strong reference from the <code><a href="#document">Document</a></code>'s
|
|
<a href="#browsing-context">browsing context</a> to the
|
|
<code><a href="#document">Document</a></code>.</li>
|
|
|
|
</ol><p class="note">Whenever a <code><a href="#document">Document</a></code> object is <a href="#discard-a-document" title="discard a Document">discarded</a>, it is also removed from
|
|
the list of <span>the worker's <code><a href="#document">Document</a></code>s</span> of each
|
|
worker whose list contains that <code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p>When <dfn id="a-browsing-context-is-discarded">a <em><span>browsing context</span></em> is
|
|
discarded</dfn>, the strong reference from the user agent itself to
|
|
the <a href="#browsing-context">browsing context</a> must be severed, and all the
|
|
<code><a href="#document">Document</a></code> objects for all the entries in the
|
|
<a href="#browsing-context">browsing context</a>'s session history must be <a href="#discard-a-document" title="discard a document">discarded</a> as well.</p>
|
|
|
|
<p>User agents may <a href="#a-browsing-context-is-discarded" title="a browsing context is
|
|
discarded">discard</a> <a href="#top-level-browsing-context" title="top-level browsing
|
|
context">top-level browsing contexts</a> at any time (typically,
|
|
in response to user requests, e.g. when a user closes a window
|
|
containing one or more <a href="#top-level-browsing-context" title="top-level browsing
|
|
context">top-level browsing contexts</a>). Other <a href="#browsing-context" title="browsing context">browsing contexts</a> must be discarded
|
|
once their <code><a href="#windowproxy">WindowProxy</a></code> object is eligible for garbage
|
|
collection.</p>
|
|
|
|
</div><h4 id="browser-interface-elements"><span class="secno">5.2.6 </span>Browser interface elements</h4><p>To allow Web pages to integrate with Web browsers, certain Web
|
|
browser interface elements are exposed in a limited way to scripts
|
|
in Web pages.<p>Each interface element is represented by a <code><a href="#barprop">BarProp</a></code>
|
|
object:<pre class="idl">interface <dfn id="barprop">BarProp</dfn> {
|
|
attribute boolean <a href="#dom-barprop-visible" title="dom-BarProp-visible">visible</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">window</var> . <code title="dom-window-locationbar"><a href="#dom-window-locationbar">locationbar</a></code> . <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code></dt>
|
|
<dd>
|
|
<p>Returns true if the location bar is visible; otherwise, returns false.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-menubar"><a href="#dom-window-menubar">menubar</a></code> . <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code></dt>
|
|
<dd>
|
|
<p>Returns true if the menu bar is visible; otherwise, returns false.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-personalbar"><a href="#dom-window-personalbar">personalbar</a></code> . <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code></dt>
|
|
|
|
<dd>
|
|
<p>Returns true if the personal bar is visible; otherwise, returns false.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-scrollbars"><a href="#dom-window-scrollbars">scrollbars</a></code> . <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code></dt>
|
|
<dd>
|
|
<p>Returns true if the scroll bars are visible; otherwise, returns false.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-statusbar"><a href="#dom-window-statusbar">statusbar</a></code> . <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code></dt>
|
|
<dd>
|
|
<p>Returns true if the status bar is visible; otherwise, returns false.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-toolbar"><a href="#dom-window-toolbar">toolbar</a></code> . <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code></dt>
|
|
<dd>
|
|
<p>Returns true if the toolbar is visible; otherwise, returns false.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-barprop-visible" title="dom-BarProp-visible">visible</dfn> attribute, on
|
|
getting, must return either true or a value determined by the user
|
|
agent to most accurately represent the visibility state of the user
|
|
interface element that the object represents, as described below. On
|
|
setting, the new value must be discarded.</p>
|
|
|
|
<p>The following <code><a href="#barprop">BarProp</a></code> objects exist for each
|
|
<code><a href="#document">Document</a></code> object in a <a href="#browsing-context">browsing
|
|
context</a>. Some of the user interface elements represented by
|
|
these objects might have no equivalent in some user agents; for
|
|
those user agents, except when otherwise specified, the object must
|
|
act as if it was present and visible (i.e. its <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code> attribute must return
|
|
true).</p>
|
|
|
|
<dl><dt><dfn id="the-location-bar-barprop-object">The location bar <code>BarProp</code> object</dfn></dt>
|
|
|
|
<dd>Represents the user interface element that contains a control
|
|
that displays the <a href="#url">URL</a> of the <a href="#active-document">active
|
|
document</a>, or some similar interface concept.</dd>
|
|
|
|
<dt><dfn id="the-menu-bar-barprop-object">The menu bar <code>BarProp</code> object</dfn></dt>
|
|
|
|
<dd>Represents the user interface element that contains a list of
|
|
commands in menu form, or some similar interface concept.</dd>
|
|
|
|
<dt><dfn id="the-personal-bar-barprop-object">The personal bar <code>BarProp</code> object</dfn></dt>
|
|
|
|
<dd>Represents the user interface element that contains links to
|
|
the user's favorite pages, or some similar interface concept.</dd>
|
|
|
|
<dt><dfn id="the-scrollbar-barprop-object">The scrollbar <code>BarProp</code> object</dfn></dt>
|
|
|
|
<dd>Represents the user interface element that contains a scrolling
|
|
mechanism, or some similar interface concept.</dd>
|
|
|
|
<dt><dfn id="the-status-bar-barprop-object">The status bar <code>BarProp</code> object</dfn></dt>
|
|
|
|
<dd>Represents a user interface element found immediately below or
|
|
after the document, as appropriate for the user's media. If the
|
|
user agent has no such user interface element, then the object may
|
|
act as if the corresponding user interface element was absent
|
|
(i.e. its <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code>
|
|
attribute may return false).</dd>
|
|
|
|
<dt><dfn id="the-toolbar-barprop-object">The toolbar <code>BarProp</code> object</dfn></dt>
|
|
|
|
<dd>Represents the user interface element found immediately above
|
|
or before the document, as appropriate for the user's media. If the
|
|
user agent has no such user interface element, then the object may
|
|
act as if the corresponding user interface element was absent
|
|
(i.e. its <code title="dom-BarProp-visible"><a href="#dom-barprop-visible">visible</a></code>
|
|
attribute may return false).</dd>
|
|
|
|
</dl><p>The <dfn id="dom-window-locationbar" title="dom-window-locationbar"><code>locationbar</code></dfn>
|
|
attribute must return <a href="#the-location-bar-barprop-object">the location bar <code>BarProp</code>
|
|
object</a>.</p>
|
|
|
|
<p>The <dfn id="dom-window-menubar" title="dom-window-menubar"><code>menubar</code></dfn>
|
|
attribute must return <a href="#the-menu-bar-barprop-object">the menu bar <code>BarProp</code>
|
|
object</a>.</p>
|
|
|
|
<p>The <dfn id="dom-window-personalbar" title="dom-window-personalbar"><code>personalbar</code></dfn>
|
|
attribute must return <a href="#the-personal-bar-barprop-object">the personal bar <code>BarProp</code>
|
|
object</a>.</p>
|
|
|
|
<p>The <dfn id="dom-window-scrollbars" title="dom-window-scrollbars"><code>scrollbars</code></dfn>
|
|
attribute must return <a href="#the-scrollbar-barprop-object">the scrollbar <code>BarProp</code>
|
|
object</a>.</p>
|
|
|
|
<p>The <dfn id="dom-window-statusbar" title="dom-window-statusbar"><code>statusbar</code></dfn> attribute
|
|
must return <a href="#the-status-bar-barprop-object">the status bar <code>BarProp</code>
|
|
object</a>.</p>
|
|
|
|
<p>The <dfn id="dom-window-toolbar" title="dom-window-toolbar"><code>toolbar</code></dfn>
|
|
attribute must return <a href="#the-toolbar-barprop-object">the toolbar <code>BarProp</code>
|
|
object</a>.</p>
|
|
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-windowproxy-object"><span class="secno">5.2.7 </span>The <code><a href="#windowproxy">WindowProxy</a></code> object</h4>
|
|
|
|
|
|
<p>As mentioned earlier, each <a href="#browsing-context">browsing context</a> has a
|
|
<dfn id="windowproxy"><code>WindowProxy</code></dfn> object. This object is unusual
|
|
in that all operations that would be performed on it must be
|
|
performed on the <code><a href="#window">Window</a></code> object of the <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#active-document">active document</a> instead. It is thus
|
|
indistinguishable from that <code><a href="#window">Window</a></code> object in every way
|
|
until the <a href="#browsing-context">browsing context</a> is navigated.</p>
|
|
|
|
<p>There is no <code><a href="#windowproxy">WindowProxy</a></code> interface object.</p>
|
|
|
|
<p class="note">The <code><a href="#windowproxy">WindowProxy</a></code> object allows scripts
|
|
to act as if each <a href="#browsing-context">browsing context</a> had a single
|
|
<code><a href="#window">Window</a></code> object, while still keeping separate
|
|
<code><a href="#window">Window</a></code> objects for each <code><a href="#document">Document</a></code>.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>In the following example, the variable <var title="">x</var> is
|
|
set to the <code><a href="#windowproxy">WindowProxy</a></code> object returned by the <code title="dom-window"><a href="#dom-window">window</a></code> accessor on the global object. All
|
|
of the expressions following the assignment return true, because in
|
|
every respect, the <code><a href="#windowproxy">WindowProxy</a></code> object acts like the
|
|
underlying <code><a href="#window">Window</a></code> object.</p>
|
|
|
|
<pre>var x = window;
|
|
x instanceof Window; // true
|
|
x === this; // true</pre>
|
|
|
|
</div>
|
|
|
|
</div><h3 id="origin-0"><span class="secno">5.3 </span>Origin</h3><p>The <dfn id="origin">origin</dfn> of a resource and the <dfn id="effective-script-origin">effective script
|
|
origin</dfn> of a resource are both either opaque identifiers or
|
|
tuples consisting of a scheme component, a host component, a port
|
|
component, and optionally extra data.<p class="note">The extra data could include the certificate of the
|
|
site when using encrypted connections, to ensure that if the site's
|
|
secure certificate changes, the origin is considered to change as
|
|
well.<div class="impl">
|
|
|
|
<p>These characteristics are defined as follows:</p>
|
|
|
|
<dl><dt>For URLs</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <a href="#origin">origin</a> and <a href="#effective-script-origin">effective script
|
|
origin</a> of the <a href="#url">URL</a> is whatever is returned by
|
|
the following algorithm:</p>
|
|
|
|
<ol><li><p>Let <var title="">url</var> be the <a href="#url">URL</a> for
|
|
which the <a href="#origin">origin</a> is being determined.</li>
|
|
|
|
<li><p><a href="#parse-a-url" title="parse a url">Parse</a> <var title="">url</var>.</li>
|
|
|
|
<li><p>If <var title="">url</var> identifies a resource that is
|
|
its own trust domain (e.g. it identifies an e-mail on an IMAP
|
|
server or a post on an NNTP server) then return a globally unique
|
|
identifier specific to the resource identified by <var title="">url</var>, so that if this algorithm is invoked again
|
|
for <a href="#url" title="URL">URLs</a> that identify the same resource,
|
|
the same identifier will be returned.</li>
|
|
|
|
<li><p>If <var title="">url</var> does not use a server-based
|
|
naming authority, or if parsing <var title="">url</var> failed,
|
|
or if <var title="">url</var> is not an <a href="#absolute-url">absolute
|
|
URL</a>, then return a new globally unique
|
|
identifier.</li>
|
|
|
|
<li><p>Let <var title="">scheme</var> be the <a href="#url-scheme" title="url-scheme"><scheme></a> component of <var title="">url</var>, <a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
|
|
|
|
<li><p>If the UA doesn't support the protocol given by <var title="">scheme</var>, then return a new globally unique
|
|
identifier.</li>
|
|
|
|
<li><p>If <var title="">scheme</var> is "<code title="">file</code>", then the user agent may return a
|
|
UA-specific value.</li>
|
|
|
|
<li><p>Let <var title="">host</var> be the <a href="#url-host" title="url-host"><host></a> component of <var title="">url</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Apply the IDNA ToASCII algorithm to <var title="">host</var>,
|
|
with both the AllowUnassigned and UseSTD3ASCIIRules flags
|
|
set. Let <var title="">host</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 return a new globally unique
|
|
identifier. <a href="#refsRFC3490">[RFC3490]</a></p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">host</var> be the result of converting
|
|
<var title="">host</var> <a href="#converted-to-ascii-lowercase" title="converted to ASCII lowercase">to
|
|
ASCII lowercase</a>.</li>
|
|
|
|
<li><p>If there is no <a href="#url-port" title="url-port"><port></a>
|
|
component, then let <var title="">port</var> be the default port
|
|
for the protocol given by <var title="">scheme</var>. Otherwise,
|
|
let <var title="">port</var> be the <a href="#url-port" title="url-port"><port></a> component of <var title="">url</var>.</li>
|
|
|
|
<li><p>Return the tuple (<var title="">scheme</var>, <var title="">host</var>, <var title="">port</var>).</li>
|
|
|
|
</ol><p>In addition, if the <a href="#url">URL</a> is in fact associated with
|
|
a <code><a href="#document">Document</a></code> object that was created by parsing the
|
|
resource obtained from fetching <a href="#url">URL</a>, and this was
|
|
done over a secure connection, then the server's secure
|
|
certificate may be added to the origin as additional data.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>For scripts</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <a href="#origin">origin</a> and <a href="#effective-script-origin">effective script
|
|
origin</a> of a script are determined from another resource,
|
|
called the <i>owner</i>:</p>
|
|
|
|
<dl class="switch"><dt>If a script is in a <code><a href="#the-script-element">script</a></code> element</dt>
|
|
|
|
<dd>The owner is the <code><a href="#document">Document</a></code> to which the
|
|
<code><a href="#the-script-element">script</a></code> element belongs.</dd>
|
|
|
|
|
|
<dt>If a script is in an <a href="#event-handler-content-attributes" title="event handler content
|
|
attributes">event handler content attribute</a></dt>
|
|
|
|
<dd>The owner is the <code><a href="#document">Document</a></code> to which the
|
|
attribute node belongs.</dd>
|
|
|
|
|
|
<dt>If a script is a function or other code reference created by
|
|
another script</dt>
|
|
|
|
<dd>The owner is the script that created it.</dd>
|
|
|
|
|
|
<dt>If a script is a <a href="#javascript-protocol" title="javascript protocol"><code title="">javascript:</code> URL</a> that was returned as the
|
|
location of an HTTP redirect (<a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a> in
|
|
other protocols)</dt>
|
|
|
|
<dd>The owner is the <a href="#url">URL</a> that redirected to the
|
|
<a href="#javascript-protocol" title="javascript protocol"><code title="">javascript:</code> URL</a>.</dd>
|
|
|
|
|
|
<dt>If a script is a <a href="#javascript-protocol" title="javascript protocol"><code title="">javascript:</code> URL</a> in an attribute</dt>
|
|
|
|
<dd>The owner is the <code><a href="#document">Document</a></code> of the element on
|
|
which the attribute is found.</dd>
|
|
|
|
|
|
<dt>If a script is a <a href="#javascript-protocol" title="javascript protocol"><code title="">javascript:</code> URL</a> in a style sheet</dt>
|
|
|
|
<dd>The owner is the <a href="#url">URL</a> of the style sheet.</dd>
|
|
|
|
|
|
<dt>If a script is a <a href="#javascript-protocol" title="javascript protocol"><code title="">javascript:</code> URL</a> to which a <a href="#browsing-context">browsing
|
|
context</a> is being <a href="#navigate" title="navigate">navigated</a>,
|
|
the URL having been provided by the user (e.g. by using a
|
|
<i>bookmarklet</i>)</dt>
|
|
|
|
<dd>The owner is the <code><a href="#document">Document</a></code> of the <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#active-document">active document</a>.</dd>
|
|
|
|
|
|
<dt>If a script is a <a href="#javascript-protocol" title="javascript protocol"><code title="">javascript:</code> URL</a> to which a <a href="#browsing-context">browsing
|
|
context</a> is being <a href="#navigate" title="navigate">navigated</a>,
|
|
the URL having been declared in markup</dt>
|
|
|
|
<dd>The owner is the <code><a href="#document">Document</a></code> of the element
|
|
(e.g. an <code><a href="#the-a-element">a</a></code> or <code><a href="#the-area-element">area</a></code> element) that
|
|
declared the URL.</dd>
|
|
|
|
|
|
<dt>If a script is a <a href="#javascript-protocol" title="javascript protocol"><code title="">javascript:</code> URL</a> to which a <a href="#browsing-context">browsing
|
|
context</a> is being <a href="#navigate" title="navigate">navigated</a>,
|
|
the URL having been provided by script</dt>
|
|
|
|
<dd>The owner is the script that provided the URL.</dd>
|
|
|
|
</dl><p>The <a href="#origin">origin</a> of the script is then equal to the
|
|
<a href="#origin">origin</a> of the owner, and the <a href="#effective-script-origin">effective script
|
|
origin</a> of the script is equal to the <a href="#effective-script-origin">effective script
|
|
origin</a> of the owner.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>For <code><a href="#document">Document</a></code> objects and images</dt>
|
|
|
|
<dd>
|
|
|
|
<dl class="switch"><dt id="sandboxOrigin">If a <code><a href="#document">Document</a></code> is in a
|
|
<a href="#browsing-context">browsing context</a> whose <a href="#sandboxed-origin-browsing-context-flag">sandboxed origin
|
|
browsing context flag</a> was set when the
|
|
<code><a href="#document">Document</a></code> was created</dt>
|
|
|
|
<dt>If a <code><a href="#document">Document</a></code> was generated from a resource
|
|
labeled as <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code></dt>
|
|
|
|
<dd>The <a href="#origin">origin</a> is a globally unique identifier
|
|
assigned when the <code><a href="#document">Document</a></code> is created.</dd>
|
|
|
|
|
|
<dt>If a <code><a href="#document">Document</a></code> or image was generated from a
|
|
<a href="#javascript-protocol" title="javascript protocol"><code>javascript:</code>
|
|
URL</a></dt>
|
|
|
|
<dd>The <a href="#origin">origin</a> is equal to the <a href="#origin">origin</a>
|
|
of the script of that <a href="#javascript-protocol" title="javascript
|
|
protocol"><code>javascript:</code> URL</a>.</dd>
|
|
|
|
|
|
<dt>If a <code><a href="#document">Document</a></code> or image was served over the
|
|
network and has an address that uses a URL scheme with a
|
|
server-based naming authority</dt>
|
|
|
|
<dd>The <a href="#origin">origin</a> is the <a href="#origin">origin</a> of the
|
|
<a href="#the-document-s-address" title="the document's address">address</a> of the
|
|
<code><a href="#document">Document</a></code> or the <a href="#url">URL</a> of the image, as
|
|
appropriate.</dd>
|
|
|
|
|
|
<dt>If a <code><a href="#document">Document</a></code> or image was generated from a
|
|
<a href="#data-protocol" title="data protocol"><code title="">data:</code>
|
|
URL</a> that was returned as the location of an HTTP redirect
|
|
(<a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a>
|
|
in other protocols)</dt>
|
|
|
|
<dd>The <a href="#origin">origin</a> is the <a href="#origin">origin</a> of the
|
|
<a href="#url">URL</a> that redirected to the <a href="#data-protocol" title="data
|
|
protocol"><code title="">data:</code> URL</a>.</dd>
|
|
|
|
|
|
<dt>If a <code><a href="#document">Document</a></code> or image was generated from a
|
|
<a href="#data-protocol" title="data protocol"><code title="">data:</code>
|
|
URL</a> found in another <code><a href="#document">Document</a></code> or in a
|
|
script</dt>
|
|
|
|
<dd>The <a href="#origin">origin</a> is the <a href="#origin">origin</a> of the
|
|
<code><a href="#document">Document</a></code> or script that initiated the <a href="#navigate" title="navigate">navigation</a> to that <a href="#url">URL</a>.</dd>
|
|
|
|
|
|
<dt>If a <code><a href="#document">Document</a></code> has the <a href="#the-document-s-address" title="the
|
|
document's address">address</a>
|
|
"<code><a href="#about:blank">about:blank</a></code>"</dt>
|
|
|
|
<dd>The <a href="#origin">origin</a> of the <code><a href="#document">Document</a></code> is <a href="#about-blank-origin">the <span>origin</span> it was
|
|
assigned when its browsing context was created</a>.</dd>
|
|
|
|
|
|
<dt>If a <code><a href="#document">Document</a></code> is <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a></dt>
|
|
|
|
<dd>The <a href="#origin">origin</a> of the <code><a href="#document">Document</a></code> is the
|
|
<a href="#origin">origin</a> of the <code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#browsing-context-container">browsing context container</a>'s
|
|
<code><a href="#document">Document</a></code>.</dd>
|
|
|
|
|
|
<dt>If a <code><a href="#document">Document</a></code> or image was obtained in some
|
|
other manner (e.g. a <a href="#data-protocol" title="data protocol"><code title="">data:</code> URL</a> typed in by the user, a
|
|
<code><a href="#document">Document</a></code> created using the <code title="dom-DOMImplementation-createDocument"><a href="#dom-domimplementation-createdocument">createDocument()</a></code>
|
|
API, etc)</dt>
|
|
|
|
<dd>The <a href="#origin">origin</a> is a globally unique identifier
|
|
assigned when the <code><a href="#document">Document</a></code> or image is created.</dd>
|
|
|
|
</dl><p>When a <code><a href="#document">Document</a></code> is created, its <a href="#effective-script-origin">effective
|
|
script origin</a> is initialized to the <a href="#origin">origin</a> of
|
|
the <code><a href="#document">Document</a></code>. However, the <code title="dom-document-domain"><a href="#dom-document-domain">document.domain</a></code> attribute can
|
|
be used to change it.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>For <code><a href="#the-audio-element">audio</a></code> and <code><a href="#the-video-element">video</a></code> elements</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If value of the <a href="#media-element">media element</a>'s <code title="dom-media-currentSrc"><a href="#dom-media-currentsrc">currentSrc</a></code> attribute is the
|
|
empty string, the <a href="#origin">origin</a> is the same as the
|
|
<a href="#origin">origin</a> of the element's <code><a href="#document">Document</a></code>'s
|
|
<a href="#origin">origin</a>.</p>
|
|
|
|
<p>Otherwise, the <a href="#origin">origin</a> is equal to the
|
|
<a href="#origin">origin</a> of the <a href="#absolute-url">absolute URL</a> given by the
|
|
<a href="#media-element">media element</a>'s <code title="dom-media-currentSrc"><a href="#dom-media-currentsrc">currentSrc</a></code> attribute.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>For fonts</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <a href="#origin">origin</a> of a downloadable Web font is equal to
|
|
the <a href="#origin">origin</a> of the <a href="#absolute-url">absolute URL</a> used to
|
|
obtain the font (after any redirects). <a href="#refsCSSFONTS">[CSSFONTS]</a></p>
|
|
|
|
<p>The <a href="#origin">origin</a> of a locally installed system font is
|
|
equal to the <a href="#origin">origin</a> of the <code><a href="#document">Document</a></code> in
|
|
which that font is being used.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>Other specifications can override the above definitions by
|
|
themselves specifying the origin of a particular URL, script,
|
|
<code><a href="#document">Document</a></code>, or image.</p>
|
|
|
|
|
|
<hr><p>The <dfn id="unicode-serialization-of-an-origin">Unicode serialization of an origin</dfn> is the string
|
|
obtained by applying the following algorithm to the given
|
|
<a href="#origin">origin</a>:</p>
|
|
|
|
<ol><li><p>If the <a href="#origin">origin</a> in question is not a
|
|
scheme/host/port tuple, then return the literal string "<code title="">null</code>" and abort these steps.</li>
|
|
|
|
<li><p>Otherwise, let <var title="">result</var> be the scheme part
|
|
of the <a href="#origin">origin</a> tuple.</li>
|
|
|
|
<li><p>Append the string "<code title="">://</code>" to <var title="">result</var>.</li>
|
|
|
|
<li><p>Apply the IDNA ToUnicode algorithm to each component of the
|
|
host part of the <a href="#origin">origin</a> tuple, and append the results
|
|
— each component, in the same order, separated by U+002E FULL
|
|
STOP characters (.) — to <var title="">result</var>. <a href="#refsRFC3490">[RFC3490]</a></li>
|
|
|
|
<li><p>If the port part of the <a href="#origin">origin</a> tuple gives a port
|
|
that is different from the default port for the protocol given by
|
|
the scheme part of the <a href="#origin">origin</a> tuple, then append a
|
|
U+003A COLON character (:) and the given port, in base ten, to
|
|
<var title="">result</var>.</li>
|
|
|
|
<li><p>Return <var title="">result</var>.</li>
|
|
|
|
</ol><p>The <dfn id="ascii-serialization-of-an-origin">ASCII serialization of an origin</dfn> is the string
|
|
obtained by applying the following algorithm to the given
|
|
<a href="#origin">origin</a>:</p>
|
|
|
|
<ol><li><p>If the <a href="#origin">origin</a> in question is not a
|
|
scheme/host/port tuple, then return the literal string "<code title="">null</code>" and abort these steps.</li>
|
|
|
|
<li><p>Otherwise, let <var title="">result</var> be the scheme part
|
|
of the <a href="#origin">origin</a> tuple.</li>
|
|
|
|
<li><p>Append the string "<code title="">://</code>" to <var title="">result</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Apply the IDNA ToASCII algorithm the host part of the
|
|
<a href="#origin">origin</a> tuple, with both the AllowUnassigned and
|
|
UseSTD3ASCIIRules flags set, and append the results <var title="">result</var>.</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 return the empty string and abort these steps. <a href="#refsRFC3490">[RFC3490]</a></p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the port part of the <a href="#origin">origin</a> tuple gives a port
|
|
that is different from the default port for the protocol given by
|
|
the scheme part of the <a href="#origin">origin</a> tuple, then append a
|
|
U+003A COLON character (:) and the given port, in base ten, to
|
|
<var title="">result</var>.</li>
|
|
|
|
<li><p>Return <var title="">result</var>.</li>
|
|
|
|
</ol><p>Two <a href="#origin" title="origin">origins</a> are said to be the
|
|
<dfn id="same-origin">same origin</dfn> if the following algorithm returns true:</p>
|
|
|
|
<ol><li><p>Let <var title="">A</var> be the first <a href="#origin">origin</a>
|
|
being compared, and <var title="">B</var> be the second
|
|
<a href="#origin">origin</a> being compared.</li>
|
|
|
|
<li><p>If <var title="">A</var> and <var title="">B</var> are both
|
|
opaque identifiers, and their value is equal, then return
|
|
true.</li>
|
|
|
|
<li><p>Otherwise, if either <var title="">A</var> or <var title="">B</var> or both are opaque identifiers, return
|
|
false.</li>
|
|
|
|
<li><p>If <var title="">A</var> and <var title="">B</var> have
|
|
scheme components that are not identical, return false.</li>
|
|
|
|
<li><p>If <var title="">A</var> and <var title="">B</var> have host
|
|
components that are not identical, return false.</li>
|
|
|
|
<li><p>If <var title="">A</var> and <var title="">B</var> have port
|
|
components that are not identical, return false.</li>
|
|
|
|
<li><p>If either <var title="">A</var> or <var title="">B</var>
|
|
have additional data, but that data is not identical for both,
|
|
return false.</li>
|
|
|
|
<li><p>Return true.</li>
|
|
|
|
</ol></div><h4 id="relaxing-the-same-origin-restriction"><span class="secno">5.3.1 </span>Relaxing the same-origin restriction</h4><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-domain"><a href="#dom-document-domain">domain</a></code> [ = <var title="">domain</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current domain used for security checks.</p>
|
|
|
|
<p>Can be set to a value that removes subdomains, to change the
|
|
<a href="#effective-script-origin">effective script origin</a> to allow pages on other
|
|
subdomains of the same domain (if they do the same thing) to
|
|
access each other.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-domain" title="dom-document-domain"><code>domain</code></dfn>
|
|
attribute on <code><a href="#document">Document</a></code> objects must be initialized to
|
|
<a href="#the-document-s-domain">the document's domain</a>, if it has one, and the empty
|
|
string otherwise. If the value is an IPv6 address, then the square
|
|
brackets from the host portion of the <a href="#url-host" title="url-host"><host></a> component must be omitted from
|
|
the attribute's value.</p>
|
|
|
|
<p>On getting, the attribute must return its current value, unless
|
|
the <code><a href="#document">Document</a></code> has no <a href="#browsing-context">browsing context</a>, in
|
|
which case it must return the empty string.</p>
|
|
|
|
<p>On setting, the user agent must run the following algorithm:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the <code><a href="#document">Document</a></code> has no <a href="#browsing-context">browsing
|
|
context</a>, throw a <code><a href="#security_err">SECURITY_ERR</a></code> exception and
|
|
abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the new value is an IP address, let <var title="">new
|
|
value</var> be the new value. Otherwise, apply the IDNA ToASCII
|
|
algorithm to the new value, with both the AllowUnassigned and
|
|
UseSTD3ASCIIRules flags set, and let <var title="">new value</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 throw a <code><a href="#security_err">SECURITY_ERR</a></code> exception and abort
|
|
these steps. <a href="#refsRFC3490">[RFC3490]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">new value</var> is not exactly equal to the
|
|
current value of the <code title="dom-document-domain"><a href="#dom-document-domain">document.domain</a></code> attribute, then
|
|
run these substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the current value is an IP address, throw a
|
|
<code><a href="#security_err">SECURITY_ERR</a></code> exception and abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">new value</var>, prefixed by a U+002E FULL
|
|
STOP (.), does not exactly match the end of the current value,
|
|
throw a <code><a href="#security_err">SECURITY_ERR</a></code> exception and abort these
|
|
steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">new value</var> matches a suffix in the
|
|
Public Suffix List, or, if <var title="">new value</var>,
|
|
prefixed by a U+002E FULL STOP (.), matches the end of a
|
|
suffix in the Public Suffix List, then throw a
|
|
<code><a href="#security_err">SECURITY_ERR</a></code> exception and abort these steps. <a href="#refsPSL">[PSL]</a></p>
|
|
|
|
<p>Suffixes must be compared after applying the IDNA ToASCII
|
|
algorithm to them, with both the AllowUnassigned and
|
|
UseSTD3ASCIIRules flags set, in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner. <a href="#refsRFC3490">[RFC3490]</a></p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Release the <a href="#storage-mutex">storage mutex</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the attribute's value to <var title="">new value</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the host part of the <a href="#effective-script-origin">effective script origin</a>
|
|
tuple of the <code><a href="#document">Document</a></code> to <var title="">new
|
|
value</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the port part of the <a href="#effective-script-origin">effective script origin</a>
|
|
tuple of the <code><a href="#document">Document</a></code> to "manual override" (a value
|
|
that, for the purposes of <a href="#same-origin" title="same origin">comparing
|
|
origins</a>, is identical to "manual override" but not
|
|
identical to any other value).</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The <dfn id="the-document-s-domain" title="the document's domain">domain</dfn> of a
|
|
<code><a href="#document">Document</a></code> is the host part of the document's
|
|
<a href="#origin">origin</a>, if that is a scheme/host/port tuple. If it
|
|
isn't, then the document does not have a domain.</p>
|
|
|
|
</div><p class="note">The <code title="dom-document-domain"><a href="#dom-document-domain">domain</a></code>
|
|
attribute is used to enable pages on different hosts of a domain to
|
|
access each others' DOMs.<p class="warning">Do not use the <code title="dom-document-domain"><a href="#dom-document-domain">document.domain</a></code> attribute when
|
|
using shared hosting. If an untrusted third party is able to host an
|
|
HTTP server at the same IP address but on a different port, then the
|
|
same-origin protection that normally protects two different sites on
|
|
the same host will fail, as the ports are ignored when comparing
|
|
origins after the <code title="dom-document-domain"><a href="#dom-document-domain">document.domain</a></code> attribute has
|
|
been used.<h3 id="history"><span class="secno">5.4 </span>Session history and navigation</h3><h4 id="the-session-history-of-browsing-contexts"><span class="secno">5.4.1 </span>The session history of browsing contexts</h4><p>The sequence of <code><a href="#document">Document</a></code>s in a <a href="#browsing-context">browsing
|
|
context</a> is its <dfn id="session-history">session history</dfn>.<p><code><a href="#history-0">History</a></code> objects provide a representation of the
|
|
pages in the session history of <a href="#browsing-context" title="browsing
|
|
context">browsing contexts</a>. Each <a href="#browsing-context">browsing
|
|
context</a>, including <a href="#nested-browsing-context" title="nested browsing
|
|
context">nested browsing contexts</a>, has a distinct session
|
|
history.<p>Each <code><a href="#document">Document</a></code> object in a <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#session-history">session history</a> is associated with a
|
|
unique instance of the <code><a href="#history-0">History</a></code> object, although they
|
|
all must model the same underlying <a href="#session-history">session history</a>.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-history" 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="#history-0">History</a></code> interface for that
|
|
<code><a href="#window">Window</a></code> object's <code><a href="#document">Document</a></code>.</p>
|
|
|
|
</div><p><code><a href="#history-0">History</a></code> objects represent their <a href="#browsing-context">browsing
|
|
context</a>'s session history as a flat list of <a href="#session-history-entry" title="session history entry">session history entries</a>. Each
|
|
<dfn id="session-history-entry">session history entry</dfn> consists of either a
|
|
<a href="#url">URL</a> or a <a href="#state-object">state object</a>, or both<span class="impl">, and may in addition have a title, a
|
|
<code><a href="#document">Document</a></code> object, form data, a scroll position, and
|
|
other information associated with it</span>.<div class="impl">
|
|
|
|
<p class="note">This does not imply that the user interface need be
|
|
linear. See the <a href="#history-notes">notes below</a>.</p>
|
|
|
|
</div><p class="note">Titles associated with <a href="#session-history-entry" title="session history
|
|
entry">session history entries</a> need not have any relation
|
|
with the current <code><a href="#the-title-element">title</a></code> of the
|
|
<code><a href="#document">Document</a></code>. The title of a <a href="#session-history-entry">session history
|
|
entry</a> is intended to explain the state of the document at
|
|
that point, so that the user can navigate the document's
|
|
history.<p>URLs without associated <a href="#state-object" title="state object">state
|
|
objects</a> are added to the session history as the user (or
|
|
script) navigates from page to page.<p>A <dfn id="state-object">state object</dfn> is an object representing a user
|
|
interface state.<p>Pages can <a href="#dom-history-pushstate" title="dom-history-pushState">add</a> <a href="#state-object" title="state object">state objects</a> between their entry in the
|
|
session history and the next ("forward") entry. These are then <a href="#event-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.<div class="note">
|
|
|
|
<p><a href="#state-object" title="state object">State objects</a> are intended to
|
|
be used for two main purposes: first, storing a preparsed
|
|
description of the state in the <a href="#url">URL</a> so that in the
|
|
simple case an author doesn't have to do the parsing (though one
|
|
would still need the parsing for handling <a href="#url" title="URL">URLs</a> passed around by users, so it's only a minor
|
|
optimization), and second, so that the author can store state that
|
|
one wouldn't store in the URL because it only applies to the current
|
|
<code><a href="#document">Document</a></code> instance and it would have to be reconstructed
|
|
if a new <code><a href="#document">Document</a></code> were opened.</p>
|
|
|
|
<p>An example of the latter would be something like keeping track of
|
|
the precise coordinate from which a popup <code><a href="#the-div-element">div</a></code> was made
|
|
to animate, so that if the user goes back, it can be made to animate
|
|
to the same location. Or alternatively, it could be used to keep a
|
|
pointer into a cache of data that would be fetched from the server
|
|
based on the information in the <a href="#url">URL</a>, so that when going
|
|
back and forward, the information doesn't have to be fetched
|
|
again.</p>
|
|
|
|
</div><hr><p>At any point, one of the entries in the session history is the
|
|
<dfn id="current-entry">current entry</dfn>. This is the entry representing the
|
|
<a href="#active-document">active document</a> of the <a href="#browsing-context">browsing
|
|
context</a>. The <a href="#current-entry">current entry</a> is usually an entry
|
|
for the <a href="#dom-location-href" title="dom-location-href">location</a> of the
|
|
<code><a href="#document">Document</a></code>. However, it can also be one of the entries
|
|
for <a href="#state-object" title="state object">state objects</a> added to the
|
|
history by that document.<p><dfn id="an-entry-with-persisted-user-state">An entry with persisted user state</dfn> is one that also
|
|
has user-agent defined state. This specification does not specify
|
|
what kind of state can be stored.<p class="example">For example, some user agents might want to
|
|
persist the scroll position, or the values of form controls.<p>Entries that consist of <a href="#state-object" title="state object">state
|
|
objects</a> share the same <code><a href="#document">Document</a></code> as the entry for
|
|
the page that was active when they were added.<p>Contiguous entries that differ just by fragment identifier also
|
|
share the same <code><a href="#document">Document</a></code>.<p class="note">All entries that share the same
|
|
<code><a href="#document">Document</a></code> (and that are therefore merely different
|
|
states of one particular document) are contiguous by definition.<div class="impl">
|
|
|
|
<p>User agents may <a href="#discard-a-document" title="discard a Document">discard</a>
|
|
the <code><a href="#document">Document</a></code> objects of entries other than the
|
|
<a href="#current-entry">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 <code><a href="#document">Document</a></code> objects and when they should
|
|
cache them.</p>
|
|
|
|
<p>Entries that have had their <code><a href="#document">Document</a></code> objects
|
|
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><a href="#document">Document</a></code> object with it
|
|
must share the new object as well.</p>
|
|
|
|
</div><h4 id="the-history-interface"><span class="secno">5.4.2 </span>The <code><a href="#history-0">History</a></code> interface</h4><pre class="idl">interface <dfn id="history-0">History</dfn> {
|
|
readonly attribute long <a href="#dom-history-length" title="dom-history-length">length</a>;
|
|
readonly attribute any <a href="#dom-history-state" title="dom-history-state">state</a>;
|
|
void <a href="#dom-history-go" title="dom-history-go">go</a>(in optional long delta);
|
|
void <a href="#dom-history-back" title="dom-history-back">back</a>();
|
|
void <a href="#dom-history-forward" title="dom-history-forward">forward</a>();
|
|
void <a href="#dom-history-pushstate" title="dom-history-pushState">pushState</a>(in any data, in DOMString title, in optional DOMString url);
|
|
void <a href="#dom-history-replacestate" title="dom-history-replaceState">replaceState</a>(in any data, in DOMString title, in optional DOMString url);
|
|
};</pre><dl class="domintro"><dt><var title="">window</var> . <code title="dom-history"><a href="#dom-history">history</a></code> . <code title="dom-history-length"><a href="#dom-history-length">length</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the number of entries in the <a href="#joint-session-history">joint session history</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-history"><a href="#dom-history">history</a></code> . <code title="dom-history-state"><a href="#dom-history-state">state</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current <a href="#state-object">state object</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-history"><a href="#dom-history">history</a></code> . <code title="dom-history-go"><a href="#dom-history-go">go</a></code>( [ <var title="">delta</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Goes back or forward the specified number of steps in the <a href="#joint-session-history">joint session history</a>.</p>
|
|
|
|
<p>A zero delta will reload the current page.</p>
|
|
|
|
<p>If the delta is out of range, does nothing.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-history"><a href="#dom-history">history</a></code> . <code title="dom-history-back"><a href="#dom-history-back">back</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Goes back one step in the <a href="#joint-session-history">joint session history</a>.</p>
|
|
|
|
<p>If there is no previous page, does nothing.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-history"><a href="#dom-history">history</a></code> . <code title="dom-history-forward"><a href="#dom-history-forward">forward</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Goes forward one step in the <a href="#joint-session-history">joint session history</a>.</p>
|
|
|
|
<p>If there is no next page, does nothing.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-history"><a href="#dom-history">history</a></code> . <code title="dom-history-pushState"><a href="#dom-history-pushstate">pushState</a></code>(<var title="">data</var>, <var title="">title</var> [, <var title="">url</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Pushes the given data onto the session history, with the given title, and, if provided, the given URL.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-history"><a href="#dom-history">history</a></code> . <code title="dom-history-replaceState"><a href="#dom-history-replacestate">replaceState</a></code>(<var title="">data</var>, <var title="">title</var> [, <var title="">url</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Updates the current entry in the session history to have the given data, title, and, if provided, URL.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The <dfn id="joint-session-history">joint session history</dfn> of a <code><a href="#history-0">History</a></code>
|
|
object is the union of all the <a href="#session-history" title="session history">session
|
|
histories</a> of all <a href="#browsing-context" title="browsing context">browsing
|
|
contexts</a> of all the <a href="#fully-active">fully active</a>
|
|
<code><a href="#document">Document</a></code> objects that share the <code><a href="#history-0">History</a></code>
|
|
object's <a href="#top-level-browsing-context">top-level browsing context</a>, with all the
|
|
entries that are <a href="#current-entry" title="current entry">current entries</a>
|
|
in their respective <a href="#session-history" title="session history">session
|
|
histories</a> removed except for the <a href="#current-entry-of-the-joint-session-history">current entry of the
|
|
joint session history</a>.<p>The <dfn id="current-entry-of-the-joint-session-history">current entry of the joint session history</dfn> is the
|
|
entry that most recently became a <a href="#current-entry">current entry</a> in its
|
|
<a href="#session-history">session history</a>.<p>Entries in the <a href="#joint-session-history">joint session history</a> are ordered
|
|
chronologically by the time they were added to their respective
|
|
<a href="#session-history" title="session history">session histories</a>. (Since all
|
|
these <a href="#browsing-context" title="browsing context">browsing contexts</a> by
|
|
definition share an <a href="#event-loop">event loop</a>, there is always a
|
|
well-defined sequential order in which their <a href="#session-history" title="session
|
|
history">session histories</a> had their entries added.) Each
|
|
entry has an index; the earliest entry has index 0, and the
|
|
subsequent entries are numbered with consecutively increasing
|
|
integers (1, 2, 3, etc).<div class="impl">
|
|
|
|
<p>The <dfn id="dom-history-length" title="dom-history-length"><code>length</code></dfn>
|
|
attribute of the <code><a href="#history-0">History</a></code> interface must return the
|
|
number of entries in the <a href="#joint-session-history">joint session history</a>.</p>
|
|
|
|
<p>The actual entries are not accessible from script.</p>
|
|
|
|
<p>The <dfn id="dom-history-state" title="dom-history-state"><code>state</code></dfn>
|
|
attribute of the <code><a href="#history-0">History</a></code> interface must return the last
|
|
value it was set to by the user agent. Initially, its value must be
|
|
null.</p>
|
|
|
|
<p>When the <dfn id="dom-history-go" title="dom-history-go"><code>go(<var title="">delta</var>)</code></dfn> method is invoked, if the
|
|
argument to the method was omitted or has the value zero, the user
|
|
agent must act as if the <code title="dom-location-reload"><a href="#dom-location-reload">location.reload()</a></code> method was
|
|
called instead. Otherwise, the user agent must <a href="#traverse-the-history-by-a-delta">traverse the
|
|
history by a delta</a> whose value is the value of the method's
|
|
argument.</p>
|
|
|
|
<p>When the <dfn id="dom-history-back" title="dom-history-back"><code>back()</code></dfn>
|
|
method is invoked, the user agent must <a href="#traverse-the-history-by-a-delta">traverse the history by
|
|
a delta</a> −1.</p>
|
|
|
|
<p>When the <dfn id="dom-history-forward" title="dom-history-forward"><code>forward()</code></dfn>method is
|
|
invoked, the user agent must <a href="#traverse-the-history-by-a-delta">traverse the history by a
|
|
delta</a> +1.</p>
|
|
|
|
<p>To <dfn id="traverse-the-history-by-a-delta">traverse the history by a delta</dfn> <var title="">delta</var>, the user agent must <a href="#queue-a-task">queue a task</a>
|
|
to run the following steps. The <a href="#task-source">task source</a> for the
|
|
queued task is the <a href="#history-traversal-task-source">history traversal task source</a>.</p>
|
|
|
|
<ol><li><p>Let <var title="">delta</var> be the argument to the
|
|
method.</li>
|
|
|
|
<li><p>If the index of the <a href="#current-entry-of-the-joint-session-history">current entry of the joint session
|
|
history</a> plus <var title="">delta</var> is less than zero or
|
|
greater than or equal to the number of items in the <a href="#joint-session-history">joint
|
|
session history</a>, then abort these steps.</p>
|
|
|
|
<li><p>Let <var title="">specified entry</var> be the entry in the
|
|
<a href="#joint-session-history">joint session history</a> whose index is the sum of <var title="">delta</var> and the index of the <a href="#current-entry-of-the-joint-session-history">current entry of
|
|
the joint session history</a>.</li>
|
|
|
|
<li><p>Let <var title="">specified browsing context</var> be the
|
|
<a href="#browsing-context">browsing context</a> of the <var title="">specified
|
|
entry</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">specified browsing context</var>'s
|
|
<a href="#active-document">active document</a> is not the same <code><a href="#document">Document</a></code>
|
|
as the <code><a href="#document">Document</a></code> of the <var title="">specified
|
|
entry</var>, then run these substeps:</p>
|
|
|
|
<ol><li><p><a href="#prompt-to-unload-a-document" title="prompt to unload a document">Prompt to
|
|
unload</a> the <a href="#active-document">active document</a> of the <var title="">specified browsing context</var>. If the user
|
|
<a href="#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</a>, then
|
|
abort these steps.</li>
|
|
|
|
<li><p><a href="#unload-a-document" title="unload a document">Unload</a> the
|
|
<a href="#active-document">active document</a> of the <var title="">specified
|
|
browsing context</var> with the <var title="">recycle</var>
|
|
parameter set to false.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p><a href="#traverse-the-history">Traverse the history</a> of the <var title="">specified browsing context</var> to the <var title="">specified entry</var>.</p>
|
|
|
|
</ol><p>When the user navigates through a <a href="#browsing-context">browsing context</a>,
|
|
e.g. using a browser's back and forward buttons, the user agent must
|
|
<a href="#traverse-the-history-by-a-delta">traverse the history by a delta</a> equivalent to the
|
|
action specified by the user.</p>
|
|
|
|
<hr><p>The <dfn id="dom-history-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 entry to
|
|
the history.</p>
|
|
|
|
<p>The <dfn id="dom-history-replacestate" title="dom-history-replaceState"><code>replaceState(<var title="">data</var>, <var title="">title</var>, <var title="">url</var>)</code></dfn> method updates the state object,
|
|
title, and optionally the <a href="#url">URL</a> of the <a href="#current-entry">current
|
|
entry</a> in the history.</p>
|
|
|
|
<p>When either of these methods is invoked, the user agent must run
|
|
the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">clone data</var> be a <a href="#structured-clone">structured
|
|
clone</a> of the specified <var title="">data</var>. If this
|
|
throws an exception, then rethrow that exception and abort these
|
|
steps.</li>
|
|
|
|
<li>
|
|
|
|
<p>If a third argument is specified, run these substeps:</p>
|
|
|
|
<ol><li><a href="#resolve-a-url" title="resolve a url">Resolve</a> the value of the
|
|
third argument, relative to the <a href="#entry-script">entry script</a>'s <a href="#script-s-base-url" title="script's base URL">base URL</a>.</li>
|
|
|
|
<li>If that fails, raise a <code><a href="#security_err">SECURITY_ERR</a></code> exception
|
|
and abort these steps.</li>
|
|
|
|
<li>Compare the resulting <a href="#absolute-url">absolute URL</a> to <a href="#the-document-s-address">the
|
|
document's address</a>. If any part of these two <a href="#url" title="URL">URLs</a> differ other than the <a href="#url-path" title="url-path"><path></a>, <a href="#url-query" title="url-query"><query></a>, and <a href="#url-fragment" title="url-fragment"><fragment></a> components, then
|
|
raise a <code><a href="#security_err">SECURITY_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li>If the <a href="#origin">origin</a> of the resulting <a href="#absolute-url">absolute
|
|
URL</a> is not the same as the <a href="#origin">origin</a> of the
|
|
<a href="#entry-script">entry script</a>'s <a href="#script-s-document" title="script's
|
|
document">document</a>, and either the <a href="#url-path" title="url-path"><path></a> or <a href="#url-query" title="url-query"><query></a> components of the two
|
|
<a href="#url" title="URL">URLs</a> compared in the previous step
|
|
differ, raise a <code><a href="#security_err">SECURITY_ERR</a></code> exception and abort
|
|
these steps. (This prevents sandboxed content from spoofing other
|
|
pages on the same origin.)</li>
|
|
|
|
</ol><p>For the purposes of the comparisons in the above substeps, the
|
|
<a href="#url-path" title="url-path"><path></a> and <a href="#url-query" title="url-query"><query></a> components can only be the
|
|
same if the URLs are both <a href="#hierarchical-url" title="hierarchical
|
|
URL">hierarchical URLs</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the method invoked was the <code title="dom-history-pushState"><a href="#dom-history-pushstate">pushState()</a></code> method:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Remove all the entries in the <a href="#browsing-context">browsing context</a>'s
|
|
<a href="#session-history">session history</a> after the <a href="#current-entry">current
|
|
entry</a>. If the <a href="#current-entry">current entry</a> is the last
|
|
entry in the session history, then no entries are
|
|
removed.</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>Remove any <a href="#concept-task" title="concept-task">tasks</a> queued
|
|
by the <a href="#history-traversal-task-source">history traversal task source</a>.</li>
|
|
|
|
<li><p>If appropriate, update the <a href="#current-entry">current entry</a> to
|
|
reflect any state that the user agent wishes to persist. The
|
|
entry is then said to be <a href="#an-entry-with-persisted-user-state">an entry with persisted user
|
|
state</a>.</li>
|
|
|
|
<li><p>Add a state object entry to the session history, after the
|
|
<a href="#current-entry">current entry</a>, with <var title="">cloned data</var> as
|
|
the state object, the given <var title="">title</var> as the title,
|
|
and, if the third argument is present, the <a href="#absolute-url">absolute
|
|
URL</a> that was found earlier in this algorithm as the
|
|
<a href="#url">URL</a> of the entry.</li>
|
|
|
|
<li><p>Update the <a href="#current-entry">current entry</a> to be this newly
|
|
added entry.</li>
|
|
|
|
</ol><p>Otherwise, if the method invoked was the <code title="dom-history-replaceState"><a href="#dom-history-replacestate">replaceState()</a></code> method:</p>
|
|
|
|
<ol><li><p>Update the <a href="#current-entry">current entry</a> in the session
|
|
history so that <var title="">cloned data</var> is the entry's
|
|
new state object, the given <var title="">title</var> is the new
|
|
title, and, if the third argument is present, the <a href="#absolute-url">absolute
|
|
URL</a> that was found earlier in this algorithm is the
|
|
entry's new <a href="#url">URL</a>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>If the third argument is present, set <a href="#the-document-s-current-address">the document's
|
|
current address</a> to the <a href="#absolute-url">absolute URL</a> that was
|
|
found earlier in this algorithm.</p>
|
|
|
|
<p class="note">Since this is neither a <a href="#navigate" title="navigate">navigation</a> of the <a href="#browsing-context">browsing
|
|
context</a> nor a <a href="#traverse-the-history" title="traverse the history">history
|
|
traversal</a>, it does not cause a <code title="event-hashchange"><a href="#event-hashchange">hashchange</a></code> event to be fired.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Set <code title="dom-history-state"><a href="#dom-history-state">history.state</a></code> to
|
|
another <a href="#structured-clone">structured clone</a> of the specified <var title="">data</var>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><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><a href="#document">Document</a></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>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Consider a game where the user can navigate along a line, such
|
|
that the user is always at some coordinate, and such that the user
|
|
can bookmark the page corresponding to a particular coordinate, to
|
|
return to it later.</p>
|
|
|
|
<p>A static page implementing the x=5 position in such a game could
|
|
look like the following:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<!-- this is http://example.com/line?x=5 -->
|
|
<title>Line Game - 5</title>
|
|
<p>You are at coordinate 5 on the line.</p>
|
|
<p>
|
|
<a href="?x=6">Advance to 6</a> or
|
|
<a href="?x=4">retreat to 4</a>?
|
|
</p></pre>
|
|
|
|
<p>The problem with such a system is that each time the user
|
|
clicks, the whole page has to be reloaded. Here instead is another
|
|
way of doing it, using script:</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<!-- this starts off as http://example.com/line?x=5 -->
|
|
<title>Line Game - 5</title>
|
|
<p>You are at coordinate <span id="coord">5</span> on the line.</p>
|
|
<p>
|
|
<a href="?x=6" onclick="go(1); return false;">Advance to 6</a> or
|
|
<a href="?x=4" onclick="go(-1); return false;">retreat to 4</a>?
|
|
</p>
|
|
<script>
|
|
var currentPage = 5; // prefilled by server
|
|
function go(d) {
|
|
setupPage(currentPage + d);
|
|
history.pushState(currentPage, document.title, '?x=' + currentPage);
|
|
}
|
|
onpopstate = function(event) {
|
|
setupPage(event.state);
|
|
}
|
|
function setupPage(page) {
|
|
currentPage = page;
|
|
document.title = 'Line Game - ' + currentPage;
|
|
document.getElementById('coord').textContent = currentPage;
|
|
document.links[0].href = '?x=' + (currentPage+1);
|
|
document.links[0].textContent = 'Advance to ' + (currentPage+1);
|
|
document.links[1].href = '?x=' + (currentPage-1);
|
|
document.links[1].textContent = 'retreat to ' + (currentPage-1);
|
|
}
|
|
</script></pre>
|
|
|
|
<p>In systems without script, this still works like the previous
|
|
example. However, users that <em>do</em> have script support can
|
|
now navigate much faster, since there is no network access for the
|
|
same experience. Furthermore, contrary to the experience the user
|
|
would have with just a naïve script-based approach,
|
|
bookmarking and navigating the session history still work.</p>
|
|
|
|
<p>In the example above, the <var title="">data</var> argument to
|
|
the <code title="dom-history-pushState"><a href="#dom-history-pushstate">pushState()</a></code> method
|
|
is the same information as would be sent to the server, but in a
|
|
more convenient form, so that the script doesn't have to parse the
|
|
URL each time the user navigates.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Applications might not use the same title for a <a href="#session-history-entry">session
|
|
history entry</a> as the value of the document's
|
|
<code><a href="#the-title-element">title</a></code> element at that time. For example, here is a
|
|
simple page that shows a block in the <code><a href="#the-title-element">title</a></code> element.
|
|
Clearly, when navigating backwards to a previous state the user
|
|
does not go back in time, and therefore it would be inappropriate
|
|
to put the time in the session history title.</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<TITLE>Line</TITLE>
|
|
<SCRIPT>
|
|
setInterval(function () { document.title = 'Line - ' + new Date(); }, 1000);
|
|
var i = 1;
|
|
function inc() {
|
|
set(i+1);
|
|
history.pushState(i, 'Line - ' + i);
|
|
}
|
|
function set(newI) {
|
|
i = newI;
|
|
document.forms.F.I.value = newI;
|
|
}
|
|
</SCRIPT>
|
|
<BODY ONPOPSTATE="set(event.state)">
|
|
<FORM NAME=F>
|
|
State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON ONCLICK="inc()">
|
|
</FORM></pre>
|
|
|
|
</div><h4 id="the-location-interface"><span class="secno">5.4.3 </span>The <code><a href="#location">Location</a></code> interface</h4><p>Each <code><a href="#document">Document</a></code> object in a <a href="#browsing-context">browsing
|
|
context</a>'s session history is associated with a unique
|
|
instance of a <code><a href="#location">Location</a></code> object.<dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-location"><a href="#dom-document-location">location</a></code> [ = <var title="">value</var> ]</dt>
|
|
<dt><var title="">window</var> . <code title="dom-location"><a href="#dom-location">location</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#location">Location</a></code> object with the current page's location.</p>
|
|
|
|
<p>Can be set, to navigate to another page.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-location" 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="#location">Location</a></code> object for that <code><a href="#document">Document</a></code> object,
|
|
if it is in a <a href="#browsing-context">browsing context</a>, and null otherwise.</p>
|
|
|
|
<p>The <dfn id="dom-location" title="dom-location"><code>location</code></dfn>
|
|
attribute of the <code><a href="#window">Window</a></code> interface must return the
|
|
<code><a href="#location">Location</a></code> object for that <code><a href="#window">Window</a></code> object's
|
|
<code><a href="#document">Document</a></code>.</p>
|
|
|
|
</div><p><code><a href="#location">Location</a></code> objects provide a representation of <a href="#the-document-s-current-address" title="the document's current address">their document's current
|
|
address</a>, and allow the <a href="#current-entry">current entry</a> of the
|
|
<a href="#browsing-context">browsing context</a>'s session history to be changed, by
|
|
adding or replacing entries in the <code title="dom-history"><a href="#dom-history">history</a></code> object.<pre class="idl">interface <dfn id="location">Location</dfn> {
|
|
stringifier attribute DOMString <a href="#dom-location-href" title="dom-location-href">href</a>;
|
|
void <a href="#dom-location-assign" title="dom-location-assign">assign</a>(in DOMString url);
|
|
void <a href="#dom-location-replace" title="dom-location-replace">replace</a>(in DOMString url);
|
|
void <a href="#dom-location-reload" title="dom-location-reload">reload</a>();
|
|
|
|
// <a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a>
|
|
attribute DOMString <a href="#dom-location-protocol" title="dom-location-protocol">protocol</a>;
|
|
attribute DOMString <a href="#dom-location-host" title="dom-location-host">host</a>;
|
|
attribute DOMString <a href="#dom-location-hostname" title="dom-location-hostname">hostname</a>;
|
|
attribute DOMString <a href="#dom-location-port" title="dom-location-port">port</a>;
|
|
attribute DOMString <a href="#dom-location-pathname" title="dom-location-pathname">pathname</a>;
|
|
attribute DOMString <a href="#dom-location-search" title="dom-location-search">search</a>;
|
|
attribute DOMString <a href="#dom-location-hash" title="dom-location-hash">hash</a>;
|
|
|
|
// resolving relative URLs
|
|
DOMString <a href="#dom-location-resolveurl" title="dom-location-resolveURL">resolveURL</a>(in DOMString url);
|
|
};</pre><dl class="domintro"><dt><var title="">location</var> . <code title="dom-location-href"><a href="#dom-location-href">href</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current page's location.</p>
|
|
|
|
<p>Can be set, to navigate to another page.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">location</var> . <code title="dom-location-assign"><a href="#dom-location-assign">assign</a></code>(<var title="">url</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Navigates to the given page.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">location</var> . <code title="dom-location-replace"><a href="#dom-location-replace">replace</a></code>(<var title="">url</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Removes the current page from the session history and navigates to the given page.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">location</var> . <code title="dom-location-reload"><a href="#dom-location-reload">reload</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Reloads the current page.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">url</var> = <var title="">location</var> . <code title="dom-location-resolveURL"><a href="#dom-location-resolveurl">resolveURL</a></code>(<var title="">url</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Resolves the given relative URL to an absolute URL.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-location-href" title="dom-location-href"><code>href</code></dfn>
|
|
attribute must return <a href="#the-document-s-current-address" title="the document's current
|
|
address">the current address</a> of the associated
|
|
<code><a href="#document">Document</a></code> object, as an <a href="#absolute-url">absolute URL</a>.</p>
|
|
|
|
<p>On setting, if the <code><a href="#location">Location</a></code> object's associated
|
|
<code><a href="#document">Document</a></code> object has <a href="#completely-loaded">completely loaded</a>,
|
|
then the user agent must act as if the <code title="dom-location-assign"><a href="#dom-location-assign">assign()</a></code> method had been called
|
|
with the new value as its argument. Otherwise, the user agent must
|
|
act as if the <code title="dom-location-replace"><a href="#dom-location-replace">replace()</a></code>
|
|
method had been called with the new value as its argument.</p>
|
|
|
|
|
|
<p>When the <dfn id="dom-location-assign" title="dom-location-assign"><code>assign(<var title="">url</var>)</code></dfn> method is invoked, the UA must
|
|
<a href="#resolve-a-url" title="resolve a url">resolve</a> the argument, relative to
|
|
the <a href="#entry-script">entry script</a>'s <a href="#script-s-base-url" title="script's base URL">base
|
|
URL</a>, and if that is successful, must
|
|
<a href="#navigate">navigate</a> the
|
|
<a href="#browsing-context">browsing context</a> to the specified <var title="">url</var>. If the <a href="#browsing-context">browsing context</a>'s
|
|
<a href="#session-history">session history</a> contains only one
|
|
<code><a href="#document">Document</a></code>, and that was the <code><a href="#about:blank">about:blank</a></code>
|
|
<code><a href="#document">Document</a></code> created when the <a href="#browsing-context">browsing context</a>
|
|
was created, then the navigation must be done with <a href="#replacement-enabled">replacement
|
|
enabled</a>.</p>
|
|
<p>When the <dfn id="dom-location-replace" title="dom-location-replace"><code>replace(<var title="">url</var>)</code></dfn> method is invoked, the UA must
|
|
<a href="#resolve-a-url" title="resolve a url">resolve</a> the argument, relative to
|
|
the <a href="#entry-script">entry script</a>'s <a href="#script-s-base-url" title="script's base URL">base
|
|
URL</a>, and if that is successful,
|
|
<a href="#navigate">navigate</a> the
|
|
<a href="#browsing-context">browsing context</a> to the specified <var title="">url</var> with <a href="#replacement-enabled">replacement enabled</a>.</p>
|
|
|
|
<p>Navigation for the <code title="dom-location-assign"><a href="#dom-location-assign">assign()</a></code> and <code title="dom-location-replace"><a href="#dom-location-replace">replace()</a></code> methods must be done
|
|
with the <a href="#script-s-browsing-context" title="script's browsing context">browsing
|
|
context</a> of the script that invoked the method as the
|
|
<a href="#source-browsing-context">source browsing context</a>.</p>
|
|
|
|
<p>If the <a href="#resolve-a-url" title="resolve a url">resolving</a> step of the
|
|
<code title="dom-location-assign"><a href="#dom-location-assign">assign()</a></code> and <code title="dom-location-replace"><a href="#dom-location-replace">replace()</a></code> methods is not
|
|
successful, then the user agent must instead throw a
|
|
<code><a href="#syntax_err">SYNTAX_ERR</a></code> exception.</p>
|
|
|
|
<p>When the <dfn id="dom-location-reload" title="dom-location-reload"><code>reload()</code></dfn> method is
|
|
invoked, the user agent must run the appropriate steps from the
|
|
following list:</p>
|
|
|
|
<dl class="switch"><dt>If the currently executing <a href="#concept-task" title="concept-task">task</a> is the dispatch of a <code title="event-resize">resize</code> event in response to the user
|
|
resizing the <a href="#browsing-context">browsing context</a></dt>
|
|
|
|
<dd><p>Repaint the <a href="#browsing-context">browsing context</a> and abort these
|
|
steps.</dd>
|
|
<dt>If the <a href="#browsing-context">browsing context</a>'s <a href="#active-document">active
|
|
document</a> is <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a></dt>
|
|
|
|
<dd><p><a href="#process-the-iframe-attributes" title="process the iframe attributes">Reprocess the
|
|
<code>iframe</code> attributes</a> of the <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#browsing-context-container">browsing context container</a>.</dd>
|
|
|
|
<dt>If the <a href="#browsing-context">browsing context</a>'s <a href="#active-document">active
|
|
document</a> has its <a href="#reload-override-flag">reload override
|
|
flag</a> set</dt>
|
|
|
|
<dd><p>Perform <a href="#an-overridden-reload">an overridden reload</a>.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p><a href="#navigate">Navigate</a> the
|
|
<a href="#browsing-context">browsing context</a> to <a href="#the-document-s-current-address">the document's current
|
|
address</a> with <a href="#replacement-enabled">replacement enabled</a>. The
|
|
<a href="#source-browsing-context">source browsing context</a> must be the <a href="#browsing-context">browsing
|
|
context</a> being navigated.</dd>
|
|
|
|
|
|
</dl><p>When a user requests that the current page of a <a href="#browsing-context">browsing
|
|
context</a> be reloaded through a user interface element, the
|
|
user agent should <a href="#navigate">navigate</a> the
|
|
<a href="#browsing-context">browsing context</a> to the same resource as
|
|
<code><a href="#document">Document</a></code>, with <a href="#replacement-enabled">replacement enabled</a>. In the
|
|
case of non-idempotent methods (e.g. HTTP POST), the user agent
|
|
should prompt the user to confirm the operation first, since
|
|
otherwise transactions (e.g. purchases or database modifications)
|
|
could be repeated. User agents may allow the user to explicitly
|
|
override any caches when reloading. If <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#active-document">active document</a>'s <a href="#reload-override-flag">reload
|
|
override flag</a> is set, then the user agent may instead perform
|
|
<a href="#an-overridden-reload">an overridden reload</a> rather than the navigation
|
|
described in this paragraph.</p>
|
|
|
|
</div><p>The <code><a href="#location">Location</a></code> interface also has the complement of
|
|
<a href="#url-decomposition-idl-attributes">URL decomposition IDL attributes</a>, <dfn id="dom-location-protocol" title="dom-location-protocol"><code>protocol</code></dfn>, <dfn id="dom-location-host" title="dom-location-host"><code>host</code></dfn>, <dfn id="dom-location-port" title="dom-location-port"><code>port</code></dfn>, <dfn id="dom-location-hostname" title="dom-location-hostname"><code>hostname</code></dfn>, <dfn id="dom-location-pathname" title="dom-location-pathname"><code>pathname</code></dfn>, <dfn id="dom-location-search" title="dom-location-search"><code>search</code></dfn>, and <dfn id="dom-location-hash" title="dom-location-hash"><code>hash</code></dfn>. <span class="impl">These must follow the rules given for <a href="#url-decomposition-idl-attributes">URL
|
|
decomposition IDL attributes</a>, with the <a href="#concept-uda-input" title="concept-uda-input">input</a> being <a href="#the-document-s-current-address" title="the
|
|
document's current address">the current address</a> of the
|
|
associated <code><a href="#document">Document</a></code> object, as an <a href="#absolute-url">absolute
|
|
URL</a> (same as the <code title="dom-location-href"><a href="#dom-location-href">href</a></code>
|
|
attribute), and the <a href="#concept-uda-setter" title="concept-uda-setter">common setter
|
|
action</a> being the same as setting the <code title="dom-location-href"><a href="#dom-location-href">href</a></code> attribute to the new output
|
|
value.</span><div class="impl">
|
|
|
|
<hr><p>The <dfn id="dom-location-resolveurl" title="dom-location-resolveURL"><code>resolveURL(<var title="">url</var>)</code></dfn> method must <a href="#resolve-a-url" title="resolve a
|
|
url">resolve</a> its <var title="">url</var> argument, relative
|
|
to the <a href="#entry-script">entry script</a>'s <a href="#script-s-base-url" title="script's base
|
|
URL">base URL</a>, and if that succeeds, return the resulting
|
|
<a href="#absolute-url">absolute URL</a>. If it fails, it must throw a
|
|
<code><a href="#syntax_err">SYNTAX_ERR</a></code> exception instead.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="security-location"><span class="secno">5.4.3.1 </span>Security</h5>
|
|
|
|
<p id="security-3">User agents must raise a
|
|
<code><a href="#security_err">SECURITY_ERR</a></code> exception whenever any of the members of a
|
|
<code><a href="#location">Location</a></code> object are accessed by scripts whose
|
|
<a href="#effective-script-origin">effective script origin</a> is not the <a href="#same-origin" title="same
|
|
origin">same</a> as the <code><a href="#location">Location</a></code> object's associated
|
|
<code><a href="#document">Document</a></code>'s <a href="#effective-script-origin">effective script origin</a>, with
|
|
the following exceptions:</p>
|
|
|
|
<ul><li>The <code title="dom-location-href"><a href="#dom-location-href">href</a></code> setter, if the
|
|
script is running in a <a href="#browsing-context">browsing context</a> that is
|
|
<a href="#allowed-to-navigate">allowed to navigate</a> the browsing context with which
|
|
the <code><a href="#location">Location</a></code> object is associated
|
|
|
|
<li>The <code title="dom-location-replace"><a href="#dom-location-replace">replace()</a></code> method,
|
|
if the script is running in a <a href="#browsing-context">browsing context</a> that is
|
|
<a href="#allowed-to-navigate">allowed to navigate</a> the browsing context with which
|
|
the <code><a href="#location">Location</a></code> object is associated
|
|
|
|
</ul></div><div class="impl">
|
|
|
|
<h4 id="history-notes"><span class="secno">5.4.4 </span>Implementation notes for session history</h4>
|
|
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>The <code><a href="#history-0">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="#dom-history">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="#the-iframe-element">iframe</a></code>s has a <code title="dom-history"><a href="#dom-history">history</a></code> object distinct from the
|
|
<code><a href="#the-iframe-element">iframe</a></code>s' <code title="dom-history"><a href="#dom-history">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="#dom-history-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="#dom-history-pushstate">pushState()</a></code> that are invoked on
|
|
a timer, or from event listeners that are not triggered in response
|
|
to a clear user action, or that are invoked in rapid succession.</p>
|
|
|
|
</div><h3 id="browsing-the-web"><span class="secno">5.5 </span>Browsing the Web</h3><div class="impl">
|
|
|
|
<h4 id="navigating-across-documents"><span class="secno">5.5.1 </span>Navigating across documents</h4>
|
|
|
|
<p>Certain actions cause the <a href="#browsing-context">browsing context</a> to
|
|
<i><a href="#navigate">navigate</a></i> to a new resource. Navigation always involves
|
|
<dfn id="source-browsing-context">source browsing context</dfn>, which is the browsing context
|
|
which was responsible for starting the navigation.</p>
|
|
|
|
<p class="example">For example, <a href="#following-hyperlinks" title="following
|
|
hyperlinks">following a hyperlink</a>, <a href="#concept-form-submit" title="concept-form-submit">form submission</a>, and the <code title="dom-open"><a href="#dom-open">window.open()</a></code> and <code title="dom-location-assign"><a href="#dom-location-assign">location.assign()</a></code> methods can all
|
|
cause a browsing context to navigate.</p>
|
|
|
|
<p>A user agent may provide various ways for the user to explicitly
|
|
cause a browsing context to navigate, in addition to those defined
|
|
in this specification.</p>
|
|
|
|
|
|
<p>When a browsing context is <dfn id="navigate" title="navigate">navigated</dfn>
|
|
to a new resource, the user agent must run the following steps:</p>
|
|
|
|
<ol><li><p>Release the <a href="#storage-mutex">storage mutex</a>.</li>
|
|
|
|
<li id="sandboxLinks">
|
|
|
|
<p>If the <a href="#source-browsing-context">source browsing context</a> is not the same as
|
|
the <a href="#browsing-context">browsing context</a> being navigated, and the
|
|
<a href="#source-browsing-context">source browsing context</a> is not one of the <a href="#ancestor-browsing-context" title="ancestor browsing context">ancestor browsing
|
|
contexts</a> of the <a href="#browsing-context">browsing context</a> being
|
|
navigated, and the <a href="#browsing-context">browsing context</a> being navigated is
|
|
not both a <a href="#top-level-browsing-context">top-level browsing context</a> and one of the
|
|
<a href="#ancestor-browsing-context" title="ancestor browsing context">ancestor browsing
|
|
contexts</a> of the <a href="#source-browsing-context">source browsing context</a>, and
|
|
the <a href="#source-browsing-context">source browsing context</a> had its <a href="#sandboxed-navigation-browsing-context-flag">sandboxed
|
|
navigation browsing context flag</a> set when its <a href="#active-document">active
|
|
document</a> was created, then abort these steps.</p>
|
|
|
|
<p>Otherwise, if the <a href="#browsing-context">browsing context</a> being navigated
|
|
is a <a href="#top-level-browsing-context">top-level browsing context</a>, and is one of the
|
|
<a href="#ancestor-browsing-context" title="ancestor browsing context">ancestor browsing
|
|
contexts</a> of the <a href="#source-browsing-context">source browsing context</a>, and
|
|
the <a href="#source-browsing-context">source browsing context</a> had its <a href="#sandboxed-top-level-navigation-browsing-context-flag">sandboxed
|
|
top-level navigation browsing context flag</a> set when its
|
|
<a href="#active-document">active document</a> was created, then abort these
|
|
steps.</p>
|
|
|
|
<p>In both cases, the user agent may additionally offer to open
|
|
the new resource in a new <a href="#top-level-browsing-context">top-level browsing context</a>
|
|
or in the <a href="#top-level-browsing-context">top-level browsing context</a> of the
|
|
<a href="#source-browsing-context">source browsing context</a>, at the user's option, in
|
|
which case the user agent must <a href="#navigate">navigate</a> that designated <a href="#top-level-browsing-context">top-level browsing
|
|
context</a> to the new resource as if the user had requested it
|
|
independently.</p>
|
|
|
|
</li>
|
|
|
|
<li id="seamlessLinks"><p>If the <a href="#source-browsing-context">source browsing
|
|
context</a> is the same as the <a href="#browsing-context">browsing context</a>
|
|
being navigated, and this browsing context has its <a href="#seamless-browsing-context-flag">seamless
|
|
browsing context flag</a> set, and the <a href="#browsing-context">browsing
|
|
context</a> being navigated was not chosen using an
|
|
<a href="#explicit-self-navigation-override">explicit self-navigation override</a>, then find the
|
|
nearest <a href="#ancestor-browsing-context">ancestor browsing context</a> that does not have
|
|
its <a href="#seamless-browsing-context-flag">seamless browsing context flag</a> set, and continue
|
|
these steps as if <em>that</em> <a href="#browsing-context">browsing context</a> was
|
|
the one that was going to be <a href="#navigate" title="navigate">navigated</a> instead.</li>
|
|
|
|
<li><p>If there is a preexisting attempt to navigate the
|
|
<a href="#browsing-context">browsing context</a>, and the <a href="#source-browsing-context">source browsing
|
|
context</a> is the same as the <a href="#browsing-context">browsing context</a>
|
|
being navigated, and that attempt is currently
|
|
running the <a href="#unload-a-document">unload a document</a> algorithm, and the
|
|
<a href="#origin">origin</a> of the <a href="#url">URL</a> of the resource being
|
|
loaded in that navigation is not the <a href="#same-origin">same origin</a> as
|
|
the <a href="#origin">origin</a> of the <a href="#url">URL</a> of the resource
|
|
being loaded in <em>this</em> navigation, then abort these steps
|
|
without affecting the preexisting attempt to navigate the
|
|
<a href="#browsing-context">browsing context</a>.</li>
|
|
|
|
|
|
<li><p>If a <a href="#concept-task" title="concept-task">task</a> queued by the
|
|
<a href="#traverse-the-history-by-a-delta">traverse the history by a delta</a> algorithm is running
|
|
the <a href="#unload-a-document">unload a document</a> algorithm for the <a href="#active-document">active
|
|
document</a> of the <a href="#browsing-context">browsing context</a> being
|
|
navigated, then abort these steps without affecting the
|
|
<a href="#unload-a-document">unload a document</a> algorithm or the aforementioned
|
|
history traversal task.</li>
|
|
<li><p>If there is a preexisting attempt to navigate the
|
|
<a href="#browsing-context">browsing context</a>, and either that attempt has not yet
|
|
<a href="#concept-navigate-mature" title="concept-navigate-mature">matured</a> (i.e. it has
|
|
not passed the point of making its <code><a href="#document">Document</a></code> the
|
|
<a href="#active-document">active document</a>), or that navigation's resource is not
|
|
to be fetched using HTTP GET <a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or equivalent</a>, or its
|
|
resource's <a href="#absolute-url">absolute URL</a> differs from this attempt's by
|
|
more than the presence, absence, or value of the <a href="#url-fragment" title="url-fragment"><fragment></a> component, then cancel
|
|
that preexisting attempt to navigate the <a href="#browsing-context">browsing
|
|
context</a>.</li>
|
|
|
|
<li id="navigate-fragid-step"><p><i>Fragment identifiers</i>: If
|
|
the <a href="#absolute-url">absolute URL</a> of the new resource is the same as
|
|
the <a href="#the-document-s-address" title="the document's address">address</a> of the
|
|
<a href="#active-document">active document</a> of the <a href="#browsing-context">browsing context</a>
|
|
being navigated, ignoring any <a href="#url-fragment" title="url-fragment"><fragment></a> components of those
|
|
<a href="#url" title="URL">URLs</a>, and the new resource is to be
|
|
fetched using HTTP GET <a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or
|
|
equivalent</a>, and the <a href="#absolute-url">absolute URL</a> of the new
|
|
resource has a <a href="#url-fragment" title="url-fragment"><fragment></a>
|
|
component (even if it is empty), then <a href="#scroll-to-fragid" title="navigate-fragid">navigate to that fragment identifier</a>
|
|
and abort these steps.</li>
|
|
|
|
<li><p>Cancel <em>any</em> preexisting attempt to navigate the
|
|
<a href="#browsing-context">browsing context</a>.</li>
|
|
|
|
<li><p>If the new resource is to be handled using a mechanism that
|
|
does not affect the browsing context, e.g. ignoring the navigation
|
|
request altogether because the specified scheme is not one of the
|
|
supported protocols, then abort these steps and proceed with that
|
|
mechanism instead.</li>
|
|
|
|
<li><p><a href="#prompt-to-unload-a-document" title="prompt to unload a document">Prompt to
|
|
unload</a> the <code><a href="#document">Document</a></code> object. If the user
|
|
<a href="#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</a>, then
|
|
these steps must be aborted.</li>
|
|
|
|
<li><p><a href="#abort-a-document" title="abort a document">Abort</a> the
|
|
<a href="#active-document">active document</a> of the <a href="#browsing-context">browsing
|
|
context</a>.</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="#dom-navigator-registerprotocolhandler" title="dom-navigator-registerProtocolHandler">a registered
|
|
handler</a> for the given scheme, then <a href="#read-ua-inline" title="navigate-ua-inline">display the inline content</a> and
|
|
abort these steps.</p>
|
|
|
|
<p class="note">In the case of a registered handler being used,
|
|
the algorithm will be reinvoked with a new URL to handle the
|
|
request.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the resource has already been obtained (e.g. because it is
|
|
being used to populate an <code><a href="#the-object-element">object</a></code> element's new
|
|
<a href="#child-browsing-context">child browsing context</a>), then skip this step.</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p>If the new resource is to be fetched using HTTP GET <a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or equivalent</a>, and
|
|
there are <a href="#relevant-application-cache" title="relevant application cache">relevant
|
|
application caches</a> that are identified by a URL with the
|
|
<a href="#same-origin">same origin</a> as the URL in question, and that have
|
|
this URL as one of their entries, excluding entries marked as
|
|
<a href="#concept-appcache-foreign" title="concept-appcache-foreign">foreign</a>, then get
|
|
the resource from the <a href="#concept-appcache-selection" title="concept-appcache-selection">most appropriate application
|
|
cache</a> of those that match.</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>
|
|
|
|
<p>Otherwise, <a href="#fetch">fetch</a> the new resource, with the
|
|
<i>manual redirect flag</i> set.</p>
|
|
|
|
<p>If the resource is being fetched using a method other than one
|
|
<a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">equivalent to</a>
|
|
HTTP's GET, or, if the
|
|
<a href="#navigate" title="navigate">navigation algorithm</a> was invoked as
|
|
a result of the <a href="#concept-form-submit" title="concept-form-submit">form submission
|
|
algorithm</a>, then the <a href="#fetch" title="fetch">fetching
|
|
algorithm</a> must be invoked from the <a href="#origin">origin</a> of
|
|
the <a href="#active-document">active document</a> of the <a href="#source-browsing-context">source browsing
|
|
context</a>, if any.</p>
|
|
<p>If the <a href="#browsing-context">browsing context</a> being navigated is a
|
|
<a href="#child-browsing-context">child browsing context</a> for an <code><a href="#the-iframe-element">iframe</a></code> or
|
|
<code><a href="#the-object-element">object</a></code> element, then the <a href="#fetch" title="fetch">fetching
|
|
algorithm</a> must be invoked from the <code><a href="#the-iframe-element">iframe</a></code> or
|
|
<code><a href="#the-object-element">object</a></code> element's <a href="#browsing-context-scope-origin">browsing context scope
|
|
origin</a>, if it has one.</p>
|
|
<p>The <a href="#fetch">fetch</a> algorithm must <a href="#delay-the-load-event">delay the load
|
|
event</a> of the <a href="#browsing-context">browsing context</a>.</p>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>At this point, unless this step has already been reached once
|
|
before in the execution of this instance of the algorithm, the
|
|
user agents must return to whatever algorithm invoked the
|
|
navigation steps and must continue these steps asynchronously.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If fetching the resource results in a redirect, and either the
|
|
<a href="#url">URL</a> of the target of the redirect has the <a href="#same-origin">same
|
|
origin</a> as the original resource, or the resource is being
|
|
obtained using the POST method or a safe method (in HTTP terms),
|
|
return to <a href="#navigate-fragid-step">the step labeled
|
|
"fragment identifiers"</a> with the new resource.</p>
|
|
|
|
<p>Otherwise, if fetching the resource results in a redirect but
|
|
the <a href="#url">URL</a> of the target of the redirect does not have
|
|
the <a href="#same-origin">same origin</a> as the original resource and the
|
|
resource is being obtained using a method that is neither the POST
|
|
method nor a safe method (in HTTP terms), then abort these
|
|
steps. The user agent may indicate to the user that the navigation
|
|
has been aborted for security reasons.</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.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the resource was not fetched from an <a href="#application-cache">application
|
|
cache</a>, and was to be fetched using HTTP GET <a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or equivalent</a>, and its
|
|
URL <a href="#concept-appcache-matches-fallback" title="concept-appcache-matches-fallback">matches the
|
|
fallback namespace</a> of one or more <a href="#relevant-application-cache" title="relevant
|
|
application cache">relevant application caches</a>, and the
|
|
<a href="#concept-appcache-selection" title="concept-appcache-selection">most appropriate
|
|
application cache</a> of those that match does not have an
|
|
entry in its <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online
|
|
whitelist</a> that has the <a href="#same-origin">same origin</a> as the
|
|
resource's URL and that is a <a href="#prefix-match">prefix match</a> for the
|
|
resource's URL, and the user didn't cancel the navigation attempt
|
|
during the previous step, and the navigation attempt failed (e.g.
|
|
the server returned a 4xx or 5xx status code <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a>, or
|
|
there was a DNS error), then:</p>
|
|
<p>Let <var title="">candidate</var> be the <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback resource</a>
|
|
specified for the <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespace</a> in
|
|
question. If multiple application caches match, the user agent
|
|
must use the fallback of the <a href="#concept-appcache-selection" title="concept-appcache-selection">most appropriate application
|
|
cache</a> of those that match.</p>
|
|
|
|
<p>If <var title="">candidate</var> is not marked as <a href="#concept-appcache-foreign" title="concept-appcache-foreign">foreign</a>, then the user
|
|
agent must discard the failed load and instead continue along
|
|
these steps using <var title="">candidate</var> as the
|
|
resource. <a href="#the-document-s-address">The document's address</a>, if appropriate,
|
|
will still be the originally requested URL, not the fallback URL,
|
|
but 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 URL of the fallback resource actually is.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the document's out-of-band metadata (e.g. HTTP headers),
|
|
not counting any <a href="#content-type" 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>
|
|
|
|
|
|
<p>HTTP 401 responses that do not include a challenge recognized
|
|
by the user agent must be processed as if they had no challenge,
|
|
e.g. rendering the entity body as if the response had been 200
|
|
OK.</p>
|
|
|
|
<p>User agents may show the entity body of an HTTP 401 response
|
|
even when the response do include a recognized challenge, with the
|
|
option to login being included in a non-modal fashion, to enable
|
|
the information provided by the server to be used by the user
|
|
before authenticating. Similarly, user agents should allow the
|
|
user to authenticate (in a non-modal fashion) against
|
|
authentication challenges included in other responses such as HTTP
|
|
200 OK responses, effectively allowing resources to present HTTP
|
|
login forms without requiring their use.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">type</var> be <a href="#content-type-sniffing-0" title="Content-Type
|
|
sniffing">the sniffed type of the resource</a>.</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="#browsing-context">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>"<code><a href="#text-html">text/html</a></code>"</dt>
|
|
<dt>"<code><a href="#text-html-sandboxed">text/html-sandboxed</a></code>"</dt>
|
|
<dd>Follow the steps given in the <a href="#read-html" title="navigate-html">HTML document</a> section, and abort
|
|
these steps.</dd>
|
|
|
|
|
|
<dt>Any type ending in "<code title="">+xml</code>"</dt>
|
|
<dt>"<code>application/xml</code>"</dt>
|
|
<dt>"<code>text/xml</code>"</dt>
|
|
<dd>Follow the steps given in the <a href="#read-xml" 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>"<code>text/plain</code>"</dt>
|
|
<dd>Follow the steps given in the <a href="#read-text" 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="#read-image" 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="#browsing-context">browsing context</a></dt>
|
|
<dd>Follow the steps given in the <a href="#read-plugin" title="navigate-plugin">plugin</a> section, and abort these
|
|
steps.</dd>
|
|
|
|
</dl><p><dfn id="set-the-document-s-address" title="set the document's address">Setting the document's
|
|
address</dfn>: If there is no <dfn id="override-url">override URL</dfn>, then any
|
|
<code><a href="#document">Document</a></code> created by these steps must have its <a href="#the-document-s-address" title="the document's address">address</a> set to the
|
|
<a href="#url">URL</a> that was originally to be <a href="#fetch" title="fetch">fetched</a>, ignoring any other data that was
|
|
used to obtain the resource (e.g. the entity body in the case of a
|
|
POST submission is not part of <a href="#the-document-s-address">the document's
|
|
address</a>, nor is the URL of the fallback resource in the
|
|
case of the original load having failed and that URL having been
|
|
found to match a <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback
|
|
namespace</a>). However, if there <em>is</em> an <a href="#override-url">override
|
|
URL</a>, then any <code><a href="#document">Document</a></code> created by these steps
|
|
must have its <a href="#the-document-s-address" title="the document's address">address</a>
|
|
set to that <a href="#url">URL</a> instead.</p>
|
|
|
|
<p class="note">An <a href="#override-url" title="override URL">override URL</a>
|
|
is set when <a href="#concept-js-deref" title="concept-js-deref">dereferencing a
|
|
<code>javascript:</code> URL</a>.</p>
|
|
|
|
<p><dfn id="create-a-document-object" title="create a Document object">Creating a new
|
|
<code>Document</code> object</dfn>: When a <code><a href="#document">Document</a></code>
|
|
is created as part of the above steps, a new <code><a href="#window">Window</a></code>
|
|
object must be created and associated with the
|
|
<code><a href="#document">Document</a></code>, with one exception: if the <a href="#browsing-context">browsing
|
|
context</a>'s only entry in its <a href="#session-history">session history</a> is
|
|
the <code><a href="#about:blank">about:blank</a></code> <code><a href="#document">Document</a></code> that was added
|
|
when the <a href="#browsing-context">browsing context</a> was created, and navigation
|
|
is occurring with <a href="#replacement-enabled">replacement enabled</a>, and that
|
|
<code><a href="#document">Document</a></code> has the <a href="#same-origin">same origin</a> as the new
|
|
<code><a href="#document">Document</a></code>, then the <code><a href="#window">Window</a></code> object of that
|
|
<code><a href="#document">Document</a></code> must be used instead, and the <code title="dom-document"><a href="#dom-document">document</a></code> attribute of the
|
|
<code><a href="#window">Window</a></code> object must be changed to point to the new
|
|
<code><a href="#document">Document</a></code> instead.</p>
|
|
|
|
</li>
|
|
|
|
<li id="navigate-non-Document">
|
|
|
|
<p><i>Non-document content</i>: 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="#dom-navigator-registercontenthandler" title="dom-navigator-registerContentHandler">a registered
|
|
handler</a> for the given type, then <a href="#read-ua-inline" title="navigate-ua-inline">display the inline content</a> and
|
|
abort these steps.</p>
|
|
|
|
<p class="note">In the case of a registered handler being used,
|
|
the algorithm will be reinvoked with a new URL to handle the
|
|
request.</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>
|
|
|
|
</ol><hr><p>Some of the sections below, to which the above algorithm defers
|
|
in certain cases, require the user agent to <dfn id="update-the-session-history-with-the-new-page">update the session
|
|
history with the new page</dfn>. When a user agent is required to do
|
|
this, it must <a href="#queue-a-task">queue a task</a> (associated with the
|
|
<code><a href="#document">Document</a></code> object of the <a href="#current-entry">current entry</a>, not
|
|
the new one) to run the following steps:</p>
|
|
|
|
<ol><li><p><a href="#unload-a-document" title="unload a document">Unload</a> the
|
|
<code><a href="#document">Document</a></code> object of the <a href="#current-entry">current entry</a>,
|
|
with the <var title="">recycle</var> parameter set to
|
|
false.</li>
|
|
|
|
<li>
|
|
|
|
<dl><dt>If the navigation was initiated for <dfn id="entry-update">entry update</dfn> of
|
|
an entry</dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li><p>Replace the <code><a href="#document">Document</a></code> of the entry being
|
|
updated, and any other entries that referenced the same
|
|
document as that entry, with the new
|
|
<code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li><p><a href="#traverse-the-history">Traverse the history</a> to the new
|
|
entry.</li>
|
|
|
|
</ol><p class="note">This can only happen if the entry being updated
|
|
is no the <a href="#current-entry">current entry</a>, and can never happen with
|
|
<a href="#replacement-enabled">replacement enabled</a>. (It happens when the user
|
|
tried to traverse to a session history entry that no longer had
|
|
a <code><a href="#document">Document</a></code> object.)</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li>
|
|
|
|
<p>Remove all the entries in the <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#session-history">session history</a> after the
|
|
<a href="#current-entry">current entry</a>. If the <a href="#current-entry">current entry</a>
|
|
is the last entry in the session history, then no entries are
|
|
removed.</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>Remove any <a href="#concept-task" title="concept-task">tasks</a>
|
|
queued by the <a href="#history-traversal-task-source">history traversal task
|
|
source</a>.</li>
|
|
<li><p>Append a new entry at the end of the <code><a href="#history-0">History</a></code>
|
|
object representing the new resource and its
|
|
<code><a href="#document">Document</a></code> object and related state.</li>
|
|
|
|
<li><p><a href="#traverse-the-history">Traverse the history</a> to the new entry. If
|
|
the navigation was initiated with <a href="#replacement-enabled">replacement
|
|
enabled</a>, then the traversal must itself be initiated
|
|
with <a href="#replacement-enabled">replacement enabled</a>.</p>
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>The <a href="#navigate" title="navigate">navigation algorithm</a> has
|
|
now <dfn id="concept-navigate-mature" title="concept-navigate-mature">matured</dfn>.</li>
|
|
|
|
<li><p><i>Fragment identifier loop</i>: <a href="#spin-the-event-loop">Spin the event
|
|
loop</a> for a user-agent-defined amount of time, as desired by
|
|
the user agent implementor. (This is intended to allow the user
|
|
agent to optimize the user experience in the face of performance
|
|
concerns.)</li>
|
|
|
|
<li><p>If the <code><a href="#document">Document</a></code> object has no parser, or its
|
|
parser has <a href="#stop-parsing" title="stop parsing">stopped parsing</a>, or
|
|
the user agent has reason to believe the user is no longer
|
|
interested in scrolling to the fragment identifier, then abort
|
|
these steps.</li>
|
|
|
|
<li><p><a href="#scroll-to-the-fragment-identifier">Scroll to the fragment identifier</a> given in
|
|
<a href="#the-document-s-current-address">the document's current address</a>. If this fails to find
|
|
<a href="#the-indicated-part-of-the-document" title="the indicated part of the document">an indicated part
|
|
of the document</a>, then return to the <i>fragment identifier
|
|
loop</i> step.</li>
|
|
|
|
</ol><p>The <a href="#task-source">task source</a> for this <a href="#concept-task" title="concept-task">task</a> is the <a href="#networking-task-source">networking task
|
|
source</a>.</p>
|
|
|
|
|
|
<h4 id="read-html"><span class="secno">5.5.2 </span><dfn 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="#browsing-context">browsing
|
|
context</a>, the user agent must <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#create-a-document-object">create a <code>Document</code> object</a>, mark it as being
|
|
an <a href="#html-documents" title="HTML documents">HTML document</a>, create an
|
|
<a href="#html-parser">HTML parser</a>, and associate it with the document. Each
|
|
<a href="#concept-task" title="concept-task">task</a> that the <a href="#networking-task-source">networking
|
|
task source</a> places on the <a href="#task-queue">task queue</a> while the
|
|
<a href="#fetch" title="fetch">fetching algorithm</a> runs must then fill
|
|
the parser's <a href="#the-input-stream">input stream</a> with the fetched bytes and
|
|
cause the <a href="#html-parser">HTML parser</a> to perform the appropriate
|
|
processing of the input stream.</p>
|
|
|
|
<p class="note">The <a href="#the-input-stream">input stream</a> converts bytes into
|
|
characters for use in the <a href="#tokenization" title="tokenization">tokenizer</a>. This process relies, in part,
|
|
on character encoding information found in the real <a href="#content-type" 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, the user agent must <a href="#queue-a-task">queue
|
|
a task</a> for the parser to process the implied EOF character,
|
|
which eventually causes a <code title="event-load">load</code> event
|
|
to be fired.</p>
|
|
|
|
<p>After creating the <code><a href="#document">Document</a></code> object, but before any
|
|
script execution, certainly before the parser <a href="#stop-parsing" title="stop
|
|
parsing">stops</a>, the user agent must <a href="#update-the-session-history-with-the-new-page">update the session
|
|
history with the new page</a>.</p>
|
|
|
|
<p class="note"><a href="#concept-appcache-init" title="concept-appcache-init">Application
|
|
cache selection</a> happens <a href="#parser-appcache">in the
|
|
HTML parser</a>.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for the two tasks mentioned in this
|
|
section must be the <a href="#networking-task-source">networking task source</a>.</p>
|
|
|
|
|
|
|
|
<h4 id="read-xml"><span class="secno">5.5.3 </span><dfn 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 <a href="#create-a-document-object">create a <code>Document</code> object</a>, following
|
|
the requirements of the XML and Namespaces in XML recommendations,
|
|
RFC 3023, DOM3 Core, and other relevant specifications. <a href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a> <a href="#refsRFC3023">[RFC3023]</a> <a href="#refsDOMCORE">[DOMCORE]</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. Once the character encoding is established, the
|
|
<a href="#document-s-character-encoding">document's character encoding</a> must be set to that
|
|
character encoding.</p>
|
|
|
|
<p>If the root element, as parsed according to the XML
|
|
specifications cited above, is found to be an <code><a href="#the-html-element">html</a></code>
|
|
element with an attribute <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> whose value is not the
|
|
empty string, then, as soon as the element is <a href="#insert-an-element-into-a-document" title="insert an
|
|
element into a document">inserted into the document</a>, the user
|
|
agent must <a href="#resolve-a-url" title="resolve a url">resolve</a> the value of
|
|
that attribute relative to that element, and if that is successful,
|
|
must run the <a href="#concept-appcache-init" title="concept-appcache-init">application cache
|
|
selection algorithm</a> with the resulting <a href="#absolute-url">absolute
|
|
URL</a> with any <a href="#url-fragment" title="url-fragment"><fragment></a> component removed as
|
|
the manifest URL, and passing in the newly-created
|
|
<code><a href="#document">Document</a></code>. Otherwise, if the attribute is absent, its
|
|
value is the empty string, or resolving its value fails, then as
|
|
soon as the root element is <a href="#insert-an-element-into-a-document" title="insert an element into a
|
|
document">inserted into the document</a>, the user agent must run
|
|
the <a href="#concept-appcache-init" title="concept-appcache-init">application cache selection
|
|
algorithm</a> with no manifest, and passing in the
|
|
<code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p class="note">Because the processing of the <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attribute happens
|
|
only once the root element is parsed, any URLs referenced by
|
|
processing instructions before the root element (such as <code title=""><?xml-stylesheet?></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><a href="#element">Element</a></code> node of this <code><a href="#document">Document</a></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">the next step</a> (labeled
|
|
"non-document content") in the <a href="#navigate">navigate</a> steps
|
|
above.</p>
|
|
|
|
<p>Otherwise, then, with the newly created <code><a href="#document">Document</a></code>,
|
|
the user agents must <a href="#update-the-session-history-with-the-new-page">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>), and
|
|
must do this before any scripts are to be executed.</p>
|
|
|
|
<p>Error messages from the parse process (e.g. XML namespace
|
|
well-formedness errors) may be reported inline by mutating the
|
|
<code><a href="#document">Document</a></code>.</p>
|
|
|
|
|
|
<h4 id="read-text"><span class="secno">5.5.4 </span><dfn 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="#browsing-context">browsing
|
|
context</a>, the user agent should <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#create-a-document-object">create a <code>Document</code> object</a>, mark it as being
|
|
an <a href="#html-documents" title="HTML documents">HTML document</a>, create an
|
|
<a href="#html-parser">HTML parser</a>, associate it with the document, act as if
|
|
the tokenizer had emitted a start tag token with the tag name "pre"
|
|
followed by a single U+000A LINE FEED (LF) character, and switch the <a href="#html-parser">HTML parser</a>'s tokenizer
|
|
to the <a href="#plaintext-state">PLAINTEXT state</a>. Each <a href="#concept-task" title="concept-task">task</a> that the <a href="#networking-task-source">networking task
|
|
source</a> places on the <a href="#task-queue">task queue</a> while the <a href="#fetch" title="fetch">fetching algorithm</a> runs must then fill the
|
|
parser's <a href="#the-input-stream">input stream</a> with the fetched bytes and cause
|
|
the <a href="#html-parser">HTML parser</a> to perform the appropriate processing
|
|
of the input stream.</p>
|
|
|
|
<p>The rules for how to convert the bytes of the plain text document
|
|
into actual characters, and the rules for actually rendering the
|
|
text to the user, are defined in RFC 2046, RFC 3676, and subsequent
|
|
versions thereof. <a href="#refsRFC2046">[RFC2046]</a> <a href="#refsRFC3676">[RFC3676]</a></p>
|
|
|
|
<p>The <a href="#document-s-character-encoding">document's character encoding</a> must be set to the
|
|
character encoding used to decode the document.</p>
|
|
|
|
<p>Upon creation of the <code><a href="#document">Document</a></code> object, the user agent
|
|
must run the <a href="#concept-appcache-init" title="concept-appcache-init">application cache
|
|
selection algorithm</a> with no manifest, and passing in the
|
|
newly-created <code><a href="#document">Document</a></code>.</p>
|
|
|
|
|
|
<p>When no more bytes are available, the user agent must <a href="#queue-a-task">queue
|
|
a task</a> for the parser to process the implied EOF character,
|
|
which eventually causes a <code title="event-load">load</code> event
|
|
to be fired.</p>
|
|
|
|
<p>After creating the <code><a href="#document">Document</a></code> object, but potentially
|
|
before the page has finished parsing, the user agent must
|
|
<a href="#update-the-session-history-with-the-new-page">update the session history with the new page</a>.</p>
|
|
|
|
<p>User agents may add content to the <code><a href="#the-head-element">head</a></code> element of
|
|
the <code><a href="#document">Document</a></code>, e.g. linking to a style sheet or an XBL
|
|
binding, providing script, giving the document a <code><a href="#the-title-element">title</a></code>,
|
|
etc.</p>
|
|
|
|
<p class="note">In particular, if the user agent supports the <code title="">Format=Flowed</code> feature of RFC 3676 then the user
|
|
agent would need to apply extra styling to cause the text to wrap
|
|
correctly and to handle the quoting feature. This could be performed
|
|
using, e.g., an XBL binding or a CSS extension.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for the two tasks mentioned in this
|
|
section must be the <a href="#networking-task-source">networking task source</a>.</p>
|
|
|
|
|
|
<h4 id="read-image"><span class="secno">5.5.5 </span><dfn title="navigate-image">Page load processing model for images</dfn></h4>
|
|
|
|
<p>When an image resource is to be loaded in a <a href="#browsing-context">browsing
|
|
context</a>, the user agent should <a href="#create-a-document-object">create a
|
|
<code>Document</code> object</a>, mark it as being an <a href="#html-documents" title="HTML documents">HTML document</a>, append an
|
|
<code><a href="#the-html-element">html</a></code> element to the <code><a href="#document">Document</a></code>, append a
|
|
<code><a href="#the-head-element">head</a></code> element and a <code><a href="#the-body-element">body</a></code> element to the
|
|
<code><a href="#the-html-element">html</a></code> element, append an <code><a href="#the-img-element">img</a></code> to the
|
|
<code><a href="#the-body-element">body</a></code> element, and set the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute of the <code><a href="#the-img-element">img</a></code>
|
|
element to the address of the image.</p>
|
|
|
|
|
|
<p>Then, the user agent must act as if it had <a href="#stop-parsing" title="stop
|
|
parsing">stopped parsing</a>.</p>
|
|
|
|
<p>Upon creation of the <code><a href="#document">Document</a></code> object, the user agent
|
|
must run the <a href="#concept-appcache-init" title="concept-appcache-init">application cache
|
|
selection algorithm</a> with no manifest, and passing in the
|
|
newly-created <code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p>After creating the <code><a href="#document">Document</a></code> object, but potentially
|
|
before the page has finished fully loading, the user agent must
|
|
<a href="#update-the-session-history-with-the-new-page">update the session history with the new page</a>.</p>
|
|
|
|
<p>User agents may add content to the <code><a href="#the-head-element">head</a></code> element of
|
|
the <code><a href="#document">Document</a></code>, or attributes to the <code><a href="#the-img-element">img</a></code>
|
|
element, e.g. to link to a style sheet or an XBL binding, to provide
|
|
a script, to give the document a <code><a href="#the-title-element">title</a></code>, etc.</p>
|
|
|
|
|
|
<h4 id="read-plugin"><span class="secno">5.5.6 </span><dfn 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="#browsing-context">browsing context</a>, the user agent
|
|
should <a href="#create-a-document-object">create a <code>Document</code> object</a>, mark it
|
|
as being an <a href="#html-documents" title="HTML documents">HTML document</a>,
|
|
append an <code><a href="#the-html-element">html</a></code> element to the <code><a href="#document">Document</a></code>,
|
|
append a <code><a href="#the-head-element">head</a></code> element and a <code><a href="#the-body-element">body</a></code> element
|
|
to the <code><a href="#the-html-element">html</a></code> element, append an <code><a href="#the-embed-element">embed</a></code> to
|
|
the <code><a href="#the-body-element">body</a></code> element, and set the <code title="attr-embed-src"><a href="#attr-embed-src">src</a></code> attribute of the
|
|
<code><a href="#the-embed-element">embed</a></code> element to the address of the resource.</p>
|
|
|
|
|
|
<p>Then, the user agent must act as if it had <a href="#stop-parsing" title="stop
|
|
parsing">stopped parsing</a>.</p>
|
|
|
|
<p>Upon creation of the <code><a href="#document">Document</a></code> object, the user agent
|
|
must run the <a href="#concept-appcache-init" title="concept-appcache-init">application cache
|
|
selection algorithm</a> with no manifest, and passing in the
|
|
newly-created <code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p>After creating the <code><a href="#document">Document</a></code> object, but potentially
|
|
before the page has finished fully loading, the user agent must
|
|
<a href="#update-the-session-history-with-the-new-page">update the session history with the new page</a>.</p>
|
|
|
|
<p>User agents may add content to the <code><a href="#the-head-element">head</a></code> element of
|
|
the <code><a href="#document">Document</a></code>, or attributes to the <code><a href="#the-embed-element">embed</a></code>
|
|
element, e.g. to link to a style sheet or an XBL binding, or to give
|
|
the document a <code><a href="#the-title-element">title</a></code>.</p>
|
|
|
|
<p class="note" id="sandboxPluginNavigate">If the <a href="#sandboxed-plugins-browsing-context-flag">sandboxed
|
|
plugins browsing context flag</a> was set on the <a href="#browsing-context">browsing
|
|
context</a> when the <code><a href="#document">Document</a></code> was created, the
|
|
synthesized <code><a href="#the-embed-element">embed</a></code> element will <a href="#sandboxPluginEmbed">fail to render the content</a>.</p>
|
|
|
|
|
|
<h4 id="read-ua-inline"><span class="secno">5.5.7 </span><dfn 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="#browsing-context">browsing context</a>, the user agent should <a href="#create-a-document-object">create a
|
|
<code>Document</code> object</a>, mark it as being an <a href="#html-documents" title="HTML documents">HTML document</a>, and then either
|
|
associate that <code><a href="#document">Document</a></code> with a custom rendering that is
|
|
not rendered using the normal <code><a href="#document">Document</a></code> rendering rules,
|
|
or mutate that <code><a href="#document">Document</a></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="#stop-parsing" title="stop parsing">stopped parsing</a>.</p>
|
|
|
|
<p>Upon creation of the <code><a href="#document">Document</a></code> object, the user agent
|
|
must run the <a href="#concept-appcache-init" title="concept-appcache-init">application cache
|
|
selection algorithm</a> with no manifest, passing in the
|
|
newly-created <code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p>After creating the <code><a href="#document">Document</a></code> object, but potentially
|
|
before the page has been completely set up, the user agent must
|
|
<a href="#update-the-session-history-with-the-new-page">update the session history with the new page</a>.</p>
|
|
|
|
|
|
|
|
<h4 id="scroll-to-fragid"><span class="secno">5.5.8 </span><dfn 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="#queue-a-task">queue a task</a> to
|
|
run the following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Remove all the entries in the <a href="#browsing-context">browsing context</a>'s
|
|
<a href="#session-history">session history</a> after the <a href="#current-entry">current
|
|
entry</a>. If the <a href="#current-entry">current entry</a> is the last entry
|
|
in the session history, then no entries are removed.</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>Remove any <a href="#concept-task" title="concept-task">tasks</a> queued by
|
|
the <a href="#history-traversal-task-source">history traversal task source</a>.</li>
|
|
|
|
<li><p>Append a new entry at the end of the <code><a href="#history-0">History</a></code>
|
|
object representing the new resource and its <code><a href="#document">Document</a></code>
|
|
object and related state. Its <a href="#url">URL</a> must be set to the
|
|
address to which the user agent was <a href="#navigate" title="navigate">navigating</a>. The title must be left
|
|
unset.</li>
|
|
|
|
<li><p><a href="#traverse-the-history">Traverse the history</a> to the new entry. This
|
|
will <a href="#scroll-to-the-fragment-identifier">scroll to the fragment identifier</a> given in what
|
|
is now <a href="#the-document-s-current-address">the document's current address</a>.</li>
|
|
|
|
</ol><p class="note">If the scrolling fails because the relevant <a href="#concept-id" title="concept-id">ID</a> has
|
|
not yet been parsed, then the original <a href="#navigate" title="navigate">navigation</a> algorithm will take care of the
|
|
scrolling instead, as the last few steps of its <a href="#update-the-session-history-with-the-new-page">update the
|
|
session history with the new page</a> algorithm.</p>
|
|
|
|
<hr><p>When the user agent is required to <dfn id="scroll-to-the-fragment-identifier">scroll to the fragment
|
|
identifier</dfn>, it must change the scrolling position of the
|
|
document using the <span>scroll an element into view</span>
|
|
algorithm defined in the CSSOM View specification, or perform some
|
|
other action, such that <a href="#the-indicated-part-of-the-document">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. <a href="#refsCSSOMVIEW">[CSSOMVIEW]</a></p>
|
|
|
|
<p><dfn id="the-indicated-part-of-the-document">The indicated part of the document</dfn> is the one that the
|
|
fragment identifier, if any, identifies. The semantics of the
|
|
fragment identifier in terms of mapping it to a specific DOM Node is
|
|
defined by the specification that defines the <a href="#mime-type">MIME type</a>
|
|
used by the <code><a href="#document">Document</a></code> (for example, the processing of
|
|
fragment identifiers for <a href="#xml-mime-type" title="XML MIME type">XML MIME
|
|
types</a> is the responsibility of RFC3023). <a href="#refsRFC3023">[RFC3023]</a></p>
|
|
|
|
<p>For HTML documents (and <a href="#html-mime-type" title="HTML MIME type">HTML MIME
|
|
types</a>), the following processing model must be followed to
|
|
determine what <a href="#the-indicated-part-of-the-document">the indicated part of the document</a>
|
|
is.</p>
|
|
|
|
<ol><li><p><a href="#parse-a-url" title="parse a url">Parse</a> the <a href="#url">URL</a>,
|
|
and let <var title="">fragid</var> be the <a href="#url-fragment" title="url-fragment"><fragment></a> component of the
|
|
URL.</li>
|
|
<li><p>If <var title="">fragid</var> is the empty string, then
|
|
<a href="#the-indicated-part-of-the-document">the indicated part of the document</a> is the top of the
|
|
document; stop the algorithm here.</li>
|
|
|
|
<li><p>Let <var title="">decoded fragid</var> be the result of
|
|
expanding any sequences of percent-encoded octets in <var title="">fragid</var> that are valid UTF-8 sequences into Unicode
|
|
characters as defined by UTF-8. If any percent-encoded octets in
|
|
that string are not valid UTF-8 sequences, then skip this step and
|
|
the next one.</p>
|
|
|
|
<li><p>If this step was not skipped and there is an element in the
|
|
DOM that has an <a href="#concept-id" title="concept-id">ID</a> exactly equal to <var title="">decoded
|
|
fragid</var>, then the first such element in tree order is
|
|
<a href="#the-indicated-part-of-the-document">the indicated part of the document</a>; stop the algorithm
|
|
here.</li>
|
|
|
|
<li><p>If there is an <code><a href="#the-a-element">a</a></code> element in the DOM that has a
|
|
<code title="attr-a-name"><a href="#attr-a-name">name</a></code> attribute whose value is
|
|
exactly equal to <var title="">fragid</var> (<em>not</em> <var title="">decoded fragid</var>), then the first such element in tree
|
|
order is <a href="#the-indicated-part-of-the-document">the indicated part of the document</a>; stop the
|
|
algorithm here.</li>
|
|
|
|
<li><p>If <var title="">fragid</var> is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string <code title="">top</code>, then <a href="#the-indicated-part-of-the-document">the indicated part of the
|
|
document</a> is the top of the document; stop the algorithm
|
|
here.</li>
|
|
|
|
<li><p>Otherwise, there is no <a href="#the-indicated-part-of-the-document" title="the indicated part of
|
|
the document">indicated part of the document</a>.</li>
|
|
|
|
</ol><p>For the purposes of the interaction of HTML with Selectors' <code title="selector-target">:target</code> pseudo-class, the
|
|
<dfn id="target-element"><i>target element</i></dfn> is <a href="#the-indicated-part-of-the-document">the indicated part of the
|
|
document</a>, if that is an element; otherwise there is no
|
|
<i><a href="#target-element">target element</a></i>. <a href="#refsSELECTORS">[SELECTORS]</a></p>
|
|
|
|
</div><h4 id="history-traversal"><span class="secno">5.5.9 </span>History traversal</h4><div class="impl">
|
|
|
|
<p>When a user agent is required to <dfn id="traverse-the-history">traverse the history</dfn>
|
|
to a <i>specified entry</i>, optionally with <a href="#replacement-enabled">replacement
|
|
enabled</a>, the user agent must act as follows.</p>
|
|
|
|
<p class="note">This algorithm is not just invoked when <a href="#traverse-the-history-by-a-delta" title="traverse the history by a delta">explicitly going back or
|
|
forwards in the session history</a> — it is also invoked in
|
|
other situations, for example when <a href="#navigate" title="navigate">navigating
|
|
a browsing context</a>, as part of <a href="#update-the-session-history-with-the-new-page" title="update the session
|
|
history with the new page">updating the session history with the new
|
|
page</a>.</p>
|
|
|
|
<ol><li><p>If there is no longer a <code><a href="#document">Document</a></code> object for the
|
|
entry in question, the user agent must
|
|
<a href="#navigate">navigate</a>
|
|
the browsing context to the location for that entry to perform an
|
|
<a href="#entry-update">entry update</a> of that entry, and abort these steps. The
|
|
"<a href="#navigate">navigate</a>" algorithm reinvokes this "traverse"
|
|
algorithm to complete the traversal, at which point there
|
|
<em>is</em> a <code><a href="#document">Document</a></code> object and so this step gets
|
|
skipped. The navigation must be done using the same <a href="#source-browsing-context">source
|
|
browsing context</a> as was used the first time this entry was
|
|
created. (This can never happen with <a href="#replacement-enabled">replacement
|
|
enabled</a>.)</li>
|
|
|
|
<li><p>If the <a href="#current-entry">current entry</a>'s title was not set by the
|
|
<code title="dom-history-pushState"><a href="#dom-history-pushstate">pushState()</a></code> or <code title="dom-history-replaceState"><a href="#dom-history-replacestate">replaceState()</a></code> methods,
|
|
then set its title to the value returned by the <code title="dom-document-title"><a href="#document.title">document.title</a></code> IDL
|
|
attribute.</li>
|
|
|
|
<li><p>If appropriate, update the <a href="#current-entry">current entry</a> in the
|
|
<a href="#browsing-context">browsing context</a>'s <code><a href="#document">Document</a></code> object's
|
|
<code><a href="#history-0">History</a></code> object to reflect any state that the user
|
|
agent wishes to persist. The entry is then said to be <a href="#an-entry-with-persisted-user-state">an
|
|
entry with persisted user state</a>.</li>
|
|
|
|
<li><p>If the <i>specified entry</i> has a different
|
|
<code><a href="#document">Document</a></code> object than the <a href="#current-entry">current entry</a>
|
|
then the user agent must run the following substeps:</p>
|
|
|
|
<ol><li>If the browsing context is a <a href="#top-level-browsing-context">top-level browsing
|
|
context</a>, but not an <a href="#auxiliary-browsing-context">auxiliary browsing
|
|
context</a>, and the <a href="#origin">origin</a> of the
|
|
<code><a href="#document">Document</a></code> of the <i>specified entry</i> is not the
|
|
<a href="#same-origin" title="same origin">same</a> as the <a href="#origin">origin</a>
|
|
of the <code><a href="#document">Document</a></code> of the <a href="#current-entry">current entry</a>,
|
|
then the following sub-sub-steps must be run:
|
|
|
|
<ol><li>The current <a href="#browsing-context-name">browsing context name</a> must be
|
|
stored with all the entries in the history that are associated
|
|
with <code><a href="#document">Document</a></code> objects with the <a href="#same-origin">same
|
|
origin</a> as the <a href="#active-document">active document</a> <em>and</em>
|
|
that are contiguous with the <a href="#current-entry">current entry</a>.</li>
|
|
|
|
<li id="resetBCName">The browsing context's <a href="#browsing-context-name">browsing
|
|
context name</a> must be unset.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li id="appcache-history-2">The user agent must make the
|
|
<i>specified entry</i>'s <code><a href="#document">Document</a></code> object the
|
|
<a href="#active-document">active document</a> of the <a href="#browsing-context">browsing
|
|
context</a>.</li>
|
|
|
|
<li>If the <i>specified entry</i> has a <a href="#browsing-context-name">browsing
|
|
context name</a> stored with it, then the following
|
|
sub-sub-steps must be run:
|
|
|
|
<ol><li>The browsing context's <a href="#browsing-context-name">browsing context name</a>
|
|
must be set to the name stored with the specified entry.</li>
|
|
|
|
<li>Any <a href="#browsing-context-name">browsing context name</a> stored with the
|
|
entries in the history that are associated with
|
|
<code><a href="#document">Document</a></code> objects with the <a href="#same-origin">same origin</a>
|
|
as the new <a href="#active-document">active document</a>, and that are
|
|
contiguous with the specified entry, must be cleared.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li id="history-autocomplete"><p>If the <i>specified entry</i>'s
|
|
<code><a href="#document">Document</a></code> has any <code><a href="#the-input-element">input</a></code> elements whose
|
|
<a href="#resulting-autocompletion-state">resulting autocompletion state</a> is <i title="">off</i>, invoke the <a href="#concept-form-reset-control" title="concept-form-reset-control">reset algorithm</a> of each
|
|
of those elements.</li>
|
|
|
|
<li><p>If the <a href="#current-document-readiness">current document readiness</a> of the
|
|
<i>specified entry</i>'s <code><a href="#document">Document</a></code> is "complete",
|
|
<a href="#queue-a-task">queue a task</a> to fire a <code title="event-pageshow"><a href="#event-pageshow">pageshow</a></code> event at the
|
|
<code><a href="#window">Window</a></code> object of that <code><a href="#document">Document</a></code>, but
|
|
with its <code title="dom-event-target"><a href="#dom-event-target">target</a></code> set to the
|
|
<code><a href="#document">Document</a></code> object (and the <code title="dom-event-currentTarget">currentTarget</code> set to the
|
|
<code><a href="#window">Window</a></code> object), using the
|
|
<code><a href="#pagetransitionevent">PageTransitionEvent</a></code> interface, with the <code title="dom-PageTransitionEvent-persisted"><a href="#dom-pagetransitionevent-persisted">persisted</a></code>
|
|
attribute set to true. This event must not bubble, must not be
|
|
cancelable, and has no default action.</li>
|
|
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Set <a href="#the-document-s-current-address">the document's current address</a> to the URL
|
|
of the <i>specified entry</i>.</li>
|
|
|
|
<li><p>If the <i>specified entry</i> has a URL whose fragment
|
|
identifier differs from that of the <a href="#current-entry">current entry</a>'s
|
|
when compared in a <a href="#case-sensitive">case-sensitive</a> manner, and the two
|
|
share the same <code><a href="#document">Document</a></code> object, then let <var title="">hash changed</var> be true, and let <var title="">old
|
|
URL</var> be the URL of the <a href="#current-entry">current entry</a> and <var title="">new URL</var> be the URL of the <i>specified entry</i>.
|
|
Otherwise, let <var title="">hash changed</var> be false.</li>
|
|
|
|
<li><p>If the traversal was initiated with <dfn id="replacement-enabled">replacement
|
|
enabled</dfn>, remove the entry immediately before the
|
|
<var title="">specified entry</var> in the session history.</p>
|
|
|
|
<li><p>If the <i>specified entry</i> is not <a href="#an-entry-with-persisted-user-state">an entry with
|
|
persisted user state</a>, but its URL has a fragment identifier,
|
|
<a href="#scroll-to-the-fragment-identifier">scroll to the fragment identifier</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the entry is <a href="#an-entry-with-persisted-user-state">an entry with persisted user
|
|
state</a>, the user agent may update aspects of the document
|
|
and its rendering, for instance the scroll position or values of
|
|
form fields, that it had previously recorded.</p>
|
|
|
|
|
|
<p class="note">This can even include updating the <code title="attr-dir"><a href="#the-dir-attribute">dir</a></code> attribute of <code><a href="#the-textarea-element">textarea</a></code>
|
|
elements or <code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in either the
|
|
<a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state or the <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a> state, if the
|
|
persisted state includes the directionality of user input in such
|
|
controls.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the entry is a <a href="#state-object">state object</a> entry, let <var title="">state</var> be a <a href="#structured-clone">structured clone</a> of that
|
|
state object. Otherwise, let <var title="">state</var> be
|
|
null.</li>
|
|
|
|
<li><p>Set <code title="dom-history-state"><a href="#dom-history-state">history.state</a></code> to <var title="">state</var>.</li>
|
|
|
|
<li><p>Fire a <code title="event-popstate"><a href="#event-popstate">popstate</a></code> event at
|
|
the <code><a href="#window">Window</a></code> object of the <code><a href="#document">Document</a></code>, using
|
|
the <code><a href="#popstateevent">PopStateEvent</a></code> interface, with the <code title="dom-PopStateEvent-state"><a href="#dom-popstateevent-state">state</a></code> attribute set to the
|
|
value of <var title="">state</var>. This event must bubble but not
|
|
be cancelable and has no default action.</li>
|
|
|
|
<li><p>If <var title="">hash changed</var> is true, then fire a
|
|
<code title="event-hashchange"><a href="#event-hashchange">hashchange</a></code> event at the
|
|
<a href="#browsing-context">browsing context</a>'s <code><a href="#window">Window</a></code> object, using
|
|
the <code><a href="#hashchangeevent">HashChangeEvent</a></code> interface, with the <code title="dom-HashChangeEvent-oldURL"><a href="#dom-hashchangeevent-oldurl">oldURL</a></code> attribute set to
|
|
<var title="">old URL</var> and the <code title="dom-HashChangeEvent-newURL"><a href="#dom-hashchangeevent-newurl">newURL</a></code> attribute set to
|
|
<var title="">new URL</var>. This event must bubble but not be
|
|
cancelable and has no default action.</li>
|
|
|
|
<li><p>The <a href="#current-entry">current entry</a> is now the <i>specified
|
|
entry</i>.</li>
|
|
|
|
</ol><p>The <a href="#task-source">task source</a> for the tasks mentioned above is the
|
|
<a href="#dom-manipulation-task-source">DOM manipulation task source</a>.</p>
|
|
|
|
|
|
<h5 id="event-definitions"><span class="secno">5.5.9.1 </span>Event definitions</h5>
|
|
|
|
</div><p>The <dfn id="event-popstate" title="event-popstate"><code>popstate</code></dfn> event
|
|
is fired in certain cases when navigating to a <a href="#session-history-entry">session history
|
|
entry</a>.<pre class="idl">interface <dfn id="popstateevent">PopStateEvent</dfn> : <a href="#event">Event</a> {
|
|
readonly attribute any <a href="#dom-popstateevent-state" title="dom-PopStateEvent-state">state</a>;
|
|
void <a href="#dom-popstateevent-initpopstateevent" title="dom-PopStateEvent-initPopStateEvent">initPopStateEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any stateArg);
|
|
};</pre><dl class="domintro"><dt><var title="">event</var> . <code title="dom-PopStateEvent-state"><a href="#dom-popstateevent-state">state</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a copy of the information that was provided to <code title="dom-history-pushState"><a href="#dom-history-pushstate">pushState()</a></code> or <code title="dom-history-replaceState"><a href="#dom-history-replacestate">replaceState()</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-popstateevent-initpopstateevent" title="dom-PopStateEvent-initPopStateEvent"><code>initPopStateEvent()</code></dfn>
|
|
method must initialize the event in a manner analogous to the
|
|
similarly-named method in the DOM Events interfaces. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
<p>The <dfn id="dom-popstateevent-state" title="dom-PopStateEvent-state"><code>state</code></dfn>
|
|
attribute represents the context information for the event, or null,
|
|
if the state represented is the initial state of the
|
|
<code><a href="#document">Document</a></code>.</p>
|
|
|
|
</div><hr><p>The <dfn id="event-hashchange" title="event-hashchange"><code>hashchange</code></dfn>
|
|
event is fired when navigating to a <a href="#session-history-entry">session history
|
|
entry</a> whose <a href="#url">URL</a> differs from that of the
|
|
previous one only in the fragment identifier.<pre class="idl">interface <dfn id="hashchangeevent">HashChangeEvent</dfn> : <a href="#event">Event</a> {
|
|
readonly attribute DOMString <a href="#dom-hashchangeevent-oldurl" title="dom-HashChangeEvent-oldURL">oldURL</a>;
|
|
readonly attribute DOMString <a href="#dom-hashchangeevent-newurl" title="dom-HashChangeEvent-newURL">newURL</a>;
|
|
void <a href="#dom-hashchangeevent-inithashchangeevent" title="dom-HashChangeEvent-initHashChangeEvent">initHashChangeEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString oldURLArg, in DOMString newURLArg);
|
|
};</pre><dl class="domintro"><dt><var title="">event</var> . <code title="dom-HashChangeEvent-oldURL"><a href="#dom-hashchangeevent-oldurl">oldURL</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <a href="#url">URL</a> of the <a href="#session-history-entry">session history
|
|
entry</a> that was previously current.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">event</var> . <code title="dom-HashChangeEvent-newURL"><a href="#dom-hashchangeevent-newurl">newURL</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <a href="#url">URL</a> of the <a href="#session-history-entry">session history
|
|
entry</a> that is now current.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-hashchangeevent-inithashchangeevent" title="dom-HashChangeEvent-initHashChangeEvent"><code>initHashChangeEvent()</code></dfn>
|
|
method must initialize the event in a manner analogous to the
|
|
similarly-named method in the DOM Events interfaces. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
<p>The <dfn id="dom-hashchangeevent-oldurl" title="dom-HashChangeEvent-oldURL"><code>oldURL</code></dfn>
|
|
attribute represents context information for the event, specifically
|
|
the URL of the <a href="#session-history-entry">session history entry</a> that was traversed
|
|
from.</p>
|
|
|
|
<p>The <dfn id="dom-hashchangeevent-newurl" title="dom-HashChangeEvent-newURL"><code>newURL</code></dfn>
|
|
attribute represents context information for the event, specifically
|
|
the URL of the <a href="#session-history-entry">session history entry</a> that was traversed
|
|
to.</p>
|
|
|
|
</div><hr><p>The <dfn id="event-pageshow" title="event-pageshow"><code>pageshow</code></dfn> event
|
|
is fired when traversing <em>to</em> a <a href="#session-history-entry">session history
|
|
entry</a>.<p>The <dfn id="event-pagehide" title="event-pagehide"><code>pagehide</code></dfn>
|
|
event is fired when traversing <em>from</em> a <a href="#session-history-entry">session history
|
|
entry</a>.<pre class="idl">interface <dfn id="pagetransitionevent">PageTransitionEvent</dfn> : <a href="#event">Event</a> {
|
|
readonly attribute boolean <a href="#dom-pagetransitionevent-persisted" title="dom-PageTransitionEvent-persisted">persisted</a>;
|
|
void <a href="#dom-pagetransitionevent-initpagetransitionevent" title="dom-PageTransitionEvent-initPageTransitionEvent">initPageTransitionEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in boolean persistedArg);
|
|
};</pre><dl class="domintro"><dt><var title="">event</var> . <code title="dom-PageTransitionEvent-persisted"><a href="#dom-pagetransitionevent-persisted">persisted</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns false if the page is newly being loaded (and the <code title="event-load">load</code> event will fire). Otherwise, returns true.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-pagetransitionevent-initpagetransitionevent" title="dom-PageTransitionEvent-initPageTransitionEvent"><code>initPageTransitionEvent()</code></dfn>
|
|
method must initialize the event in a manner analogous to the
|
|
similarly-named method in the DOM Events interfaces. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
<p>The <dfn id="dom-pagetransitionevent-persisted" title="dom-PageTransitionEvent-persisted"><code>persisted</code></dfn>
|
|
attribute represents the context information for the event.</p>
|
|
|
|
</div><h4 id="unloading-documents"><span class="secno">5.5.10 </span>Unloading documents</h4><div class="impl">
|
|
|
|
<p>A <code><a href="#document">Document</a></code> has a <var title="concept-document-salvageable">salvageable</var> state, which
|
|
is initially true.</p>
|
|
|
|
<p>When a user agent is to <dfn id="prompt-to-unload-a-document">prompt to unload a document</dfn>,
|
|
it must run the following steps.</p>
|
|
|
|
<ol><li><p>Let <var title="">event</var> be a new
|
|
<code><a href="#beforeunloadevent">BeforeUnloadEvent</a></code> event object with the name <code title="event-beforeunload">beforeunload</code>, which does not
|
|
bubble but is cancelable.</li>
|
|
|
|
<li><p><i>Dispatch</i>: Dispatch <var title="">event</var> at the
|
|
<code><a href="#document">Document</a></code>'s <code><a href="#window">Window</a></code> object.</li>
|
|
|
|
<li><p>Release the <a href="#storage-mutex">storage mutex</a>.</li>
|
|
|
|
<li><p>If any event listeners were triggered by the earlier
|
|
<i>dispatch</i> step, then set the <code><a href="#document">Document</a></code>'s <var title="concept-document-salvageable">salvageable</var> state to
|
|
false.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <code title="dom-BeforeUnloadEvent-returnValue"><a href="#dom-beforeunloadevent-returnvalue">returnValue</a></code>
|
|
attribute of the <var title="">event</var> object is not the empty
|
|
string, or if the event was canceled, then the user agent should
|
|
ask the user to confirm that they wish to unload the document.</p>
|
|
|
|
<p>The prompt shown by the user agent may include the string of
|
|
the <code title="dom-BeforeUnloadEvent-returnValue"><a href="#dom-beforeunloadevent-returnvalue">returnValue</a></code>
|
|
attribute, or some leading subset thereof. (A user agent may want
|
|
to truncate the string to 1024 characters for display, for
|
|
instance.)</p>
|
|
|
|
<p>The user agent must <a href="#pause">pause</a> while waiting for the
|
|
user's response.</p>
|
|
|
|
<p>If the user did not confirm the page navigation, then the user
|
|
agent <dfn id="refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</dfn>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If this algorithm was invoked by another instance of the
|
|
"prompt to unload a document" algorithm (i.e. through the steps
|
|
below that invoke this algorithm for all descendant browsing
|
|
contexts), then abort these steps here.</li>
|
|
|
|
<li><p>Let <var title="">descendants</var> be the <a href="#list-of-the-descendant-browsing-contexts">list of the
|
|
descendant browsing contexts</a> of the
|
|
<code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">descendants</var> is not an empty list, then
|
|
for each <a href="#browsing-context">browsing context</a> <var title="">b</var> in
|
|
<var title="">descendants</var> run the following substeps:</p>
|
|
|
|
<ol><li><p><a href="#prompt-to-unload-a-document" title="prompt to unload a document">Prompt to
|
|
unload</a> the <a href="#active-document">active document</a> of the
|
|
<a href="#browsing-context">browsing context</a> <var title="">b</var>. If the user
|
|
<a href="#refused-to-allow-the-document-to-be-unloaded">refused to allow the document to be unloaded</a>, then
|
|
the user implicitly also <a href="#refused-to-allow-the-document-to-be-unloaded" title="refused to allow the
|
|
document to be unloaded">refused to allow <em>this</em> document
|
|
to be unloaded</a>; abort these steps.</p>
|
|
|
|
<li><p>If <var title="concept-document-salvageable">salvageable</var> state of
|
|
the <a href="#active-document">active document</a> of the <a href="#browsing-context">browsing
|
|
context</a> <var title="">b</var> is false, then set the <var title="concept-document-salvageable">salvageable</var> state of
|
|
<em>this</em> document to false also.</li>
|
|
|
|
</ol></li>
|
|
|
|
</ol><p>When a user agent is to <dfn id="unload-a-document">unload a document</dfn>, it must run
|
|
the following steps. These steps are passed an argument, <var title="">recycle</var>, which is either true or false, indicating
|
|
whether the <code><a href="#document">Document</a></code> object is going to be
|
|
re-used. (This is set by the <code title="dom-document-open"><a href="#dom-document-open">document.open()</a></code> method.)</p>
|
|
|
|
<ol><li><p>Fire a <code title="event-pagehide"><a href="#event-pagehide">pagehide</a></code> event at
|
|
the <code><a href="#window">Window</a></code> object of the <code><a href="#document">Document</a></code>, but
|
|
with its <code title="dom-event-target"><a href="#dom-event-target">target</a></code> set to the
|
|
<code><a href="#document">Document</a></code> object (and the <code title="dom-event-currentTarget">currentTarget</code> set to the
|
|
<code><a href="#window">Window</a></code> object), using the
|
|
<code><a href="#pagetransitionevent">PageTransitionEvent</a></code> interface, with the <code title="dom-PageTransitionEvent-persisted"><a href="#dom-pagetransitionevent-persisted">persisted</a></code>
|
|
attribute set to true. This event must not bubble, must not be
|
|
cancelable, and has no default action.</li>
|
|
|
|
<li><p><i>Unload event</i>: <a href="#fire-a-simple-event">Fire a simple event</a> named
|
|
<code title="event-unload">unload</code> at the
|
|
<code><a href="#document">Document</a></code>'s <code><a href="#window">Window</a></code> object.</li>
|
|
|
|
<li><p>Release the <a href="#storage-mutex">storage mutex</a>.</li>
|
|
|
|
<li><p>If any event listeners were triggered by the earlier
|
|
<i>unload event</i> step, then set the <code><a href="#document">Document</a></code>
|
|
object's <var title="concept-document-salvageable">salvageable</var> state to
|
|
false.</li>
|
|
|
|
<li><p>Run any <a href="#unloading-document-cleanup-steps">unloading document cleanup steps</a> for
|
|
<code><a href="#document">Document</a></code> that are defined by this specification and
|
|
<a href="#other-applicable-specifications">other applicable specifications</a>.</li>
|
|
|
|
<li><p>If this algorithm was invoked by another instance of the
|
|
"unload a document" algorithm (i.e. through the steps below that
|
|
invoke this algorithm for all descendant browsing contexts), then
|
|
abort these steps here.</li>
|
|
|
|
<li><p>Let <var title="">descendants</var> be the <a href="#list-of-the-descendant-browsing-contexts">list of the
|
|
descendant browsing contexts</a> of the
|
|
<code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">descendants</var> is not an empty list, then
|
|
for each <a href="#browsing-context">browsing context</a> <var title="">b</var> in
|
|
<var title="">descendants</var> run the following substeps:</p>
|
|
|
|
<ol><li><p><a href="#unload-a-document" title="unload a document">Unload</a> the
|
|
<a href="#active-document">active document</a> of the <a href="#browsing-context">browsing context</a>
|
|
<var title="">b</var> with the <var title="">recycle</var>
|
|
parameter set to false.</li>
|
|
|
|
<li><p>If <var title="concept-document-salvageable">salvageable</var> state of
|
|
the <a href="#active-document">active document</a> of the <a href="#browsing-context">browsing
|
|
context</a> <var title="">b</var> is false, then set the <var title="concept-document-salvageable">salvageable</var> state of
|
|
<em>this</em> document to false also.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>If <var title="concept-document-salvageable">salvageable</var> and <var title="">recycle</var> are both false, then the
|
|
<code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> must <a href="#discard-a-document" title="discard a document">discard the
|
|
<code>Document</code></a>.</li>
|
|
|
|
</ol><p>This specification defines the following <dfn id="unloading-document-cleanup-steps">unloading document
|
|
cleanup steps</dfn>. Other specifications can define more.</p>
|
|
|
|
<ol><li><p><span>Close the WebSocket connection</span> of any
|
|
<code>WebSocket</code> objects that were created by the <code title="dom-WebSocket">WebSocket()</code> constructor visible on the
|
|
<code><a href="#document">Document</a></code>'s <code><a href="#window">Window</a></code> object. If this
|
|
affected any <code>WebSocket</code> objects, the set
|
|
<code><a href="#document">Document</a></code>'s <var title="concept-document-salvageable">salvageable</var> state to
|
|
false.
|
|
|
|
<a href="#refsWEBSOCKET">[WEBSOCKET]</a>
|
|
|
|
</li>
|
|
|
|
<li><p>If the <code><a href="#document">Document</a></code>'s <var title="concept-document-salvageable">salvageable</var> state is
|
|
false, empty the <code><a href="#document">Document</a></code>'s <code><a href="#window">Window</a></code>'s
|
|
<a href="#list-of-active-timeouts">list of active timeouts</a> and its <a href="#list-of-active-intervals">list of active
|
|
intervals</a>.</li>
|
|
|
|
</ol><h5 id="event-definition"><span class="secno">5.5.10.1 </span>Event definition</h5>
|
|
|
|
</div><pre class="idl">interface <dfn id="beforeunloadevent">BeforeUnloadEvent</dfn> : <a href="#event">Event</a> {
|
|
attribute DOMString <a href="#dom-beforeunloadevent-returnvalue" title="dom-BeforeUnloadEvent-returnValue">returnValue</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">event</var> . <code title="dom-BeforeUnloadEvent-returnValue"><a href="#dom-beforeunloadevent-returnvalue">returnValue</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current return value of the event (the message to show the user).</p>
|
|
|
|
<p>Can be set, to update the message.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p class="note">There are no <code><a href="#beforeunloadevent">BeforeUnloadEvent</a></code>-specific
|
|
initialization methods.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-beforeunloadevent-returnvalue" title="dom-BeforeUnloadEvent-returnValue"><code>returnValue</code></dfn>
|
|
attribute represents the message to show the user. When the event is
|
|
created, the attribute must be set to the empty string. On getting,
|
|
it must return the last value it was set to. On setting, the
|
|
attribute must be set to the new value.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="aborting-a-document-load"><span class="secno">5.5.11 </span>Aborting a document load</h4>
|
|
|
|
<p>If a <code><a href="#document">Document</a></code> is <dfn id="abort-a-document" title="abort a
|
|
document">aborted</dfn>, the user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p><a href="#abort-a-document" title="abort a document">Abort</a> the <a href="#active-document" title="active document">active documents</a> of every
|
|
<a href="#child-browsing-context">child browsing context</a>.</li>
|
|
|
|
<li><p>Cancel any instances of the <a href="#fetch" title="fetch">fetch</a>
|
|
algorithm in the context of this <code><a href="#document">Document</a></code>, discarding
|
|
any <a href="#concept-task" title="concept-task">tasks</a> <a href="#queue-a-task" title="queue a
|
|
task">queued</a> for them, and discarding any further data
|
|
received from the network for them.</li>
|
|
|
|
<li><p>If the <code><a href="#document">Document</a></code> has an <a href="#active-parser">active
|
|
parser</a>, then <a href="#abort-a-parser" title="abort a parser">abort that
|
|
parser</a>.</li>
|
|
|
|
|
|
|
|
</ol><p>User agents may allow users to explicitly invoke the <a href="#abort-a-document" title="abort a document">abort a document</a> algorithm for a
|
|
<code><a href="#document">Document</a></code>. If the user does so, then, if that
|
|
<code><a href="#document">Document</a></code> is an <a href="#active-document">active document</a>, the user
|
|
agent should <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-abort">abort</code> at that
|
|
<code><a href="#document">Document</a></code>'s <code><a href="#window">Window</a></code> object before invoking
|
|
the <a href="#abort-a-document" title="abort a document">abort</a> algorithm.</p>
|
|
|
|
|
|
</div><h3 id="offline"><span class="secno">5.6 </span>Offline Web applications</h3><h4 id="introduction-4"><span class="secno">5.6.1 </span>Introduction</h4><p><i>This section is non-normative.</i><p>In order to enable users to continue interacting with Web
|
|
applications and documents even when their network connection is
|
|
unavailable — for instance, because they are traveling outside
|
|
of their ISP's coverage area — authors can provide a manifest
|
|
which lists the files that are needed for the Web application to
|
|
work offline and which causes the user's browser to keep a copy of
|
|
the files for use offline.<p>To illustrate this, consider a simple clock applet consisting of
|
|
an HTML page "<code title="">clock.html</code>", a CSS style sheet
|
|
"<code title="">clock.css</code>", and a JavaScript script "<code title="">clock.js</code>".<p>Before adding the manifest, these three files might look like
|
|
this:<pre><!-- clock.html -->
|
|
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Clock</title>
|
|
<script src="clock.js"></script>
|
|
<link rel="stylesheet" href="clock.css">
|
|
</head>
|
|
<body>
|
|
<p>The time is: <output id="clock"></output></p>
|
|
</body>
|
|
</html></pre><pre>/* clock.css */
|
|
output { font: 2em sans-serif; }</pre><pre>/* clock.js */
|
|
setTimeout(function () {
|
|
document.getElementById('clock').value = new Date();
|
|
}, 1000);</pre><p>If the user tries to open the "<code title="">clock.html</code>"
|
|
page while offline, though, the user agent (unless it happens to
|
|
have it still in the local cache) will fail with an error.<p>The author can instead provide a manifest of the three files:<pre>CACHE MANIFEST
|
|
clock.html
|
|
clock.css
|
|
clock.js</pre><p>With a small change to the HTML file, the manifest (served as
|
|
<code><a href="#text-cache-manifest">text/cache-manifest</a></code>) is linked to the application:<pre><!-- clock.html -->
|
|
<!DOCTYPE HTML>
|
|
<html manifest="clock.appcache">
|
|
<head>
|
|
<title>Clock</title>
|
|
<script src="clock.js"></script>
|
|
<link rel="stylesheet" href="clock.css">
|
|
</head>
|
|
<body>
|
|
<p>The time is: <output id="clock"></output></p>
|
|
</body>
|
|
</html></pre><p>Now, if the user goes to the page, the browser will cache the
|
|
files and make them available even when the user is offline.<p class="note">Authors are encouraged to include the main page in
|
|
the manifest also, but in practice the page that referenced the
|
|
manifest is automatically cached even if it isn't explicitly
|
|
mentioned.<p class="note">HTTP cache headers and restrictions on caching pages
|
|
served over TLS (encrypted, using <code title="">https:</code>) are
|
|
overridden by manifests. Thus, pages will not expire from an
|
|
application cache before the user agent has updated it, and even
|
|
applications served over TLS can be made to work offline.</p><h5 id="appcacheevents"><span class="secno">5.6.1.1 </span>Event summary</h5><p><i>This section is non-normative.</i><p>When the user visits a page that declares a manifest, the browser
|
|
will try to update the cache. It does this by fetching a copy of the
|
|
manifest and, if the manifest has changed since the user agent last
|
|
saw it, redownloading all the resources it mentions and caching them
|
|
anew.<p>As this is going on, a number of events get fired on the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> object to keep the script updated as
|
|
to the state of the cache update, so that the user can be notified
|
|
appropriately. The events are as follows:<table><thead><tr><th> Event name
|
|
<th> Interface
|
|
<th> Dispatched when...
|
|
<th> Next events
|
|
<tbody><tr><td> <dfn id="event-appcache-checking" title="event-appcache-checking"><code>checking</code></dfn>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> The user agent is checking for an update, or attempting to download the manifest for the first time. <strong>This is always the first event in the sequence.</strong>
|
|
<td> <code title="event-appcache-noupdate"><a href="#event-appcache-noupdate">noupdate</a></code>, <code title="event-appcache-downloading"><a href="#event-appcache-downloading">downloading</a></code>, <code title="event-appcache-obsolete"><a href="#event-appcache-obsolete">obsolete</a></code>, <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code>
|
|
<tr><td> <dfn id="event-appcache-noupdate" title="event-appcache-noupdate"><code>noupdate</code></dfn>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> The manifest hadn't changed.
|
|
<td> Last event in sequence.
|
|
<tr><td> <dfn id="event-appcache-downloading" title="event-appcache-downloading"><code>downloading</code></dfn>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> The user agent has found an update and is fetching it, or is downloading the resources listed by the manifest for the first time.
|
|
<td> <code title="event-appcache-progress"><a href="#event-appcache-progress">progress</a></code>, <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code>, <code title="event-appcache-cached"><a href="#event-appcache-cached">cached</a></code>, <code title="event-appcache-updateready"><a href="#event-appcache-updateready">updateready</a></code>
|
|
<tr><td> <dfn id="event-appcache-progress" title="event-appcache-progress"><code>progress</code></dfn>
|
|
<td> <code>ProgressEvent</code>
|
|
<td> The user agent is downloading resources listed by the manifest.
|
|
<td> <code title="event-appcache-progress"><a href="#event-appcache-progress">progress</a></code>, <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code>, <code title="event-appcache-cached"><a href="#event-appcache-cached">cached</a></code>, <code title="event-appcache-updateready"><a href="#event-appcache-updateready">updateready</a></code>
|
|
<tr><td> <dfn id="event-appcache-cached" title="event-appcache-cached"><code>cached</code></dfn>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> The resources listed in the manifest have been downloaded, and the application is now cached.
|
|
<td> Last event in sequence.
|
|
<tr><td> <dfn id="event-appcache-updateready" title="event-appcache-updateready"><code>updateready</code></dfn>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> The resources listed in the manifest have been newly redownloaded, and the script can use <code title="dom-appcache-swapCache"><a href="#dom-appcache-swapcache">swapCache()</a></code> to switch to the new cache.
|
|
<td> Last event in sequence.
|
|
<tr><td> <dfn id="event-appcache-obsolete" title="event-appcache-obsolete"><code>obsolete</code></dfn>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> The manifest was found to have become a 404 or 410 page, so the application cache is being deleted.
|
|
<td> Last event in sequence.
|
|
<tr><td rowspan="4"> <dfn id="event-appcache-error" title="event-appcache-error"><code>error</code></dfn>
|
|
<td rowspan="4"> <code><a href="#event">Event</a></code>
|
|
<td> The manifest was a 404 or 410 page, so the attempt to cache the application has been aborted.
|
|
<td rowspan="3"> Last event in sequence.
|
|
<tr><td> The manifest hadn't changed, but the page referencing the manifest failed to download properly.
|
|
<tr><td> A fatal error occurred while fetching the resources listed in the manifest.
|
|
<tr><td> The manifest changed while the update was being run.
|
|
<td> The user agent will try fetching the files again momentarily.
|
|
</table><div class="impl">
|
|
|
|
<h4 id="appcache"><span class="secno">5.6.2 </span>Application caches</h4>
|
|
|
|
<p>An <dfn id="application-cache">application cache</dfn> is a set of cached resources
|
|
consisting of:</p>
|
|
|
|
<ul><li>
|
|
|
|
<p>One or more resources (including their out-of-band metadata,
|
|
such as HTTP headers, if any), identified by URLs, each falling
|
|
into one (or more) of the following categories:</p>
|
|
|
|
<dl><dt><dfn id="concept-appcache-master" title="concept-appcache-master">Master entries</dfn>
|
|
|
|
<dd><p class="note">These are documents that were added to the
|
|
cache because a <a href="#browsing-context">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="#attr-html-manifest">manifest</a></code> attribute.</p>
|
|
|
|
|
|
<dt><dfn id="concept-appcache-manifest" title="concept-appcache-manifest">The manifest</dfn>
|
|
|
|
<dd><p class="note">This is the resource corresponding to the URL
|
|
that was given in a master entry's <code><a href="#the-html-element">html</a></code> element's
|
|
<code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attribute. The
|
|
manifest is fetched and processed during the <a href="#application-cache-download-process">application
|
|
cache download process</a>. All the <a href="#concept-appcache-master" title="concept-appcache-master">master entries</a> have the
|
|
<a href="#same-origin" title="same origin">same origin</a> as the manifest.</p>
|
|
|
|
|
|
<dt><dfn id="concept-appcache-explicit" title="concept-appcache-explicit">Explicit entries</dfn>
|
|
|
|
<dd><p class="note">These are the resources that were listed in
|
|
the cache's <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a> in an <a href="#concept-appcache-manifest-explicit" title="concept-appcache-manifest-explicit">explicit
|
|
section</a>.</p>
|
|
|
|
|
|
<dt><dfn id="concept-appcache-fallback" title="concept-appcache-fallback">Fallback entries</dfn>
|
|
|
|
<dd><p class="note">These are the resources that were listed in
|
|
the cache's <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a> in a <a href="#concept-appcache-manifest-fallback" title="concept-appcache-manifest-fallback">fallback
|
|
section</a>.</p>
|
|
|
|
|
|
</dl><p><a href="#concept-appcache-explicit" title="concept-appcache-explicit">Explicit entries</a>
|
|
and <a href="#concept-appcache-fallback" title="concept-appcache-fallback">Fallback
|
|
entries</a> can be marked as <dfn id="concept-appcache-foreign" title="concept-appcache-foreign">foreign</dfn>, which means that
|
|
they have a <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code>
|
|
attribute but that it doesn't point at this cache's <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a>.</p>
|
|
|
|
<p class="note">A URL in the list can be flagged with multiple
|
|
different types, and thus an entry can end up being categorized as
|
|
multiple entries. For example, an entry can be a manifest entry
|
|
and an explicit entry at the same time, if the manifest is listed
|
|
within the manifest.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Zero or more <dfn id="concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback
|
|
namespaces</dfn>, each of which is mapped to a <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback entry</a>.</p>
|
|
|
|
<p class="note">These are URLs used as <a href="#concept-appcache-matches-fallback" title="concept-appcache-matches-fallback">prefix match
|
|
patterns</a> for resources that are to be fetched from the
|
|
network if possible, or to be replaced by the corresponding <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback entry</a> if not.
|
|
Each namespace URL has the <a href="#same-origin">same origin</a> as <a href="#concept-appcache-manifest" title="concept-appcache-manifest">the manifest</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Zero or more URLs that form the <dfn id="concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist
|
|
namespaces</dfn>.</p>
|
|
|
|
<p class="note">These are used as prefix match patterns, and
|
|
declare URLs that the user agent will never load from the cache
|
|
but will instead always attempt to obtain from the network.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>An <dfn id="concept-appcache-onlinewhitelist-wildcard" title="concept-appcache-onlinewhitelist-wildcard">online whitelist
|
|
wildcard flag</dfn>, which is either <i title="">open</i> or <i title="">blocking</i>.</p>
|
|
|
|
<p class="note">The <i title="">open</i> state indicates that any
|
|
URL not listed as cached is to be implicitly treated as being in
|
|
the <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online
|
|
whitelist namespaces</a>; the <i title="">blocking</i> state
|
|
indicates that URLs not listed explicitly in the manifest are to
|
|
be treated as unavailable.</p>
|
|
|
|
</li>
|
|
|
|
</ul><p>Each <a href="#application-cache">application cache</a> has a <dfn id="concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</dfn>, which is
|
|
either <i>complete</i> or <i>incomplete</i>.</p>
|
|
|
|
<hr><p>An <dfn id="application-cache-group">application cache group</dfn> is a group of <a href="#application-cache" title="application cache">application caches</a>, identified by
|
|
the <a href="#absolute-url">absolute URL</a> of a resource <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a> which is used to
|
|
populate the caches in the group.</p>
|
|
|
|
<p>An <a href="#application-cache">application cache</a> is <dfn id="concept-appcache-newer" title="concept-appcache-newer">newer</dfn> than another if it was
|
|
created after the other (in other words, <a href="#application-cache" title="application
|
|
cache">application caches</a> in an <a href="#application-cache-group">application cache
|
|
group</a> have a chronological order).</p>
|
|
|
|
<p>Only the newest <a href="#application-cache">application cache</a> in an
|
|
<a href="#application-cache-group">application cache group</a> can have its <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> set to
|
|
<i>incomplete</i>; the others are always all <i>complete</i>.</p>
|
|
|
|
<p>Each <a href="#application-cache-group">application cache group</a> has an <dfn id="concept-appcache-status" title="concept-appcache-status">update status</dfn>, which is one of
|
|
the following: <i>idle</i>, <i>checking</i>, <i>downloading</i>.</p>
|
|
|
|
<p>A <dfn id="relevant-application-cache">relevant application cache</dfn> is an <a href="#application-cache">application
|
|
cache</a> that is the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a> in its <a href="#application-cache-group" title="application cache group">group</a> to be
|
|
<i>complete</i>.</p>
|
|
|
|
<p>Each <a href="#application-cache-group">application cache group</a> has a <dfn id="concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</dfn>. Each entry in this list consists of a resource and a
|
|
corresponding <code><a href="#document">Document</a></code> object. It is used during the
|
|
<a href="#application-cache-download-process">application cache download process</a> to ensure that new
|
|
master entries are cached even if the <a href="#application-cache-download-process">application cache
|
|
download process</a> was already running for their
|
|
<a href="#application-cache-group">application cache group</a> when they were loaded.</p>
|
|
|
|
<p>An <a href="#application-cache-group">application cache group</a> can be marked as <dfn id="concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</dfn>, meaning that it
|
|
must be ignored when looking at what <a href="#application-cache-group" title="application cache
|
|
group">application cache groups</a> exist.</p>
|
|
|
|
<hr><p>A <dfn id="cache-host">cache host</dfn> is a <code><a href="#document">Document</a></code> or a
|
|
<code>SharedWorkerGlobalScope</code> object. A <a href="#cache-host">cache
|
|
host</a> can be associated with an <a href="#application-cache">application
|
|
cache</a>.
|
|
|
|
<a href="#refsWEBWORKERS">[WEBWORKERS]</a>
|
|
|
|
</p>
|
|
|
|
<p>A <code><a href="#document">Document</a></code> initially is not associated with an
|
|
<a href="#application-cache">application cache</a>, but can become associated with one
|
|
early during the page load process, when steps <a href="#parser-appcache">in the parser</a> and in the <a href="#navigate" title="navigate">navigation</a> sections cause <a href="#concept-appcache-init" title="concept-appcache-init">cache selection</a> to occur.</p>
|
|
|
|
<p>A <code>SharedWorkerGlobalScope</code> can be associated with an
|
|
<a href="#application-cache">application cache</a> when it is created.
|
|
|
|
<a href="#refsWEBWORKERS">[WEBWORKERS]</a>
|
|
|
|
</p>
|
|
|
|
<p>Each <a href="#cache-host">cache host</a> has an associated
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> object.</p>
|
|
|
|
<hr><p>Multiple <a href="#application-cache" title="application cache">application
|
|
caches</a> in different <a href="#application-cache-group" title="application cache
|
|
group">application cache groups</a> can contain the same
|
|
resource, e.g. if the manifests all reference that resource. If the
|
|
user agent is to <dfn id="concept-appcache-selection" title="concept-appcache-selection">select an
|
|
application cache</dfn> from a list of <a href="#relevant-application-cache" title="relevant
|
|
application cache">relevant application caches</a> that contain a
|
|
resource, 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>which application cache was being used to display the
|
|
resource from which the user decided to look at the new resource,
|
|
and
|
|
|
|
<li>which application cache the user prefers.
|
|
|
|
</ul><hr><p>A URL <dfn id="concept-appcache-matches-fallback" title="concept-appcache-matches-fallback">matches a
|
|
fallback namespace</dfn> if there exists a <a href="#relevant-application-cache">relevant
|
|
application cache</a> whose <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a>'s URL has the
|
|
<a href="#same-origin">same origin</a> as the URL in question, and that has a
|
|
<a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespace</a>
|
|
that is a <a href="#prefix-match">prefix match</a> for the URL being examined. If
|
|
multiple fallback namespaces match the same URL, the longest one is
|
|
the one that matches. A URL looking for a fallback 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> is a
|
|
fallback namespace, and the user navigates to <code title="">HTTP://EXAMPLE.COM:80/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 URL.</p>
|
|
|
|
|
|
</div>
|
|
|
|
</div><h4 id="manifests"><span class="secno">5.6.3 </span>The cache manifest syntax</h4><h5 id="some-sample-manifests"><span class="secno">5.6.3.1 </span>Some sample manifests</h5><p><i>This section is non-normative.</i><div class="example">
|
|
|
|
<p>This example manifest requires two images and a style sheet to be
|
|
cached and whitelists a CGI script.</p>
|
|
|
|
<pre>CACHE MANIFEST
|
|
# the above line is required
|
|
|
|
# this is a comment
|
|
# there can be as many of these anywhere in the file
|
|
# they are all ignored
|
|
# comments can have spaces before them
|
|
# but must be alone on the line
|
|
|
|
# blank lines are ignored too
|
|
|
|
# these are files that need to be cached they can either be listed
|
|
# first, or a "CACHE:" header could be put before them, as is done
|
|
# lower down.
|
|
images/sound-icon.png
|
|
images/background.png
|
|
# note that each file has to be put on its own line
|
|
|
|
# here is a file for the online whitelist -- it isn't cached, and
|
|
# references to this file will bypass the cache, always hitting the
|
|
# network (or trying to, if the user is offline).
|
|
NETWORK:
|
|
comm.cgi
|
|
|
|
# here is another set of files to cache, this time just the CSS file.
|
|
CACHE:
|
|
style/default.css</pre>
|
|
|
|
<p>It could equally well be written as follows:</p>
|
|
|
|
<pre>CACHE MANIFEST
|
|
NETWORK:
|
|
comm.cgi
|
|
CACHE:
|
|
style/default.css
|
|
images/sound-icon.png
|
|
images/background.png</pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>Offline application cache manifests can use absolute paths or
|
|
even absolute URLs:</p>
|
|
|
|
<pre>CACHE MANIFEST
|
|
|
|
/main/home
|
|
/main/app.js
|
|
/settings/home
|
|
/settings/app.js
|
|
http://img.example.com/logo.png
|
|
http://img.example.com/check.png
|
|
http://img.example.com/cross.png</pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>The following manifest defines a catch-all error page that is
|
|
displayed for any page on the site while the user is offline. It
|
|
also specifies that the <a href="#concept-appcache-onlinewhitelist-wildcard" title="concept-appcache-onlinewhitelist-wildcard">online whitelist
|
|
wildcard flag</a> is <i title="">open</i>, meaning that accesses
|
|
to resources on other sites will not be blocked. (Resources on the
|
|
same site are already not blocked because of the catch-all fallback
|
|
namespace.)</p>
|
|
|
|
<p>So long as all pages on the site reference this manifest, they
|
|
will get cached locally as they are fetched, so that subsequent hits
|
|
to the same page will load the page immediately from the
|
|
cache. Until the manifest is changed, those pages will not be
|
|
fetched from the server again. When the manifest changes, then all
|
|
the files will be redownloaded.</p>
|
|
|
|
<p>Subresources, such as style sheets, images, etc, would only be
|
|
cached using the regular HTTP caching semantics, however.</p>
|
|
|
|
<pre>CACHE MANIFEST
|
|
FALLBACK:
|
|
/ /offline.html
|
|
NETWORK:
|
|
*</pre>
|
|
|
|
</div><h5 id="writing-cache-manifests"><span class="secno">5.6.3.2 </span>Writing cache manifests</h5><p>Manifests must be served using the
|
|
<code><a href="#text-cache-manifest">text/cache-manifest</a></code> <a href="#mime-type">MIME type</a>. All
|
|
resources served using the <code><a href="#text-cache-manifest">text/cache-manifest</a></code>
|
|
<a href="#mime-type">MIME type</a> must follow the syntax of application cache
|
|
manifests, as described in this section.<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. <a href="#refsRFC3629">[RFC3629]</a><p class="note">This is a <a href="#willful-violation">willful violation</a> of RFC
|
|
2046, which requires all <code title="">text/*</code> types to only
|
|
allow CRLF line breaks. This requirement, however, is outdated; the
|
|
use of CR, LF, and CRLF line breaks is commonly supported and indeed
|
|
sometimes CRLF is <em>not</em> supported by text editors. <a href="#refsRFC2046">[RFC2046]</a><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 either a U+0020 SPACE character, a U+0009 CHARACTER
|
|
TABULATION (tab) character, a U+000A LINE FEED (LF) character, or a
|
|
U+000D CARRIAGE RETURN (CR) character. The first line may optionally
|
|
be preceded by a U+FEFF BYTE ORDER MARK (BOM) character. If any
|
|
other text is found on the first line, it is ignored.<p>Subsequent lines, if any, must all be one of the following:<dl><dt>A blank line
|
|
<dd>
|
|
<p>Blank lines must consist of zero or more U+0020 SPACE and
|
|
U+0009 CHARACTER TABULATION (tab) characters only.</p>
|
|
|
|
<dt>A comment
|
|
<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 URL, the "#" would be
|
|
mistaken for part of a fragment identifier.</p>
|
|
|
|
<dt>A section header
|
|
<dd>
|
|
<p>Section headers change the current section. There are three
|
|
possible section headers:
|
|
|
|
<dl><dt><code>CACHE:</code>
|
|
<dd>Switches to the <dfn id="concept-appcache-manifest-explicit" title="concept-appcache-manifest-explicit">explicit section</dfn>.
|
|
|
|
<dt><code>FALLBACK:</code>
|
|
<dd>Switches to the <dfn id="concept-appcache-manifest-fallback" title="concept-appcache-manifest-fallback">fallback section</dfn>.
|
|
|
|
<dt><code>NETWORK:</code>
|
|
<dd>Switches to the <dfn id="concept-appcache-manifest-network" title="concept-appcache-manifest-network">online whitelist section</dfn>.
|
|
|
|
</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
|
|
<a href="#concept-appcache-manifest-explicit" title="concept-appcache-manifest-explicit">explicit section</a>.</p>
|
|
|
|
<dt>Data for the current section
|
|
<dd>
|
|
<p>The format that data lines must take depends on the current
|
|
section.</p>
|
|
|
|
<p>When the current section is the <a href="#concept-appcache-manifest-explicit" title="concept-appcache-manifest-explicit">explicit
|
|
section</a>, data lines must consist of zero or more U+0020
|
|
SPACE and U+0009 CHARACTER TABULATION (tab) characters, a
|
|
<a href="#valid-url">valid URL</a> identifying a resource other than the
|
|
manifest itself, and then zero or more U+0020 SPACE and U+0009
|
|
CHARACTER TABULATION (tab) characters.</p>
|
|
|
|
<p>When the current section is the <a href="#concept-appcache-manifest-fallback" title="concept-appcache-manifest-fallback">fallback
|
|
section</a>, data lines must consist of zero or more U+0020
|
|
SPACE and U+0009 CHARACTER TABULATION (tab) characters, a
|
|
<a href="#valid-url">valid URL</a> identifying a resource other than the
|
|
manifest itself, one or more U+0020 SPACE and U+0009 CHARACTER
|
|
TABULATION (tab) characters, another <a href="#valid-url">valid URL</a>
|
|
identifying a resource other than the manifest itself, and then
|
|
zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION (tab)
|
|
characters.</p>
|
|
|
|
<p>When the current section is the <a href="#concept-appcache-manifest-network" title="concept-appcache-manifest-network">online whitelist
|
|
section</a>, data lines must consist of zero or more U+0020
|
|
SPACE and U+0009 CHARACTER TABULATION (tab) characters, either a
|
|
single U+002A ASTERISK character (*) or a <a href="#valid-url">valid
|
|
URL</a> identifying a resource other than the manifest itself,
|
|
and then zero or more U+0020 SPACE and U+0009 CHARACTER TABULATION
|
|
(tab) characters.</p>
|
|
|
|
|
|
</dl><p>Manifests may contain sections more than once. Sections may be
|
|
empty.<p>If the manifest's <a href="#url-scheme" title="url-scheme"><scheme></a>
|
|
is <code title="">https:</code> or another scheme intended for
|
|
encrypted data transfer, then all URLs in <a href="#concept-appcache-manifest-explicit" title="concept-appcache-manifest-explicit">explicit sections</a>
|
|
must have the <a href="#same-origin">same origin</a> as the manifest itself.<p>URLs that are to be fallback pages associated with <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespaces</a>, and
|
|
those namespaces themselves, must be given in <a href="#concept-appcache-manifest-fallback" title="concept-appcache-manifest-fallback">fallback sections</a>,
|
|
with the namespace being the first URL of the data line, and the
|
|
corresponding fallback page being the second URL. All the other
|
|
pages to be cached must be listed in <a href="#concept-appcache-manifest-explicit" title="concept-appcache-manifest-explicit">explicit
|
|
sections</a>.<p><a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">Fallback
|
|
namespaces</a> and <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback entries</a> must have
|
|
the <a href="#same-origin">same origin</a> as the manifest itself.<p>A <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback
|
|
namespace</a> must not be listed more than once.<p>Namespaces that the user agent is to put into the <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist</a>
|
|
must all be specified in <a href="#concept-appcache-manifest-network" title="concept-appcache-manifest-network">online whitelist
|
|
sections</a>. (This is needed for any URL that the page is
|
|
intending to use to communicate back to the server.) To specify that
|
|
all URLs are automatically whitelisted in this way, a U+002A
|
|
ASTERISK character (*) may be specified as one of the URLs. <p>Authors should not include namespaces in the <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist</a> for
|
|
which another namespace in the <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist</a> is
|
|
a <a href="#prefix-match">prefix match</a>.<p>Relative URLs must be given relative to the manifest's own
|
|
URL. All URLs in the manifest must have the same <a href="#url-scheme" title="url-scheme"><scheme></a> as the manifest itself
|
|
(either explicitly or implicitly, through the use of relative
|
|
URLs).<p>URLs in manifests must not have fragment identifiers (i.e. the
|
|
U+0023 NUMBER SIGN character isn't allowed in URLs in
|
|
manifests).<p><a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">Fallback
|
|
namespaces</a> and namespaces in the <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist</a> are
|
|
matched by <a href="#prefix-match">prefix match</a>.<div class="impl">
|
|
|
|
<h5 id="parsing-cache-manifests"><span class="secno">5.6.3.3 </span>Parsing cache manifests</h5>
|
|
|
|
<p>When a user agent is to <dfn id="parse-a-manifest">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 byte stream corresponding
|
|
with the manifest to be parsed <a href="#decoded-as-utf-8-with-error-handling" title="decoded as UTF-8, with
|
|
error handling">as UTF-8, with error handling</a>. </li>
|
|
|
|
<li><p>Let <var title="">base URL</var> be the <a href="#absolute-url">absolute
|
|
URL</a> representing the manifest.</li>
|
|
|
|
<li><p>Let <var title="">explicit URLs</var> be an initially empty
|
|
list of <a href="#absolute-url" title="absolute URL">absolute URLs</a> for <a href="#concept-appcache-explicit" title="concept-appcache-explicit">explicit entries</a>.</li>
|
|
|
|
<li><p>Let <var title="">fallback URLs</var> be an initially empty
|
|
mapping of <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback
|
|
namespaces</a> to <a href="#absolute-url" title="absolute URL">absolute
|
|
URLs</a> for <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback
|
|
entries</a>.</li>
|
|
|
|
<li><p>Let <var title="">online whitelist namespaces</var> be an
|
|
initially empty list of <a href="#absolute-url" title="absolute URL">absolute
|
|
URLs</a> for an <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online
|
|
whitelist</a>.</li>
|
|
|
|
<li><p>Let <var title="">online whitelist wildcard flag</var> be <i title="">blocking</i>. </li>
|
|
|
|
<li><p>Let <var title="">input</var> be the decoded text of the
|
|
manifest's byte stream.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the first
|
|
character.</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.</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.</li>
|
|
|
|
<li><p>If the character at <var title="">position</var> is neither
|
|
a U+0020 SPACE character, a U+0009 CHARACTER TABULATION (tab)
|
|
character, U+000A LINE FEED (LF) character, 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.</li>
|
|
|
|
<li><p>This is a cache manifest. The algorithm cannot fail beyond
|
|
this point (though bogus lines can get ignored).</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> that are
|
|
<em>not</em> U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR)
|
|
characters, and ignore those characters. (Extra text on the first
|
|
line, after the signature, is ignored.)</li>
|
|
|
|
<li><p>Let <var title="">mode</var> be "explicit".</li>
|
|
|
|
<li><p><i>Start of line</i>: If <var title="">position</var> is
|
|
past the end of <var title="">input</var>, then jump to the last
|
|
step. Otherwise, <a href="#collect-a-sequence-of-characters">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.</li>
|
|
|
|
|
|
<li><p>Now, <a href="#collect-a-sequence-of-characters">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>.</li>
|
|
|
|
<li><p>Drop any trailing U+0020 SPACE and U+0009 CHARACTER
|
|
TABULATION (tab) characters at the end of <var title="">line</var>.</li>
|
|
|
|
<li><p>If <var title="">line</var> is the empty string, then jump
|
|
back to the step labeled "start of line".</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
|
|
labeled "start of line".</li>
|
|
|
|
<li><p>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
|
|
labeled "start of line".</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
|
|
labeled "start of line".</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
|
|
labeled "start of line".</li>
|
|
|
|
<li><p>If <var title="">line</var> ends with a U+003A COLON
|
|
character (:), then set <var title="">mode</var> to "unknown" and
|
|
jump back to the step labeled "start of line".</li>
|
|
|
|
<li><p>This is either a data line or it is syntactically
|
|
incorrect.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">line</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>Let <var title="">tokens</var> be a list of strings,
|
|
initially empty.</li>
|
|
|
|
<li>
|
|
|
|
<p>While <var title="">position</var> doesn't point past the end
|
|
of <var title="">line</var>:</p>
|
|
|
|
<ol><li><p>Let <var title="">current token</var> be an empty
|
|
string.</li>
|
|
|
|
<li><p>While <var title="">position</var> doesn't point past the
|
|
end of <var title="">line</var> and the character at <var title="">position</var> is neither a U+0020 SPACE nor a U+0009
|
|
CHARACTER TABULATION (tab) character, add the character at <var title="">position</var> to <var title="">current token</var> and
|
|
advance <var title="">position</var> to the next character in
|
|
<var title="">input</var>.</li>
|
|
|
|
<li><p>Add <var title="">current token</var> to the <var title="">tokens</var> list.</li>
|
|
|
|
<li><p>While <var title="">position</var> doesn't point past the
|
|
end of <var title="">line</var> and the character at <var title="">position</var> is either a U+0020 SPACE or a U+0009
|
|
CHARACTER TABULATION (tab) character, advance <var title="">position</var> to the next character in <var title="">input</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>Process <var title="">tokens</var> as follows:</p>
|
|
|
|
<dl class="switch"><dt>If <var title="">mode</var> is "explicit"</dt>
|
|
|
|
<dd>
|
|
|
|
<p><a href="#resolve-a-url" title="resolve a url">Resolve</a> the first item in
|
|
<var title="">tokens</var>, relative to <var title="">base
|
|
URL</var>; ignore the rest.</p>
|
|
|
|
<p>If this fails, then jump back to the step labeled "start of
|
|
line".</p>
|
|
|
|
<p>If the resulting <a href="#absolute-url">absolute URL</a> has a different
|
|
<a href="#url-scheme" title="url-scheme"><scheme></a> component than
|
|
the manifest's URL (compared in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner), then jump back to the step
|
|
labeled "start of line". If the manifest's <a href="#url-scheme" title="url-scheme"><scheme></a> is <code title="">https:</code> or another scheme intended for encrypted
|
|
data transfer, and the resulting <a href="#absolute-url">absolute URL</a> does
|
|
not have the <a href="#same-origin">same origin</a> as the manifest's URL,
|
|
then jump back to the step labeled "start of line".</p>
|
|
|
|
<p>Drop the <a href="#url-fragment" title="url-fragment"><fragment></a>
|
|
component of the resulting <a href="#absolute-url">absolute URL</a>, if it has
|
|
one.</p>
|
|
|
|
<p>Add the resulting <a href="#absolute-url">absolute URL</a> to the <var title="">explicit URLs</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">mode</var> is "fallback"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Let <var title="">part one</var> be the first token in <var title="">tokens</var>, and let <var title="">part two</var> be
|
|
the second token in <var title="">tokens</var>.</p>
|
|
|
|
<p><a href="#resolve-a-url" title="resolve a url">Resolve</a> <var title="">part
|
|
one</var> and <var title="">part two</var>, relative to <var title="">base URL</var>.</p>
|
|
|
|
<p>If either fails, then jump back to the step labeled "start of
|
|
line".</p>
|
|
|
|
<p>If the <a href="#absolute-url">absolute URL</a> corresponding to either <var title="">part one</var> or <var title="">part two</var> does not
|
|
have the <a href="#same-origin">same origin</a> as the manifest's URL, then
|
|
jump back to the step labeled "start of line".</p>
|
|
<p>Drop any <a href="#url-fragment" title="url-fragment"><fragment></a>
|
|
components of the resulting <a href="#absolute-url" title="absolute URL">absolute
|
|
URLs</a>.</p>
|
|
|
|
<p>If the <a href="#absolute-url">absolute URL</a> corresponding to <var title="">part one</var> is already in the <var title="">fallback
|
|
URLs</var> mapping as a <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespace</a>,
|
|
then jump back to the step labeled "start of line".</p>
|
|
|
|
<p>Otherwise, add the <a href="#absolute-url">absolute URL</a> corresponding to
|
|
<var title="">part one</var> to the <var title="">fallback
|
|
URLs</var> mapping as a <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespace</a>,
|
|
mapped to the <a href="#absolute-url">absolute URL</a> corresponding to <var title="">part two</var> as the <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback entry</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">mode</var> is "online whitelist"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the first item in <var title="">tokens</var> is a U+002A
|
|
ASTERISK character (*), then set <var title="">online whitelist
|
|
wildcard flag</var> to <i title="">open</i> and jump back to the
|
|
step labeled "start of line".</p>
|
|
|
|
<p>Otherwise, <a href="#resolve-a-url" title="resolve a url">resolve</a> the
|
|
first item in <var title="">tokens</var>, relative to <var title="">base URL</var>; ignore the rest.</p>
|
|
|
|
<p>If this fails, then jump back to the step labeled "start of
|
|
line".</p>
|
|
|
|
<p>If the resulting <a href="#absolute-url">absolute URL</a> has a different
|
|
<a href="#url-scheme" title="url-scheme"><scheme></a> component than
|
|
the manifest's URL (compared in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner), then jump back to the step
|
|
labeled "start of line".</p>
|
|
|
|
<p>Drop the <a href="#url-fragment" title="url-fragment"><fragment></a>
|
|
component of the resulting <a href="#absolute-url">absolute URL</a>, if it has
|
|
one.</p>
|
|
|
|
<p>Add the resulting <a href="#absolute-url">absolute URL</a> to the <var title="">online whitelist namespaces</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If <var title="">mode</var> is "unknown"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Do nothing. The line is ignored.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>Jump back to the step labeled "start of line". (That step
|
|
jumps to the next, and last, step when the end of the file is
|
|
reached.)</li>
|
|
|
|
<li><p>Return the <var title="">explicit URLs</var> list, the <var title="">fallback URLs</var> mapping, the <var title="">online
|
|
whitelist namespaces</var>, and the <var title="">online whitelist
|
|
wildcard flag</var>.</li>
|
|
|
|
</ol><div class="note">
|
|
|
|
<p>The resource that declares the manifest (with the <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attribute) will always
|
|
get taken from the cache, whether it is listed in the cache or not,
|
|
even if it is listed in an <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist
|
|
namespace</a>.</p>
|
|
|
|
<p>If a resource is listed in the <a href="#concept-appcache-manifest-explicit" title="concept-appcache-manifest-explicit">explicit section</a>
|
|
or as a <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback
|
|
entry</a> in the <a href="#concept-appcache-manifest-fallback" title="concept-appcache-manifest-fallback">fallback section</a>,
|
|
the resource will always be taken from the cache, regardless of any
|
|
other matching entries in the <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespaces</a> or
|
|
<a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist
|
|
namespaces</a>.</p>
|
|
|
|
<p>When a <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback
|
|
namespace</a> and an <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist
|
|
namespace</a> overlap, the <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist
|
|
namespace</a> has priority.</p>
|
|
|
|
<p>The <a href="#concept-appcache-onlinewhitelist-wildcard" title="concept-appcache-onlinewhitelist-wildcard">online whitelist
|
|
wildcard flag</a> is applied last, only for URLs that match
|
|
neither the <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online
|
|
whitelist namespace</a> nor the <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespace</a> and
|
|
that are not listed in the <a href="#concept-appcache-manifest-explicit" title="concept-appcache-manifest-explicit">explicit
|
|
section</a>.</p>
|
|
|
|
</div>
|
|
|
|
|
|
<h4 id="downloading-or-updating-an-application-cache"><span class="secno">5.6.4 </span>Downloading or updating an application cache</h4>
|
|
|
|
<p>When the user agent is required (by other parts of this
|
|
specification) to start the <dfn id="application-cache-download-process">application cache download
|
|
process</dfn> for an <a href="#absolute-url">absolute URL</a> purported to identify
|
|
a <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a>, or for an
|
|
<a href="#application-cache-group">application cache group</a>, potentially given a particular
|
|
<a href="#cache-host">cache host</a>, and potentially given a <a href="#concept-appcache-master" title="concept-appcache-master">master</a> resource, the user
|
|
agent must run the steps below. These steps are always run
|
|
asynchronously, in parallel with the <a href="#event-loop">event loop</a> <a href="#concept-task" title="concept-task">tasks</a>.</p>
|
|
|
|
<p>Some of these steps have requirements that only apply if the user
|
|
agent <dfn id="shows-caching-progress">shows caching progress</dfn>. Support for this is
|
|
optional. Caching progress UI could consist of a progress bar or
|
|
message panel in the user agent's interface, or an overlay, or
|
|
something else. Certain events fired during the <a href="#application-cache-download-process">application
|
|
cache download process</a> allow the script to override the display
|
|
of such an interface. The goal of this is to allow Web applications
|
|
to provide more seamless update mechanisms, hiding from the user the
|
|
mechanics of the application cache mechanism. User agents may
|
|
display user interfaces independent of this, but are encouraged to
|
|
not show prominent update progress notifications for applications
|
|
that cancel the relevant events.</p>
|
|
|
|
<p class="note">These events are delayed until after the <code title="event-load">load</code> event has fired.</p>
|
|
|
|
<p>The <a href="#application-cache-download-process">application cache download process</a> steps are as
|
|
follows:
|
|
|
|
<ol><li><p>Optionally, wait until the permission to start the
|
|
<a href="#application-cache-download-process">application cache download process</a> has been obtained
|
|
from the user and until the user agent is confident that the
|
|
network is available. This could include doing nothing until the
|
|
user explicitly opts-in to caching the site, or could involve
|
|
prompting the user for permission. The algorithm might never get
|
|
past this point. (This step is particularly intended to be used by
|
|
user agents running on severely space-constrained devices or in
|
|
highly privacy-sensitive environments).</li>
|
|
|
|
<li>
|
|
|
|
<p>Atomically, so as to avoid race conditions, perform the
|
|
following substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Pick the appropriate substeps:</p>
|
|
|
|
<dl class="switch"><dt>If these steps were invoked with an <a href="#absolute-url">absolute
|
|
URL</a> purported to identify a <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Let <var title="">manifest URL</var> be that <a href="#absolute-url">absolute
|
|
URL</a>.</p>
|
|
|
|
<p>If there is no <a href="#application-cache-group">application cache group</a>
|
|
identified by <var title="">manifest URL</var>, then create a
|
|
new <a href="#application-cache-group">application cache group</a> identified by <var title="">manifest URL</var>. Initially, it has no <a href="#application-cache" title="application cache">application caches</a>. One will
|
|
be created later in this algorithm.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If these steps were invoked with an <a href="#application-cache-group">application cache
|
|
group</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Let <var title="">manifest URL</var> be the <a href="#absolute-url">absolute
|
|
URL</a> of the <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a> used to
|
|
identify the <a href="#application-cache-group">application cache group</a> to be
|
|
updated.</p>
|
|
|
|
<p>If that <a href="#application-cache-group">application cache group</a> is <a href="#concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</a>, then abort
|
|
this instance of the <a href="#application-cache-download-process">application cache download
|
|
process</a>. This can happen if another instance of this
|
|
algorithm found the manifest to be 404 or 410 while this
|
|
algorithm was waiting in the first step above.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>Let <var title="">cache group</var> be the
|
|
<a href="#application-cache-group">application cache group</a> identified by <var title="">manifest URL</var>.</li>
|
|
|
|
<li><p>If these steps were invoked with a <a href="#concept-appcache-master" title="concept-appcache-master">master</a> resource, then add
|
|
the resource, along with the resource's <code><a href="#document">Document</a></code>, to
|
|
<var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>.</li>
|
|
|
|
<li><p>If these steps were invoked with a <a href="#cache-host">cache
|
|
host</a>, and the <a href="#concept-appcache-status" title="concept-appcache-status">status</a> of <var title="">cache group</var> is <i>checking</i> or
|
|
<i>downloading</i>, then <a href="#queue-a-post-load-task">queue a post-load task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-appcache-checking"><a href="#event-appcache-checking">checking</a></code> that is
|
|
cancelable at the <code><a href="#applicationcache">ApplicationCache</a></code> singleton of that
|
|
<a href="#cache-host">cache host</a>. The default action of this event must
|
|
be, if the user agent <a href="#shows-caching-progress">shows caching progress</a>, the
|
|
display of some sort of user interface indicating to the user
|
|
that the user agent is checking to see if it can download the
|
|
application.</li>
|
|
|
|
<li><p>If these steps were invoked with a <a href="#cache-host">cache
|
|
host</a>, and the <a href="#concept-appcache-status" title="concept-appcache-status">status</a> of <var title="">cache group</var> is <i>downloading</i>, then also
|
|
<a href="#queue-a-post-load-task">queue a post-load task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-appcache-downloading"><a href="#event-appcache-downloading">downloading</a></code> that is
|
|
cancelable at the <code><a href="#applicationcache">ApplicationCache</a></code> singleton of that
|
|
<a href="#cache-host">cache host</a>. The default action of this event must
|
|
be, if the user agent <a href="#shows-caching-progress">shows caching progress</a>, the
|
|
display of some sort of user interface indicating to the user the
|
|
application is being downloaded.</li>
|
|
|
|
<li><p>If the <a href="#concept-appcache-status" title="concept-appcache-status">status</a>
|
|
of the <var title="">cache group</var> is either <i>checking</i>
|
|
or <i>downloading</i>, then abort this instance of the
|
|
<a href="#application-cache-download-process">application cache download process</a>, as an update is
|
|
already in progress.</li>
|
|
|
|
<li><p>Set the <a href="#concept-appcache-status" title="concept-appcache-status">status</a> of <var title="">cache group</var> to <i>checking</i>.</p>
|
|
|
|
<li><p>For each <a href="#cache-host">cache host</a> associated with an
|
|
<a href="#application-cache">application cache</a> in <var title="">cache
|
|
group</var>, <a href="#queue-a-post-load-task">queue a post-load task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> that is cancelable named <code title="event-appcache-checking"><a href="#event-appcache-checking">checking</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a>. The default action of these events must be, if the
|
|
user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of
|
|
some sort of user interface indicating to the user that the user
|
|
agent is checking for the availability of updates.</li>
|
|
|
|
</ol><p class="note">The remainder of the steps run asynchronously.</p>
|
|
|
|
<p>If <var title="">cache group</var> already has an
|
|
<a href="#application-cache">application cache</a> in it, then this is an <dfn id="concept-appcache-upgrade" title="concept-appcache-upgrade">upgrade attempt</dfn>. Otherwise,
|
|
this is a <dfn id="concept-appcache-cache" title="concept-appcache-cache">cache
|
|
attempt</dfn>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If this is a <a href="#concept-appcache-cache" title="concept-appcache-cache">cache
|
|
attempt</a>, then this algorithm was invoked with a <a href="#cache-host">cache
|
|
host</a>; <a href="#queue-a-post-load-task">queue a post-load task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-appcache-checking"><a href="#event-appcache-checking">checking</a></code> that is cancelable
|
|
at the <code><a href="#applicationcache">ApplicationCache</a></code> singleton of that <a href="#cache-host">cache
|
|
host</a>. The default action of this event must be, if the user
|
|
agent <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort
|
|
of user interface indicating to the user that the user agent is
|
|
checking for the availability of updates.</li>
|
|
|
|
<li>
|
|
|
|
<p><i>Fetching the manifest</i>: <a href="#fetch">Fetch</a> the resource
|
|
from <var title="">manifest URL</var> with the <i>synchronous
|
|
flag</i> set, and let <var title="">manifest</var> be that
|
|
resource.</p>
|
|
<p>If the resource is labeled with the <a href="#mime-type">MIME type</a>
|
|
<code><a href="#text-cache-manifest">text/cache-manifest</a></code>, parse <var title="">manifest</var> according to the <a href="#parse-a-manifest" title="parse a
|
|
manifest">rules for parsing manifests</a>, obtaining a list of
|
|
<a href="#concept-appcache-explicit" title="concept-appcache-explicit">explicit entries</a>,
|
|
<a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback entries</a>
|
|
and the <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback
|
|
namespaces</a> that map to them, entries for the <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist</a>,
|
|
and a value for the <a href="#concept-appcache-onlinewhitelist-wildcard" title="concept-appcache-onlinewhitelist-wildcard">online whitelist
|
|
wildcard flag</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <i>fetching the manifest</i> fails due to a 404 or 410
|
|
response <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or
|
|
equivalent</a>, then run these substeps:</p>
|
|
|
|
<ol><li><p>Mark <var title="">cache group</var> as <a href="#concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</a>. This <var title="">cache group</var> no longer exists for any purpose other
|
|
than the processing of <code><a href="#document">Document</a></code> objects already
|
|
associated with an <a href="#application-cache">application cache</a> in the <var title="">cache group</var>.</li>
|
|
|
|
<li><p>Let <var title="">task list</var> be an empty list of
|
|
<a href="#concept-task" title="concept-task">tasks</a>.</p>
|
|
|
|
<li><p>For each <a href="#cache-host">cache host</a> associated with an
|
|
<a href="#application-cache">application cache</a> in <var title="">cache
|
|
group</var>, create a <a href="#concept-task" title="concept-task">task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-appcache-obsolete"><a href="#event-appcache-obsolete">obsolete</a></code> that is
|
|
cancelable at the <code><a href="#applicationcache">ApplicationCache</a></code> singleton of the
|
|
<a href="#cache-host">cache host</a>, and append it to <var title="">task
|
|
list</var>. The default action of these events must be, if the
|
|
user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of
|
|
some sort of user interface indicating to the user that the
|
|
application is no longer available for offline use.</li>
|
|
|
|
<li><p>For each entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>, create a <a href="#concept-task" title="concept-task">task</a>
|
|
to <a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named
|
|
<code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> (not <code title="event-appcache-obsolete"><a href="#event-appcache-obsolete">obsolete</a></code>!) at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a> the <code><a href="#document">Document</a></code> for this entry, if there
|
|
still is one, and append it to <var title="">task list</var>. The
|
|
default action of this event must be, if the user agent
|
|
<a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
|
|
user interface indicating to the user that the user agent failed
|
|
to save the application for offline use.</li>
|
|
|
|
<li><p>If <var title="">cache group</var> has an
|
|
<a href="#application-cache">application cache</a> whose <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> is
|
|
<i>incomplete</i>, then discard that <a href="#application-cache">application
|
|
cache</a>.</p>
|
|
|
|
<li><p>If appropriate, remove any user interface indicating that
|
|
an update for this cache is in progress.</li>
|
|
|
|
<li><p>Let the <a href="#concept-appcache-status" title="concept-appcache-status">status</a> of <var title="">cache group</var> be <i>idle</i>.</li>
|
|
|
|
<li><p>For each <a href="#concept-task" title="concept-task">task</a> in <var title="">task list</var>, <a href="#queue-a-post-load-task" title="queue a post-load
|
|
task">queue that task as a post-load task</a>.</li>
|
|
|
|
<li><p>Abort the <a href="#application-cache-download-process">application cache download
|
|
process</a>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, if <i>fetching the manifest</i> fails in some other
|
|
way (e.g. the server returns another 4xx or 5xx response <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a>, or
|
|
there is a DNS error, or the connection times out, or the user
|
|
cancels the download, or the parser for manifests fails when
|
|
checking the magic signature), or if the server returned a
|
|
redirect, or if the resource is labeled with a <a href="#mime-type">MIME
|
|
type</a> other than <code><a href="#text-cache-manifest">text/cache-manifest</a></code>, then run
|
|
the <a href="#cache-failure-steps">cache failure steps</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If this is an <a href="#concept-appcache-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 the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a>
|
|
<a href="#application-cache">application cache</a> in <var title="">cache group</var>,
|
|
or the server reported it as "304 Not Modified" <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a>, then
|
|
run these substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">cache</var> be the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a> <a href="#application-cache">application
|
|
cache</a> in <var title="">cache group</var>.</li>
|
|
|
|
<li><p>Let <var title="">task list</var> be an empty list of
|
|
<a href="#concept-task" title="concept-task">tasks</a>.</p>
|
|
|
|
<li>
|
|
|
|
<p>For each entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>, wait for the resource for this entry to have
|
|
either completely downloaded or failed.</p>
|
|
|
|
<p>If the download failed (e.g. the connection times out, or the
|
|
user cancels the download), then create a <a href="#concept-task" title="concept-task">task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a> the <code><a href="#document">Document</a></code> for this entry, if there
|
|
still is one, and append it to <var title="">task list</var>. The
|
|
default action of this event must be, if the user agent
|
|
<a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
|
|
user interface indicating to the user that the user agent failed
|
|
to save the application for offline use.</p>
|
|
|
|
<p>Otherwise, associate the <code><a href="#document">Document</a></code> for this entry
|
|
with <var title="">cache</var>; store the resource for this
|
|
entry in <var title="">cache</var>, if it isn't already there,
|
|
and categorize its entry as a <a href="#concept-appcache-master" title="concept-appcache-master">master entry</a>. If the
|
|
resource's <a href="#url">URL</a> has a <a href="#url-fragment" title="url-fragment"><fragment></a> component, it must
|
|
be removed from the entry in <var title="">cache</var>
|
|
(application caches never include fragment identifiers).</p>
|
|
|
|
<p class="note">HTTP caching rules, such as <code title="">Cache-Control: no-store</code>, are ignored for the
|
|
purposes of the <a href="#application-cache-download-process">application cache download
|
|
process</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>For each <a href="#cache-host">cache host</a> associated with an
|
|
<a href="#application-cache">application cache</a> in <var title="">cache
|
|
group</var>, create a <a href="#concept-task" title="concept-task">task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named <code title="event-appcache-noupdate"><a href="#event-appcache-noupdate">noupdate</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a>, and append it to <var title="">task list</var>. The
|
|
default action of these events must be, if the user agent
|
|
<a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
|
|
user interface indicating to the user that the application is up
|
|
to date.</li>
|
|
|
|
<li><p>Empty <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>.</li>
|
|
|
|
<li><p>If appropriate, remove any user interface indicating that
|
|
an update for this cache is in progress.</li>
|
|
|
|
<li><p>Let the <a href="#concept-appcache-status" title="concept-appcache-status">status</a> of <var title="">cache group</var> be <i>idle</i>.</li>
|
|
|
|
<li><p>For each <a href="#concept-task" title="concept-task">task</a> in <var title="">task list</var>, <a href="#queue-a-post-load-task" title="queue a post-load
|
|
task">queue that task as a post-load task</a>.</li>
|
|
|
|
<li><p>Abort the <a href="#application-cache-download-process">application cache download
|
|
process</a>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Let <var title="">new cache</var> be a newly created
|
|
<a href="#application-cache">application cache</a> in <var title="">cache
|
|
group</var>. Set its <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> to
|
|
<i>incomplete</i>.</li>
|
|
|
|
<li><p>For each entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>, associate the <code><a href="#document">Document</a></code> for this entry
|
|
with <var title="">new cache</var>.</li>
|
|
|
|
<li><p>Set the <a href="#concept-appcache-status" title="concept-appcache-status">status</a>
|
|
of <var title="">cache group</var> to <i>downloading</i>.</li>
|
|
|
|
<li><p>For each <a href="#cache-host">cache host</a> associated with an
|
|
<a href="#application-cache">application cache</a> in <var title="">cache group</var>,
|
|
<a href="#queue-a-post-load-task">queue a post-load task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that is cancelable named <code title="event-appcache-downloading"><a href="#event-appcache-downloading">downloading</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a>. The default action of these events must be, if the
|
|
user agent <a href="#shows-caching-progress">shows caching progress</a>, the display of some
|
|
sort of user interface indicating to the user that a new version is
|
|
being downloaded.</li>
|
|
|
|
<li><p>Let <var title="">file list</var> be an empty list of
|
|
URLs with flags.</li>
|
|
|
|
<li><p>Add all the URLs in the list of <a href="#concept-appcache-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".</li>
|
|
|
|
<li><p>Add all the URLs in the list of <a href="#concept-appcache-fallback" 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".</li>
|
|
|
|
<li><p>If this is an <a href="#concept-appcache-upgrade" title="concept-appcache-upgrade">upgrade
|
|
attempt</a>, then add all the URLs of <a href="#concept-appcache-master" title="concept-appcache-master">master entries</a> in the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a> <a href="#application-cache">application
|
|
cache</a> in <var title="">cache group</var> whose <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> is
|
|
<i>complete</i> to <var title="">file list</var>, each flagged with
|
|
"master entry".</li>
|
|
|
|
<li><p>If any URL is in <var title="">file list</var> more than
|
|
once, then merge the entries into one entry for that URL, that
|
|
entry having all the flags that the original entries had.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each URL in <var title="">file list</var>, run the
|
|
following steps. These steps may be run in parallel for two or
|
|
more of the URLs at a time.</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the resource URL being processed was flagged as neither an
|
|
"explicit entry" nor or a "fallback entry", then the user agent
|
|
may skip this URL.</p>
|
|
|
|
<p class="note">This is intended to allow user agents to expire
|
|
resources not listed in the manifest from the cache. Generally,
|
|
implementors are urged to use an approach that expires
|
|
lesser-used resources first.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>For each <a href="#cache-host">cache host</a> associated with an
|
|
<a href="#application-cache">application cache</a> in <var title="">cache
|
|
group</var>, <a href="#queue-a-post-load-task">queue a post-load task</a> to fire an event
|
|
with the name <code title="event-appcache-progress"><a href="#event-appcache-progress">progress</a></code>, which does not
|
|
bubble, which is cancelable, and which uses the
|
|
<code>ProgressEvent</code> interface, at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a>. The <code title="dom-ProgressEvents-lengthComputable">lengthComputable</code>
|
|
attribute must be set to true, the <code title="dom-ProgressEvents-total">total</code> attribute must be
|
|
set to the number of files in <var title="">file list</var>, and
|
|
the <code title="dom-ProgressEvents-loaded">loaded</code>
|
|
attribute must be set to the number of number of files in <var title="">file list</var> that have been either downloaded or
|
|
skipped so far. The default action of these events must be, if
|
|
the user agent <a href="#shows-caching-progress">shows caching progress</a>, the display
|
|
of some sort of user interface indicating to the user that a file
|
|
is being downloaded in preparation for updating the
|
|
application. <a href="#refsPROGRESS">[PROGRESS]</a></li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#fetch">Fetch</a> the resource, from the <a href="#origin">origin</a>
|
|
of the <a href="#url">URL</a> <var title="">manifest URL</var>, with
|
|
the <i>synchronous flag</i> set and the <i>manual redirect
|
|
flag</i> set. If this is an <a href="#concept-appcache-upgrade" title="concept-appcache-upgrade">upgrade attempt</a>, then
|
|
use the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a>
|
|
<a href="#application-cache">application cache</a> in <var title="">cache
|
|
group</var> as an HTTP cache, and honor 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.</p>
|
|
|
|
<p class="note">If the resource in question is already being
|
|
downloaded for other reasons then the existing download process
|
|
can sometimes be used for the purposes of this step, as defined
|
|
by the <a href="#fetch" title="fetch">fetching</a> algorithm.</p>
|
|
|
|
<p class="example">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 <code><a href="#the-img-element">img</a></code> element on the page, as well as
|
|
being listed in the cache manifest. According to the rules for
|
|
<a href="#fetch" title="fetch">fetching</a> that image only need be
|
|
downloaded once, and it can be used both for the cache and for
|
|
the rendered Web page.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the previous step fails (e.g. the server returns a 4xx or
|
|
5xx response <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or
|
|
equivalent</a>, or there is a DNS error, or the connection
|
|
times out, or the user cancels the download), or if the server
|
|
returned a redirect, then run the first appropriate step from
|
|
the following list:</p>
|
|
|
|
<dl class="switch"><dt>If the URL being processed was flagged as an "explicit
|
|
entry" or a "fallback entry"</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Run the <a href="#cache-failure-steps">cache failure steps</a>.</p>
|
|
|
|
<p class="note">Redirects are fatal because they are either
|
|
indicative of a network problem (e.g. a captive portal); or
|
|
would allow resources to be added to the cache under URLs that
|
|
differ from any URL that the networking model will allow
|
|
access to, leaving orphan entries; or would allow resources to
|
|
be stored under URLs different than their true URLs. All of
|
|
these situations are bad.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the error was a 404 or 410 HTTP response <a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Skip this resource. It is dropped from the cache.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Copy the resource and its metadata from the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a> <a href="#application-cache">application
|
|
cache</a> in <var title="">cache group</var> whose <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a>
|
|
is <i>complete</i>, and act as if that was the fetched
|
|
resource, ignoring the resource obtained from the network.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>User agents may warn the user of these errors as an aid to
|
|
development.</p>
|
|
|
|
<p class="note">These rules make errors for resources listed in
|
|
the manifest fatal, while making it possible for other resources
|
|
to be removed from caches when they are removed from the server,
|
|
without errors, and making non-manifest resources survive
|
|
server-side errors.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, the fetching succeeded. Store the resource in
|
|
the <var title="">new cache</var>.</p>
|
|
|
|
<p>If the user agent is not able to store the resource (e.g.
|
|
because of quota restrictions), the user agent may prompt the
|
|
user or try to resolve the problem in some other manner (e.g.
|
|
automatically pruning content in other caches). If the problem
|
|
cannot be resolved, the user agent must run the <a href="#cache-failure-steps">cache
|
|
failure steps</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the URL being processed was flagged as an "explicit
|
|
entry" in <var title="">file list</var>, then categorize the
|
|
entry as an <a href="#concept-appcache-explicit" title="concept-appcache-explicit">explicit
|
|
entry</a>.</li>
|
|
|
|
<li><p>If the URL being processed was flagged as a "fallback
|
|
entry" in <var title="">file list</var>, then categorize the
|
|
entry as a <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback
|
|
entry</a>.</li>
|
|
|
|
<li><p>If the URL being processed was flagged as an "master
|
|
entry" in <var title="">file list</var>, then categorize the
|
|
entry as a <a href="#concept-appcache-master" title="concept-appcache-master">master
|
|
entry</a>.</li>
|
|
|
|
<li><p>As an optimization, if the resource is an HTML or XML file
|
|
whose root element is an <code><a href="#the-html-element">html</a></code> element with a <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attribute whose value
|
|
doesn't match the manifest URL of the application cache being
|
|
processed, then the user agent should mark the entry as being
|
|
<a href="#concept-appcache-foreign" title="concept-appcache-foreign">foreign</a>.</p>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>For each <a href="#cache-host">cache host</a> associated with an
|
|
<a href="#application-cache">application cache</a> in <var title="">cache group</var>,
|
|
<a href="#queue-a-post-load-task">queue a post-load task</a> to fire an event with the name
|
|
<code title="event-appcache-progress"><a href="#event-appcache-progress">progress</a></code>, which does
|
|
not bubble, which is cancelable, and which uses the
|
|
<code>ProgressEvent</code> interface, at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a>. The <code title="dom-ProgressEvents-lengthComputable">lengthComputable</code>
|
|
attribute must be set to true, the <code title="dom-ProgressEvents-total">total</code> and the <code title="dom-ProgressEvents-loaded">loaded</code> attributes must be
|
|
set to the number of number of files in <var title="">file
|
|
list</var>. The default action of these events must be, if the user
|
|
agent <a href="#shows-caching-progress">shows caching progress</a>, the display of some sort
|
|
of user interface indicating to the user that all the files have
|
|
been downloaded. <a href="#refsPROGRESS">[PROGRESS]</a></li>
|
|
|
|
<li><p>Store the list of <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespaces</a>,
|
|
and the URLs of the <a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback entries</a> that they
|
|
map to, in <var title="">new cache</var>.</li>
|
|
|
|
<li><p>Store the URLs that form the new <a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online whitelist</a> in
|
|
<var title="">new cache</var>.</li>
|
|
|
|
<li><p>Store the value of the new <a href="#concept-appcache-onlinewhitelist-wildcard" title="concept-appcache-onlinewhitelist-wildcard">online whitelist
|
|
wildcard flag</a> in <var title="">new cache</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>, wait for the resource for this entry to have
|
|
either completely downloaded or failed.</p>
|
|
|
|
<p>If the download failed (e.g. the connection times out, or the
|
|
user cancels the download), then run these substeps:</p>
|
|
|
|
<ol><li><p>Unassociate the <code><a href="#document">Document</a></code> for this entry from
|
|
<var title="">new cache</var>.</li>
|
|
|
|
<li><p><a href="#queue-a-post-load-task">Queue a post-load task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the
|
|
<code><a href="#document">Document</a></code> for this entry, if there still is one. The
|
|
default action of this event must be, if the user agent
|
|
<a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
|
|
user interface indicating to the user that the user agent failed
|
|
to save the application for offline use.</p>
|
|
|
|
<li>
|
|
|
|
<p>If this is a <a href="#concept-appcache-cache" title="concept-appcache-cache">cache
|
|
attempt</a> and this entry is the last entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>, then run these further substeps:</p>
|
|
|
|
<ol><li><p>Discard <var title="">cache group</var> and its only
|
|
<a href="#application-cache">application cache</a>, <var title="">new
|
|
cache</var>.</p>
|
|
|
|
<li><p>If appropriate, remove any user interface indicating
|
|
that an update for this cache is in progress.</li>
|
|
|
|
<li><p>Abort the <a href="#application-cache-download-process">application cache download
|
|
process</a>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Otherwise, remove this entry from <var title="">cache
|
|
group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list
|
|
of pending master entries</a>.</li>
|
|
|
|
</ol><p>Otherwise, store the resource for this entry in <var title="">new cache</var>, if it isn't already there, and
|
|
categorize its entry as a <a href="#concept-appcache-master" title="concept-appcache-master">master entry</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#fetch">Fetch</a> the resource from <var title="">manifest
|
|
URL</var> again, with the <i>synchronous flag</i> set, and let
|
|
<var title="">second manifest</var> be that resource.</p>
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the previous step failed for any reason, or if the fetching
|
|
attempt involved a redirect, or if <var title="">second
|
|
manifest</var> and <var title="">manifest</var> are not
|
|
byte-for-byte identical, then schedule a rerun of the entire
|
|
algorithm with the same parameters after a short delay, and run
|
|
the <a href="#cache-failure-steps">cache failure steps</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, store <var title="">manifest</var> in <var title="">new cache</var>, if it's not there already, and
|
|
categorize its entry as <a href="#concept-appcache-manifest" title="concept-appcache-manifest">the manifest</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Set the <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> of
|
|
<var title="">new cache</var> to <i>complete</i>.</li>
|
|
|
|
<li><p>Let <var title="">task list</var> be an empty list of <a href="#concept-task" title="concept-task">tasks</a>.</p>
|
|
|
|
<li>
|
|
|
|
<p>If this is a <a href="#concept-appcache-cache" title="concept-appcache-cache">cache
|
|
attempt</a>, then for each <a href="#cache-host">cache host</a> associated
|
|
with an <a href="#application-cache">application cache</a> in <var title="">cache
|
|
group</var>, create a <a href="#concept-task" title="concept-task">task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named <code title="event-appcache-cached"><a href="#event-appcache-cached">cached</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a>, and append it to <var title="">task list</var>. The
|
|
default action of these events must be, if the user agent
|
|
<a href="#shows-caching-progress">shows caching progress</a>, 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>
|
|
|
|
<p>Otherwise, it is an <a href="#concept-appcache-upgrade" title="concept-appcache-upgrade">upgrade attempt</a>. For each
|
|
<a href="#cache-host">cache host</a> associated with an <a href="#application-cache">application
|
|
cache</a> in <var title="">cache group</var>, create a <a href="#concept-task" title="concept-task">task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that is cancelable named <code title="event-appcache-updateready"><a href="#event-appcache-updateready">updateready</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a>, and append it to <var title="">task list</var>. The
|
|
default action of these events must be, if the user agent
|
|
<a href="#shows-caching-progress">shows caching progress</a>, 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>
|
|
|
|
</li>
|
|
|
|
<li><p>If appropriate, remove any user interface indicating that
|
|
an update for this cache is in progress.</li>
|
|
|
|
<li><p>Set the <a href="#concept-appcache-status" title="concept-appcache-status">update
|
|
status</a> of <var title="">cache group</var> to
|
|
<i>idle</i>.</li>
|
|
|
|
<li><p>For each <a href="#concept-task" title="concept-task">task</a> in <var title="">task list</var>, <a href="#queue-a-post-load-task" title="queue a post-load
|
|
task">queue that task as a post-load task</a>.</li>
|
|
|
|
</ol><p>The <dfn id="cache-failure-steps">cache failure steps</dfn> are as follows:</p>
|
|
|
|
<ol><li><p>Let <var title="">task list</var> be an empty list of <a href="#concept-task" title="concept-task">tasks</a>.</p>
|
|
|
|
<li>
|
|
|
|
<p>For each entry in <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>, run the following further substeps. These steps
|
|
may be run in parallel for two or more entries at a time.</p>
|
|
|
|
<ol><li><p>Wait for the resource for this entry to have either
|
|
completely downloaded or failed.</p>
|
|
|
|
<li><p>Unassociate the <code><a href="#document">Document</a></code> for this entry from
|
|
its <a href="#application-cache">application cache</a>, if it has one.</li>
|
|
|
|
<li><p>Create a <a href="#concept-task" title="concept-task">task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the
|
|
<code><a href="#document">Document</a></code> for this entry, if there still is one, and
|
|
append it to <var title="">task list</var>. The default action of
|
|
these events must be, if the user agent <a href="#shows-caching-progress">shows caching
|
|
progress</a>, the display of some sort of user interface
|
|
indicating to the user that the user agent failed to save the
|
|
application for offline use.</p>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>For each <a href="#cache-host">cache host</a> still associated with an
|
|
<a href="#application-cache">application cache</a> in <var title="">cache group</var>,
|
|
create a <a href="#concept-task" title="concept-task">task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> that is cancelable named <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code> at the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> singleton of the <a href="#cache-host">cache
|
|
host</a>, and append it to <var title="">task list</var>. The
|
|
default action of these events must be, if the user agent
|
|
<a href="#shows-caching-progress">shows caching progress</a>, the display of some sort of
|
|
user interface indicating to the user that the user agent failed to
|
|
save the application for offline use.</li>
|
|
|
|
<li><p>Empty <var title="">cache group</var>'s <a href="#concept-appcache-pending-masters" title="concept-appcache-pending-masters">list of pending master
|
|
entries</a>.</li>
|
|
|
|
<li><p>If <var title="">cache group</var> has an <a href="#application-cache">application
|
|
cache</a> whose <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> is
|
|
<i>incomplete</i>, then discard that <a href="#application-cache">application
|
|
cache</a>.</p>
|
|
|
|
<li><p>If appropriate, remove any user interface indicating that an
|
|
update for this cache is in progress.</li>
|
|
|
|
<li><p>Let the <a href="#concept-appcache-status" title="concept-appcache-status">status</a>
|
|
of <var title="">cache group</var> be <i>idle</i>.</li>
|
|
|
|
<li><p>If this was a <a href="#concept-appcache-cache" title="concept-appcache-cache">cache
|
|
attempt</a>, discard <var title="">cache group</var>
|
|
altogether.</p>
|
|
|
|
<li><p>For each <a href="#concept-task" title="concept-task">task</a> in <var title="">task list</var>, <a href="#queue-a-post-load-task" title="queue a post-load
|
|
task">queue that task as a post-load task</a>.</li>
|
|
|
|
<li><p>Abort the <a href="#application-cache-download-process">application cache download
|
|
process</a>.</li>
|
|
|
|
</ol><p>Attempts to <a href="#fetch">fetch</a> resources as part of the
|
|
<a href="#application-cache-download-process">application cache download process</a> may be done with
|
|
cache-defeating semantics, to avoid problems with stale or
|
|
inconsistent intermediary caches.</p>
|
|
|
|
<hr><p>User agents may invoke the <a href="#application-cache-download-process">application cache download
|
|
process</a>, in the background, for any <a href="#application-cache">application
|
|
cache</a>, at any time (with no <a href="#cache-host">cache host</a>). This
|
|
allows user agents to keep caches primed and to update caches even
|
|
before the user visits a site.</p>
|
|
|
|
<hr><p>Each <code><a href="#document">Document</a></code> has a list of <dfn id="pending-application-cache-download-process-tasks">pending application
|
|
cache download process tasks</dfn> that is used to delay events
|
|
fired by the algorithm above until the document's <code title="event-load">load</code> event has fired. When the
|
|
<code><a href="#document">Document</a></code> is created, the list must be empty.</p>
|
|
|
|
<p>When the steps above say to <dfn id="queue-a-post-load-task">queue a post-load task</dfn>
|
|
<var title="">task</var>, where <var title="">task</var> is a <a href="#concept-task" title="concept-task">task</a> that dispatches an event on a
|
|
target <code><a href="#applicationcache">ApplicationCache</a></code> object <var title="">target</var>, the user agent must run the appropriate steps
|
|
from the following list:</p>
|
|
|
|
<dl><dt>If <var title="">target</var>'s <code><a href="#document">Document</a></code> is
|
|
<a href="#ready-for-post-load-tasks">ready for post-load tasks</a></dt>
|
|
|
|
<dd><p><a href="#queue-a-task" title="queue a task">Queue</a> the task <var title="">task</var>.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>Add <var title="">task</var> to <var title="">target</var>'s
|
|
<code><a href="#document">Document</a></code>'s list of <a href="#pending-application-cache-download-process-tasks">pending application cache
|
|
download process tasks</a>.</dd>
|
|
|
|
</dl><p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <a href="#networking-task-source">networking task
|
|
source</a>.</p>
|
|
|
|
|
|
|
|
|
|
<h4 id="the-application-cache-selection-algorithm"><span class="secno">5.6.5 </span>The application cache selection algorithm</h4>
|
|
|
|
<p>When the <dfn id="concept-appcache-init" title="concept-appcache-init">application cache
|
|
selection algorithm</dfn> algorithm is invoked with a
|
|
<code><a href="#document">Document</a></code> <var title="">document</var> and optionally a
|
|
manifest <a href="#url">URL</a> <var title="">manifest URL</var>, the user
|
|
agent must run the first applicable set of steps from the following
|
|
list:</p>
|
|
|
|
<dl class="switch"><dt>If there is a <var title="">manifest URL</var>, and <var title="">document</var> was loaded from an <a href="#application-cache">application
|
|
cache</a>, and the URL of the <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a> of that cache's
|
|
<a href="#application-cache-group">application cache group</a> is <em>not</em> the same as
|
|
<var title="">manifest URL</var></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Mark the entry for the resource from which <var title="">document</var> was taken in the <a href="#application-cache">application
|
|
cache</a> from which it was loaded as <a href="#concept-appcache-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="#update-the-session-history-with-the-new-page">update the session history with
|
|
the new page</a> is only ever completed <em>after</em> this
|
|
<a href="#concept-appcache-init" title="concept-appcache-init">application cache selection
|
|
algorithm</a> 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 document's own metadata, to aid in
|
|
application development.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If <var title="">document</var> was loaded from an
|
|
<a href="#application-cache">application cache</a>, and that <a href="#application-cache">application
|
|
cache</a> still exists (it is not now <a href="#concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</a>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Associate <var title="">document</var> with the
|
|
<a href="#application-cache">application cache</a> from which it was loaded. Invoke,
|
|
in the background, the <a href="#application-cache-download-process">application cache download
|
|
process</a> for that <a href="#application-cache">application cache</a>'s
|
|
<a href="#application-cache-group">application cache group</a>, with <var title="">document</var> as the <a href="#cache-host">cache host</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If <var title="">document</var> was loaded using
|
|
HTTP GET <a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or
|
|
equivalent</a>, and, there is a <var title="">manifest
|
|
URL</var>, and <var title="">manifest URL</var> has the <a href="#same-origin">same
|
|
origin</a> as <var title="">document</var></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Invoke, in the background, the <a href="#application-cache-download-process">application cache download
|
|
process</a> for <var title="">manifest URL</var>, with <var title="">document</var> as the <a href="#cache-host">cache host</a> and with
|
|
the resource from which <var title="">document</var> was parsed as
|
|
the <a href="#concept-appcache-master" title="concept-appcache-master">master</a>
|
|
resource.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
<dd>
|
|
|
|
<p>The <code><a href="#document">Document</a></code> is not associated with any
|
|
<a href="#application-cache">application cache</a>.</p>
|
|
|
|
<p>If there was a <var title="">manifest URL</var>, the user agent
|
|
may report to the user that it was ignored, to aid in application
|
|
development.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h4 id="changesToNetworkingModel"><span class="secno">5.6.6 </span>Changes to the networking model</h4>
|
|
|
|
<p>When a <a href="#cache-host">cache host</a> is associated with an
|
|
<a href="#application-cache">application cache</a> whose <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> is
|
|
<i>complete</i>, any and all loads for resources related to that
|
|
<a href="#cache-host">cache host</a> other than those for <a href="#child-browsing-context" title="child
|
|
browsing context">child browsing contexts</a> 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 <a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or
|
|
equivalent</a>, or if its <a href="#url">URL</a> has a different <a href="#url-scheme" title="url-scheme"><scheme></a> component than the
|
|
<a href="#application-cache">application cache</a>'s <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a>, then
|
|
<a href="#fetch">fetch</a> the resource normally and abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the resource's URL is <a href="#concept-appcache-master" title="concept-appcache-master">a master entry</a>, <a href="#concept-appcache-manifest" title="concept-appcache-manifest">the manifest</a>, <a href="#concept-appcache-explicit" title="concept-appcache-explicit">an explicit entry</a>, or
|
|
<a href="#concept-appcache-fallback" title="concept-appcache-fallback">a fallback entry</a> in
|
|
the <a href="#application-cache">application cache</a>, then get the resource from the
|
|
cache (instead of fetching it), and abort these steps.</li>
|
|
|
|
<li><p>If there is an entry in the <a href="#application-cache">application cache</a>'s
|
|
<a href="#concept-appcache-onlinewhitelist" title="concept-appcache-onlinewhitelist">online
|
|
whitelist</a> that has the <a href="#same-origin">same origin</a> as the
|
|
resource's URL and that is a <a href="#prefix-match">prefix match</a> for the
|
|
resource's URL, then <a href="#fetch">fetch</a> the resource normally and
|
|
abort these steps.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the resource's URL has the <a href="#same-origin">same origin</a> as the
|
|
manifest's URL, and there is a <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespace</a>
|
|
<var title="">f</var> in the <a href="#application-cache">application cache</a> that
|
|
is a <a href="#prefix-match">prefix match</a> for the resource's URL, then:</p>
|
|
|
|
<p><a href="#fetch">Fetch</a> the resource normally. If this results in a
|
|
redirect to a resource with another <a href="#origin">origin</a>
|
|
(indicative of a captive portal), or a 4xx or 5xx status code
|
|
<a href="#concept-http-equivalent-codes" title="concept-http-equivalent-codes">or equivalent</a>,
|
|
or if there were network errors (but not if the user canceled the
|
|
download), then instead get, from the cache, the resource of the
|
|
<a href="#concept-appcache-fallback" title="concept-appcache-fallback">fallback entry</a>
|
|
corresponding to the <a href="#concept-appcache-fallback-ns" title="concept-appcache-fallback-ns">fallback namespace</a>
|
|
<var title="">f</var>. Abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the <a href="#application-cache">application cache</a>'s <a href="#concept-appcache-onlinewhitelist-wildcard" title="concept-appcache-onlinewhitelist-wildcard">online whitelist
|
|
wildcard flag</a> is <i title="">open</i>, then
|
|
<a href="#fetch">fetch</a> the resource normally and abort these
|
|
steps.</li>
|
|
|
|
<li><p>Fail the resource load as if there had been a generic
|
|
network error.</li>
|
|
|
|
</ol><p class="note">The above algorithm ensures that so long as the
|
|
<a href="#concept-appcache-onlinewhitelist-wildcard" title="concept-appcache-onlinewhitelist-wildcard">online
|
|
whitelist wildcard flag</a> is <i title="">blocking</i>,
|
|
resources that are not present in the <a href="#concept-appcache-manifest" title="concept-appcache-manifest">manifest</a> will always fail
|
|
to load (at least, after the <a href="#application-cache">application cache</a> has been
|
|
primed the first time), making the testing of offline applications
|
|
simpler.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="expiring-application-caches"><span class="secno">5.6.7 </span>Expiring application caches</h4>
|
|
|
|
<p>As a general rule, user agents should not expire application
|
|
caches, except on request from the user, or after having been left
|
|
unused for an extended period of time.</p>
|
|
|
|
<p>Application caches and cookies have similar implications with
|
|
respect to privacy (e.g. if the site can identify the user when
|
|
providing the cache, it can store data in the cache that can be used
|
|
for cookie resurrection). Implementors are therefore encouraged to
|
|
expose application caches in a manner related to HTTP cookies,
|
|
allowing caches to be expunged together with cookies and other
|
|
origin-specific data.</p>
|
|
|
|
<p class="example">For example, a user agent could have a "delete
|
|
site-specific data" feature that clears all cookies, application
|
|
caches, local storage, databases, etc, from an origin all at
|
|
once.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="disk-space"><span class="secno">5.6.8 </span>Disk space</h4>
|
|
|
|
<p>User agents should consider applying constraints on disk usage of
|
|
<a href="#application-cache" title="application cache">application caches</a>, and care
|
|
should be taken to ensure that the restrictions cannot be easily
|
|
worked around using subdomains.</p>
|
|
|
|
<p>User agents should allow users to see how much space each domain
|
|
is using, and may offer the user the ability to delete specific
|
|
<a href="#application-cache" title="application cache">application caches</a>.</p>
|
|
|
|
<p class="note">How quotas are presented to the user is not defined
|
|
by this specification. User agents are encouraged to provide
|
|
features such as allowing a user to indicate that certain sites are
|
|
trusted to use more than the default quota, e.g. by asynchronously
|
|
presenting a user interface while a cache is being updated, or by
|
|
having an explicit whitelist in the user agent's configuration
|
|
interface.</p>
|
|
|
|
</div><h4 id="application-cache-api"><span class="secno">5.6.9 </span>Application cache API</h4><pre class="idl">interface <dfn id="applicationcache">ApplicationCache</dfn> {
|
|
|
|
// <a href="#concept-appcache-status" title="concept-appcache-status">update status</a>
|
|
const unsigned short <a href="#dom-appcache-uncached" title="dom-appcache-UNCACHED">UNCACHED</a> = 0;
|
|
const unsigned short <a href="#dom-appcache-idle" title="dom-appcache-IDLE">IDLE</a> = 1;
|
|
const unsigned short <a href="#dom-appcache-checking" title="dom-appcache-CHECKING">CHECKING</a> = 2;
|
|
const unsigned short <a href="#dom-appcache-downloading" title="dom-appcache-DOWNLOADING">DOWNLOADING</a> = 3;
|
|
const unsigned short <a href="#dom-appcache-updateready" title="dom-appcache-UPDATEREADY">UPDATEREADY</a> = 4;
|
|
const unsigned short <a href="#dom-appcache-obsolete" title="dom-appcache-OBSOLETE">OBSOLETE</a> = 5;
|
|
readonly attribute unsigned short <a href="#dom-appcache-status" title="dom-appcache-status">status</a>;
|
|
|
|
// updates
|
|
void <a href="#dom-appcache-update" title="dom-appcache-update">update</a>();
|
|
void <a href="#dom-appcache-swapcache" title="dom-appcache-swapCache">swapCache</a>();
|
|
|
|
// events
|
|
attribute <a href="#function">Function</a> <a href="#handler-appcache-onchecking" title="handler-appcache-onchecking">onchecking</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-appcache-onerror" title="handler-appcache-onerror">onerror</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-appcache-onnoupdate" title="handler-appcache-onnoupdate">onnoupdate</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-appcache-ondownloading" title="handler-appcache-ondownloading">ondownloading</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-appcache-onprogress" title="handler-appcache-onprogress">onprogress</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-appcache-onupdateready" title="handler-appcache-onupdateready">onupdateready</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-appcache-oncached" title="handler-appcache-oncached">oncached</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-appcache-onobsolete" title="handler-appcache-onobsolete">onobsolete</a>;
|
|
};
|
|
<a href="#applicationcache">ApplicationCache</a> implements <a href="#eventtarget">EventTarget</a>;</pre><dl class="domintro"><dt><var title="">cache</var> = <var title="">window</var> . <code title="dom-applicationCache"><a href="#dom-applicationcache">applicationCache</a></code></dt>
|
|
<dd>
|
|
|
|
<p>(In a window.) Returns the <code><a href="#applicationcache">ApplicationCache</a></code> object that applies to the <a href="#active-document">active document</a> of that <code><a href="#window">Window</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">cache</var> = <var title="">self</var> . <code title="dom-applicationCache"><a href="#dom-applicationcache">applicationCache</a></code></dt>
|
|
<dd>
|
|
|
|
<p>(In a shared worker.) Returns the <code><a href="#applicationcache">ApplicationCache</a></code> object that applies to the current shared worker.
|
|
|
|
<a href="#refsWEBWORKERS">[WEBWORKERS]</a>
|
|
|
|
</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">cache</var> . <code title="dom-appcache-status"><a href="#dom-appcache-status">status</a></code></dt>
|
|
<dd>
|
|
|
|
<p>Returns the current status of the application cache, as given by the constants defined below.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">cache</var> . <code title="dom-appcache-update"><a href="#dom-appcache-update">update</a></code>()</dt>
|
|
<dd>
|
|
|
|
<p>Invokes the <a href="#application-cache-download-process">application cache download process</a>.</p>
|
|
|
|
<p>Throws an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception if there is no application cache to update.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">cache</var> . <code title="dom-appcache-swapCache"><a href="#dom-appcache-swapcache">swapCache</a></code>()</dt>
|
|
<dd>
|
|
|
|
<p>Switches to the most recent application cache, if there is a
|
|
newer one. If there isn't, throws an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception.</p>
|
|
|
|
<p>This does not cause previously-loaded resources to be reloaded;
|
|
for example, images do not suddenly get reloaded and style sheets
|
|
and scripts do not get reparsed or reevaluated. The only change is
|
|
that subsequent requests for cached resources will obtain the
|
|
newer copies.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>There is a one-to-one mapping from <a href="#cache-host" title="cache host">cache
|
|
hosts</a> to <code><a href="#applicationcache">ApplicationCache</a></code> objects. The <dfn id="dom-applicationcache" 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
|
|
<code><a href="#window">Window</a></code> object's <a href="#active-document">active document</a>. The <dfn id="dom-sharedworkerglobalscope-applicationcache" title="dom-SharedWorkerGlobalScope-applicationCache"><code>applicationCache</code></dfn>
|
|
attribute on <code>SharedWorkerGlobalScope</code> objects must
|
|
return the <code><a href="#applicationcache">ApplicationCache</a></code> object associated with the
|
|
worker.
|
|
|
|
<a href="#refsWEBWORKERS">[WEBWORKERS]</a>
|
|
|
|
</p>
|
|
|
|
<p class="note">A <code><a href="#window">Window</a></code> or
|
|
<code>SharedWorkerGlobalScope</code> object has an associated
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> object even if that <a href="#cache-host">cache
|
|
host</a> has no actual <a href="#application-cache">application cache</a>.</p>
|
|
|
|
<hr><p>The <dfn id="dom-appcache-status" title="dom-appcache-status"><code>status</code></dfn>
|
|
attribute, on getting, must return the current state of the
|
|
<a href="#application-cache">application cache</a> that the
|
|
<code><a href="#applicationcache">ApplicationCache</a></code> object's <a href="#cache-host">cache host</a> is
|
|
associated with, if any. This must be the appropriate value from the
|
|
following list:</p>
|
|
|
|
</div><dl><dt><dfn id="dom-appcache-uncached" title="dom-appcache-UNCACHED"><code>UNCACHED</code></dfn>
|
|
(numeric value 0)</dt>
|
|
|
|
<dd><p>The <code><a href="#applicationcache">ApplicationCache</a></code> object's <a href="#cache-host">cache
|
|
host</a> is not associated with an <a href="#application-cache">application
|
|
cache</a> at this time.</dd>
|
|
|
|
<dt><dfn id="dom-appcache-idle" title="dom-appcache-IDLE"><code>IDLE</code></dfn>
|
|
(numeric value 1)</dt>
|
|
|
|
<dd><p>The <code><a href="#applicationcache">ApplicationCache</a></code> object's <a href="#cache-host">cache
|
|
host</a> is associated with an <a href="#application-cache">application cache</a>
|
|
whose <a href="#application-cache-group">application cache group</a>'s <a href="#concept-appcache-status" title="concept-appcache-status">update status</a> is
|
|
<i>idle</i>, and that <a href="#application-cache">application cache</a> is the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a> cache in its
|
|
<a href="#application-cache-group">application cache group</a>, and the <a href="#application-cache-group">application
|
|
cache group</a> is not marked as <a href="#concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</a>.</dd>
|
|
|
|
<dt><dfn id="dom-appcache-checking" title="dom-appcache-CHECKING"><code>CHECKING</code></dfn>
|
|
(numeric value 2)</dt>
|
|
|
|
<dd><p>The <code><a href="#applicationcache">ApplicationCache</a></code> object's <a href="#cache-host">cache
|
|
host</a> is associated with an <a href="#application-cache">application cache</a>
|
|
whose <a href="#application-cache-group">application cache group</a>'s <a href="#concept-appcache-status" title="concept-appcache-status">update status</a> is
|
|
<i>checking</i>.</dd>
|
|
|
|
<dt><dfn id="dom-appcache-downloading" title="dom-appcache-DOWNLOADING"><code>DOWNLOADING</code></dfn>
|
|
(numeric value 3)</dt>
|
|
|
|
<dd><p>The <code><a href="#applicationcache">ApplicationCache</a></code> object's <a href="#cache-host">cache
|
|
host</a> is associated with an <a href="#application-cache">application cache</a>
|
|
whose <a href="#application-cache-group">application cache group</a>'s <a href="#concept-appcache-status" title="concept-appcache-status">update status</a> is
|
|
<i>downloading</i>.</dd>
|
|
|
|
<dt><dfn id="dom-appcache-updateready" title="dom-appcache-UPDATEREADY"><code>UPDATEREADY</code></dfn>
|
|
(numeric value 4)</dt>
|
|
|
|
<dd><p>The <code><a href="#applicationcache">ApplicationCache</a></code> object's <a href="#cache-host">cache
|
|
host</a> is associated with an <a href="#application-cache">application cache</a>
|
|
whose <a href="#application-cache-group">application cache group</a>'s <a href="#concept-appcache-status" title="concept-appcache-status">update status</a> is
|
|
<i>idle</i>, and whose <a href="#application-cache-group">application cache group</a> is not
|
|
marked as <a href="#concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</a>,
|
|
but that <a href="#application-cache">application cache</a> is <em>not</em> the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a> cache in its
|
|
group.</dd>
|
|
|
|
<dt><dfn id="dom-appcache-obsolete" title="dom-appcache-OBSOLETE"><code>OBSOLETE</code></dfn>
|
|
(numeric value 5)</dt>
|
|
|
|
<dd><p>The <code><a href="#applicationcache">ApplicationCache</a></code> object's <a href="#cache-host">cache
|
|
host</a> is associated with an <a href="#application-cache">application cache</a>
|
|
whose <a href="#application-cache-group">application cache group</a> is marked as <a href="#concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</a>.</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<hr><p>If the <dfn id="dom-appcache-update" title="dom-appcache-update"><code>update()</code></dfn> method is
|
|
invoked, the user agent must invoke the <a href="#application-cache-download-process">application cache
|
|
download process</a>, in the background, for the <a href="#application-cache">application
|
|
cache</a> with which the <code><a href="#applicationcache">ApplicationCache</a></code> object's
|
|
<a href="#cache-host">cache host</a> is associated, but without giving that
|
|
<a href="#cache-host">cache host</a> to the algorithm. If there is no such
|
|
<a href="#application-cache">application cache</a>, or if it is marked as <a href="#concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</a>, then the method
|
|
must raise an <code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception instead.</p>
|
|
|
|
<p>If the <dfn id="dom-appcache-swapcache" title="dom-appcache-swapCache"><code>swapCache()</code></dfn> method
|
|
is invoked, the user agent must run the following steps:
|
|
|
|
<ol><li><p>Check that <code><a href="#applicationcache">ApplicationCache</a></code> object's
|
|
<a href="#cache-host">cache host</a> is associated with an <a href="#application-cache">application
|
|
cache</a>. If it is not, then raise an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li><p>Let <var title="">cache</var> be the <a href="#application-cache">application
|
|
cache</a> with which the <code><a href="#applicationcache">ApplicationCache</a></code> object's
|
|
<a href="#cache-host">cache host</a> is associated. (By definition, this is the
|
|
same as the one that was found in the previous step.)</li>
|
|
|
|
<li><p>If <var title="">cache</var>'s <a href="#application-cache-group">application cache
|
|
group</a> is marked as <a href="#concept-appcache-obsolete" title="concept-appcache-obsolete">obsolete</a>, then unassociate
|
|
the <code><a href="#applicationcache">ApplicationCache</a></code> object's <a href="#cache-host">cache host</a>
|
|
from <var title="">cache</var> and abort these steps. (Resources
|
|
will now load from the network instead of the cache.)</li>
|
|
|
|
<li><p>Check that there is an application cache in the same
|
|
<a href="#application-cache-group">application cache group</a> as <var title="">cache</var>
|
|
whose <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness
|
|
flag</a> is <i>complete</i> and that is <a href="#concept-appcache-newer" title="concept-appcache-newer">newer</a> than <var title="">cache</var>. If there is not, then raise an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li><p>Let <var title="">new cache</var> be the <a href="#concept-appcache-newer" title="concept-appcache-newer">newest</a> <a href="#application-cache">application
|
|
cache</a> in the same <a href="#application-cache-group">application cache group</a> as
|
|
<var title="">cache</var> whose <a href="#concept-appcache-completeness" title="concept-appcache-completeness">completeness flag</a> is
|
|
<i>complete</i>.</li>
|
|
|
|
<li><p>Unassociate the <code><a href="#applicationcache">ApplicationCache</a></code> object's
|
|
<a href="#cache-host">cache host</a> from <var title="">cache</var> and instead
|
|
associate it with <var title="">new cache</var>.</li>
|
|
|
|
</ol><p>The following are the <a href="#event-handlers">event handlers</a> (and their
|
|
corresponding <a href="#event-handler-event-type" title="event handler event type">event handler
|
|
event types</a>) that must be supported, as IDL attributes, by
|
|
all objects implementing the <code><a href="#applicationcache">ApplicationCache</a></code>
|
|
interface:</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-appcache-onchecking" title="handler-appcache-onchecking"><code>onchecking</code></dfn> <td> <code title="event-appcache-checking"><a href="#event-appcache-checking">checking</a></code>
|
|
<tr><td><dfn id="handler-appcache-onerror" title="handler-appcache-onerror"><code>onerror</code></dfn> <td> <code title="event-appcache-error"><a href="#event-appcache-error">error</a></code>
|
|
<tr><td><dfn id="handler-appcache-onnoupdate" title="handler-appcache-onnoupdate"><code>onnoupdate</code></dfn> <td> <code title="event-appcache-noupdate"><a href="#event-appcache-noupdate">noupdate</a></code>
|
|
<tr><td><dfn id="handler-appcache-ondownloading" title="handler-appcache-ondownloading"><code>ondownloading</code></dfn> <td> <code title="event-appcache-downloading"><a href="#event-appcache-downloading">downloading</a></code>
|
|
<tr><td><dfn id="handler-appcache-onprogress" title="handler-appcache-onprogress"><code>onprogress</code></dfn> <td> <code title="event-appcache-progress"><a href="#event-appcache-progress">progress</a></code>
|
|
<tr><td><dfn id="handler-appcache-onupdateready" title="handler-appcache-onupdateready"><code>onupdateready</code></dfn> <td> <code title="event-appcache-updateready"><a href="#event-appcache-updateready">updateready</a></code>
|
|
<tr><td><dfn id="handler-appcache-oncached" title="handler-appcache-oncached"><code>oncached</code></dfn> <td> <code title="event-appcache-cached"><a href="#event-appcache-cached">cached</a></code>
|
|
<tr><td><dfn id="handler-appcache-onobsolete" title="handler-appcache-onobsolete"><code>onobsolete</code></dfn> <td> <code title="event-appcache-obsolete"><a href="#event-appcache-obsolete">obsolete</a></code>
|
|
</table></div><h4 id="browser-state"><span class="secno">5.6.10 </span>Browser state</h4><pre class="idl">[Supplemental, NoInterfaceObject]
|
|
interface <dfn id="navigatoronline">NavigatorOnLine</dfn> {
|
|
readonly attribute boolean <a href="#dom-navigator-online" title="dom-navigator-onLine">onLine</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-onLine"><a href="#dom-navigator-online">onLine</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns false if the user agent is definitely offline
|
|
(disconnected from the network). Returns true if the user agent
|
|
might be online.</p>
|
|
|
|
<p>The events <code title="event-online"><a href="#event-online">online</a></code> and <code title="event-offline"><a href="#event-offline">offline</a></code> are fired when the value of
|
|
this attribute changes.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-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="#dom-navigator-online">navigator.onLine</a></code> attribute of a
|
|
<code><a href="#window">Window</a></code> or <code>WorkerGlobalScope</code> changes from
|
|
true to false, the user agent must <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <dfn id="event-offline" title="event-offline"><code>offline</code></dfn> at the
|
|
<code><a href="#window">Window</a></code> or <code>WorkerGlobalScope</code> object.</p>
|
|
|
|
<p>On the other hand, when the value that would be returned by the
|
|
<code title="dom-navigator-onLine"><a href="#dom-navigator-online">navigator.onLine</a></code> attribute
|
|
of a <code><a href="#window">Window</a></code> or <code>WorkerGlobalScope</code> changes
|
|
from false to true, the user agent must <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <dfn id="event-online" title="event-online"><code>online</code></dfn> at the
|
|
<code><a href="#window">Window</a></code> or <code>WorkerGlobalScope</code> object.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <a href="#networking-task-source">networking task
|
|
source</a>.</p>
|
|
|
|
</div><p class="note">This attribute is inherently unreliable. A computer
|
|
can be connected to a network without having Internet access.<div class="example">
|
|
|
|
<p>In this example, an indicator is updated as the browser goes
|
|
online and offline.</p>
|
|
|
|
<pre><!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Online status</title>
|
|
<script>
|
|
function updateIndicator() {
|
|
document.getElementById('indicator').textContext = navigator.onLine ? 'online' : 'offline';
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="updateIndicator()" ononline="updateIndicator()" onoffline="updateIndicator()">
|
|
<p>The network is: <span id="indicator">(state unknown)</span>
|
|
</body>
|
|
</html></pre>
|
|
|
|
</div><h2 id="webappapis"><span class="secno">6 </span>Web application APIs</h2><h3 id="scripting"><span class="secno">6.1 </span>Scripting</h3><h4 id="introduction-5"><span class="secno">6.1.1 </span>Introduction</h4><p>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:<ul><li>Processing of <code><a href="#the-script-element">script</a></code> elements.</li>
|
|
|
|
<li>Processing of inline <code title="javascript
|
|
protocol"><a href="#javascript-protocol">javascript:</a></code> URLs (e.g. the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute of <code><a href="#the-img-element">img</a></code>
|
|
elements, or an <code title="">@import</code> rule in a CSS
|
|
<code><a href="#the-style-element">style</a></code> element block).</li>
|
|
|
|
<li>Event handlers, whether registered through the DOM using <code title="">addEventListener()</code>, by explicit <a href="#event-handler-content-attributes">event handler
|
|
content attributes</a>, by <a href="#event-handler-idl-attributes">event handler IDL
|
|
attributes</a>, or otherwise.</li>
|
|
|
|
<li>Processing of technologies like XBL or SVG that have their own
|
|
scripting features.</li>
|
|
|
|
</ul><div class="impl">
|
|
|
|
<h4 id="enabling-and-disabling-scripting"><span class="secno">6.1.2 </span>Enabling and disabling scripting</h4>
|
|
|
|
<p><dfn id="concept-bc-script" title="concept-bc-script">Scripting is enabled</dfn> in a
|
|
<em><a href="#browsing-context">browsing context</a></em> when all of the
|
|
following conditions are true:</p>
|
|
|
|
<ul><li>The user agent supports scripting.</li>
|
|
|
|
<li>The user has not disabled scripting for this <a href="#browsing-context">browsing
|
|
context</a> at this time. (User agents may provide users with
|
|
the option to disable scripting globally, or in a finer-grained
|
|
manner, e.g. on a per-origin basis.)</li>
|
|
|
|
<li id="sandboxScriptBlocked">The <a href="#browsing-context">browsing context</a> did
|
|
not have the <a href="#sandboxed-scripts-browsing-context-flag">sandboxed scripts browsing context flag</a>
|
|
set when the <a href="#browsing-context">browsing context</a>'s <a href="#active-document">active
|
|
document</a> was created.</li>
|
|
|
|
</ul><p><dfn id="concept-bc-noscript" title="concept-bc-noscript">Scripting is disabled</dfn> in a
|
|
<a href="#browsing-context">browsing context</a> when any of the above conditions are
|
|
false (i.e. when scripting is not <a href="#concept-bc-script" title="concept-bc-script">enabled</a>).</p>
|
|
|
|
<hr><p><dfn id="concept-n-script" title="concept-n-script">Scripting is enabled</dfn> for a
|
|
<em>node</em> if the <code><a href="#document">Document</a></code> object of the node (the
|
|
node itself, if it is itself a <code><a href="#document">Document</a></code> object) has an
|
|
associated <a href="#browsing-context">browsing context</a>, and <a href="#concept-bc-script" title="concept-bc-script">scripting is enabled</a> in that
|
|
<a href="#browsing-context">browsing context</a>.</p>
|
|
|
|
<p><dfn id="concept-n-noscript" title="concept-n-noscript">Scripting is disabled</dfn> for a
|
|
node if there is no such <a href="#browsing-context">browsing context</a>, or if <a href="#concept-bc-noscript" title="concept-bc-noscript">scripting is disabled</a> in that
|
|
<a href="#browsing-context">browsing context</a>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
|
|
<h4 id="processing-model-1"><span class="secno">6.1.3 </span>Processing model</h4>
|
|
|
|
<h5 id="definitions-0"><span class="secno">6.1.3.1 </span>Definitions</h5>
|
|
|
|
<p>A <dfn id="concept-script" title="concept-script">script</dfn> has:</p>
|
|
|
|
<dl><dt>A <dfn id="script-execution-environment">script execution environment</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The characteristics of the script execution environment depend
|
|
on the language, and are not defined by this specification.</p>
|
|
|
|
<p class="example">In JavaScript, the script execution environment
|
|
consists of the interpreter, the stack of <i>execution
|
|
contexts</i>, the <i>global code</i> and <i>function code</i> and
|
|
the Function objects resulting, and so forth.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A <dfn id="list-of-code-entry-points">list of code entry-points</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Each code entry-point represents a block of executable code
|
|
that the script exposes to other scripts and to the user
|
|
agent.</p>
|
|
|
|
<p class="example">Each Function object in a JavaScript
|
|
<a href="#script-execution-environment">script execution environment</a> has a corresponding code
|
|
entry-point, for instance.</p>
|
|
|
|
<p>The main program code of the script, if any, is the
|
|
<dfn id="initial-code-entry-point"><i>initial code entry-point</i></dfn>. Typically, the code
|
|
corresponding to this entry-point is executed immediately after
|
|
the script is parsed.</p>
|
|
|
|
<p class="example">In JavaScript, this corresponds to the
|
|
execution context of the global code.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A relationship with the <dfn id="script-s-global-object">script's global object</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>An object that provides the APIs that the code can use.</p>
|
|
|
|
<p class="example">This is typically a <code><a href="#window">Window</a></code>
|
|
object. In JavaScript, this corresponds to the <i>global
|
|
object</i>.</p>
|
|
|
|
<p class="note">When a <a href="#script-s-global-object">script's global object</a> is an
|
|
empty object, it can't do anything that interacts with the
|
|
environment.</p>
|
|
|
|
<p>If the <a href="#script-s-global-object">script's global object</a> is a
|
|
<code><a href="#window">Window</a></code> object, then in JavaScript, the ThisBinding of
|
|
the global execution context for this script must be the
|
|
<code><a href="#window">Window</a></code> object's <code><a href="#windowproxy">WindowProxy</a></code> object,
|
|
rather than the global object. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
<p class="note">This is a <a href="#willful-violation">willful violation</a> of the
|
|
JavaScript specification current at the time of writing
|
|
(ECMAScript edition 5, as defined in section 10.4.1.1 Initial
|
|
Global Execution Context, step 3). The JavaScript specification
|
|
requires that the <code title="">this</code> keyword in the global
|
|
scope return the global object, but this is not compatible with
|
|
the security design prevalent in implementations as specified
|
|
herein. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt>A relationship with the <dfn id="script-s-browsing-context">script's browsing context</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>A <a href="#browsing-context">browsing context</a> that is assigned responsibility
|
|
for actions taken by the script.</p>
|
|
|
|
<p class="example">When a script creates and <a href="#navigate" title="navigate">navigates</a> a new <a href="#top-level-browsing-context">top-level browsing
|
|
context</a>, the <code title="dom-opener"><a href="#dom-opener">opener</a></code>
|
|
attribute of the new <a href="#browsing-context">browsing context</a>'s
|
|
<code><a href="#window">Window</a></code> object will be set to the <a href="#script-s-browsing-context">script's
|
|
browsing context</a>'s <code><a href="#windowproxy">WindowProxy</a></code> object.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A relationship with the <dfn id="script-s-document">script's document</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>A <code><a href="#document">Document</a></code> that is assigned responsibility for
|
|
actions taken by the script.</p>
|
|
|
|
<p class="example">When a script <a href="#fetch" title="fetch">fetches</a> a resource, the <a href="#the-document-s-current-address" title="the
|
|
document's current address">current address</a> of the
|
|
<a href="#script-s-document">script's document</a> will be used to set the <code title="http-referer">Referer</code> (sic) header.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A <dfn id="script-s-url-character-encoding" title="script's URL character encoding">URL character encoding</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>A character encoding, set when the script is created, used to
|
|
encode URLs. <span id="sce-not-copy" title="">If the character
|
|
encoding is set from another source, e.g. a <a href="#document-s-character-encoding">document's
|
|
character encoding</a>, then the <a href="#script-s-url-character-encoding">script's URL character
|
|
encoding</a> must follow the source, so that if the source's
|
|
changes, so does the script's.</span></p>
|
|
|
|
</dd>
|
|
|
|
<dt>A <dfn id="script-s-base-url" title="script's base URL">base URL</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>A <a href="#url">URL</a>, set when the script is created, used to
|
|
resolve relative URLs. <span id="sbu-not-copy" title="">If the
|
|
base URL is set from another source, e.g. a <a href="#document-base-url">document base
|
|
URL</a>, then the <a href="#script-s-base-url">script's base URL</a> must follow
|
|
the source, so that if the source's changes, so does the
|
|
script's.</span></p>
|
|
|
|
</dd>
|
|
|
|
</dl></div><div class="impl">
|
|
|
|
<h5 id="calling-scripts"><span class="secno">6.1.3.2 </span>Calling scripts</h5>
|
|
|
|
<p>When a user agent is to <dfn id="jump-to-a-code-entry-point">jump to a code entry-point</dfn> for
|
|
a <a href="#concept-script" title="concept-script">script</a>, for example to invoke
|
|
an event listener defined in that <a href="#concept-script" title="concept-script">script</a>, the user agent must run the
|
|
following steps:</p>
|
|
|
|
<ol><li><p>If the <a href="#script-s-global-object">script's global object</a> is a
|
|
<code><a href="#window">Window</a></code> object whose <code><a href="#document">Document</a></code> object is
|
|
not <a href="#fully-active">fully active</a>, then abort these steps without doing
|
|
anything. The callback is not fired.</p>
|
|
|
|
<li><p>Set the <a href="#entry-script">entry script</a> to be the <a href="#concept-script" title="concept-script">script</a> being invoked.</li>
|
|
|
|
<li><p>Make the <a href="#script-execution-environment" title="script execution environment">script
|
|
execution environment</a> for the <a href="#concept-script" title="concept-script">script</a> execute the code for the given
|
|
code entry-point.</li>
|
|
|
|
<li><p>Set the <a href="#entry-script">entry script</a> back to whatever it was
|
|
when this algorithm started.</li>
|
|
|
|
</ol><p>This algorithm is not invoked by one script calling another.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="creating-scripts"><span class="secno">6.1.3.3 </span>Creating scripts</h5>
|
|
|
|
<p>When the specification says that a <a href="#concept-script" title="concept-script">script</a> is to be <dfn id="create-a-script" title="create a
|
|
script">created</dfn>, given some script source, its scripting
|
|
language, a global object, a browsing context, a URL character
|
|
encoding, and a base URL, the user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>If <a href="#concept-bc-noscript" title="concept-bc-noscript">scripting is
|
|
disabled</a> for <a href="#browsing-context">browsing context</a> passed to this
|
|
algorithm, then abort these steps, as if the script did nothing but
|
|
return void.</p>
|
|
|
|
<li><p>Set up a <a href="#script-execution-environment">script execution environment</a> as
|
|
appropriate for the scripting language.</li>
|
|
|
|
<li><p>Parse/compile/initialize the source of the script using the
|
|
<a href="#script-execution-environment">script execution environment</a>, as appropriate for the
|
|
scripting language, and thus obtain the <a href="#list-of-code-entry-points">list of code
|
|
entry-points</a> for the script. If the semantics of the
|
|
scripting language and the given source code are such that there is
|
|
executable code to be immediately run, then the <i><a href="#initial-code-entry-point">initial code
|
|
entry-point</a></i> is the entry-point for that code.</li>
|
|
|
|
<li><p>Set up the <a href="#script-s-global-object">script's global object</a>, the
|
|
<a href="#script-s-browsing-context">script's browsing context</a>, the <a href="#script-s-document">script's
|
|
document</a>, the <a href="#script-s-url-character-encoding">script's URL character encoding</a>,
|
|
and the <a href="#script-s-base-url">script's base URL</a> from the settings passed to
|
|
this algorithm.</li>
|
|
|
|
<li>
|
|
|
|
<p>If all the steps above succeeded (in particular, if the script
|
|
was compiled successfully), <a href="#jump-to-a-code-entry-point" title="jump to a code
|
|
entry-point">Jump</a> to the <a href="#concept-script" title="concept-script">script</a>'s <i><a href="#initial-code-entry-point">initial code
|
|
entry-point</a></i>.</p>
|
|
|
|
<p>Otherwise, <a href="#report-the-error">report the error</a> using the <code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code> <a href="#event-handlers" title="event
|
|
handlers">event handler</a> of the <a href="#script-s-global-object">script's global
|
|
object</a>. If the error is still <i title="concept-error-nothandled"><a href="#concept-error-nothandled">not handled</a></i> after this, then
|
|
the error may be reported to the user.</p>
|
|
|
|
</li>
|
|
|
|
</ol><hr><p>When the user agent is to <dfn id="create-an-impotent-script">create an impotent script</dfn>,
|
|
given some script source, its scripting language, and a browsing
|
|
context, the user agent must <a href="#create-a-script">create a script</a>, using the
|
|
given script source and scripting language, using a new empty object
|
|
as the global object, and using the given browsing context as the
|
|
browsing context. The URL character encoding and base URL for the
|
|
resulting <a href="#concept-script" title="concept-script">script</a> are not
|
|
important as no APIs are exposed to the script.</p>
|
|
|
|
<hr><p>When the specification says that a <a href="#concept-script" title="concept-script">script</a> is to be <dfn id="create-a-script-from-a-node" title="create a
|
|
script from a node">created from a node</dfn> <var title="">node</var>, given some script source and its scripting
|
|
language, the user agent must <a href="#create-a-script">create a script</a>, using
|
|
the given script source and scripting language, and using <a href="#the-script-settings-determined-from-the-node">the
|
|
script settings determined from the node</a> <var title="">node</var>.</p>
|
|
|
|
<p><dfn id="the-script-settings-determined-from-the-node">The script settings determined from the node</dfn> <var title="">node</var> are computed as follows:</p>
|
|
|
|
<ol><li><p>Let <var title="">document</var> be the
|
|
<code><a href="#document">Document</a></code> of <var title="">node</var> (or <var title="">node</var> itself if it is a
|
|
<code><a href="#document">Document</a></code>).</li>
|
|
|
|
<li><p>The browsing context is the <a href="#browsing-context">browsing context</a> of
|
|
<var title="">document</var>.</p>
|
|
|
|
<li><p>The global object is the <code><a href="#window">Window</a></code> object of
|
|
<var title="">document</var>.</li>
|
|
|
|
<li><p>The URL character encoding is the <a href="#document-s-character-encoding" title="document's
|
|
character encoding">character encoding</a> of <var title="">document</var>. (<a href="#sce-not-copy">This is a
|
|
reference, not a copy</a>.)</li>
|
|
|
|
<li><p>The base URL is the <a href="#document-base-url" title="document base URL">base
|
|
URL</a> of <var title="">document</var>. (<a href="#sbu-not-copy">This is a reference, not a copy</a>.)</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h5 id="killing-scripts"><span class="secno">6.1.3.4 </span>Killing scripts</h5>
|
|
|
|
<p>User agents may impose resource limitations on scripts, for
|
|
example CPU quotas, memory limits, total execution time limits, or
|
|
bandwidth limitations. When a script exceeds a limit, the user agent
|
|
may either throw a <code><a href="#quota_exceeded_err">QUOTA_EXCEEDED_ERR</a></code> exception, abort
|
|
the script without an exception, prompt the user, or throttle script
|
|
execution.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, the following script never terminates. A user agent
|
|
could, after waiting for a few seconds, prompt the user to either
|
|
terminate the script or let it continue.</p>
|
|
|
|
<pre><script>
|
|
while (true) { /* loop */ }
|
|
</script></pre>
|
|
|
|
</div>
|
|
|
|
<p>User agents are encouraged to allow users to disable scripting
|
|
whenever the user is prompted either by a script (e.g. using the
|
|
<code title="dom-alert"><a href="#dom-alert">window.alert()</a></code> API) or because of a
|
|
script's actions (e.g. because it has exceeded a time limit).</p>
|
|
|
|
<p>If scripting is disabled while a script is executing, the script
|
|
should be terminated immediately.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="runtime-script-errors"><span class="secno">6.1.3.5 </span>Runtime script errors</h5>
|
|
|
|
<p>Whenever an uncaught runtime script error occurs in one of the
|
|
scripts associated with a <code><a href="#document">Document</a></code>, the user agent must
|
|
<a href="#report-the-error">report the error</a> using the <code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code> <a href="#event-handlers" title="event
|
|
handlers">event handler</a> of the <a href="#script-s-global-object">script's global
|
|
object</a>. If the error is still <i title="concept-error-nothandled"><a href="#concept-error-nothandled">not handled</a></i> after this, then
|
|
the error may be reported to the user.</p>
|
|
|
|
<hr><p>When the user agent is required to <dfn id="report-the-error" title="report the
|
|
error">report an error</dfn> <var title="">error</var> using the
|
|
<a href="#event-handlers" title="event handlers">event handler</a> <var title="">onerror</var>, it must run these steps, after which the
|
|
error is either <dfn id="concept-error-handled" title="concept-error-handled"><i>handled</i></dfn> or <dfn id="concept-error-nothandled" title="concept-error-nothandled"><i>not handled</i></dfn>:</p>
|
|
|
|
<dl class="switch"><dt>If the value of <var title="">onerror</var> is a
|
|
<code><a href="#function">Function</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The function must be invoked with three arguments. 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 <a href="#absolute-url">absolute URL</a> of
|
|
the resource in which the error occurred, and the third must give
|
|
the line number in that resource on which the error occurred.</p>
|
|
|
|
<p>If the function returns false, then the error is <i title="concept-error-handled"><a href="#concept-error-handled">handled</a></i>. Otherwise, the error is
|
|
<i title="concept-error-nothandled"><a href="#concept-error-nothandled">not handled</a></i>.</p>
|
|
|
|
<p>Any uncaught exceptions thrown or errors caused by this
|
|
function may be reported to the user immediately after the error
|
|
that the function was called for; the <a href="#report-the-error" title="report the
|
|
error">report an error</a> algorithm must not be used to handle
|
|
exceptions thrown or errors caused by this function.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The error is <i title="concept-error-nothandled"><a href="#concept-error-nothandled">not handled</a></i>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></div><div class="impl">
|
|
|
|
<h4 id="event-loops"><span class="secno">6.1.4 </span>Event loops</h4>
|
|
|
|
<h5 id="definitions-1"><span class="secno">6.1.4.1 </span>Definitions</h5>
|
|
|
|
<p>To coordinate events, user interaction, scripts, rendering,
|
|
networking, and so forth, user agents must use <dfn id="event-loop" title="event
|
|
loop">event loops</dfn> as described in this section.</p>
|
|
|
|
<p>There must be at least one <a href="#event-loop">event loop</a> per user
|
|
agent, and at most one <a href="#event-loop">event loop</a> per <a href="#unit-of-related-similar-origin-browsing-contexts">unit of
|
|
related similar-origin browsing contexts</a>.</p>
|
|
|
|
<p class="note">When there is more than one <a href="#event-loop">event loop</a>
|
|
for a <a href="#unit-of-related-browsing-contexts">unit of related browsing contexts</a>, complications
|
|
arise when a <a href="#browsing-context">browsing context</a> in that group is <a href="#navigate" title="navigate">navigated</a> such that it switches from one
|
|
<a href="#unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing contexts</a> to
|
|
another. This specification does not currently describe how to
|
|
handle these complications.</p>
|
|
|
|
<p>An <a href="#event-loop">event loop</a> always has at least one <a href="#browsing-context">browsing
|
|
context</a>. If an <a href="#event-loop">event loop</a>'s <a href="#browsing-context" title="browsing context">browsing contexts</a> all go away, then
|
|
the <a href="#event-loop">event loop</a> goes away as well. A <a href="#browsing-context">browsing
|
|
context</a> always has an <a href="#event-loop">event loop</a> coordinating
|
|
its activities.</p>
|
|
|
|
|
|
<p class="note">Other specifications can define new kinds of event
|
|
loops that aren't associated with browsing contexts; in particular,
|
|
the Web Workers specification does so.</p>
|
|
|
|
|
|
<p>An <a href="#event-loop">event loop</a> has one or more <dfn id="task-queue" title="task
|
|
queue">task queues</dfn>. A <a href="#task-queue">task queue</a> is an ordered
|
|
list of <dfn id="concept-task" title="concept-task">tasks</dfn>, which can be:</p>
|
|
|
|
<dl><dt>Events</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Asynchronously dispatching an <code><a href="#event">Event</a></code> object at a
|
|
particular <code><a href="#eventtarget">EventTarget</a></code> object is a task.</p>
|
|
|
|
<p class="note">Not all events are dispatched using the <a href="#task-queue">task
|
|
queue</a>, many are dispatched synchronously during other
|
|
tasks.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Parsing</dt>
|
|
|
|
<dd><p>The <a href="#html-parser">HTML parser</a> tokenizing one or more bytes,
|
|
and then processing any resulting tokens, is typically a
|
|
task.</dd>
|
|
|
|
|
|
<dt>Callbacks</dt>
|
|
|
|
<dd><p>Calling a callback asynchronously is a task.</dd>
|
|
|
|
|
|
<dt>Using a resource</dt>
|
|
|
|
<dd><p>When an algorithm <a href="#fetch" title="fetch">fetches</a> a
|
|
resource, if the fetching occurs asynchronously then the processing
|
|
of the resource once some or all of the resource is available is a
|
|
task.</dd>
|
|
|
|
|
|
<dt>Reacting to DOM manipulation</dt>
|
|
|
|
<dd><p>Some elements have tasks that trigger in response to DOM
|
|
manipulation, e.g. when that element is <a href="#insert-an-element-into-a-document" title="insert an
|
|
element into a document">inserted into the document</a>.</p>
|
|
|
|
</dl><p>When a user agent is to <dfn id="queue-a-task">queue a task</dfn>, it must add the
|
|
given task to one of the <a href="#task-queue" title="task queue">task queues</a>
|
|
of the relevant <a href="#event-loop">event loop</a>. All the tasks from one
|
|
particular <dfn id="task-source">task source</dfn> (e.g. the callbacks generated by
|
|
timers, the events dispatched for mouse movements, the tasks queued
|
|
for the parser) must always be added to the same <a href="#task-queue">task
|
|
queue</a>, but tasks from different <a href="#task-source" title="task
|
|
source">task sources</a> may be placed in different <a href="#task-queue" title="task queue">task queues</a>.</p>
|
|
|
|
<p class="example">For example, a user agent could have one
|
|
<a href="#task-queue">task queue</a> for mouse and key events (the <a href="#user-interaction-task-source">user
|
|
interaction task source</a>), and another for everything
|
|
else. The user agent could then give keyboard and mouse events
|
|
preference over other tasks three quarters of the time, keeping the
|
|
interface responsive but not starving other task queues, and never
|
|
processing events from any one <a href="#task-source">task source</a> out of
|
|
order.</p>
|
|
|
|
<p>Each <a href="#concept-task" title="concept-task">task</a> that is <a href="#queue-a-task" title="queue a task">queued</a> onto a <a href="#task-queue">task queue</a> of
|
|
an <a href="#event-loop">event loop</a> defined by this specification is
|
|
associated with a <code><a href="#document">Document</a></code>; if the task was queued in
|
|
the context of an element, then it is the element's
|
|
<code><a href="#document">Document</a></code>; if the task was queued in the context of a
|
|
<a href="#browsing-context">browsing context</a>, then it is the <a href="#browsing-context">browsing
|
|
context</a>'s <a href="#active-document">active document</a> at the time the task
|
|
was queued; if the task was queued by or for a <a href="#concept-script" title="concept-script">script</a> then the document is the
|
|
<a href="#script-s-document">script's document</a>.</p>
|
|
|
|
<p>A user agent is required to have one <dfn id="storage-mutex">storage
|
|
mutex</dfn>. This mutex is used to control access to shared state
|
|
like cookies. At any one point, the <a href="#storage-mutex">storage mutex</a> is
|
|
either free, or owned by a particular <a href="#event-loop">event loop</a> or
|
|
instance of the <a href="#fetch" title="fetch">fetching</a> algorithm.</p>
|
|
|
|
<p>Whenever a <a href="#concept-script" title="concept-script">script</a> calls into
|
|
a <a href="#plugin">plugin</a>, and whenever a <a href="#plugin">plugin</a> calls into
|
|
a <a href="#concept-script" title="concept-script">script</a>, the user agent must
|
|
release the <a href="#storage-mutex">storage mutex</a>.</p>
|
|
|
|
|
|
<h5 id="processing-model-2"><span class="secno">6.1.4.2 </span>Processing model</h5>
|
|
|
|
<p>An <a href="#event-loop">event loop</a> must continually run through the
|
|
following steps for as long as it exists:</p>
|
|
|
|
<ol><li><p>Run the oldest <a href="#concept-task" title="concept-task">task</a> on one
|
|
of the <a href="#event-loop">event loop</a>'s <a href="#task-queue" title="task queue">task
|
|
queues</a>, ignoring tasks whose associated
|
|
<code><a href="#document">Document</a></code>s are not <a href="#fully-active">fully active</a>. The user
|
|
agent may pick any <a href="#task-queue">task queue</a>.</li>
|
|
|
|
|
|
<li><p>If the <a href="#storage-mutex">storage mutex</a> is now owned by the
|
|
<a href="#event-loop">event loop</a>, release it so that it is once again
|
|
free.</li>
|
|
|
|
<li><p>Remove that task from its <a href="#task-queue">task queue</a>.</li>
|
|
|
|
<li><p><a href="#provide-a-stable-state">Provide a stable state</a>.</li>
|
|
|
|
<li><p>If necessary, update the rendering or user interface of any
|
|
<code><a href="#document">Document</a></code> or <a href="#browsing-context">browsing context</a> to reflect
|
|
the current state.</li>
|
|
|
|
<li><p>Return to the first step of the <a href="#event-loop">event
|
|
loop</a>.</li>
|
|
|
|
</ol><hr><p>When the user agent is to <dfn id="provide-a-stable-state">provide a stable state</dfn>, if
|
|
any asynchronously-running algorithms are <dfn id="await-a-stable-state" title="await a stable
|
|
state">awaiting a stable state</dfn>, then the user agent must run
|
|
their <dfn id="synchronous-section">synchronous section</dfn> and then resume running their
|
|
asynchronous algorithm (if appropriate).</p>
|
|
|
|
<p class="note">A <a href="#synchronous-section">synchronous section</a> never mutates
|
|
the DOM, runs any script, or has any other side-effects.</p>
|
|
|
|
<p class="note">Steps in <a href="#synchronous-section" title="synchronous
|
|
section">synchronous sections</a> are marked with ⌛.</p>
|
|
|
|
<hr><p>When an algorithm says to <dfn id="spin-the-event-loop">spin the event loop</dfn> until
|
|
a condition <var title="">goal</var> is met, the user agent must run
|
|
the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">task source</var> be the <a href="#task-source">task
|
|
source</a> of the currently running <a href="#concept-task" title="concept-task">task</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Stop the currently running <a href="#concept-task" title="concept-task">task</a>, allowing the <a href="#event-loop">event
|
|
loop</a> to resume, but continue these steps
|
|
asynchronously.</p>
|
|
|
|
<p class="note">This causes the <a href="#event-loop">event loop</a> to move on
|
|
to the second step of its processing model (defined above).</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Wait until the condition <var title="">goal</var> is
|
|
met.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to continue running these steps,
|
|
using the <a href="#task-source">task source</a> <var title="">task
|
|
source</var>. Wait until this task runs before continuing these
|
|
steps.</li>
|
|
|
|
<li><p>Return to the caller.</li>
|
|
|
|
</ol><hr><p>Some of the algorithms in this specification, for historical
|
|
reasons, require the user agent to <dfn id="pause">pause</dfn> while running a
|
|
<a href="#concept-task" title="concept-task">task</a> until a condition <var title="">goal</var> is met. This means running the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>If any asynchronously-running algorithms are <a href="#await-a-stable-state" title="await a stable state">awaiting a stable state</a>, then
|
|
run their <a href="#synchronous-section">synchronous section</a> and then resume running
|
|
their asynchronous algorithm. (See the <a href="#event-loop">event loop</a>
|
|
processing model definition above for details.)</p>
|
|
|
|
<li><p>If necessary, update the rendering or user interface of any
|
|
<code><a href="#document">Document</a></code> or <a href="#browsing-context">browsing context</a> to reflect
|
|
the current state.</li>
|
|
|
|
<li><p>Wait until the condition <var title="">goal</var> is met.
|
|
While a user agent has a paused <a href="#concept-task" title="concept-task">task</a>, the corresponding <a href="#event-loop">event
|
|
loop</a> must not run further <a href="#concept-task" title="concept-task">tasks</a>, and any script in the currently
|
|
running <a href="#concept-task" title="concept-task">task</a> must block. User
|
|
agents should remain responsive to user input while paused,
|
|
however, albeit in a reduced capacity since the <a href="#event-loop">event
|
|
loop</a> will not be doing anything.</li>
|
|
|
|
</ol><hr><p>When a user agent is to <dfn id="obtain-the-storage-mutex">obtain the storage mutex</dfn> as
|
|
part of running a <a href="#concept-task" title="concept-task">task</a>, it must
|
|
run through the following steps:</p>
|
|
|
|
<ol><li><p>If the <a href="#storage-mutex">storage mutex</a> is already owned by this
|
|
<a href="#concept-task" title="concept-task">task</a>'s <a href="#event-loop">event loop</a>,
|
|
then abort these steps.</li>
|
|
|
|
<li><p>Otherwise, <a href="#pause">pause</a> until the <a href="#storage-mutex">storage
|
|
mutex</a> can be taken by the <a href="#event-loop">event loop</a>.</li>
|
|
|
|
<li><p>Take ownership of the <a href="#storage-mutex">storage mutex</a>.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h5 id="generic-task-sources"><span class="secno">6.1.4.3 </span>Generic task sources</h5>
|
|
|
|
<p>The following <a href="#task-source" title="task source">task sources</a> are
|
|
used by a number of mostly unrelated features in this and other
|
|
specifications.</p>
|
|
|
|
<dl><dt>The <dfn id="dom-manipulation-task-source">DOM manipulation task source</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>This <a href="#task-source">task source</a> is used for features that react
|
|
to DOM manipulations, such as things that happen asynchronously
|
|
when an element is <a href="#insert-an-element-into-a-document" title="insert an element into a
|
|
document">inserted into the document</a>.</p>
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="user-interaction-task-source">user interaction task source</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>This <a href="#task-source">task source</a> is used for features that react
|
|
to user interaction, for example keyboard or mouse input.</p>
|
|
|
|
<p>Asynchronous events sent in response to user input (e.g. <code title="event-click"><a href="#event-click">click</a></code> events) must be dispatched using
|
|
<a href="#concept-task" title="concept-task">tasks</a> <a href="#queue-a-task" title="queue a
|
|
task">queued</a> with the <a href="#user-interaction-task-source">user interaction task
|
|
source</a>. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="networking-task-source">networking task source</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>This <a href="#task-source">task source</a> is used for features that trigger
|
|
in response to network activity.</p>
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>The <dfn id="history-traversal-task-source">history traversal task source</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>This <a href="#task-source">task source</a> is used to queue calls to <code title="dom-history-back"><a href="#dom-history-back">history.back()</a></code> and similar
|
|
APIs.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></div><div class="impl">
|
|
|
|
<!-- SCRIPT EXEC -->
|
|
<h4 id="javascript-protocol"><span class="secno">6.1.5 </span><dfn title="javascript protocol">The <code title="">javascript:</code> URL scheme</dfn></h4>
|
|
|
|
<p>When a <a href="#url">URL</a> using the <code title="">javascript:</code> scheme is <dfn id="concept-js-deref" title="concept-js-deref">dereferenced</dfn>, the user agent must run
|
|
the following steps:</p>
|
|
|
|
<ol><li><p>Let the script source be the string obtained using the
|
|
content retrieval operation defined for <code title="">javascript:</code> URLs. <a href="#refsJSURL">[JSURL]</a></li>
|
|
|
|
<li>
|
|
|
|
<p>Use the appropriate step from the following list:</p>
|
|
|
|
<dl><dt>If a <a href="#browsing-context">browsing context</a> is being <a href="#navigate" title="navigate">navigated</a> to a <code>javascript:</code>
|
|
URL, and the <a href="#source-browsing-context">source browsing context</a> for that
|
|
navigation, if any, has <a href="#concept-bc-noscript" title="concept-bc-noscript">scripting disabled</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Let <var title="">result</var> be void.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If a <a href="#browsing-context">browsing context</a> is being <a href="#navigate" title="navigate">navigated</a> to a <code>javascript:</code>
|
|
URL, and the <a href="#active-document">active document</a> of that browsing
|
|
context has the <a href="#same-origin">same origin</a> as the script given by
|
|
that URL</dt>
|
|
|
|
<dd>
|
|
|
|
|
|
|
|
<p>Let <var title="">address</var> be the <a href="#the-document-s-address" title="the
|
|
document's address">address</a> of the <a href="#active-document">active
|
|
document</a> of the <a href="#browsing-context">browsing context</a> being
|
|
navigated.</p>
|
|
|
|
<p>If <var title="">address</var> is <code><a href="#about:blank">about:blank</a></code>,
|
|
and the <a href="#browsing-context">browsing context</a> being navigated has a
|
|
<a href="#creator-browsing-context">creator browsing context</a>, then let <var title="">address</var> be the <a href="#the-document-s-address" title="the document's
|
|
address">address</a> of the <a href="#creator-document">creator
|
|
<code>Document</code></a> instead.</p>
|
|
|
|
<p><a href="#create-a-script-from-a-node" title="create a script from a node">Create a
|
|
script</a> from the <code><a href="#document">Document</a></code> node of the
|
|
<a href="#active-document">active document</a>, using the aforementioned script
|
|
source, and assuming the scripting language is JavaScript.</p>
|
|
|
|
<p>Let <var title="">result</var> be the return value of the
|
|
<i><a href="#initial-code-entry-point">initial code entry-point</a></i> of this <a href="#concept-script" title="concept-script">script</a>. If an exception was
|
|
raised, let <var title="">result</var> be void instead. (The
|
|
result will be void also if <a href="#concept-bc-noscript" title="concept-bc-noscript">scripting is disabled</a>.)</p>
|
|
|
|
<p>When it comes time to <a href="#set-the-document-s-address">set the document's address</a>
|
|
in the <a href="#navigate" title="navigate">navigation algorithm</a>, use
|
|
<var title="">address</var> as the <a href="#override-url">override
|
|
URL</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Let <var title="">result</var> be void.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>If the result of executing the script is void (there is no
|
|
return value), then the URL must be treated in a manner equivalent
|
|
to an HTTP resource with an HTTP 204 No Content response.</p>
|
|
|
|
<p>Otherwise, the URL must be treated in a manner equivalent to an
|
|
HTTP resource with a 200 OK response whose <a href="#content-type" title="Content-Type">Content-Type metadata</a> is
|
|
<code><a href="#text-html">text/html</a></code> and whose response body is the return value
|
|
converted to a string value.</p>
|
|
|
|
<p class="note">Certain contexts, in particular <code><a href="#the-img-element">img</a></code>
|
|
elements, ignore the <a href="#content-type" title="Content-Type">Content-Type
|
|
metadata</a>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><div class="example">
|
|
|
|
<p>So for example a <code title="">javascript:</code> URL for a
|
|
<code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute of an
|
|
<code><a href="#the-img-element">img</a></code> element would be evaluated in the context of an
|
|
empty object 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> URL in an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute of an <code><a href="#the-a-element">a</a></code>
|
|
element would only be evaluated when the link was <a href="#following-hyperlinks" title="following hyperlinks">followed</a>.</p>
|
|
|
|
<p>The <code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code> attribute of an
|
|
<code><a href="#the-iframe-element">iframe</a></code> element would be evaluated in the context of
|
|
the <code><a href="#the-iframe-element">iframe</a></code>'s own <a href="#browsing-context">browsing context</a>; once
|
|
evaluated, its return value (if it was not void) would replace that
|
|
<a href="#browsing-context">browsing context</a>'s document, thus changing the
|
|
variables visible in that <a href="#browsing-context">browsing context</a>.</p>
|
|
|
|
</div>
|
|
|
|
</div><h4 id="events"><span class="secno">6.1.6 </span>Events</h4><div class="impl">
|
|
|
|
<h5 id="event-handler-attributes"><span class="secno">6.1.6.1 </span>Event handlers</h5>
|
|
|
|
</div><p>Many objects can have <dfn id="event-handlers">event handlers</dfn> specified. These
|
|
act as bubbling event listeners for the object on which they are
|
|
specified.<p>An <a href="#event-handlers" title="event handlers">event handler</a> can either
|
|
have the value null or be set to a <code><a href="#function">Function</a></code>
|
|
object. <span class="impl">Initially, event handlers must be set to
|
|
null.</span><p>Event handlers are exposed in one or two ways.<p>The first way, common to all event handlers, is as an <a href="#event-handler-idl-attributes" title="event handler IDL attributes">event handler IDL
|
|
attribute</a>.<p>The second way is as an <a href="#event-handler-content-attributes" title="event handler content
|
|
attributes">event handler content attribute</a>. Event handlers
|
|
on <a href="#html-elements">HTML elements</a> and some of the event handlers on
|
|
<code><a href="#window">Window</a></code> objects are exposed in this way.<div class="impl">
|
|
|
|
<hr><p><dfn id="event-handler-idl-attributes">Event handler IDL attributes</dfn>, on setting, must set the
|
|
corresponding event handler to their new value, and on
|
|
getting, must return whatever the current value of the corresponding
|
|
event handler is (possibly null).</p>
|
|
|
|
<p>If an <a href="#event-handler-idl-attributes" title="event handler IDL attributes">event handler
|
|
IDL attribute</a> exposes an <a href="#event-handlers" title="event handlers">event
|
|
handler</a> of an object that doesn't exist, it must always
|
|
return null on getting and must do nothing on setting.</p>
|
|
|
|
<p class="note">This can happen in particular for <a href="#event-handler-idl-attributes" title="event
|
|
handler IDL attributes">event handler IDL attribute</a> on
|
|
<code><a href="#the-body-element">body</a></code> elements that do not have corresponding
|
|
<code><a href="#window">Window</a></code> objects.</p>
|
|
|
|
<p class="note">Certain event handler IDL attributes have additional
|
|
requirements, in particular the <code title="handler-MessagePort-onmessage">onmessage</code> attribute of
|
|
<code>MessagePort</code> objects.</p>
|
|
|
|
<hr></div><p><dfn id="event-handler-content-attributes">Event handler content attributes</dfn>, when specified, must
|
|
contain valid JavaScript code which, when parsed, would match the
|
|
<code title="">FunctionBody</code> production after automatic
|
|
semicolon insertion. <a href="#refsECMA262">[ECMA262]</a><div class="impl">
|
|
|
|
<!-- SCRIPT EXEC -->
|
|
<p>When an <a href="#event-handler-content-attributes" title="event handler content attributes">event
|
|
handler content attribute</a> is set, if the element is owned by
|
|
a <code><a href="#document">Document</a></code> that is in a <a href="#browsing-context">browsing context</a>,
|
|
and <a href="#concept-bc-script" title="concept-bc-script">scripting is enabled</a> for
|
|
that <a href="#browsing-context">browsing context</a>, the user agent must run the
|
|
following steps to create a <a href="#concept-script" title="concept-script">script</a> after setting the content
|
|
attribute to its new value:</p>
|
|
|
|
<ol><li><p>Set the corresponding <a href="#event-handlers" title="event handlers">event
|
|
handler</a> to null.</li>
|
|
|
|
<li><p>Set up a <a href="#script-execution-environment">script execution environment</a> for
|
|
JavaScript.</li>
|
|
|
|
<li><p>Let <var title="">body</var> be the <a href="#event-handler-content-attributes" title="event
|
|
handler content attributes">event handler content
|
|
attribute</a>'s new value.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">body</var> is not parsable as
|
|
<i>FunctionBody</i> or if parsing detects an <i>early error</i>
|
|
then abort these steps.</p>
|
|
|
|
<p class="note"><i>FunctionBody</i> is defined in ECMAScript
|
|
edition 5 section 13 Function Definition. <i>Early error</i> is
|
|
defined in ECMAScript edition 5 section 16 Errors. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">body</var> begins with a Directive Prologue
|
|
that contains a Use Strict Directive then let <var title="">strict</var> be true, otherwise let <var title="">strict</var> be false.</p>
|
|
<p class="note">The terms "Directive Prologue" and "Use Strict
|
|
Directive" are defined in ECMAScript edition 5 section 14.1
|
|
Directive Prologues and the Use Strict Directive. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
</li>
|
|
|
|
|
|
<li>
|
|
|
|
<p>Using the script execution environment created above, create a
|
|
function object (as defined in ECMAScript edition 5 section 13.2
|
|
Creating Function Objects), with:</p>
|
|
|
|
<dl><dt>Parameter list <var title="">FormalParameterList</var></dt>
|
|
|
|
<dd>
|
|
|
|
<dl class="switch"><dt>If the attribute is the <code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code> attribute of the
|
|
<code><a href="#window">Window</a></code> object</dt>
|
|
|
|
<dd>Let the function have three arguments, named <code title="">event</code>, <code title="">source</code>, and <code title="">fileno</code>.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>Let the function have a single argument called <code title="">event</code>.</dd>
|
|
|
|
</dl></dd>
|
|
|
|
<dt>Function body <var title="">FunctionBody</var></dt>
|
|
|
|
<dd>The result of parsing <var title="">body</var> above.</dd>
|
|
|
|
<dt>Lexical Environment <var title="">Scope</var></dt>
|
|
|
|
<dd>
|
|
|
|
<ol><li>Let <var title="">Scope</var> be the result of
|
|
NewObjectEnvironment(the element's <code><a href="#document">Document</a></code>, the
|
|
<var title="">global environment</var>).</li>
|
|
|
|
<li>If the element has a <a href="#form-owner">form owner</a>, let <var title="">Scope</var> be the result of NewObjectEnvironment(the
|
|
element's <a href="#form-owner">form owner</a>, <var title="">Scope</var>).</li>
|
|
|
|
<li>Let <var title="">Scope</var> be the result of
|
|
NewObjectEnvironment(the element's object, <var title="">Scope</var>).</li>
|
|
|
|
</ol><p class="note">NewObjectEnvironment() is defined in ECMAScript
|
|
edition 5 section 10.2.2.3 NewObjectEnvironment (O, E). <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
</dd>
|
|
|
|
<dt>Boolean flag <var title="">Strict</var></dt>
|
|
|
|
<dd>The value of <var title="">strict</var>.</dd>
|
|
|
|
</dl><p>Let this new function be the only entry in the script's
|
|
<a href="#list-of-code-entry-points">list of code entry-points</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Set up the <a href="#script-s-global-object">script's global object</a>, the
|
|
<a href="#script-s-browsing-context">script's browsing context</a>, the <a href="#script-s-document">script's
|
|
document</a>, the <a href="#script-s-url-character-encoding">script's URL character encoding</a>,
|
|
and the <a href="#script-s-base-url">script's base URL</a> from <a href="#the-script-settings-determined-from-the-node">the script
|
|
settings determined from the node</a> on which the attribute is
|
|
being set.</li>
|
|
|
|
<li><p>Set the corresponding <a href="#event-handlers" title="event handlers">event
|
|
handler</a> to the aforementioned function.</li>
|
|
|
|
</ol><p>When an event handler content attribute is removed, the user
|
|
agent must set the corresponding <a href="#event-handlers" title="event handlers">event
|
|
handler</a> to null.</p>
|
|
|
|
</div><p class="note">When an <a href="#event-handler-content-attributes" title="event handler content
|
|
attributes">event handler content attribute</a> is set on an
|
|
element owned by a <code><a href="#document">Document</a></code> that is not in a
|
|
<a href="#browsing-context">browsing context</a>, the corresponding event handler is
|
|
not changed.</p><div class="impl">
|
|
|
|
<hr><p>All <a href="#event-handlers">event handlers</a> on an object, whether an element
|
|
or some other object, and whether set to null or to a
|
|
<code><a href="#function">Function</a></code> object, must be registered as event listeners
|
|
on the object when it is created, as if the <code title="dom-EventTarget-addEventListener">addEventListener()</code>
|
|
method on the object's <code><a href="#eventtarget">EventTarget</a></code> interface had been
|
|
invoked, with the event type (<var title="dom-event-type">type</var>
|
|
argument) equal to the type corresponding to the event handler (the
|
|
<dfn id="event-handler-event-type">event handler event type</dfn>), the listener set to be a
|
|
target and bubbling phase listener (<var title="dom-event-useCapture">useCapture</var> argument set to
|
|
false), and the event listener itself (<var title="dom-event-listener">listener</var> argument) set to do
|
|
nothing while the event handler's value is not a
|
|
<code><a href="#function">Function</a></code> object, and set to invoke the <code title="dom-function-call"><a href="#dom-function-call">call()</a></code> callback of the
|
|
<code><a href="#function">Function</a></code> object associated with the event handler
|
|
otherwise.</p>
|
|
|
|
</div><p class="note"><a href="#event-handlers">Event handlers</a> <span class="impl">therefore</span> always fire before event listeners
|
|
attached using <code title="dom-EventTarget-addEventListener">addEventListener()</code>.<div class="impl">
|
|
|
|
<p class="note">The <var title="dom-event-listener">listener</var>
|
|
argument is emphatically <em>not</em> the <a href="#event-handlers" title="event
|
|
handlers">event handler</a> itself.</p>
|
|
|
|
<p class="note">The interfaces implemented by the event object do
|
|
not influence whether an <a href="#event-handlers" title="event handlers">event
|
|
handler</a> is triggered or not.</p>
|
|
|
|
<p>When an <a href="#event-handlers" title="event handlers">event handler</a>'s
|
|
<code><a href="#function">Function</a></code> object is invoked, its <code title="dom-function-call"><a href="#dom-function-call">call()</a></code> callback must be invoked
|
|
with one argument, set to the <code><a href="#event">Event</a></code> object of the event
|
|
in question.</p>
|
|
|
|
<p>The handler's return value must then be processed as follows:</p>
|
|
|
|
<dl class="switch"><dt>If the event type is <code class="event-mouseover">mouseover</code></dt>
|
|
|
|
<dd><p>If the return value is a boolean with the value true, then
|
|
the event must be canceled.</dd>
|
|
|
|
<dt>If the event object is a <code><a href="#beforeunloadevent">BeforeUnloadEvent</a></code> object</dt>
|
|
|
|
<dd><p>If the return value is a string, and the event object's
|
|
<code title="dom-BeforeUnloadEvent-returnValue"><a href="#dom-beforeunloadevent-returnvalue">returnValue</a></code>
|
|
attribute's value is the empty string, then set the <code title="dom-BeforeUnloadEvent-returnValue"><a href="#dom-beforeunloadevent-returnvalue">returnValue</a></code>
|
|
attribute's value to the return value.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>If the return value is a boolean with the value false, then
|
|
the event must be canceled.</dd>
|
|
|
|
</dl></div><hr><p>The <code><a href="#function">Function</a></code> interface represents a function in the
|
|
scripting language being used. It is represented in IDL as
|
|
follows:<pre class="idl">[Callback=FunctionOnly, NoInterfaceObject]
|
|
interface <dfn id="function">Function</dfn> {
|
|
any <a href="#dom-function-call" title="dom-function-call">call</a>(in any... arguments);
|
|
};</pre><p>The <dfn id="dom-function-call" title="dom-function-call"><code>call(...)</code></dfn>
|
|
method is the object's callback.<p class="note">In JavaScript, any <code title="">Function</code>
|
|
object implements this interface.<p>If the <code><a href="#function">Function</a></code> object is a JavaScript <code title="">Function</code>, then when it is invoked by the user agent,
|
|
the user agent must set the <var title="">thisArg</var> (as defined
|
|
by ECMAScript edition 5 section 10.4.3 Entering Function Code) to
|
|
the <a href="#event-handlers" title="event handlers">event handler</a>'s object. <a href="#refsECMA262">[ECMA262]</a><div class="example">
|
|
|
|
<p>For example, the following document fragment:</p>
|
|
|
|
<pre><body onload="alert(this)" onclick="alert(this)"></pre>
|
|
|
|
<p>...leads to an alert saying "<code title="">[object Window]</code>" when the document is loaded,
|
|
and an alert saying "<code title="">[object HTMLBodyElement]</code>" whenever the user
|
|
clicks something in the page.</p>
|
|
|
|
</div><p>The return value of the function affects whether the event is
|
|
canceled or not: <span class="impl">as described above,</span> if
|
|
the return value is false, the event is canceled (except for <code class="event-mouseover">mouseover</code> events, where the return
|
|
value has to be true to cancel the event). With <code title="event-beforeunload">beforeunload</code> events, the value is
|
|
instead used to determine the message to show the user.<div class="impl">
|
|
|
|
<h5 id="event-handlers-on-elements-document-objects-and-window-objects"><span class="secno">6.1.6.2 </span>Event handlers on elements, <code><a href="#document">Document</a></code> objects, and <code><a href="#window">Window</a></code> objects</h5>
|
|
|
|
<p>The following are the <a href="#event-handlers">event handlers</a> (and their
|
|
corresponding <a href="#event-handler-event-type" title="event handler event type">event handler
|
|
event types</a>) that must be supported by all <a href="#html-elements">HTML
|
|
elements</a>, as both content attributes and IDL attributes, and
|
|
on <code><a href="#document">Document</a></code> and <code><a href="#window">Window</a></code> objects, as IDL
|
|
attributes.</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-onabort" title="handler-onabort"><code>onabort</code></dfn> <td> <code title="event-abort">abort</code>
|
|
<tr><td><dfn id="handler-oncanplay" title="handler-oncanplay"><code>oncanplay</code></dfn> <td> <code title="event-media-canplay"><a href="#event-media-canplay">canplay</a></code>
|
|
<tr><td><dfn id="handler-oncanplaythrough" title="handler-oncanplaythrough"><code>oncanplaythrough</code></dfn> <td> <code title="event-media-canplaythrough"><a href="#event-media-canplaythrough">canplaythrough</a></code>
|
|
<tr><td><dfn id="handler-onchange" title="handler-onchange"><code>onchange</code></dfn> <td> <code title="event-change">change</code>
|
|
<tr><td><dfn id="handler-onclick" title="handler-onclick"><code>onclick</code></dfn> <td> <code title="event-click"><a href="#event-click">click</a></code>
|
|
<tr><td><dfn id="handler-oncontextmenu" title="handler-oncontextmenu"><code>oncontextmenu</code></dfn> <td> <code title="event-contextmenu">contextmenu</code>
|
|
<tr><td><dfn id="handler-oncuechange" title="handler-oncuechange"><code>oncuechange</code></dfn> <td> <code title="event-cuechange">cuechange</code>
|
|
<tr><td><dfn id="handler-ondblclick" title="handler-ondblclick"><code>ondblclick</code></dfn> <td> <code title="event-dblclick">dblclick</code>
|
|
<tr><td><dfn id="handler-ondrag" title="handler-ondrag"><code>ondrag</code></dfn> <td> <code title="event-drag"><a href="#event-drag">drag</a></code>
|
|
<tr><td><dfn id="handler-ondragend" title="handler-ondragend"><code>ondragend</code></dfn> <td> <code title="event-dragend"><a href="#event-dragend">dragend</a></code>
|
|
<tr><td><dfn id="handler-ondragenter" title="handler-ondragenter"><code>ondragenter</code></dfn> <td> <code title="event-dragenter"><a href="#event-dragenter">dragenter</a></code>
|
|
<tr><td><dfn id="handler-ondragleave" title="handler-ondragleave"><code>ondragleave</code></dfn> <td> <code title="event-dragleave"><a href="#event-dragleave">dragleave</a></code>
|
|
<tr><td><dfn id="handler-ondragover" title="handler-ondragover"><code>ondragover</code></dfn> <td> <code title="event-dragover"><a href="#event-dragover">dragover</a></code>
|
|
<tr><td><dfn id="handler-ondragstart" title="handler-ondragstart"><code>ondragstart</code></dfn> <td> <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code>
|
|
<tr><td><dfn id="handler-ondrop" title="handler-ondrop"><code>ondrop</code></dfn> <td> <code title="event-drop"><a href="#event-drop">drop</a></code>
|
|
<tr><td><dfn id="handler-ondurationchange" title="handler-ondurationchange"><code>ondurationchange</code></dfn> <td> <code title="event-media-durationchange"><a href="#event-media-durationchange">durationchange</a></code>
|
|
<tr><td><dfn id="handler-onemptied" title="handler-onemptied"><code>onemptied</code></dfn> <td> <code title="event-media-emptied"><a href="#event-media-emptied">emptied</a></code>
|
|
<tr><td><dfn id="handler-onended" title="handler-onended"><code>onended</code></dfn> <td> <code title="event-media-ended"><a href="#event-media-ended">ended</a></code>
|
|
<tr><td><dfn id="handler-oninput" title="handler-oninput"><code>oninput</code></dfn> <td> <code title="event-input">input</code>
|
|
<tr><td><dfn id="handler-oninvalid" title="handler-oninvalid"><code>oninvalid</code></dfn> <td> <code title="event-invalid">invalid</code>
|
|
<tr><td><dfn id="handler-onkeydown" title="handler-onkeydown"><code>onkeydown</code></dfn> <td> <code title="event-keydown">keydown</code>
|
|
<tr><td><dfn id="handler-onkeypress" title="handler-onkeypress"><code>onkeypress</code></dfn> <td> <code title="event-keypress">keypress</code>
|
|
<tr><td><dfn id="handler-onkeyup" title="handler-onkeyup"><code>onkeyup</code></dfn> <td> <code title="event-keyup">keyup</code>
|
|
<tr><td><dfn id="handler-onloadeddata" title="handler-onloadeddata"><code>onloadeddata</code></dfn> <td> <code title="event-media-loadeddata"><a href="#event-media-loadeddata">loadeddata</a></code>
|
|
<tr><td><dfn id="handler-onloadedmetadata" title="handler-onloadedmetadata"><code>onloadedmetadata</code></dfn> <td> <code title="event-media-loadedmetadata"><a href="#event-media-loadedmetadata">loadedmetadata</a></code>
|
|
<tr><td><dfn id="handler-onloadstart" title="handler-onloadstart"><code>onloadstart</code></dfn> <td> <code title="event-media-loadstart"><a href="#event-media-loadstart">loadstart</a></code>
|
|
<tr><td><dfn id="handler-onmousedown" title="handler-onmousedown"><code>onmousedown</code></dfn> <td> <code title="event-mousedown">mousedown</code>
|
|
<tr><td><dfn id="handler-onmousemove" title="handler-onmousemove"><code>onmousemove</code></dfn> <td> <code title="event-mousemove">mousemove</code>
|
|
<tr><td><dfn id="handler-onmouseout" title="handler-onmouseout"><code>onmouseout</code></dfn> <td> <code title="event-mouseout">mouseout</code>
|
|
<tr><td><dfn id="handler-onmouseover" title="handler-onmouseover"><code>onmouseover</code></dfn> <td> <code title="event-mouseover">mouseover</code>
|
|
<tr><td><dfn id="handler-onmouseup" title="handler-onmouseup"><code>onmouseup</code></dfn> <td> <code title="event-mouseup">mouseup</code>
|
|
<tr><td><dfn id="handler-onmousewheel" title="handler-onmousewheel"><code>onmousewheel</code></dfn> <td> <code title="event-mousewheel">mousewheel</code>
|
|
<tr><td><dfn id="handler-onpause" title="handler-onpause"><code>onpause</code></dfn> <td> <code title="event-media-pause"><a href="#event-media-pause">pause</a></code>
|
|
<tr><td><dfn id="handler-onplay" title="handler-onplay"><code>onplay</code></dfn> <td> <code title="event-media-play"><a href="#event-media-play">play</a></code>
|
|
<tr><td><dfn id="handler-onplaying" title="handler-onplaying"><code>onplaying</code></dfn> <td> <code title="event-media-playing"><a href="#event-media-playing">playing</a></code>
|
|
<tr><td><dfn id="handler-onprogress" title="handler-onprogress"><code>onprogress</code></dfn> <td> <code title="event-media-progress"><a href="#event-media-progress">progress</a></code>
|
|
<tr><td><dfn id="handler-onratechange" title="handler-onratechange"><code>onratechange</code></dfn> <td> <code title="event-media-ratechange"><a href="#event-media-ratechange">ratechange</a></code>
|
|
<tr><td><dfn id="handler-onreadystatechange" title="handler-onreadystatechange"><code>onreadystatechange</code></dfn> <td> <code title="event-readystatechange"><a href="#event-readystatechange">readystatechange</a></code>
|
|
<tr><td><dfn id="handler-onreset" title="handler-onreset"><code>onreset</code></dfn> <td> <code title="event-reset">reset</code>
|
|
<tr><td><dfn id="handler-onseeked" title="handler-onseeked"><code>onseeked</code></dfn> <td> <code title="event-media-seeked"><a href="#event-media-seeked">seeked</a></code>
|
|
<tr><td><dfn id="handler-onseeking" title="handler-onseeking"><code>onseeking</code></dfn> <td> <code title="event-media-seeking"><a href="#event-media-seeking">seeking</a></code>
|
|
<tr><td><dfn id="handler-onselect" title="handler-onselect"><code>onselect</code></dfn> <td> <code title="event-select">select</code> <!-- [CSSOM] -->
|
|
<tr><td><dfn id="handler-onshow" title="handler-onshow"><code>onshow</code></dfn> <td> <code title="event-show">show</code>
|
|
<tr><td><dfn id="handler-onstalled" title="handler-onstalled"><code>onstalled</code></dfn> <td> <code title="event-media-stalled"><a href="#event-media-stalled">stalled</a></code>
|
|
<tr><td><dfn id="handler-onsubmit" title="handler-onsubmit"><code>onsubmit</code></dfn> <td> <code title="event-submit">submit</code>
|
|
<tr><td><dfn id="handler-onsuspend" title="handler-onsuspend"><code>onsuspend</code></dfn> <td> <code title="event-media-suspend"><a href="#event-media-suspend">suspend</a></code>
|
|
<tr><td><dfn id="handler-ontimeupdate" title="handler-ontimeupdate"><code>ontimeupdate</code></dfn> <td> <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code>
|
|
<tr><td><dfn id="handler-onvolumechange" title="handler-onvolumechange"><code>onvolumechange</code></dfn> <td> <code title="event-media-volumechange"><a href="#event-media-volumechange">volumechange</a></code>
|
|
<tr><td><dfn id="handler-onwaiting" title="handler-onwaiting"><code>onwaiting</code></dfn> <td> <code title="event-media-waiting"><a href="#event-media-waiting">waiting</a></code>
|
|
|
|
|
|
|
|
|
|
|
|
</table><hr><p>The following are the <a href="#event-handlers">event handlers</a> (and their
|
|
corresponding <a href="#event-handler-event-type" title="event handler event type">event handler
|
|
event types</a>) that must be supported by all <a href="#html-elements">HTML
|
|
elements</a> other than <code><a href="#the-body-element">body</a></code>, as both content
|
|
attributes and IDL attributes, and on <code><a href="#document">Document</a></code> objects,
|
|
as IDL attributes:</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-onblur" title="handler-onblur"><code>onblur</code></dfn> <td> <code title="event-blur">blur</code>
|
|
<tr><td><dfn id="handler-onerror" title="handler-onerror"><code>onerror</code></dfn> <td> <code title="event-error">error</code>
|
|
<tr><td><dfn id="handler-onfocus" title="handler-onfocus"><code>onfocus</code></dfn> <td> <code title="event-focus">focus</code>
|
|
<tr><td><dfn id="handler-onload" title="handler-onload"><code>onload</code></dfn> <td> <code title="event-load">load</code>
|
|
<tr><td><dfn id="handler-onscroll" title="handler-onscroll"><code>onscroll</code></dfn> <td> <code title="event-scroll">scroll</code>
|
|
</table><hr><p>The following are the <a href="#event-handlers">event handlers</a> (and their
|
|
corresponding <a href="#event-handler-event-type" title="event handler event type">event handler
|
|
event types</a>) that must be supported by <code><a href="#window">Window</a></code>
|
|
objects, as IDL attributes on the <code><a href="#window">Window</a></code> object, and
|
|
with corresponding content attributes and IDL attributes exposed on
|
|
the <code><a href="#the-body-element">body</a></code> and <code><a href="#frameset">frameset</a></code> elements:</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-window-onafterprint" title="handler-window-onafterprint"><code>onafterprint</code></dfn> <td> <code title="event-afterprint">afterprint</code>
|
|
<tr><td><dfn id="handler-window-onbeforeprint" title="handler-window-onbeforeprint"><code>onbeforeprint</code></dfn> <td> <code title="event-beforeprint">beforeprint</code>
|
|
<tr><td><dfn id="handler-window-onbeforeunload" title="handler-window-onbeforeunload"><code>onbeforeunload</code></dfn> <td> <code title="event-beforeunload">beforeunload</code>
|
|
<tr><td><dfn id="handler-window-onblur" title="handler-window-onblur"><code>onblur</code></dfn> <td> <code title="event-blur">blur</code>
|
|
<tr><td><dfn id="handler-window-onerror" title="handler-window-onerror"><code>onerror</code></dfn> <td> <code title="event-error">error</code>
|
|
<tr><td><dfn id="handler-window-onfocus" title="handler-window-onfocus"><code>onfocus</code></dfn> <td> <code title="event-focus">focus</code>
|
|
<tr><td><dfn id="handler-window-onhashchange" title="handler-window-onhashchange"><code>onhashchange</code></dfn> <td> <code title="event-hashchange"><a href="#event-hashchange">hashchange</a></code>
|
|
<tr><td><dfn id="handler-window-onload" title="handler-window-onload"><code>onload</code></dfn> <td> <code title="event-load">load</code>
|
|
<tr><td><dfn id="handler-window-onmessage" title="handler-window-onmessage"><code>onmessage</code></dfn> <td> <code title="event-message">message</code>
|
|
<tr><td><dfn id="handler-window-onoffline" title="handler-window-onoffline"><code>onoffline</code></dfn> <td> <code title="event-offline"><a href="#event-offline">offline</a></code>
|
|
<tr><td><dfn id="handler-window-ononline" title="handler-window-ononline"><code>ononline</code></dfn> <td> <code title="event-online"><a href="#event-online">online</a></code>
|
|
<tr><td><dfn id="handler-window-onpagehide" title="handler-window-onpagehide"><code>onpagehide</code></dfn> <td> <code title="event-pagehide"><a href="#event-pagehide">pagehide</a></code>
|
|
<tr><td><dfn id="handler-window-onpageshow" title="handler-window-onpageshow"><code>onpageshow</code></dfn> <td> <code title="event-pageshow"><a href="#event-pageshow">pageshow</a></code>
|
|
<tr><td><dfn id="handler-window-onpopstate" title="handler-window-onpopstate"><code>onpopstate</code></dfn> <td> <code title="event-popstate"><a href="#event-popstate">popstate</a></code>
|
|
<tr><td><dfn id="handler-window-onredo" title="handler-window-onredo"><code>onredo</code></dfn> <td> <code title="event-redo">redo</code>
|
|
<tr><td><dfn id="handler-window-onresize" title="handler-window-onresize"><code>onresize</code></dfn> <td> <code title="event-resize">resize</code> <!-- [CSSOM] -->
|
|
<tr><td><dfn id="handler-window-onscroll" title="handler-window-onscroll"><code>onscroll</code></dfn> <td> <code title="event-scroll">scroll</code>
|
|
<tr><td><dfn id="handler-window-onstorage" title="handler-window-onstorage"><code>onstorage</code></dfn> <td> <code title="event-storage">storage</code>
|
|
<tr><td><dfn id="handler-window-onundo" title="handler-window-onundo"><code>onundo</code></dfn> <td> <code title="event-undo">undo</code>
|
|
<tr><td><dfn id="handler-window-onunload" title="handler-window-onunload"><code>onunload</code></dfn> <td> <code title="event-unload">unload</code>
|
|
</table><p class="note">The <code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code>
|
|
handler is also used for <a href="#runtime-script-errors">reporting script errors</a>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="event-firing"><span class="secno">6.1.6.3 </span>Event firing</h5>
|
|
|
|
<p>Certain operations and methods are defined as firing events on
|
|
elements. For example, the <code title="dom-click"><a href="#dom-click">click()</a></code>
|
|
method on the <code><a href="#htmlelement">HTMLElement</a></code> interface is defined as
|
|
firing a <code title="event-click"><a href="#event-click">click</a></code> event on the
|
|
element. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
<p><dfn id="fire-a-simple-event" title="fire a simple event">Firing a simple event named <var title="">e</var></dfn> means that an event with the name <var title="">e</var>, which does not bubble (except where otherwise
|
|
stated) and is not cancelable (except where otherwise stated), and
|
|
which uses the <code><a href="#event">Event</a></code> interface, must be dispatched at
|
|
the given target.</p>
|
|
|
|
<p><dfn id="fire-a-synthetic-mouse-event" title="fire a synthetic mouse event">Firing a synthetic
|
|
mouse event named <var title="">e</var></dfn> means that an event
|
|
with the name <var title="">e</var>, which does not bubble (except
|
|
where otherwise stated) and is not cancelable (except where
|
|
otherwise stated), and which uses the <code><a href="#mouseevent">MouseEvent</a></code>
|
|
interface, must be dispatched at the given target. 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="fire-a-click-event" title="fire a click event">Firing a <code title="event-click">click</code> event</dfn> means <a href="#fire-a-synthetic-mouse-event" title="fire
|
|
a synthetic mouse event">firing a synthetic mouse event named <code title="event-click">click</code></a>, which bubbles and is
|
|
cancelable.</p>
|
|
|
|
<p>The default action of these events is to do nothing except where
|
|
otherwise stated.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="events-and-the-window-object"><span class="secno">6.1.6.4 </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><a href="#document">Document</a></code> in a <a href="#browsing-context">browsing context</a>, if the
|
|
event is not a <code title="event-load">load</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 propagate to the
|
|
<code><a href="#window">Window</a></code> object before propagating to any of the nodes,
|
|
as if the <code><a href="#window">Window</a></code> object was the parent of the
|
|
<code><a href="#document">Document</a></code> in the dispatch chain.</li>
|
|
|
|
<li>In the bubble phase, the event must propagate up to the
|
|
<code><a href="#window">Window</a></code> object at the end of the phase, unless bubbling
|
|
has been prevented, again as if the <code><a href="#window">Window</a></code> object was
|
|
the parent of the <code><a href="#document">Document</a></code> in the dispatch chain.</li>
|
|
|
|
</ol></div><h3 id="atob"><span class="secno">6.2 </span>Base64 utility methods</h3><p>The <code title="dom-windowbase64-atob"><a href="#dom-windowbase64-atob">atob()</a></code> and <code title="dom-windowbase64-btoa"><a href="#dom-windowbase64-btoa">btoa()</a></code> methods allow authors to
|
|
transform content to and from the base64 encoding.</p><pre class="idl">[Supplemental, NoInterfaceObject]
|
|
interface <dfn id="windowbase64">WindowBase64</dfn> {
|
|
DOMString <a href="#dom-windowbase64-btoa" title="dom-windowbase64-btoa">btoa</a>(in DOMString btoa);
|
|
DOMString <a href="#dom-windowbase64-atob" title="dom-windowbase64-atob">atob</a>(in DOMString atob);
|
|
};
|
|
<a href="#window">Window</a> implements <a href="#windowbase64">WindowBase64</a>;</pre><p class="note">In these APIs, for mnemonic purposes, the "b" can be
|
|
considered to stand for "binary", and the "a" for "ASCII". In
|
|
practice, though, for primarily historical reasons, both the input
|
|
and output of these functions are Unicode strings.<dl class="domintro"><dt><var title="">result</var> = <var title="">window</var> . <code title="dom-windowbase64-btoa"><a href="#dom-windowbase64-btoa">btoa</a></code>( <var title="">data</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Takes the input data, in the form of a Unicode string
|
|
containing only characters in the range U+0000 to U+00FF, each
|
|
representing a binary byte with values 0x00 to 0xFF respectively,
|
|
and converts it to its base64 representation, which it returns.</p>
|
|
|
|
<p>Throws an <code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception if the
|
|
input string contains any out-of-range characters.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">result</var> = <var title="">window</var> . <code title="dom-windowbase64-atob"><a href="#dom-windowbase64-atob">atob</a></code>( <var title="">data</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Takes the input data, in the form of a Unicode string
|
|
containing base64-encoded binary data, decodes it, and returns a
|
|
string consisting of characters in the range U+0000 to U+00FF,
|
|
each representing a binary byte with values 0x00 to 0xFF
|
|
respectively, corresponding to that binary data.</p>
|
|
|
|
<p>Throws an <code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception if the
|
|
input string is not valid base64 data.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p class="note">The <code><a href="#windowbase64">WindowBase64</a></code> interface adds to the
|
|
<code><a href="#window">Window</a></code> interface and the <code>WorkerUtils</code>
|
|
interface (part of Web Workers).</p>
|
|
|
|
<p>The <dfn id="dom-windowbase64-btoa" title="dom-windowbase64-btoa"><code>btoa()</code></dfn>
|
|
method must throw an <code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception if
|
|
the method's first argument contains any character whose code point
|
|
is greater than U+00FF. Otherwise, the user agent must convert that
|
|
argument to a sequence of octets whose <var title="">n</var>th octet
|
|
is the eight-bit representation of the code point of the <var title="">n</var>th character of the argument, and then must apply
|
|
the base64 algorithm to that sequence of octets, and return the
|
|
result. <a href="#refsRFC4648">[RFC4648]</a></p>
|
|
|
|
|
|
<p>The <dfn id="dom-windowbase64-atob" title="dom-windowbase64-atob"><code>atob()</code></dfn>
|
|
method must run the following steps to parse the string passed in
|
|
the method's first argument:</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the string being
|
|
parsed.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p>If the length of <var title="">input</var> divides by 4
|
|
leaving no remainder, then: if <var title="">input</var> ends with
|
|
one or two U+003D EQUALS SIGN (=) characters, remove them from <var title="">input</var>.</li>
|
|
|
|
<li><p>If the length of <var title="">input</var> divides by 4
|
|
leaving a remainder of 1, throw an
|
|
<code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception and abort these
|
|
steps.</p>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">input</var> contains a character that is not
|
|
in the following list of characters and character ranges, throw an
|
|
<code><a href="#invalid_character_err">INVALID_CHARACTER_ERR</a></code> exception and abort these
|
|
steps:</p>
|
|
|
|
<ul class="brief"><li>U+002B PLUS SIGN (+)
|
|
<li>U+002F SOLIDUS (/)
|
|
<li>U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9)
|
|
<li>U+0041 LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z
|
|
<li>U+0061 LATIN SMALL LETTER A to U+007A LATIN SMALL LETTER Z
|
|
</ul></li>
|
|
|
|
<li><p>Let <var title="">output</var> be a string, initially
|
|
empty.</li>
|
|
|
|
<li><p>Let <var title="">buffer</var> be a buffer that can have
|
|
bits appended to it, initially empty.</li>
|
|
|
|
<li>
|
|
|
|
<p>While <var title="">position</var> does not point past the end
|
|
of <var title="">input</var>, run these substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Find the character pointed to by <var title="">position</var>
|
|
in the first column of the following table. Let <var title="">n</var> be the number given in the second cell of the
|
|
same row.</p>
|
|
|
|
<div id="base64-table">
|
|
<table><thead><tr><th>Character
|
|
<th>Number
|
|
<tbody><tr><td>A<td>0
|
|
<tr><td>B<td>1
|
|
<tr><td>C<td>2
|
|
<tr><td>D<td>3
|
|
<tr><td>E<td>4
|
|
<tr><td>F<td>5
|
|
<tr><td>G<td>6
|
|
<tr><td>H<td>7
|
|
<tr><td>I<td>8
|
|
<tr><td>J<td>9
|
|
<tr><td>K<td>10
|
|
<tr><td>L<td>11
|
|
<tr><td>M<td>12
|
|
<tr><td>N<td>13
|
|
<tr><td>O<td>14
|
|
<tr><td>P<td>15
|
|
<tr><td>Q<td>16
|
|
<tr><td>R<td>17
|
|
<tr><td>S<td>18
|
|
<tr><td>T<td>19
|
|
<tr><td>U<td>20
|
|
<tr><td>V<td>21
|
|
<tr><td>W<td>22
|
|
<tr><td>X<td>23
|
|
<tr><td>Y<td>24
|
|
<tr><td>Z<td>25
|
|
<tr><td>a<td>26
|
|
<tr><td>b<td>27
|
|
<tr><td>c<td>28
|
|
<tr><td>d<td>29
|
|
<tr><td>e<td>30
|
|
<tr><td>f<td>31
|
|
<tr><td>g<td>32
|
|
<tr><td>h<td>33
|
|
<tr><td>i<td>34
|
|
<tr><td>j<td>35
|
|
<tr><td>k<td>36
|
|
<tr><td>l<td>37
|
|
<tr><td>m<td>38
|
|
<tr><td>n<td>39
|
|
<tr><td>o<td>40
|
|
<tr><td>p<td>41
|
|
<tr><td>q<td>42
|
|
<tr><td>r<td>43
|
|
<tr><td>s<td>44
|
|
<tr><td>t<td>45
|
|
<tr><td>u<td>46
|
|
<tr><td>v<td>47
|
|
<tr><td>w<td>48
|
|
<tr><td>x<td>49
|
|
<tr><td>y<td>50
|
|
<tr><td>z<td>51
|
|
<tr><td>0<td>52
|
|
<tr><td>1<td>53
|
|
<tr><td>2<td>54
|
|
<tr><td>3<td>55
|
|
<tr><td>4<td>56
|
|
<tr><td>5<td>57
|
|
<tr><td>6<td>58
|
|
<tr><td>7<td>59
|
|
<tr><td>8<td>60
|
|
<tr><td>9<td>61
|
|
<tr><td>+<td>62
|
|
<tr><td>/<td>63
|
|
</table></div>
|
|
|
|
</li>
|
|
|
|
<li><p>Append to <var title="">buffer</var> the six bits
|
|
corresponding to <var title="">number</var>, most significant bit
|
|
first.</li>
|
|
|
|
<li><p>If <var title="">buffer</var> has accumulated 24 bits,
|
|
interpret them as three 8-bit big-endian numbers. Append the
|
|
three characters with code points equal to those numbers to <var title="">output</var>, in the same order, and then empty <var title="">buffer</var>.</li>
|
|
|
|
<li><p>Advance <var title="">position</var> by one
|
|
character.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">buffer</var> is not empty, it contains either
|
|
12 or 18 bits. If it contains 12 bits, discard the last four and
|
|
interpret the remaining eight as an 8-bit big-endian number. If it
|
|
contains 18 bits, discard the last two and interpret the remaining
|
|
16 as two 8-bit big-endian numbers. Append the one or two
|
|
characters with code points equal to those one or two numbers to
|
|
<var title="">output</var>, in the same order.</p>
|
|
|
|
<p class="note">The discarded bits mean that, for instance, <code title="">atob("YQ")</code> and <code title="">atob("YR")</code>
|
|
both return "<code title="">a</code>".</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Return <var title="">output</var>.</li>
|
|
|
|
</ol></div><p class="note">Some base64 encoders add newlines or other
|
|
whitespace to their output. The <code title="dom-windowbase64-atob"><a href="#dom-windowbase64-atob">atob()</a></code> method throws an
|
|
exception if its input contains characters other than those
|
|
described by the regular expression bracket expression <code title="">[+/=0-9A-Za-z]</code>, so other characters need to be
|
|
removed before <code title="dom-windowbase64-atob"><a href="#dom-windowbase64-atob">atob()</a></code> is
|
|
used for decoding.<h3 id="timers"><span class="secno">6.3 </span>Timers</h3><p>The <code title="dom-windowtimers-setTimeout"><a href="#dom-windowtimers-settimeout">setTimeout()</a></code>
|
|
and <code title="dom-windowtimers-setInterval"><a href="#dom-windowtimers-setinterval">setInterval()</a></code>
|
|
methods allow authors to schedule timer-based callbacks.<pre class="idl">[Supplemental, NoInterfaceObject]
|
|
interface <dfn id="windowtimers">WindowTimers</dfn> {
|
|
long <a href="#dom-windowtimers-settimeout" title="dom-windowtimers-setTimeout">setTimeout</a>(in any handler, in optional any timeout, in any... args);
|
|
void <a href="#dom-windowtimers-cleartimeout" title="dom-windowtimers-clearTimeout">clearTimeout</a>(in long handle);
|
|
long <a href="#dom-windowtimers-setinterval" title="dom-windowtimers-setInterval">setInterval</a>(in any handler, in optional any timeout, in any... args);
|
|
void <a href="#dom-windowtimers-clearinterval" title="dom-windowtimers-clearInterval">clearInterval</a>(in long handle);
|
|
};
|
|
<a href="#window">Window</a> implements <a href="#windowtimers">WindowTimers</a>;</pre><dl class="domintro"><dt><var title="">handle</var> = <var title="">window</var> . <code title="dom-windowtimers-setTimeout"><a href="#dom-windowtimers-settimeout">setTimeout</a></code>( <var title="">handler</var> [, <var title="">timeout</var> [, <var title="">arguments</var> ] ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Schedules a timeout to run <var title="">handler</var> after
|
|
<var title="">timeout</var> milliseconds. Any <var title="">arguments</var> are passed straight through to the <var title="">handler</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">handle</var> = <var title="">window</var> . <code title="dom-windowtimers-setTimeout"><a href="#dom-windowtimers-settimeout">setTimeout</a></code>( <var title="">code</var> [, <var title="">timeout</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Schedules a timeout to compile and run <var title="">code</var>
|
|
after <var title="">timeout</var> milliseconds.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-windowtimers-clearTimeout"><a href="#dom-windowtimers-cleartimeout">clearTimeout</a></code>( <var title="">handle</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Cancels the timeout set with <code title="dom-windowtimers-setTimeout"><a href="#dom-windowtimers-settimeout">setTimeout()</a></code> identified by <var title="">handle</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">handle</var> = <var title="">window</var> . <code title="dom-windowtimers-setInterval"><a href="#dom-windowtimers-setinterval">setInterval</a></code>( <var title="">handler</var> [, <var title="">timeout</var> [, <var title="">arguments</var> ] ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Schedules a timeout to run <var title="">handler</var> every
|
|
<var title="">timeout</var> milliseconds. Any <var title="">arguments</var> are passed straight through to the <var title="">handler</var>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">handle</var> = <var title="">window</var> . <code title="dom-windowtimers-setInterval"><a href="#dom-windowtimers-setinterval">setInterval</a></code>( <var title="">code</var> [, <var title="">timeout</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Schedules a timeout to compile and run <var title="">code</var>
|
|
every <var title="">timeout</var> milliseconds.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-windowtimers-clearInterval"><a href="#dom-windowtimers-clearinterval">clearInterval</a></code>( <var title="">handle</var> )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Cancels the timeout set with <code title="dom-windowtimers-setInterval"><a href="#dom-windowtimers-setinterval">setInterval()</a></code> identified by <var title="">handle</var>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p class="note">This API does not guarantee that timers will fire
|
|
exactly on schedule. Delays due to CPU load, other tasks, etc, are
|
|
to be expected.<div class="impl">
|
|
|
|
<p class="note">The <code><a href="#windowtimers">WindowTimers</a></code> interface adds to the
|
|
<code><a href="#window">Window</a></code> interface and the <code>WorkerUtils</code>
|
|
interface (part of Web Workers).</p>
|
|
|
|
<p>Each object that implements the <code><a href="#windowtimers">WindowTimers</a></code>
|
|
interface has a <dfn id="list-of-active-timeouts">list of active timeouts</dfn> and a <dfn id="list-of-active-intervals">list
|
|
of active intervals</dfn>. Each entry in these lists is identified
|
|
by a number, which must be unique within its list for the lifetime
|
|
of the object that implements the <code><a href="#windowtimers">WindowTimers</a></code>
|
|
interface.</p>
|
|
|
|
<hr><p>The <dfn id="dom-windowtimers-settimeout" title="dom-windowtimers-setTimeout"><code>setTimeout()</code></dfn>
|
|
method must run the following steps:
|
|
|
|
<ol><li><p>Let <var title="">handle</var> be a user-agent-defined integer
|
|
that is greater than zero that will identify the timeout to be set
|
|
by this call.</li>
|
|
|
|
<li><p>Add an entry to the <a href="#list-of-active-timeouts">list of active timeouts</a> for
|
|
<var title="">handle</var>.</li>
|
|
|
|
<li><p><a href="#get-the-timed-task">Get the timed task</a> <var title="">handle</var> in
|
|
the <a href="#list-of-active-timeouts">list of active timeouts</a>, and let <var title="">task</var> be the result.</li>
|
|
|
|
<li><p><a href="#get-the-timeout">Get the timeout</a>, and let <var title="">timeout</var> be the result.</li>
|
|
|
|
<li><p>If the currently running <a href="#concept-task" title="concept-task">task</a> is a task that was created by the
|
|
<code title="dom-windowtimers-setTimeout"><a href="#dom-windowtimers-settimeout">setTimeout()</a></code>
|
|
method, and <var title="">timeout</var> is less than 4, then
|
|
increase <var title="">timeout</var> to 4.</li>
|
|
|
|
<li><p>Return <var title="">handle</var>, and then continue running
|
|
this algorithm asynchronously.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#method-context">method context</a> is a <code><a href="#window">Window</a></code>
|
|
object, wait until the <code><a href="#document">Document</a></code> associated with the
|
|
<a href="#method-context">method context</a> has been <a href="#fully-active">fully active</a> for
|
|
a further <var title="">timeout</var> milliseconds (not
|
|
necessarily consecutively).</p>
|
|
|
|
<p>Otherwise, if the <a href="#method-context">method context</a> is a
|
|
<code>WorkerUtils</code> object, wait until <var title="">timeout</var> milliseconds have passed with the worker
|
|
not suspended (not necessarily consecutively).</p>
|
|
|
|
<p>Otherwise, act as described in the specification that defines
|
|
that the <code><a href="#windowtimers">WindowTimers</a></code> interface is implemented by
|
|
some other object.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Wait until any invocations of this algorithm started before
|
|
this one whose <var title="">timeout</var> is equal to or less than
|
|
this one's have completed.</li>
|
|
|
|
<li>
|
|
|
|
<p>Optionally, wait a further user-agent defined length of
|
|
time.</p>
|
|
|
|
<p class="note">This is intended to allow user agents to pad
|
|
timeouts as needed to optimise the power usage of the device. For
|
|
example, some processors have a low-power mode where the
|
|
granularity of timers is reduced; on such platforms, user agents
|
|
can slow timers down to fit this schedule instead of requiring the
|
|
processor to use the more accurate mode with its associated higher
|
|
power usage.</p>
|
|
|
|
</li>
|
|
|
|
<li><p><a href="#queue-a-task" title="queue a task">Queue</a> the <var title="">task</var> <a href="#concept-task" title="concept-task">task</a>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-windowtimers-cleartimeout" title="dom-windowtimers-clearTimeout"><code>clearTimeout()</code></dfn>
|
|
method must clear the entry identified as <var title="">handle</var>
|
|
from the <a href="#list-of-active-timeouts">list of active timeouts</a> of the
|
|
<code><a href="#windowtimers">WindowTimers</a></code> object on which the method was invoked,
|
|
where <var title="">handle</var> is the argument passed to the
|
|
method, if any. (If <var title="">handle</var> does not identify an
|
|
entry in the <a href="#list-of-active-timeouts">list of active timeouts</a> of the
|
|
<code><a href="#windowtimers">WindowTimers</a></code> object on which the method was invoked,
|
|
the method does nothing.)</p>
|
|
|
|
<hr><p>The <dfn id="dom-windowtimers-setinterval" title="dom-windowtimers-setInterval"><code>setInterval()</code></dfn>
|
|
method must run the following steps:
|
|
|
|
<ol><li><p>Let <var title="">handle</var> be a user-agent-defined integer
|
|
that is greater than zero that will identify the interval to be set
|
|
by this call.</li>
|
|
|
|
<li><p>Add an entry to the <a href="#list-of-active-intervals">list of active intervals</a> for
|
|
<var title="">handle</var>.</li>
|
|
|
|
<li><p><a href="#get-the-timed-task">Get the timed task</a> <var title="">handle</var> in
|
|
the <a href="#list-of-active-intervals">list of active intervals</a>, and let <var title="">task</var> be the result.</li>
|
|
|
|
<li><p><a href="#get-the-timeout">Get the timeout</a>, and let <var title="">timeout</var> be the result.</li>
|
|
|
|
<li><p>If <var title="">timeout</var> is less than 10, then
|
|
increase <var title="">timeout</var> to 10.</li>
|
|
<li><p>Return <var title="">handle</var>, and then continue running
|
|
this algorithm asynchronously.</li>
|
|
|
|
|
|
<li>
|
|
|
|
<p><i title="">Wait</i>: If the <a href="#method-context">method context</a> is a
|
|
<code><a href="#window">Window</a></code> object, wait until the <code><a href="#document">Document</a></code>
|
|
associated with the <a href="#method-context">method context</a> has been <a href="#fully-active">fully
|
|
active</a> for a further <var title="">interval</var>
|
|
milliseconds (not necessarily consecutively).</p>
|
|
|
|
<p>Otherwise, if the <a href="#method-context">method context</a> is a
|
|
<code>WorkerUtils</code> object, wait until <var title="">interval</var> milliseconds have passed with the worker
|
|
not suspended (not necessarily consecutively).</p>
|
|
|
|
<p>Otherwise, act as described in the specification that defines
|
|
that the <code><a href="#windowtimers">WindowTimers</a></code> interface is implemented by
|
|
some other object.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Optionally, wait a further user-agent defined length of
|
|
time.</p>
|
|
|
|
<p class="note">This is intended to allow user agents to pad
|
|
timeouts as needed to optimise the power usage of the device. For
|
|
example, some processors have a low-power mode where the
|
|
granularity of timers is reduced; on such platforms, user agents
|
|
can slow timers down to fit this schedule instead of requiring the
|
|
processor to use the more accurate mode with its associated higher
|
|
power usage.</p>
|
|
|
|
</li>
|
|
|
|
<li><p><a href="#queue-a-task" title="queue a task">Queue</a> the <var title="">task</var> <a href="#concept-task" title="concept-task">task</a>.</li>
|
|
|
|
<li><p>Return to the step labeled <i>wait</i>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-windowtimers-clearinterval" title="dom-windowtimers-clearInterval"><code>clearInterval()</code></dfn>
|
|
method must clear the entry identified as <var title="">handle</var>
|
|
from the <a href="#list-of-active-intervals">list of active intervals</a> of the
|
|
<code><a href="#windowtimers">WindowTimers</a></code> object on which the method was invoked,
|
|
where <var title="">handle</var> is the argument passed to the
|
|
method, if any. (If <var title="">handle</var> does not identify an
|
|
entry in the <a href="#list-of-active-intervals">list of active intervals</a> of the
|
|
<code><a href="#windowtimers">WindowTimers</a></code> object on which the method was invoked,
|
|
the method does nothing.)</p>
|
|
|
|
<hr><p>The <dfn id="method-context">method context</dfn>, when referenced by the algorithms
|
|
in this section, is the object on which the method for which the
|
|
algorithm is running is implemented (a <code><a href="#window">Window</a></code> or
|
|
<code>WorkerUtils</code> object).</p>
|
|
|
|
<p>When the above methods are invoked and try to <dfn id="get-the-timed-task">get the timed
|
|
task</dfn> <var title="">handle</var> in list <var title="">list</var>,
|
|
they must run the following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the first argument to the invoked method is an object that
|
|
has an internal [[Call]] method, then return a <a href="#concept-task" title="concept-task">task</a> that checks if the entry for <var title="">handle</var> in <var title="">list</var> has been
|
|
cleared, and if it has not, calls the aforementioned [[Call]]
|
|
method with as its arguments the third and subsequent arguments to
|
|
the invoked method (if any), and with an undefined <var title="">thisArg</var>, and abort these steps. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
<p class="note">Setting <var title="">thisArg</var> to undefined
|
|
means that the function code will be executed with the <code title="">this</code> keyword bound to the <code><a href="#windowproxy">WindowProxy</a></code>
|
|
or the <code>WorkerGlobalScope</code> object, as if the code was
|
|
running in the global scope.</p>
|
|
|
|
<p>Otherwise, continue with the remaining steps.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Apply the ToString() abstract operation to the first
|
|
argument to the method, and let <var title="">script source</var>
|
|
be the result. <a href="#refsECMA262">[ECMA262]</a></li>
|
|
|
|
<li><p>Let <var title="">script language</var> be
|
|
JavaScript.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#method-context">method context</a> is a <code><a href="#window">Window</a></code>
|
|
object, let <var title="">global object</var> be the <a href="#method-context">method
|
|
context</a>, let <var title="">browsing context</var> be the
|
|
<a href="#browsing-context">browsing context</a> with which <var title="">global
|
|
object</var> is associated, let <var title="">character
|
|
encoding</var> be the <a href="#document-s-character-encoding" title="document's character
|
|
encoding">character encoding</a> of the <code><a href="#document">Document</a></code>
|
|
associated with <var title="">global object</var> (<a href="#sce-not-copy">this is a reference, not a copy</a>), and let
|
|
<var title="">base URL</var> be the <a href="#document-base-url" title="document base
|
|
URL">base URL</a> of the <code><a href="#document">Document</a></code> associated with
|
|
<var title="">global object</var> (<a href="#sbu-not-copy">this is
|
|
a reference, not a copy</a>).</p>
|
|
|
|
<p>Otherwise, if the <a href="#method-context">method context</a> is a
|
|
<code>WorkerUtils</code> object, let <var title="">global
|
|
object</var>, <var title="">browsing context</var>, <var title="">document</var>, <var title="">character encoding</var>,
|
|
and <var title="">base URL</var> be the <a href="#script-s-global-object">script's global
|
|
object</a>, <a href="#script-s-browsing-context">script's browsing context</a>,
|
|
<a href="#script-s-document">script's document</a>, <a href="#script-s-url-character-encoding">script's URL character
|
|
encoding</a>, and <a href="#script-s-base-url">script's base URL</a> (respectively)
|
|
of the <a href="#concept-script" title="concept-script">script</a> that the
|
|
<span>run a worker</span> algorithm created when it created the
|
|
<a href="#method-context">method context</a>.</p>
|
|
|
|
<p>Otherwise, act as described in the specification that defines
|
|
that the <code><a href="#windowtimers">WindowTimers</a></code> interface is implemented by
|
|
some other object.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Return a <a href="#concept-task" title="concept-task">task</a> that checks
|
|
if the entry for <var title="">handle</var> in <var title="">list</var> has been cleared, and if it has not, <a href="#create-a-script" title="create a script">creates a script</a> using <var title="">script source</var> as the script source, <var title="">scripting language</var> as the scripting language, <var title="">global object</var> as the global object, <var title="">browsing context</var> as the browsing context, <var title="">document</var> as the document, <var title="">character
|
|
encoding</var> as the URL character encoding, and <var title="">base URL</var> as the base URL.</li>
|
|
|
|
</ol><p>When the above methods are to <dfn id="get-the-timeout">get the timeout</dfn>, they
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">timeout</var> be the second argument to
|
|
the method, or zero if the argument was omitted.</li>
|
|
|
|
<li><p>Apply the ToString() abstract operation to <var title="">timeout</var>, and let <var title="">timeout</var>
|
|
be the result. <a href="#refsECMA262">[ECMA262]</a></li>
|
|
|
|
<li><p>Apply the ToNumber() abstract operation to <var title="">timeout</var>, and let <var title="">timeout</var> be the
|
|
result. <a href="#refsECMA262">[ECMA262]</a></li>
|
|
|
|
<li><p>If <var title="">timeout</var> is an Infinity value, a
|
|
Not-a-Number (NaN) value, or negative, let <var title="">timeout</var> be zero.</li>
|
|
|
|
<li><p>Round <var title="">timeout</var> down to the nearest
|
|
integer, and let <var title="">timeout</var> be the
|
|
result.</li>
|
|
|
|
<li><p>Return <var title="">timeout</var>.</li>
|
|
|
|
</ol><hr><p>The <a href="#task-source">task source</a> for these <a href="#concept-task" title="concept-task">tasks</a> is the <dfn id="timer-task-source">timer task
|
|
source</dfn>.</p>
|
|
|
|
</div><h3 id="user-prompts"><span class="secno">6.4 </span>User prompts</h3><h4 id="simple-dialogs"><span class="secno">6.4.1 </span>Simple dialogs</h4><dl class="domintro"><dt><var title="">window</var> . <code title="dom-alert"><a href="#dom-alert">alert</a></code>(<var title="">message</var>)</dt>
|
|
<dd>
|
|
|
|
<p>Displays a modal alert with the given message, and waits for the user to dismiss it.</p>
|
|
|
|
<p>A call to the <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">navigator.yieldForStorageUpdates()</a></code>
|
|
method is implied when this method is invoked.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">result</var> = <var title="">window</var> . <code title="dom-confirm"><a href="#dom-confirm">confirm</a></code>(<var title="">message</var>)</dt>
|
|
<dd>
|
|
|
|
<p>Displays a modal OK/Cancel prompt with the given message, waits
|
|
for the user to dismiss it, and returns true if the user clicks OK
|
|
and false if the user clicks Cancel.</p>
|
|
|
|
<p>A call to the <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">navigator.yieldForStorageUpdates()</a></code>
|
|
method is implied when this method is invoked.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">result</var> = <var title="">window</var> . <code title="dom-prompt"><a href="#dom-prompt">prompt</a></code>(<var title="">message</var> [, <var title="">default</var>] )</dt>
|
|
<dd>
|
|
|
|
<p>Displays a modal text field prompt with the given message,
|
|
waits for the user to dismiss it, and returns the value that the
|
|
user entered. If the user cancels the prompt, then returns null
|
|
instead. If the second argument is present, then the given value
|
|
is used as a default.</p>
|
|
|
|
<p>A call to the <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">navigator.yieldForStorageUpdates()</a></code>
|
|
method is implied when this method is invoked.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-alert" title="dom-alert"><code>alert(<var title="">message</var>)</code></dfn> method, when invoked, must
|
|
release the <a href="#storage-mutex">storage mutex</a> and 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="dom-confirm" title="dom-confirm"><code>confirm(<var title="">message</var>)</code></dfn> method, when invoked, must
|
|
release the <a href="#storage-mutex">storage mutex</a> and 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 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="dom-prompt" title="dom-prompt"><code>prompt(<var title="">message</var>, <var title="">default</var>)</code></dfn>
|
|
method, when invoked, must release the <a href="#storage-mutex">storage mutex</a>,
|
|
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 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>
|
|
|
|
</div><h4 id="printing"><span class="secno">6.4.2 </span>Printing</h4><dl class="domintro"><dt><var title="">window</var> . <code title="dom-print"><a href="#dom-print">print</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Prompts the user to print the page.</p>
|
|
|
|
<p>A call to the <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">navigator.yieldForStorageUpdates()</a></code>
|
|
method is implied when this method is invoked.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-print" title="dom-print"><code>print()</code></dfn> method,
|
|
when invoked, must run the <a href="#printing-steps">printing steps</a>.</p>
|
|
|
|
<p>User agents should also run the <a href="#printing-steps">printing steps</a>
|
|
whenever the user asks for the opportunity to <a href="#obtain-a-physical-form">obtain a
|
|
physical form</a> (e.g. printed copy), or the representation of a
|
|
physical form (e.g. PDF copy), of a document.</p>
|
|
|
|
<p>The <dfn id="printing-steps">printing steps</dfn> are as follows:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>The user agent may display a message to the user and/or may
|
|
abort these steps.</p>
|
|
|
|
<p class="example">For instance, a kiosk browser could silently
|
|
ignore any invocations of the <code title="dom-print"><a href="#dom-print">print()</a></code> method.</p>
|
|
|
|
<p class="example">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.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>The user agent must <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-beforeprint">beforeprint</code> at the
|
|
<code><a href="#window">Window</a></code> object of the <code><a href="#document">Document</a></code> that is
|
|
being printed, as well as any <a href="#nested-browsing-context" title="nested browsing
|
|
context">nested browsing contexts</a> in it.</p>
|
|
|
|
<p class="example">The <code title="event-beforeprint">beforeprint</code> event can be used
|
|
to annotate the printed copy, for instance adding the time at
|
|
which the document was printed.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>The user agent must release the <a href="#storage-mutex">storage mutex</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>The user agent should offer the user the opportunity to
|
|
<a href="#obtain-a-physical-form">obtain a physical form</a> (or the representation of a
|
|
physical form) of the document. The user agent may 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. 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.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>The user agent must <a href="#fire-a-simple-event">fire a simple event</a> named
|
|
<code title="event-afterprint">afterprint</code> at the
|
|
<code><a href="#window">Window</a></code> object of the <code><a href="#document">Document</a></code> that is
|
|
being printed, as well as any <a href="#nested-browsing-context" title="nested browsing
|
|
context">nested browsing contexts</a> in it.</p>
|
|
|
|
<p class="example">The <code title="event-afterprint">afterprint</code> 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.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><h4 id="dialogs-implemented-using-separate-documents"><span class="secno">6.4.3 </span>Dialogs implemented using separate documents</h4><dl class="domintro"><dt><var title="">result</var> = <var title="">window</var> . <code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog</a></code>(<var title="">url</var> [, <var title="">argument</var>] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Prompts the user with the given page, waits for that page to
|
|
close, and returns the return value.</p>
|
|
|
|
<p>A call to the <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">navigator.yieldForStorageUpdates()</a></code>
|
|
method is implied when this method is invoked.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-showmodaldialog" title="dom-showModalDialog"><code>showModalDialog(<var title="">url</var>, <var title="">argument</var>)</code></dfn> method, when invoked, must
|
|
cause the user agent to run the following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p><a href="#resolve-a-url" title="resolve a url">Resolve</a> <var title="">url</var> relative to the <a href="#entry-script">entry script</a>'s
|
|
<a href="#script-s-base-url" title="script's base URL">base URL</a>.</p>
|
|
|
|
<p>If this fails, then throw a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception
|
|
and abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Release the <a href="#storage-mutex">storage mutex</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the user agent is configured such that this invocation of
|
|
<code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog()</a></code> is
|
|
somehow disabled, then return the empty string and abort these
|
|
steps.</p>
|
|
|
|
<p class="note">User agents are expected to disable this method in
|
|
certain cases to avoid user annoyance (e.g. as part of their popup
|
|
blocker feature). 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.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">the list of background browsing
|
|
contexts</var> be a list of all the browsing contexts that:</p>
|
|
|
|
<ul><li>are part of the same <a href="#unit-of-related-browsing-contexts">unit of related browsing
|
|
contexts</a> as the browsing context of the
|
|
<code><a href="#window">Window</a></code> object on which the <code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog()</a></code> method was
|
|
called, and that</li>
|
|
|
|
<li>have an <a href="#active-document">active document</a> whose
|
|
<a href="#origin">origin</a> is the <a href="#same-origin" title="same origin">same</a>
|
|
as the <a href="#origin">origin</a> of the <a href="#concept-script" title="concept-script">script</a> that called the <code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog()</a></code> method at
|
|
the time the method was called,</li>
|
|
</ul><p>...as well as any browsing contexts that are nested inside any
|
|
of the browsing contexts matching those conditions.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Disable the user interface for all the browsing contexts in
|
|
<var title="">the list of background browsing contexts</var>. This
|
|
should prevent the user from navigating those browsing contexts,
|
|
causing events to be sent to those browsing context, or editing
|
|
any content in those browsing contexts. However, it does not
|
|
prevent those browsing contexts from receiving events from sources
|
|
other than the user, from running scripts, from running
|
|
animations, and so forth.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Create a new <a href="#auxiliary-browsing-context">auxiliary browsing context</a>, with the
|
|
<a href="#opener-browsing-context">opener browsing context</a> being the browsing context of
|
|
the <code><a href="#window">Window</a></code> object on which the <code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog()</a></code> method was
|
|
called. The new auxiliary browsing context has no name.</p>
|
|
|
|
<p class="note">This <a href="#browsing-context">browsing context</a>'s
|
|
<code><a href="#document">Document</a></code>s' <code><a href="#window">Window</a></code> objects all implement
|
|
the <code><a href="#windowmodal">WindowModal</a></code> interface.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the <a href="#dialog-arguments">dialog arguments</a> of the new browsing
|
|
context be set to the value of <var title="">argument</var>, or
|
|
the 'undefined' value if the argument was omitted.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the <a href="#dialog-arguments-origin">dialog arguments' origin</a> be the
|
|
<a href="#origin">origin</a> of the <a href="#concept-script" title="concept-script">script</a> that called the <code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog()</a></code> method.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#navigate">Navigate</a> the new
|
|
<a href="#browsing-context">browsing context</a> to the <a href="#absolute-url">absolute URL</a>
|
|
that resulted from <a href="#resolve-a-url" title="resolve a url">resolving</a>
|
|
<var title="">url</var> earlier, with <a href="#replacement-enabled">replacement
|
|
enabled</a>, and with the <a href="#script-s-browsing-context" title="script's browsing
|
|
context">browsing context</a> of the <a href="#concept-script" title="concept-script">script</a> that invoked the method as
|
|
the <a href="#source-browsing-context">source browsing context</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#spin-the-event-loop">Spin the event loop</a> until the new <a href="#browsing-context">browsing
|
|
context</a> is closed. (The user agent must allow the user to
|
|
indicate that the <a href="#browsing-context">browsing context</a> is to be
|
|
closed.)</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Reenable the user interface for all the browsing contexts in
|
|
<var title="">the list of background browsing contexts</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Return the <a href="#auxiliary-browsing-context">auxiliary browsing context</a>'s
|
|
<a href="#return-value">return value</a>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The <code><a href="#window">Window</a></code> objects of <code><a href="#document">Document</a></code>s hosted
|
|
by <a href="#browsing-context" title="browsing context">browsing contexts</a> created
|
|
by the above algorithm must also implement the
|
|
<code><a href="#windowmodal">WindowModal</a></code> interface.</p>
|
|
|
|
<p class="note">When this happens, the members of the
|
|
<code><a href="#windowmodal">WindowModal</a></code> interface, in JavaScript environments,
|
|
appear to actually be part of the <code><a href="#window">Window</a></code> interface
|
|
(e.g. they are on the same prototype chain as the <code title="dom-alert"><a href="#dom-alert">window.alert()</a></code> method).</p>
|
|
|
|
</div><pre class="idl">[NoInterfaceObject] interface <dfn id="windowmodal">WindowModal</dfn> {
|
|
readonly attribute any <a href="#dom-windowmodal-dialogarguments" title="dom-WindowModal-dialogArguments">dialogArguments</a>;
|
|
attribute DOMString <a href="#dom-windowmodal-returnvalue" title="dom-WindowModal-returnValue">returnValue</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">window</var> . <code title="dom-WindowModal-dialogArguments"><a href="#dom-windowmodal-dialogarguments">dialogArguments</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <var title="">argument</var> argument that was
|
|
passed to the <code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog()</a></code> method.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-WindowModal-returnValue"><a href="#dom-windowmodal-returnvalue">returnValue</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the current return value for the window.</p>
|
|
|
|
<p>Can be set, to change the value that will be returned by the
|
|
<code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog()</a></code>
|
|
method.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>Such browsing contexts have associated <dfn id="dialog-arguments">dialog
|
|
arguments</dfn>, which are stored along with the <dfn id="dialog-arguments-origin">dialog
|
|
arguments' origin</dfn>. These values are set by the <code title="dom-showModalDialog"><a href="#dom-showmodaldialog">showModalDialog()</a></code> method in the
|
|
algorithm above, when the browsing context is created, based on the
|
|
arguments provided to the method.</p>
|
|
|
|
<p>The <dfn id="dom-windowmodal-dialogarguments" title="dom-WindowModal-dialogArguments"><code>dialogArguments</code></dfn>
|
|
IDL attribute, on getting, must check whether its browsing context's
|
|
<a href="#active-document">active document</a>'s <a href="#origin">origin</a> is the <a href="#same-origin" title="same origin">same</a> as the <a href="#dialog-arguments-origin">dialog arguments'
|
|
origin</a>. If it is, then the browsing context's <a href="#dialog-arguments">dialog
|
|
arguments</a> must be returned unchanged. Otherwise, if the
|
|
<a href="#dialog-arguments">dialog arguments</a> are an object, then the empty string
|
|
must be returned, and if the <a href="#dialog-arguments">dialog arguments</a> are not
|
|
an object, then the stringification of the <a href="#dialog-arguments">dialog
|
|
arguments</a> must be returned.
|
|
|
|
<p>These browsing contexts also have an associated <dfn id="return-value">return
|
|
value</dfn>. The <a href="#return-value">return value</a> of a browsing context
|
|
must be initialized to the empty string when the browsing context is
|
|
created.</p>
|
|
|
|
<p>The <dfn id="dom-windowmodal-returnvalue" title="dom-WindowModal-returnValue"><code>returnValue</code></dfn>
|
|
IDL attribute, on getting, must return the <a href="#return-value">return value</a>
|
|
of its browsing context, and on setting, must set the <a href="#return-value">return
|
|
value</a> to the given new value.</p>
|
|
|
|
</div><p class="note">The <code title="dom-window-close"><a href="#dom-window-close">window.close()</a></code> method can be used to
|
|
close the browsing context.<h3 id="system-state-and-capabilities:-the-navigator-object"><span class="secno">6.5 </span>System state and capabilities: the <code><a href="#navigator">Navigator</a></code> object</h3><div class="impl">
|
|
|
|
<p>The <dfn id="dom-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="#navigator">Navigator</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>
|
|
|
|
</div><pre class="idl">interface <dfn id="navigator">Navigator</dfn> {
|
|
// objects implementing this interface also implement the interfaces given below
|
|
};
|
|
<a href="#navigator">Navigator</a> implements <a href="#navigatorid">NavigatorID</a>;
|
|
<a href="#navigator">Navigator</a> implements <a href="#navigatoronline">NavigatorOnLine</a>;
|
|
<a href="#navigator">Navigator</a> implements <a href="#navigatorcontentutils">NavigatorContentUtils</a>;
|
|
<a href="#navigator">Navigator</a> implements <a href="#navigatorstorageutils">NavigatorStorageUtils</a>;</pre><div class="impl">
|
|
|
|
<p>These interfaces are defined separately so that other
|
|
specifications can re-use parts of the <code><a href="#navigator">Navigator</a></code>
|
|
interface.</p>
|
|
|
|
|
|
|
|
|
|
</div><h4 id="client-identification"><span class="secno">6.5.1 </span>Client identification</h4><pre class="idl">[Supplemental, NoInterfaceObject]
|
|
interface <dfn id="navigatorid">NavigatorID</dfn> { readonly attribute DOMString <a href="#dom-navigator-appname" title="dom-navigator-appName">appName</a>;
|
|
readonly attribute DOMString <a href="#dom-navigator-appversion" title="dom-navigator-appVersion">appVersion</a>;
|
|
readonly attribute DOMString <a href="#dom-navigator-platform" title="dom-navigator-platform">platform</a>;
|
|
readonly attribute DOMString <a href="#dom-navigator-useragent" title="dom-navigator-userAgent">userAgent</a>;
|
|
};</pre><p>In certain cases, despite the best efforts of the entire
|
|
industry, Web browsers have bugs and limitations that Web authors
|
|
are forced to work around.<p>This section defines a collection of attributes that can be used
|
|
to determine, from script, the kind of user agent in use, in order
|
|
to work around these issues.<p>Client detection should always be limited to detecting known
|
|
current versions; future versions and unknown versions should always
|
|
be assumed to be fully compliant.<dl class="domintro"><dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-appName"><a href="#dom-navigator-appname">appName</a></code></dt>
|
|
<dd>
|
|
<p>Returns the name of the browser.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-appVersion"><a href="#dom-navigator-appversion">appVersion</a></code></dt>
|
|
<dd>
|
|
<p>Returns the version of the browser.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-platform"><a href="#dom-navigator-platform">platform</a></code></dt>
|
|
<dd>
|
|
<p>Returns the name of the platform.</p>
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-userAgent"><a href="#dom-navigator-useragent">userAgent</a></code></dt>
|
|
<dd>
|
|
<p>Returns the complete User-Agent header.</p>
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<dl><dt><dfn id="dom-navigator-appname" title="dom-navigator-appName"><code>appName</code></dfn></dt>
|
|
<dd><p>Must return either the string "<code title="">Netscape</code>" or the full name of the browser, e.g. "<code title="">Mellblom Browsernator</code>".</dd>
|
|
|
|
<dt><dfn id="dom-navigator-appversion" title="dom-navigator-appVersion"><code>appVersion</code></dfn></dt>
|
|
<dd><p>Must return either the string "<code title="">4.0</code>" or a string representing the version of the browser in detail, e.g. "<code title="">1.0 (VMS; en-US) Mellblomenator/9000</code>".</dd>
|
|
|
|
|
|
|
|
|
|
|
|
<dt><dfn id="dom-navigator-platform" title="dom-navigator-platform"><code>platform</code></dfn></dt>
|
|
<dd><p>Must return either the empty string or a string representing the platform on which the browser is executing, e.g. "<code title="">MacIntel</code>", "<code title="">Win32</code>", "<code title="">FreeBSD i386</code>", "<code title="">WebTV OS</code>".</dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<dt><dfn id="dom-navigator-useragent" title="dom-navigator-userAgent"><code>userAgent</code></dfn></dt>
|
|
<dd><p>Must return the string used for the value of the "<code title="">User-Agent</code>" header in HTTP requests, or the empty string if no such header is ever sent.</dd>
|
|
|
|
|
|
|
|
|
|
|
|
</dl><p class="warning">Any information in this API that varies from user
|
|
to user can be used to profile the user. In fact, if enough such
|
|
information is available, a user can actually be uniquely
|
|
identified. For this reason, user agent implementors are strongly
|
|
urged to include as little information in this API as possible.</p>
|
|
|
|
</div><h4 id="custom-handlers"><span class="secno">6.5.2 </span>Custom scheme and content handlers</h4><pre class="idl">[Supplemental, NoInterfaceObject]
|
|
interface <dfn id="navigatorcontentutils">NavigatorContentUtils</dfn> {
|
|
// content handler registration
|
|
void <a href="#dom-navigator-registerprotocolhandler" title="dom-navigator-registerProtocolHandler">registerProtocolHandler</a>(in DOMString scheme, in DOMString url, in DOMString title);
|
|
void <a href="#dom-navigator-registercontenthandler" title="dom-navigator-registerContentHandler">registerContentHandler</a>(in DOMString mimeType, in DOMString url, in DOMString title);
|
|
};</pre><p>The <dfn id="dom-navigator-registerprotocolhandler" title="dom-navigator-registerProtocolHandler"><code>registerProtocolHandler()</code></dfn>
|
|
method allows Web sites to register themselves as possible handlers
|
|
for particular schemes. For example, an online telephone messaging
|
|
service could register itself as a handler of the <code>sms:</code>
|
|
scheme (<a href="#refsRFC5724">[RFC5724]</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="dom-navigator-registercontenthandler" title="dom-navigator-registerContentHandler"><code>registerContentHandler()</code></dfn>
|
|
method allows Web sites to register themselves as possible handlers
|
|
for content in a particular <a href="#mime-type">MIME type</a>. For example, the
|
|
same online telephone messaging service could register itself as a
|
|
handler for <code>text/directory</code> files (<a href="#refsRFC2425">[RFC2425]</a>), so that if the user has no
|
|
native application capable of handling vCards (<a href="#refsRFC2426">[RFC2426]</a>), his Web browser can instead
|
|
suggest he use that site to view contact information stored on
|
|
vCards that he opens.<dl class="domintro"><dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-registerProtocolHandler"><a href="#dom-navigator-registerprotocolhandler">registerProtocolHandler</a></code>(<var title="">scheme</var>, <var title="">url</var>, <var title="">title</var>)</dt>
|
|
<dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-registerContentHandler"><a href="#dom-navigator-registercontenthandler">registerContentHandler</a></code>(<var title="">mimeType</var>, <var title="">url</var>, <var title="">title</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Registers a handler for the given scheme or content type, at
|
|
the given URL, with the given title.</p>
|
|
|
|
<p>The string "<code title="">%s</code>" in the URL is used as a
|
|
placeholder for where to put the URL of the content to be
|
|
handled.</p>
|
|
|
|
<p>Throws a <code><a href="#security_err">SECURITY_ERR</a></code> exception if the user agent
|
|
blocks the registration (this might happen if trying to register
|
|
as a handler for "http", for instance).</p>
|
|
|
|
<p>Throws a <code><a href="#syntax_err">SYNTAX_ERR</a></code> if the "<code title="">%s</code>" string is missing in the URL.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<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>User agents should keep track of which sites have registered
|
|
handlers (even if the user has declined such registrations) so that
|
|
the user is not repeatedly prompted with the same request.</p>
|
|
|
|
<p>The arguments to the methods have the following meanings and
|
|
corresponding implementation requirements:</p>
|
|
|
|
<dl><dt><var title="">scheme</var> (<code title="dom-navigator-registerProtocolHandler"><a href="#dom-navigator-registerprotocolhandler">registerProtocolHandler()</a></code> only)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>A scheme, such as <code>ftp</code> or <code>sms</code>. The
|
|
scheme must be compared in an <a href="#ascii-case-insensitive">ASCII case-insensitive</a>
|
|
manner by user agents for the purposes of comparing with the
|
|
scheme part of URLs that they consider against the list of
|
|
registered handlers.</p>
|
|
|
|
<p>The <var title="">scheme</var> value, if it contains a colon
|
|
(as in "<code>ftp:</code>"), will never match anything, since
|
|
schemes don't contain colons.</p>
|
|
|
|
<p class="note">This feature is not intended to be used with
|
|
non-standard protocols.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">mimeType</var> (<code title="dom-navigator-registerContentHandler"><a href="#dom-navigator-registercontenthandler">registerContentHandler()</a></code> only)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>A <a href="#mime-type">MIME type</a>, such as
|
|
<code>model/vnd.flatland.3dml</code> or
|
|
<code>application/vnd.google-earth.kml+xml</code>. The <a href="#mime-type">MIME
|
|
type</a> must be compared in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner 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>
|
|
|
|
<p class="note">The type is compared to the <a href="#mime-type">MIME type</a>
|
|
used by the user agent <em>after</em> the sniffing algorithms have
|
|
been applied.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">url</var></dt>
|
|
|
|
<dd>
|
|
|
|
<p>A string used to build the <a href="#url">URL</a> of the page that
|
|
will handle the requests.</p>
|
|
|
|
<p>When the user agent uses this URL, it must replace the first
|
|
occurrence of the exact literal string "<code title="">%s</code>"
|
|
with an escaped version of the <a href="#absolute-url">absolute URL</a> of the
|
|
content in question (as defined below), then <a href="#resolve-a-url" title="resolve
|
|
a url">resolve</a> the resulting URL, relative to the <a href="#script-s-base-url" title="script's base URL">base URL</a> of the <a href="#entry-script">entry
|
|
script</a> at the time the <code title="dom-navigator-registerContentHandler"><a href="#dom-navigator-registercontenthandler">registerContentHandler()</a></code>
|
|
or <code title="dom-navigator-registerProtocolHandler"><a href="#dom-navigator-registerprotocolhandler">registerProtocolHandler()</a></code>
|
|
methods were invoked, and then <a href="#navigate">navigate</a> an appropriate <a href="#browsing-context">browsing context</a> to the
|
|
resulting URL using the GET method (<a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or equivalent</a> for
|
|
non-HTTP URLs).</p>
|
|
|
|
<p>To get the escaped version of the <a href="#absolute-url">absolute URL</a> of
|
|
the content in question, the user agent must replace every
|
|
character in that <a href="#absolute-url">absolute URL</a> that doesn't match the
|
|
<query> production defined in RFC 3986 by the
|
|
percent-encoded form of that character. <a href="#refsRFC3986">[RFC3986]</a></p>
|
|
|
|
<div class="example">
|
|
|
|
<p>If the user had visited a site at <code title="">http://example.com/</code> that made the following
|
|
call:</p>
|
|
|
|
<pre>navigator.registerContentHandler('application/x-soup', 'soup?url=%s', 'SoupWeb™')</pre>
|
|
|
|
<p>...and then, much later, while visiting <code title="">http://www.example.net/</code>, clicked on a link such
|
|
as:</p>
|
|
|
|
<pre><a href="chickenkïwi.soup">Download our Chicken Kïwi soup!</a></pre>
|
|
|
|
<p>...then, assuming this <code>chickenkïwi.soup</code> file
|
|
was served with the <a href="#mime-type">MIME type</a>
|
|
<code>application/x-soup</code>, the UA might navigate to the
|
|
following URL:</p>
|
|
|
|
<pre>http://example.com/soup?url=http://www.example.net/chickenk%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 (synthesize 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 <code><a href="#security_err">SECURITY_ERR</a></code> exceptions if
|
|
the methods are called with <var title="">scheme</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> URLs or <code><a href="#text-html">text/html</a></code> content in a
|
|
Web browser would likely cause an exception to be raised.</p>
|
|
|
|
<p>User agents must raise a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception if the
|
|
<var title="">url</var> argument passed to one of these methods does
|
|
not contain the exact literal string "<code>%s</code>", or if <a href="#resolve-a-url" title="resolve a url">resolving</a> the <var title="">url</var>
|
|
argument with the first occurrence of the string "<code title="">%s</code>" removed, relative to the <a href="#entry-script">entry
|
|
script</a>'s <a href="#script-s-base-url" title="script's base URL">base URL</a>, is
|
|
not successful.</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 JavaScript 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="">url</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>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="security-and-privacy"><span class="secno">6.5.2.1 </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 schemes 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
|
|
wholly 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 URLs.</strong> The mechanism described
|
|
in this section can result in secret Intranet URLs 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 URL to the Intranet content.</li>
|
|
|
|
</ol><p>No actual confidential file data is leaked in this manner, but
|
|
the URLs themselves could contain confidential information. For
|
|
example, the URL could be
|
|
<code>http://www.corp.example.com/upcoming-aquisitions/the-sample-company.egf</code>,
|
|
which might tell the third party that Example Corporation is
|
|
intending to merge with The Sample Company. Implementors might wish
|
|
to consider allowing administrators to disable this feature for
|
|
certain subdomains, content types, or schemes.</p>
|
|
|
|
<p><strong>Leaking secure URLs.</strong> User agents should not send
|
|
HTTPS URLs to third-party sites registered as content handlers, in
|
|
the same way that user agents do not send <code title="http-referer">Referer</code> (sic) HTTP 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 URLs that are escaped and
|
|
included sent to the handler sites. User agents may even avoid
|
|
attempting to pass to Web-based handlers the URLs 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>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h5 id="sample-handler-impl"><span class="secno">6.5.2.2 </span>Sample user interface</h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>A simple implementation of this feature for a desktop Web browser
|
|
might work as follows.</p>
|
|
|
|
<p>The <code title="dom-navigator-registerContentHandler"><a href="#dom-navigator-registercontenthandler">registerContentHandler()</a></code>
|
|
method could display a modal dialog box:</p>
|
|
|
|
<p><img alt="The modal dialog box could have the title 'Content Handler Registration', and could say 'This Web page: Kittens at work http://kittens.example.org/ ...would like permission to handle files of type: application/x-meowmeow 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?' with two buttons, 'Trust kittens.example.org' and 'Cancel'." height="374" src="sample-content-handler-registration.png" width="534"></p>
|
|
|
|
<p>In this dialog box, "Kittens at work" is the title of the page
|
|
that invoked the method, "http://kittens.example.org/" is the URL of
|
|
that page, "application/x-meowmeow" is the string that was passed to
|
|
the <code title="dom-navigator-registerContentHandler"><a href="#dom-navigator-registercontenthandler">registerContentHandler()</a></code>
|
|
method as its first argument (<var title="">mimeType</var>),
|
|
"http://kittens.example.org/?show=%s" was the second argument (<var title="">url</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 URL that uses the
|
|
"application/x-meowmeow" <a href="#mime-type">MIME type</a>, then it might
|
|
display a dialog as follows:</p>
|
|
|
|
<p><img alt="The dialog box could have the title 'Unknown File Type' and could say 'You have attempted to access:' followed by a URL, followed by a prompt such as 'How would you like FerretBrowser to handle this resource?' with three radio buttons, one saying 'Contact the FerretBrowser plugin registry to see if there is an official way to handle this resource.', one saying 'Pass this URL to a local application' with an application selector, and one saying 'Pass this URL to the "Kittens-at-work displayer" application at "kittens.example.org"', with a checkbox labeled 'Always do this for resources using the "application/x-meowmeow" type in future.', and with two buttons, 'Ok' and 'Cancel'." height="428" src="sample-content-handler.png" width="577"></p>
|
|
|
|
<p>In this dialog, 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=data%3Aapplication/x-meowmeow;base64,S2l0dGVucyBhcmUgdGhlIGN1dGVzdCE%253D".</p>
|
|
|
|
<p>The <code title="dom-navigator-registerProtocolHandler"><a href="#dom-navigator-registerprotocolhandler">registerProtocolHandler()</a></code>
|
|
method would work equivalently, but for schemes instead of unknown
|
|
content types.</p>
|
|
|
|
</div><h4 id="manually-releasing-the-storage-mutex"><span class="secno">6.5.3 </span>Manually releasing the storage mutex</h4><pre class="idl">[Supplemental, NoInterfaceObject]
|
|
interface <dfn id="navigatorstorageutils">NavigatorStorageUtils</dfn> {
|
|
void <a href="#dom-navigator-yieldforstorageupdates" title="dom-navigator-yieldForStorageUpdates">yieldForStorageUpdates</a>();
|
|
};</pre><dl class="domintro"><dt><var title="">window</var> . <code title="dom-navigator"><a href="#dom-navigator">navigator</a></code> . <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">yieldForStorageUpdates</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If a script uses the <code title="dom-document-cookie"><a href="#dom-document-cookie">document.cookie</a></code> API, or the
|
|
<code title="dom-localStorage">localStorage</code> API, the
|
|
browser will block other scripts from accessing cookies or storage
|
|
until the first script finishes.
|
|
|
|
<a href="#refsWEBSTORAGE">[WEBSTORAGE]</a>
|
|
|
|
</p>
|
|
|
|
<p>Calling the <code title="dom-navigator-yieldForStorageUpdates"><a href="#dom-navigator-yieldforstorageupdates">navigator.yieldForStorageUpdates()</a></code>
|
|
method tells the user agent to unblock any other scripts that may
|
|
be blocked, even though the script hasn't returned.</p>
|
|
|
|
<p>Values of cookies and items in the <code>Storage</code> objects
|
|
of <code title="dom-localStorage">localStorage</code> attributes
|
|
can change after calling this method, whence its name.
|
|
|
|
<a href="#refsWEBSTORAGE">[WEBSTORAGE]</a>
|
|
|
|
</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-navigator-yieldforstorageupdates" title="dom-navigator-yieldForStorageUpdates"><code>yieldForStorageUpdates()</code></dfn>
|
|
method, when invoked, must, if the <a href="#storage-mutex">storage mutex</a> is
|
|
owned by the <a href="#event-loop">event loop</a> of the <a href="#concept-task" title="concept-task">task</a> that resulted in the method being
|
|
called, release the <a href="#storage-mutex">storage mutex</a> so that it is once
|
|
again free. Otherwise, it must do nothing.</p>
|
|
|
|
</div><h2 id="editing"><span class="secno">7 </span><dfn>User interaction</dfn></h2><h3 id="the-hidden-attribute"><span class="secno">7.1 </span>The <dfn title="attr-hidden"><code>hidden</code></dfn> attribute</h3><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> content attribute set. The <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute is a <a href="#boolean-attribute">boolean
|
|
attribute</a>. When specified on an element, it indicates that
|
|
the element is not yet, or is no longer, relevant. <span class="impl">User agents should not render elements that have the
|
|
<code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute
|
|
specified.</span><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').hidden = true;
|
|
document.getElementById('game').hidden = false;
|
|
}
|
|
</script>
|
|
</section>
|
|
<section id="game" hidden>
|
|
...
|
|
</section></pre>
|
|
|
|
</div><p>The <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</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-hidden"><a href="#the-hidden-attribute">hidden</a></code> to hide panels in a tabbed dialog,
|
|
because the tabbed interface is merely a kind of overflow
|
|
presentation — one could equally well just show all the form
|
|
controls in one big page with a scrollbar. It is similarly incorrect
|
|
to use this attribute to hide content just from one presentation
|
|
— if something is marked <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code>, it is hidden from all
|
|
presentations, including, for instance, screen readers.</p><p>Elements that are not <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code>
|
|
should not link to or refer to elements that are <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code>.<div class="example">
|
|
|
|
<p>For example, it would be incorrect to use the <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute to link to a
|
|
section marked with the <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code>
|
|
attribute. If the content is not applicable or relevant, then there
|
|
is no reason to link to it.</p>
|
|
|
|
<p>It would similarly be incorrect to use the ARIA <code title="attr-aria-describedby">aria-describedby</code> attribute to
|
|
refer to descriptions that are themselves <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code>. Hiding a section means that it
|
|
is not applicable or relevant to anyone at the current time, so
|
|
clearly it cannot be a valid description of content the user can
|
|
interact with.</p>
|
|
|
|
</div><p>Elements in a section hidden by the <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute are still active,
|
|
e.g. scripts and form controls in such sections still execute
|
|
and submit respectively. Only their presentation to the user
|
|
changes.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-hidden" title="dom-hidden"><code>hidden</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
</div><h3 id="activation"><span class="secno">7.2 </span>Activation</h3><dl class="domintro"><dt><var title="">element</var> . <code title="dom-click"><a href="#dom-click">click</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Acts as if the element was clicked.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>Each element has a <var title="">click in progress</var> flag,
|
|
initially set to false.</p>
|
|
|
|
<p>The <dfn id="dom-click" title="dom-click"><code>click()</code></dfn> method must
|
|
run these steps:</p>
|
|
|
|
<ol><li><p>If the element's <var title="">click in progress</var> flag
|
|
is set to true, then abort these steps.</li>
|
|
|
|
<li><p>Set the <var title="">click in progress</var> flag on the
|
|
element to true.</li>
|
|
|
|
<li><p>If the element has a defined <a href="#activation-behavior">activation behavior</a>,
|
|
<a href="#run-synthetic-click-activation-steps">run synthetic click activation steps</a> on the
|
|
element. Otherwise, <a href="#fire-a-click-event">fire a <code>click</code> event</a> at
|
|
the element.</li>
|
|
|
|
<li><p>Set the <var title="">click in progress</var> flag on the
|
|
element to false.</li>
|
|
|
|
</ol></div><h3 id="focus"><span class="secno">7.3 </span>Focus</h3><div class="impl">
|
|
|
|
<p>When an element is <i>focused</i>, key events received by the
|
|
document must be targeted at that element. There may be no element
|
|
focused; when no element is focused, key events received by the
|
|
document must be targeted at <a href="#the-body-element-0">the body element</a>.</p>
|
|
|
|
<p>User agents may track focus for each <a href="#browsing-context">browsing
|
|
context</a> or <code><a href="#document">Document</a></code> individually, or may support
|
|
only one focused element per <a href="#top-level-browsing-context">top-level browsing context</a>
|
|
— user agents should follow platform conventions in this
|
|
regard.</p>
|
|
|
|
<p>Which elements within a <a href="#top-level-browsing-context">top-level browsing context</a>
|
|
currently have focus must be independent of whether or not the
|
|
<a href="#top-level-browsing-context">top-level browsing context</a> itself has the <i>system
|
|
focus</i>.</p>
|
|
|
|
<p class="note">When an element is focused, the element matches the
|
|
CSS <code>:focus</code> pseudo-class.</p>
|
|
|
|
</div><h4 id="sequential-focus-navigation-and-the-tabindex-attribute"><span class="secno">7.3.1 </span>Sequential focus navigation and the <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute</h4><p>The <dfn id="attr-tabindex" title="attr-tabindex"><code>tabindex</code></dfn>
|
|
content attribute specifies whether the element is focusable,
|
|
whether it can be reached using sequential focus navigation, and the
|
|
relative order of the element 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 elements
|
|
that can be reached using sequential focus navigation.<p>The <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute, if
|
|
specified, must have a value that is a <a href="#valid-integer">valid
|
|
integer</a>.<div class="impl">
|
|
|
|
<p>If the attribute is specified, it must be parsed using the
|
|
<a href="#rules-for-parsing-integers">rules for parsing integers</a>. The attribute's values have
|
|
the following meanings:</p>
|
|
|
|
<dl><dt>If the attribute is omitted or parsing the value returns an
|
|
error</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The user agent should follow platform conventions to determine if
|
|
the element is to be focusable and, if so, whether the element can
|
|
be reached using sequential focus navigation, and if so, what its
|
|
relative order should be.</p>
|
|
|
|
</dd>
|
|
|
|
<dt id="negative-tabindex">If the value is a negative integer</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The user agent must allow the element to be focused, but should
|
|
not allow the element to be reached using sequential focus
|
|
navigation.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the value is a zero</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The user agent must allow the element to be focused, should
|
|
allow the element to be reached using sequential focus navigation,
|
|
and should follow platform conventions to determine the element's
|
|
relative order.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the value is greater than zero</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The user agent must allow the element to be focused, should
|
|
allow the element to be reached using sequential focus navigation,
|
|
and should place the element in the sequential focus navigation
|
|
order so that it is:</p>
|
|
|
|
<ul><li>before any focusable element whose <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute has been
|
|
omitted or whose value, when parsed, returns an error,</li>
|
|
|
|
<li>before any focusable element whose <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute has a value equal
|
|
to or less than zero,</li>
|
|
|
|
<li>after any element whose <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute has a value
|
|
greater than zero but less than the value of the <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute on the
|
|
element,</li>
|
|
|
|
<li>after any element whose <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute has a value equal
|
|
to the value of the <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code>
|
|
attribute on the element but that is earlier in the document in
|
|
<a href="#tree-order">tree order</a> than the element,</li>
|
|
|
|
<li>before any element whose <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute has a value equal
|
|
to the value of the <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code>
|
|
attribute on the element but that is later in the document in
|
|
<a href="#tree-order">tree order</a> than the element, and</li>
|
|
|
|
<li>before any element whose <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute has a value
|
|
greater than the value of the <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute on the
|
|
element.</li>
|
|
|
|
</ul></dd>
|
|
|
|
</dl><p>An element is <dfn id="specially-focusable">specially focusable</dfn> if the <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute's definition above
|
|
defines the element to be focusable.</p>
|
|
|
|
<p>An element that is <a href="#specially-focusable">specially focusable</a> but does not
|
|
otherwise have an <a href="#activation-behavior">activation behavior</a> defined has an
|
|
<a href="#activation-behavior">activation behavior</a> that does nothing.</p>
|
|
|
|
<p class="note">This means that an element that is only focusable
|
|
because of its <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> attribute
|
|
will fire a <code title="event-click"><a href="#event-click">click</a></code> event in response
|
|
to a non-mouse activation (e.g. hitting the "enter" key while the
|
|
element is focused).</p>
|
|
|
|
<p>The <dfn id="dom-tabindex" title="dom-tabIndex"><code>tabIndex</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the value of the <code title="attr-tabindex"><a href="#attr-tabindex">tabindex</a></code> content attribute. Its default
|
|
value is 0 for elements that are focusable and −1 for
|
|
elements that are not focusable.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="focus-management"><span class="secno">7.3.2 </span>Focus management</h4>
|
|
|
|
<p>An element is <dfn id="focusable">focusable</dfn> if the user agent's default
|
|
behavior allows it to be focusable or if the element is
|
|
<a href="#specially-focusable">specially focusable</a>, but only if the element is either
|
|
<a href="#being-rendered">being rendered</a> or <!-- CANVAS-FOCUS-FALLBACK --> is a
|
|
descendant of a <code><a href="#the-canvas-element">canvas</a></code> element that
|
|
<a href="#represents">represents</a> <a href="#embedded-content">embedded content</a>.</p>
|
|
|
|
<p>User agents should make the following elements
|
|
<a href="#focusable">focusable</a>, unless platform conventions dictate
|
|
otherwise:</p>
|
|
|
|
<ul><li><code><a href="#the-a-element">a</a></code> elements that have an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-link-element">link</a></code> elements that have an <code title="attr-link-href"><a href="#attr-link-href">href</a></code> attribute</li>
|
|
|
|
<li><code><a href="#the-button-element">button</a></code> elements that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-input-element">input</a></code> elements whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute are not in the
|
|
<a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state and that
|
|
are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-select-element">select</a></code> elements that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-textarea-element">textarea</a></code> elements that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a></li>
|
|
|
|
<li><code><a href="#the-command-element">command</a></code> elements that do not have a <code title="attr-command-disabled"><a href="#attr-command-disabled">disabled</a></code> attribute</li>
|
|
|
|
<li>Elements with a <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code>
|
|
attribute set, if that would enable the user agent to allow the
|
|
user to begin a drag operations for those elements without the use
|
|
of a pointing device</li>
|
|
|
|
<li><a href="#editing-host" title="editing host">Editing hosts</a></li>
|
|
|
|
</ul><p>In addition, each shape that is generated for an
|
|
<code><a href="#the-area-element">area</a></code> element should be <a href="#focusable">focusable</a>, unless
|
|
platform conventions dictate otherwise. (A single <code><a href="#the-area-element">area</a></code>
|
|
element can correspond to multiple shapes, since image maps can be
|
|
reused with multiple images on a page.)</p>
|
|
|
|
<p>The user agent may also make part of a <code><a href="#the-details-element">details</a></code>
|
|
element's rendering focusable, to enable the element to be opened or
|
|
closed using keyboard input. However, this is distinct from the
|
|
<code><a href="#the-details-element">details</a></code> or <code><a href="#the-summary-element">summary</a></code> element being
|
|
focusable.</p>
|
|
|
|
<hr><p>The <dfn id="focusing-steps">focusing steps</dfn> are as follows:</p>
|
|
|
|
<ol><li><p>If the element is not <a href="#in-a-document" title="in a Document">in a
|
|
<code>Document</code></a>, or if the element's
|
|
<code><a href="#document">Document</a></code> has no <a href="#browsing-context">browsing context</a>, or if
|
|
the element's <code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a>
|
|
has no <a href="#top-level-browsing-context">top-level browsing context</a>, then abort these
|
|
steps.</p>
|
|
|
|
<li><p>If focusing the element will remove the focus from another
|
|
element, then run the <a href="#unfocusing-steps">unfocusing steps</a> for that
|
|
element.</li>
|
|
|
|
<li>
|
|
|
|
<p>Make the element the currently focused element in its
|
|
<a href="#top-level-browsing-context">top-level browsing context</a>.</p>
|
|
|
|
<p>Some elements, most notably <code><a href="#the-area-element">area</a></code>, can correspond
|
|
to more than one distinct focusable area. If a particular area was
|
|
indicated when the element was focused, then that is the area that
|
|
must get focus; otherwise, e.g. when using the <code title="dom-focus"><a href="#dom-focus">focus()</a></code> method, the first such region in
|
|
tree order is the one that must be focused.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>The user agent may apply relevant platform-specific conventions
|
|
for focusing widgets.</p>
|
|
|
|
<p class="note">For example, some platforms select the contents of
|
|
a text field when that field is focused.</p>
|
|
|
|
</li>
|
|
|
|
<li><p><a href="#fire-a-simple-event">Fire a simple event</a> named <code title="event-focus">focus</code> at the element.</li>
|
|
|
|
|
|
</ol><p>User agents must synchronously run the <a href="#focusing-steps">focusing
|
|
steps</a> for an element whenever the user moves the focus to a
|
|
<a href="#focusable">focusable</a> element.</p>
|
|
|
|
<p>The <dfn id="unfocusing-steps">unfocusing steps</dfn> are as follows:</p>
|
|
|
|
<ol><li><p>If the element is an <code><a href="#the-input-element">input</a></code> element, and the
|
|
<code title="event-input-change"><a href="#event-input-change">change</a></code> event applies to the
|
|
element, and the element does not have a defined <a href="#activation-behavior">activation
|
|
behavior</a>, and the user has changed the element's <a href="#concept-fe-value" title="concept-fe-value">value</a> or its list of <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>
|
|
while the control was focused without committing that change, then
|
|
<a href="#fire-a-simple-event">fire a simple event</a> that bubbles named <code title="event-change">change</code> at the element.</p>
|
|
|
|
<li><p>Unfocus the element.</li>
|
|
|
|
<li><p><a href="#fire-a-simple-event">Fire a simple event</a> named <code title="event-blur">blur</code> at the element.</li>
|
|
|
|
|
|
</ol><p>When an element that is focused stops being a
|
|
<a href="#focusable">focusable</a> element, or stops being focused without
|
|
another element being explicitly focused in its stead, the user
|
|
agent should synchronously run the <a href="#focusing-steps">focusing steps</a> for
|
|
<a href="#the-body-element-0">the body element</a>, if there is one; if there is not,
|
|
then the user agent should synchronously run the <a href="#unfocusing-steps">unfocusing
|
|
steps</a> for the affected element only.</p>
|
|
|
|
<p class="example">For example, this might happen because the
|
|
element is removed from its <code><a href="#document">Document</a></code>, or has a <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute added. It would also
|
|
happen to an <code><a href="#the-input-element">input</a></code> element when the element gets <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>.</p>
|
|
|
|
</div><h4 id="document-level-focus-apis"><span class="secno">7.3.3 </span>Document-level focus APIs</h4><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-activeElement"><a href="#dom-document-activeelement">activeElement</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the currently focused element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-hasFocus"><a href="#dom-document-hasfocus">hasFocus</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the document has focus; otherwise, returns false.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-focus"><a href="#dom-window-focus">focus</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Focuses the window. Use of this method is discouraged. Allow the user to control window focus instead.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">window</var> . <code title="dom-window-blur"><a href="#dom-window-blur">blur</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Unfocuses the window. Use of this method is discouraged. Allow the user to control window focus instead.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-activeelement" title="dom-document-activeElement"><code>activeElement</code></dfn>
|
|
attribute on <code><a href="#htmldocument">HTMLDocument</a></code> objects must return the
|
|
element in the document that is focused. If no element in the
|
|
<code><a href="#document">Document</a></code> is focused, this must return <a href="#the-body-element-0">the body
|
|
element</a>.</p>
|
|
|
|
<p>The <dfn id="dom-document-hasfocus" title="dom-document-hasFocus"><code>hasFocus()</code></dfn> method
|
|
on <code><a href="#htmldocument">HTMLDocument</a></code> objects must return true if the
|
|
<code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> is focused,
|
|
and all its <a href="#ancestor-browsing-context" title="ancestor browsing context">ancestor
|
|
browsing contexts</a> are also focused, and the <a href="#top-level-browsing-context">top-level
|
|
browsing context</a> has the <i>system focus</i>. If the
|
|
<code><a href="#document">Document</a></code> has no <a href="#browsing-context">browsing context</a> or if its
|
|
<a href="#browsing-context">browsing context</a> has no <a href="#top-level-browsing-context">top-level browsing
|
|
context</a>, then the method will always return false.</p>
|
|
|
|
<p>The <dfn id="dom-window-focus" title="dom-window-focus"><code>focus()</code></dfn>
|
|
method on the <code><a href="#window">Window</a></code> object, when invoked, provides a
|
|
hint to the user agent that the script believes the user might be
|
|
interested in the contents of the <a href="#browsing-context">browsing context</a> of
|
|
the <code><a href="#window">Window</a></code> object on which the method was invoked.</p>
|
|
|
|
<p>User agents are encouraged to have this <code title="dom-window-focus"><a href="#dom-window-focus">focus()</a></code> method trigger some kind of
|
|
notification.</p>
|
|
|
|
<p>The <dfn id="dom-window-blur" title="dom-window-blur"><code>blur()</code></dfn> method
|
|
on the <code><a href="#window">Window</a></code> object, when invoked, provides a hint to
|
|
the user agent that the script believes the user probably is not
|
|
currently interested in the contents of the <a href="#browsing-context">browsing
|
|
context</a> of the <code><a href="#window">Window</a></code> object on which the method
|
|
was invoked, but that the contents might become interesting again in
|
|
the future.</p>
|
|
|
|
<p>User agents are encouraged to ignore calls to this <code title="dom-window-blur"><a href="#dom-window-blur">blur()</a></code> method entirely.</p>
|
|
|
|
<p class="note">Historically the <code title="dom-window-blur"><a href="#dom-window-blur">focus()</a></code> and <code title="dom-window-blur"><a href="#dom-window-blur">blur()</a></code> methods actually affected the
|
|
system focus, but hostile sites widely abuse this behavior to the
|
|
user's detriment.</p>
|
|
|
|
</div><h4 id="element-level-focus-apis"><span class="secno">7.3.4 </span>Element-level focus APIs</h4><dl class="domintro"><dt><var title="">element</var> . <code title="dom-focus"><a href="#dom-focus">focus</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Focuses the element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-blur"><a href="#dom-blur">blur</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Unfocuses the element. Use of this method is discouraged. Focus
|
|
another element instead.</p>
|
|
|
|
<p>Do not use this method to hide the focus ring if you find the
|
|
focus ring unsightly. Instead, use a CSS rule to override the
|
|
'outline' property.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, to hide the outline from links, you could use:</p>
|
|
|
|
<pre>:link:focus, :visited:focus { outline: none; }</pre>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-focus" title="dom-focus"><code>focus()</code></dfn> method,
|
|
when invoked, must run the following algorithm:</p>
|
|
|
|
<ol><li><p>If the element is marked as <i><a href="#locked-for-focus">locked for focus</a></i>, then abort
|
|
these steps.</li>
|
|
|
|
<li><p>If the element is not <a href="#focusable">focusable</a>, then abort these
|
|
steps.</li>
|
|
|
|
<li><p>Mark the element as <dfn id="locked-for-focus">locked for focus</dfn>.</li>
|
|
|
|
<li><p>If the element is not already focused, run the <a href="#focusing-steps">focusing
|
|
steps</a> for the element.</li>
|
|
|
|
<li><p>Unmark the element as <i><a href="#locked-for-focus">locked for focus</a></i>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-blur" title="dom-blur"><code>blur()</code></dfn> method, when
|
|
invoked, should run the <a href="#focusing-steps">focusing steps</a> for <a href="#the-body-element-0">the
|
|
body element</a>, if there is one; if there is not, then it
|
|
should run the <a href="#unfocusing-steps">unfocusing steps</a> for the element on
|
|
which the method was called instead. User agents may selectively or
|
|
uniformly ignore calls to this method for usability reasons.</p>
|
|
|
|
<p class="example">For example, if the <code title="dom-blur"><a href="#dom-blur">blur()</a></code> method is unwisely being used to
|
|
remove the focus ring for aesthetics reasons, the page would become
|
|
unusable by keyboard users. Ignoring calls to this method would thus
|
|
allow keyboard users to interact with the page.</p>
|
|
|
|
</div><h3 id="assigning-keyboard-shortcuts"><span class="secno">7.4 </span>Assigning keyboard shortcuts</h3><h4 id="introduction-6"><span class="secno">7.4.1 </span>Introduction</h4><p><i>This section is non-normative.</i><p>Each element that can be activated or focused can be assigned a
|
|
single key combination to activate it, using the <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> attribute.<p>The exact shortcut is determined by the user agent, based on
|
|
information about the user's keyboard, what keyboard shortcuts
|
|
already exist on the platform, and what other shortcuts have been
|
|
specified on the page, using the information provided in the <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> attribute as a guide.<p>In order to ensure that a relevant keyboard shortcut is available
|
|
on a wide variety of input devices, the author can provide a number
|
|
of alternatives in the <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code>
|
|
attribute.<p>Each alternative consists of a single character, such as a letter
|
|
or digit.<p>User agents can provide users with a list of the keyboard
|
|
shortcuts, but authors are encouraged to do so also. The <code title="dom-accessKeyLabel"><a href="#dom-accesskeylabel">accessKeyLabel</a></code> IDL attribute
|
|
returns a string representing the actual key combination assigned by
|
|
the user agent.<h4 id="the-accesskey-attribute"><span class="secno">7.4.2 </span>The <dfn title="attr-accesskey"><code>accesskey</code></dfn> attribute</h4><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> content attribute set. The
|
|
<code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> attribute's value is
|
|
used by the user agent as a guide for creating a keyboard shortcut
|
|
that activates or focuses the element.<p>If specified, the value must be an <a href="#ordered-set-of-unique-space-separated-tokens">ordered set of unique
|
|
space-separated tokens</a> that are <a href="#case-sensitive">case-sensitive</a>,
|
|
each of which must be exactly one Unicode code point in length.<div class="example">
|
|
|
|
<p>In the following example, a variety of links are given with
|
|
access keys so that keyboard users familiar with the site can
|
|
more quickly navigate to the relevant pages:</p>
|
|
|
|
<pre><nav>
|
|
<p>
|
|
<a title="Consortium Activities" accesskey="A" href="/Consortium/activities">Activities</a> |
|
|
<a title="Technical Reports and Recommendations" accesskey="T" href="/TR/">Technical Reports</a> |
|
|
<a title="Alphabetical Site Index" accesskey="S" href="/Consortium/siteindex">Site Index</a> |
|
|
<a title="About This Site" accesskey="B" href="/Consortium/">About Consortium</a> |
|
|
<a title="Contact Consortium" accesskey="C" href="/Consortium/contact">Contact</a>
|
|
</p>
|
|
</nav></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, the search field is given two possible
|
|
access keys, "s" and "0" (in that order). A user agent on a device
|
|
with a full keyboard might pick
|
|
<kbd><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>S</kbd></kbd> as the
|
|
shortcut key, while a user agent on a small device with just a
|
|
numeric keypad might pick just the plain unadorned key
|
|
<kbd><kbd>0</kbd></kbd>:</p>
|
|
|
|
<pre><form action="/search">
|
|
<label>Search: <input type="search" name="q" accesskey="s 0"></label>
|
|
<input type="submit">
|
|
</form></pre>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In the following example, a button has possible access keys
|
|
described. A script then tries to update the button's label to
|
|
advertise the key combination the user agent selected.</p>
|
|
|
|
<pre><input type=submit accesskey="N @ 1" value="Compose">
|
|
...
|
|
<script>
|
|
function labelButton(button) {
|
|
if (button.accessKeyLabel)
|
|
button.value += ' (' + button.accessKeyLabel + ')';
|
|
}
|
|
var inputs = document.getElementsByTagName('input');
|
|
for (var i = 0; i < inputs.length; i += 1) {
|
|
if (inputs[i].type == "submit")
|
|
labelButton(inputs[i]);
|
|
}
|
|
</script></pre>
|
|
|
|
<p>On one user agent, the button's label might become
|
|
"<samp>Compose (⌘N)</samp>". On another, it might become
|
|
"<samp>Compose (Alt+⇧+1)</samp>". If the user agent doesn't
|
|
assign a key, it will be just "<samp>Compose</samp>". The exact
|
|
string depends on what the <a href="#assigned-access-key">assigned access key</a> is, and
|
|
on how the user agent represents that key combination.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="processing-model-3"><span class="secno">7.4.3 </span>Processing model</h4>
|
|
|
|
<p>An element's <dfn id="assigned-access-key">assigned access key</dfn> is a key combination
|
|
derived from the element's <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> content attribute.
|
|
Initially, an element must not have an <a href="#assigned-access-key">assigned access
|
|
key</a>.</p>
|
|
|
|
<p>Whenever an element's <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> attribute is set, changed,
|
|
or removed, the user agent must update the element's <a href="#assigned-access-key">assigned
|
|
access key</a> by running the following steps:</p>
|
|
|
|
<ol><li><p>If the element has no <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> attribute, then skip to the
|
|
<i>fallback</i> step below.</li>
|
|
|
|
<li><p>Otherwise, <a href="#split-a-string-on-spaces" title="split a string on spaces">split the
|
|
attribute's value on spaces</a>, and let <var title="">keys</var> be the resulting tokens.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each value in <var title="">keys</var> in turn, in the
|
|
order the tokens appeared in the attribute's value, run the
|
|
following substeps:</p>
|
|
|
|
<ol><li><p>If the value is not a string exactly one Unicode code
|
|
point in length, then skip the remainder of these steps for this
|
|
value.</li>
|
|
|
|
<li><p>If the value does not correspond to a key on the system's
|
|
keyboard, then skip the remainder of these steps for this
|
|
value.</li>
|
|
|
|
<li><p>If the user agent can find a combination of modifier keys
|
|
that, with the key that corresponds to the value given in the
|
|
attribute, can be used as a shortcut key, then the user agent may
|
|
assign that combination of keys as the element's <a href="#assigned-access-key">assigned
|
|
access key</a> and abort these steps.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p><i>Fallback</i>: Optionally, the user agent may assign a key
|
|
combination of its choosing as the element's <a href="#assigned-access-key">assigned access
|
|
key</a> and then abort these steps.</li>
|
|
|
|
<li><p>If this step is reached, the element has no <a href="#assigned-access-key">assigned
|
|
access key</a>.</li>
|
|
|
|
</ol><p>Once a user agent has selected and assigned an access key for an
|
|
element, the user agent should not change the element's
|
|
<a href="#assigned-access-key">assigned access key</a> unless the <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> content attribute is changed
|
|
or the element is moved to another <code><a href="#document">Document</a></code>.</p>
|
|
|
|
<p>When the user presses the key combination corresponding to the
|
|
<a href="#assigned-access-key">assigned access key</a> for an element, if the element
|
|
<a href="#concept-command" title="concept-command">defines a command</a>, and the
|
|
command's <a href="#command-facet-hiddenstate" title="command-facet-HiddenState">Hidden
|
|
State</a> facet is false (visible), and the command's <a href="#command-facet-disabledstate" title="command-facet-DisabledState">Disabled State</a> facet is
|
|
also false (enabled), then the user agent must trigger the <a href="#command-facet-action" title="command-facet-Action">Action</a> of the command.</p>
|
|
|
|
<p>User agents may expose elements that have an <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> attribute in other ways as
|
|
well, e.g. in a menu displayed in response to a specific key
|
|
combination.</p>
|
|
|
|
<p>The <dfn id="dom-accesskey" title="dom-accessKey"><code>accessKey</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-accesskey"><a href="#the-accesskey-attribute">accesskey</a></code> content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-accesskeylabel" title="dom-accessKeyLabel"><code>accessKeyLabel</code></dfn> IDL
|
|
attribute must return a string that represents the element's
|
|
<a href="#assigned-access-key">assigned access key</a>, if any. If the element does not
|
|
have one, then the IDL attribute must return the empty string.</p>
|
|
|
|
</div><h3 id="contenteditable"><span class="secno">7.5 </span>The <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute</h3><p>The <dfn id="attr-contenteditable" title="attr-contenteditable"><code>contenteditable</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">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 <i>true</i> state. The <code title="">false</code> keyword maps to the <i>false</i> state. In
|
|
addition, there is a third state, the <i>inherit</i> state, which is
|
|
the <i>missing value default</i> (and the <i>invalid value
|
|
default</i>).<p>The <i>true</i> state indicates that the element is editable. The
|
|
<i>inherit</i> state indicates that the element is editable if its
|
|
parent is. The <i>false</i> state indicates that the element is not
|
|
editable.<div class="impl">
|
|
|
|
<p>Specifically, if an <a href="#html-elements" title="HTML elements">HTML
|
|
element</a> has a <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute set to
|
|
the true state, or it has its <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute set to
|
|
the inherit state and if its nearest ancestor <a href="#html-elements" title="HTML
|
|
elements">HTML element</a> with the <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute set to
|
|
a state other than the inherit state has its attribute set to the
|
|
true state, or if it and its ancestors all have their <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute set to
|
|
the inherit state but the <code><a href="#document">Document</a></code> has <code title="dom-document-designMode"><a href="#designMode">designMode</a></code> enabled, then the
|
|
UA must treat the element as <dfn id="editable">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="#attr-contenteditable">contenteditable</a></code> attribute set to
|
|
the false state, or its <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute is set
|
|
to the inherit state and its nearest ancestor <a href="#html-elements" title="HTML
|
|
elements">HTML element</a> with the <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute set to
|
|
a state other than the inherit state has its attribute set to the
|
|
false state, or all its ancestors have their <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute set to
|
|
the inherit state and the <code><a href="#document">Document</a></code> itself has <code title="dom-document-designMode"><a href="#designMode">designMode</a></code> disabled; either
|
|
way, the element is not editable.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">element</var> . <code title="dom-contentEditable"><a href="#dom-contenteditable">contentEditable</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns "<code title="">true</code>", "<code title="">false</code>", or "<code title="">inherit</code>", based
|
|
on the state of the <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code> attribute.</p>
|
|
|
|
<p>Can be set, to change that state.</p>
|
|
|
|
<p>Throws a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception if the new value
|
|
isn't one of those strings.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">element</var> . <code title="dom-isContentEditable"><a href="#dom-iscontenteditable">isContentEditable</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element is editable; otherwise, returns false.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-contenteditable" title="dom-contentEditable"><code>contentEditable</code></dfn> IDL
|
|
attribute, on getting, must return the string "<code title="">true</code>" if the content attribute is set to the true
|
|
state, "<code title="">false</code>" if the content attribute is set
|
|
to the false state, and "<code title="">inherit</code>"
|
|
otherwise. On setting, if the new value is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">inherit</code>" then the content attribute must be removed,
|
|
if the new value is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for
|
|
the string "<code title="">true</code>" then the content attribute
|
|
must be set to the string "<code title="">true</code>", if the new
|
|
value is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string
|
|
"<code title="">false</code>" then the content attribute must be set
|
|
to the string "<code title="">false</code>", and otherwise the
|
|
attribute setter must raise a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception.</p>
|
|
|
|
<p>The <dfn id="dom-iscontenteditable" title="dom-isContentEditable"><code>isContentEditable</code></dfn>
|
|
IDL attribute, on getting, must return true if the element is
|
|
<a href="#editable">editable</a>, and false otherwise.</p>
|
|
|
|
<p>If an element is <a href="#editable">editable</a> and its parent element is
|
|
not, or if an element is <a href="#editable">editable</a> and it has no parent
|
|
element, then the element is an <dfn id="editing-host">editing host</dfn>. Editable
|
|
elements can be nested. Editing hosts are typically focusable and
|
|
typically form part of the <a href="#attr-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-position">caret
|
|
position</dfn> that specifies where the current editing position is.
|
|
It may also have a selection.</p>
|
|
|
|
<p class="note">How the caret and selection are represented depends
|
|
entirely on the UA.</p>
|
|
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="user-editing-actions"><span class="secno">7.5.1 </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.</dd>
|
|
|
|
|
|
<dt>Change the selection</dt>
|
|
|
|
<dd><p>User agents must allow users to change the selection within
|
|
an editing host, even into nested editable elements. 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). 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.</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="#phrasing-content">phrasing
|
|
content</a> is not allowed (e.g. inside an empty <code><a href="#the-ol-element">ol</a></code>
|
|
element), then the user agent must not insert the text directly at
|
|
the caret position. In such cases the behavior 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="#the-p-element">p</a></code> elements before and after the <code><a href="#the-dl-element">dl</a></code>
|
|
element, as children of the <code><a href="#the-section-element">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 behavior 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.</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="#the-br-element">br</a></code> element.</p>
|
|
|
|
<p>If the caret is positioned somewhere where <a href="#phrasing-content">phrasing
|
|
content</a> is not allowed (e.g. in an empty <code><a href="#the-ol-element">ol</a></code>
|
|
element), then the user agent must not insert the <code><a href="#the-br-element">br</a></code>
|
|
element directly at the caret position. In such cases the behavior
|
|
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.</dd>
|
|
|
|
|
|
<dt id="contenteditable-delete">Delete</dt>
|
|
|
|
<dd><p>UAs should offer a way for the user to delete text and
|
|
elements, including non-editable descendants, 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 selection whose start and end points do not share a
|
|
common parent node.</p>
|
|
|
|
<p>In any case, the exact behavior 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.</dd>
|
|
|
|
|
|
<dt id="contenteditable-wrapSemantic">Insert, and wrap text in,
|
|
semantic elements</dt>
|
|
|
|
<dd><p>UAs should offer the user the ability to mark text and
|
|
paragraphs with semantics that HTML can express.</p>
|
|
|
|
<p>UAs should similarly offer a way for the user to insert empty
|
|
semantic elements 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>In response to a request from a user to mark text up in italics,
|
|
user agents should use the <code><a href="#the-i-element">i</a></code> element to represent the
|
|
semantic. The <code><a href="#the-em-element">em</a></code> element should be used only if the
|
|
user agent is sure that the user means to indicate stress
|
|
emphasis.</p>
|
|
|
|
<p>In response to a request from a user to mark text up in bold,
|
|
user agents should use the <code><a href="#the-b-element">b</a></code> element to represent the
|
|
semantic. The <code><a href="#the-strong-element">strong</a></code> element should be used only if
|
|
the user agent is sure that the user means to indicate
|
|
importance.</p>
|
|
|
|
<p>The exact behavior 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.</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="#dnd">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.</dd>
|
|
|
|
|
|
<dt>Edit form controls nested inside editing hosts</dt>
|
|
|
|
<dd><p>When an <a href="#editable">editable</a> form control is edited, the
|
|
changes must be reflected in both its current value <em>and</em>
|
|
its default value. For <code><a href="#the-input-element">input</a></code> elements this means
|
|
updating the <code title="dom-input-defaultValue"><a href="#dom-input-defaultvalue">defaultValue</a></code> IDL attribute as
|
|
well as the <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL
|
|
attribute; for <code><a href="#the-select-element">select</a></code> elements it means updating the
|
|
<code><a href="#the-option-element">option</a></code> elements' <code title="dom-option-defaultSelected"><a href="#dom-option-defaultselected">defaultSelected</a></code> IDL
|
|
attribute as well as the <code title="dom-option-selected"><a href="#dom-option-selected">selected</a></code> IDL attribute; for
|
|
<code><a href="#the-textarea-element">textarea</a></code> elements this means updating the <code title="dom-textarea-defaultValue"><a href="#dom-textarea-defaultvalue">defaultValue</a></code> IDL attribute
|
|
as well as the <code title="dom-textarea-value"><a href="#dom-textarea-value">value</a></code> IDL
|
|
attribute. (Updating the <code title="">default*</code> IDL
|
|
attributes causes content attributes to be updated as well.)</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 the selection followed by a request
|
|
to break the paragraph at that position.</p>
|
|
|
|
<p>User agents may add <span>DOM changes</span> entries to the
|
|
<span>undo transaction history</span> of the <a href="#editing-host">editing
|
|
host</a>'s <code><a href="#document">Document</a></code> object each time an action is
|
|
triggered.</p>
|
|
|
|
<p>All of the actions defined above, whether triggered by the user
|
|
or programmatically (e.g. by <code title="dom-document-execCommand"><a href="#execCommand">execCommand()</a></code> commands),
|
|
must fire mutation events as appropriate.</p>
|
|
|
|
</div><h4 id="making-entire-documents-editable"><span class="secno">7.5.2 </span>Making entire documents editable</h4><div class="impl">
|
|
|
|
<p>Documents have a <dfn id="designMode" title="dom-document-designMode"><code>designMode</code></dfn>, which
|
|
can be either enabled or disabled.</p>
|
|
|
|
</div><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-designMode"><a href="#designMode">designMode</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns "<code title="">on</code>" if the document is editable,
|
|
and "<code title="">off</code>" if it isn't.</p>
|
|
|
|
<p>Can be set, to change the document's current state.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <code title="dom-document-designMode"><a href="#designMode">designMode</a></code> IDL
|
|
attribute on the <code><a href="#document">Document</a></code> object takes two values,
|
|
"<code title="">on</code>" and "<code title="">off</code>". When it
|
|
is set, the new value must be compared in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner 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 IDL 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>
|
|
|
|
</div><h3 id="spelling-and-grammar-checking"><span class="secno">7.6 </span>Spelling and grammar checking</h3><div class="impl">
|
|
|
|
<p>User agents can support the checking of spelling and grammar of
|
|
editable text, either in form controls (such as the value of
|
|
<code><a href="#the-textarea-element">textarea</a></code> elements), or in elements in an <a href="#editing-host">editing
|
|
host</a> (using <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code>).</p>
|
|
|
|
<p>For each element, user agents must establish a <dfn id="concept-spellcheck-default" title="concept-spellcheck-default">default behavior</dfn>, either
|
|
through defaults or through preferences expressed by the user. There
|
|
are three possible default behaviors for each element:</p>
|
|
|
|
<dl><dt><dfn id="concept-spellcheck-default-true" title="concept-spellcheck-default-true">true-by-default</dfn>
|
|
|
|
<dd>The element will be checked for spelling and grammar if its
|
|
contents are editable.
|
|
|
|
<dt><dfn id="concept-spellcheck-default-false" title="concept-spellcheck-default-false">false-by-default</dfn>
|
|
|
|
<dd>The element will never be checked for spelling and grammar.
|
|
|
|
<dt><dfn id="concept-spellcheck-default-inherit" title="concept-spellcheck-default-inherit">inherit-by-default</dfn>
|
|
|
|
<dd>The element's default behavior is the same as its parent
|
|
element's. Elements that have no parent element cannot have this as
|
|
their default behavior.
|
|
|
|
</dl><hr></div><p>The <dfn id="attr-spellcheck" title="attr-spellcheck"><code>spellcheck</code></dfn>
|
|
attribute is an <a href="#enumerated-attribute">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 <i>true</i> state. The <code title="">false</code> keyword maps to the <i>false</i> state. In
|
|
addition, there is a third state, the <i>default</i> state, which is
|
|
the <i>missing value default</i> (and the <i>invalid value
|
|
default</i>).<p>The <i>true</i> state indicates that the element is to have its
|
|
spelling and grammar checked. The <i>default</i> state indicates
|
|
that the element is to act according to a default behavior, possibly
|
|
based on the parent element's own <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> state. The <i>false</i>
|
|
state indicates that the element is not to be checked.<div class="impl">
|
|
|
|
<hr></div><dl class="domintro"><dt><var title="">element</var> . <code title="dom-spellcheck"><a href="#dom-spellcheck">spellcheck</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element is to have its spelling and grammar
|
|
checked; otherwise, returns false.</p>
|
|
|
|
<p>Can be set, to override the default and set the <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> content attribute.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-spellcheck" title="dom-spellcheck"><code>spellcheck</code></dfn> IDL
|
|
attribute, on getting, must return true if the element's <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> content attribute is in
|
|
the <i>true</i> state, or if the element's <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> content attribute is in
|
|
the <i>default</i> state and the element's <a href="#concept-spellcheck-default" title="concept-spellcheck-default">default behavior</a> is <a href="#concept-spellcheck-default-true" title="concept-spellcheck-default-true">true-by-default</a>, or
|
|
if the element's <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code>
|
|
content attribute is in the <i>default</i> state and the element's
|
|
<a href="#concept-spellcheck-default" title="concept-spellcheck-default">default behavior</a> is
|
|
<a href="#concept-spellcheck-default-inherit" title="concept-spellcheck-default-inherit">inherit-by-default</a>
|
|
and the element's parent element's <code title="dom-spellcheck"><a href="#dom-spellcheck">spellcheck</a></code> IDL attribute would return
|
|
true; otherwise, if none of those conditions applies, then the
|
|
attribute must instead return false.</p>
|
|
|
|
<p class="note">The <code title="dom-spellcheck"><a href="#dom-spellcheck">spellcheck</a></code>
|
|
IDL attribute is not affected by user preferences that override the
|
|
<code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> content attribute,
|
|
and therefore might not reflect the actual spellchecking state.</p>
|
|
|
|
<p>On setting, if the new value is true, then the element's <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> content attribute must be
|
|
set to the literal string "<code title="">true</code>", otherwise it
|
|
must be set to the literal string "<code title="">false</code>".
|
|
|
|
<hr><p>User agents must only consider the following pieces of text as
|
|
checkable for the purposes of this feature:</p>
|
|
|
|
<ul><li>The value of <code><a href="#the-input-element">input</a></code> elements to which the <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute applies,
|
|
whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attributes are not
|
|
in the <a href="#password-state" title="attr-input-type-password">Password</a>
|
|
state, and that are not <i title="concept-input-immutable"><a href="#concept-input-immutable">immutable</a></i> (i.e. that do not
|
|
have the <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>
|
|
attribute specified and that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>).</li>
|
|
|
|
<li>The value of <code><a href="#the-textarea-element">textarea</a></code> elements that do not have a
|
|
<code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">readonly</a></code> attribute and
|
|
that are not <a href="#concept-fe-disabled" title="concept-fe-disabled">disabled</a>.</li>
|
|
|
|
<li>Text in <a href="#text-node" title="text node">text nodes</a> that are
|
|
children of <a href="#editable">editable</a> elements.</li>
|
|
|
|
<li>Text in attributes of <a href="#editable">editable</a> elements.</li>
|
|
|
|
</ul><p>For text that is part of a <a href="#text-node">text node</a>, the element
|
|
with which the text is associated is the element that is the
|
|
immediate parent of the first character of the word, sentence, or
|
|
other piece of text. For text in attributes, it is the attribute's
|
|
element. For the values of <code><a href="#the-input-element">input</a></code> and
|
|
<code><a href="#the-textarea-element">textarea</a></code> elements, it is the element itself.</p>
|
|
|
|
<p>To determine if a word, sentence, or other piece of text in an
|
|
applicable element (as defined above) is to have spelling- and/or
|
|
grammar-checking enabled, the UA must use the following
|
|
algorithm:</p>
|
|
|
|
<ol><li>If the user has disabled the checking for this text, then the
|
|
checking is disabled.</li>
|
|
|
|
<li>Otherwise, if the user has forced the checking for this text to
|
|
always be enabled, then the checking is enabled.</li>
|
|
|
|
|
|
|
|
<li>Otherwise, if the element with which the text is associated has
|
|
a <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> content
|
|
attribute, then: if that attribute is in the <i>true</i> state,
|
|
then checking is enabled; otherwise, if that attribute is in the
|
|
<i>false</i> state, then checking is disabled.</li>
|
|
|
|
|
|
|
|
<li>Otherwise, if there is an ancestor element with a <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> content attribute that is
|
|
not in the <i>default</i> state, then: if the nearest such
|
|
ancestor's <code title="attr-spellcheck"><a href="#attr-spellcheck">spellcheck</a></code> content
|
|
attribute is in the <i>true</i> state, then checking is enabled;
|
|
otherwise, checking is disabled.</li>
|
|
|
|
|
|
|
|
<li>Otherwise, if the element's <a href="#concept-spellcheck-default" title="concept-spellcheck-default">default behavior</a> is <a href="#concept-spellcheck-default-true" title="concept-spellcheck-default-true">true-by-default</a>,
|
|
then checking is enabled.</li>
|
|
|
|
<li>Otherwise, if the element's <a href="#concept-spellcheck-default" title="concept-spellcheck-default">default behavior</a> is <a href="#concept-spellcheck-default-false" title="concept-spellcheck-default-false">false-by-default</a>,
|
|
then checking is disabled.</li>
|
|
|
|
|
|
|
|
<li>Otherwise, if the element's parent element has <em>its</em>
|
|
checking enabled, then checking is enabled.</li>
|
|
|
|
<li>Otherwise, checking is disabled.</li>
|
|
|
|
</ol><p>If the checking is enabled for a word/sentence/text, the user
|
|
agent should indicate spelling and/or grammar errors in that
|
|
text. User agents should take into account the other semantics given
|
|
in the document when suggesting spelling and grammar
|
|
corrections. User agents may use the language of the element to
|
|
determine what spelling and grammar rules to use, or may use the
|
|
user's preferred language settings. UAs should use
|
|
<code><a href="#the-input-element">input</a></code> element attributes such as <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> to ensure that the
|
|
resulting value is valid, where possible.</p>
|
|
|
|
<p>If checking is disabled, the user agent should not indicate
|
|
spelling or grammar errors for that text.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>The element with ID "a" in the following example would be the
|
|
one used to determine if the word "Hello" is checked for spelling
|
|
errors. In this example, it would not be.</p>
|
|
|
|
<pre><div contenteditable="true">
|
|
<span spellcheck="false" id="a">Hell</span><em>o!</em>
|
|
</div></pre>
|
|
|
|
<p>The element with ID "b" in the following example would have
|
|
checking enabled (the leading space character in the attribute's
|
|
value on the <code><a href="#the-input-element">input</a></code> element causes the attribute to be
|
|
ignored, so the ancestor's value is used instead, regardless of the
|
|
default).</p>
|
|
|
|
<pre><p spellcheck="true">
|
|
<label>Name: <input spellcheck=" false" id="b"></label>
|
|
</p></pre>
|
|
|
|
</div>
|
|
|
|
</div><p class="note">This specification does not define the user
|
|
interface for spelling and grammar checkers. A user agent could
|
|
offer on-demand checking, could perform continuous checking while
|
|
the checking is enabled, or could use other interfaces.<h3 id="dnd"><span class="secno">7.7 </span><dfn>Drag and drop</dfn></h3><p>This section defines an event-based drag-and-drop mechanism.<p>This specification does not define exactly what a
|
|
<em>drag-and-drop operation</em> actually is.<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>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 where he wishes to
|
|
drop it, respectively.<div class="impl">
|
|
|
|
<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
|
|
the selection 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>
|
|
|
|
</div><h4 id="introduction-7"><span class="secno">7.7.1 </span>Introduction</h4><p><i>This section is non-normative.</i><p>To make an element draggable is simple: give the element a <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code> attribute, and set an event
|
|
listener for <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code> that
|
|
stores the data being dragged.<p>The event handler typically needs to check that it's not a text
|
|
selection that is being dragged, and then needs to store data into
|
|
the <code><a href="#datatransfer">DataTransfer</a></code> object and set the allowed effects
|
|
(copy, move, link, or some combination).<p>For example:<pre><p>What fruits do you like?</p>
|
|
<ol ondragstart="dragStartHandler(event)">
|
|
<li draggable="true" data-value="fruit-apple">Apples</li>
|
|
<li draggable="true" data-value="fruit-orange">Oranges</li>
|
|
<li draggable="true" data-value="fruit-pear">Pears</li>
|
|
</ol>
|
|
<script>
|
|
var internalDNDType = 'text/x-example'; // set this to something specific to your site
|
|
function dragStartHandler(event) {
|
|
if (event.target instanceof HTMLLIElement) {
|
|
// use the element's data-value="" attribute as the value to be moving:
|
|
event.dataTransfer.setData(internalDNDType, event.target.dataset.value);
|
|
event.dataTransfer.effectAllowed = 'move'; // only allow moves
|
|
} else {
|
|
event.preventDefault(); // don't allow selection to be dragged
|
|
}
|
|
}
|
|
</script></pre><hr><p>To accept a drop, the drop target has to have a <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute and listen to the
|
|
<code title="drop-event">drop</code> event.<p>The value of the <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code>
|
|
attribute specifies what kind of data to accept (e.g. "<code title="">s:text/plain</code>" to accept any text strings, or
|
|
"<code>f:image/png</code>" to accept a PNG image file) and what kind
|
|
of feedback to give (e.g. "<code>move</code>" to indicate that the
|
|
data will be moved).<p class="note">Instead of using the <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute, a drop target can
|
|
handle the <code title="event-dragenter"><a href="#event-dragenter">dragenter</a></code> event (to
|
|
report whether or not the drop target is to accept the drop) and the
|
|
<code title="event-dragover"><a href="#event-dragover">dragover</a></code> event (to specify what
|
|
feedback is to be shown to the user).<p>The <code title="event-drop"><a href="#event-drop">drop</a></code> event allows the actual
|
|
drop to be performed. This event needs to be canceled, so that the
|
|
<code title="dom-DataTransfer-DropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code>
|
|
attribute's value can be used by the source (otherwise it's
|
|
reset).<p>For example:<pre><p>Drop your favorite fruits below:</p>
|
|
<ol dropzone="move s:text/x-example" ondrop="dropHandler(event)">
|
|
<-- don't forget to change the "text/x-example" type to something
|
|
specific to your site -->
|
|
</ol>
|
|
<script>
|
|
var internalDNDType = 'text/x-example'; // set this to something specific to your site
|
|
function dropHandler(event) {
|
|
var li = document.createElement('li');
|
|
var data = event.dataTransfer.getData(internalDNDType);
|
|
if (data == 'fruit-apple') {
|
|
li.textContent = 'Apples';
|
|
} else if (data == 'fruit-orange') {
|
|
li.textContent = 'Oranges';
|
|
} else if (data == 'fruit-pear') {
|
|
li.textContent = 'Pears';
|
|
} else {
|
|
li.textContent = 'Unknown Fruit';
|
|
}
|
|
event.target.appendChild(li);
|
|
}
|
|
</script></pre><hr><p>To remove the original element (the one that was dragged) from
|
|
the display, the <code title="event-dragend"><a href="#event-dragend">dragend</a></code> event
|
|
can be used.<p>For our example here, that means updating the original markup to
|
|
handle that event:<pre><p>What fruits do you like?</p>
|
|
<ol ondragstart="dragStartHandler(event)" ondragend="dragEndHandler(event)">
|
|
<em>...as before...</em>
|
|
</ol>
|
|
<script>
|
|
function dragStartHandler(event) {
|
|
// <em>...as before...</em>
|
|
}
|
|
function dragEndHandler(event) {
|
|
// remove the dragged element
|
|
event.target.parentNode.removeChild(event.target);
|
|
}
|
|
</script></pre><h4 id="the-drag-data-store"><span class="secno">7.7.2 </span>The drag data store</h4><p>The data that underlies a drag-and-drop operation, known as the
|
|
<dfn id="drag-data-store">drag data store</dfn>, consists of the following information:<ul><li><p>A <dfn id="drag-data-store-item-list">drag data store item list</dfn>, which is a list of
|
|
items representing the dragged data, each consisting of the
|
|
following information:</p>
|
|
|
|
<dl><dt><dfn id="the-drag-data-item-kind">The drag data item kind</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>The kind of data:</p>
|
|
|
|
<dl><dt><i>Plain Unicode string</i></dt>
|
|
<dd>
|
|
<p>Text.</p>
|
|
</dd>
|
|
|
|
|
|
<dt><i><a href="#file">File</a></i></dt>
|
|
<dd>
|
|
<p>Binary data with a file name.</p>
|
|
</dd>
|
|
|
|
|
|
</dl></dd>
|
|
|
|
<dt><dfn id="the-drag-data-item-type-string">The drag data item type string</dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>A Unicode string giving the type or format of the data,
|
|
generally given by a <a href="#mime-type">MIME type</a>. Some values that
|
|
are not <a href="#mime-type" title="MIME type">MIME types</a> are
|
|
special-cased for legacy reasons. The API does not enforce the
|
|
use of <a href="#mime-type" title="MIME type">MIME types</a>; other values
|
|
can be used as well. In all cases, however, the values are all
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a> by the API.</p>
|
|
|
|
<p class="note">Strings that contain <a href="#space-character" title="space
|
|
character">space characters</a> cannot be used with the <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute, so authors are
|
|
encouraged to use only <a href="#mime-type" title="MIME type">MIME types</a>
|
|
or custom strings (without spaces).</p>
|
|
|
|
<p>There is a limit of one <i>Plain Unicode string</i> item per
|
|
<a href="#the-drag-data-item-type-string" title="The drag data item type string">item type
|
|
string</a>.</p>
|
|
</dd>
|
|
|
|
<dt>The actual data</dt>
|
|
|
|
<dd><p>A Unicode or binary string, in some cases with a file name
|
|
(itself a Unicode string), as
|
|
per <a href="#the-drag-data-item-kind">the drag data item kind</a>.</dd>
|
|
|
|
</dl><p>The <a href="#drag-data-store-item-list">drag data store item list</a> is ordered in the
|
|
order that the items were added to the list; most recently added
|
|
last.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>The following information, used to generate the UI feedback
|
|
during the drag:</p>
|
|
|
|
<ul><li>User-agent-defined default feedback information, known as the
|
|
<dfn id="drag-data-store-default-feedback">drag data store default feedback</dfn>.</li>
|
|
|
|
<li>A list of zero or more elements known as the <dfn id="drag-data-store-elements-list">drag data
|
|
store elements list</dfn>.</li>
|
|
|
|
<li>Optionally, a bitmap image and the coordinate of a point
|
|
within that image, known as the <dfn id="drag-data-store-bitmap">drag data store bitmap</dfn>
|
|
and <dfn id="drag-data-store-hot-spot-coordinate">drag data store hot spot coordinate</dfn>.</li>
|
|
|
|
</ul></li>
|
|
|
|
<li>
|
|
|
|
<p>A <dfn id="drag-data-store-mode">drag data store mode</dfn>, which is one of the
|
|
following:</p>
|
|
|
|
<dl><dt><dfn id="concept-dnd-rw" title="concept-dnd-rw">Read/write mode</dfn></dt>
|
|
<dd>
|
|
|
|
<p>For the <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code> event.
|
|
New data can be added to the <a href="#drag-data-store">drag data store</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="concept-dnd-ro" title="concept-dnd-ro">Read-only mode</dfn></dt>
|
|
<dd>
|
|
|
|
<p>For the <code title="event-drop"><a href="#event-drop">drop</a></code> event. The list of
|
|
items representing dragged data can be read, including the data.
|
|
No new data can be added.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><dfn id="concept-dnd-p" title="concept-dnd-p">Protected mode</dfn></dt>
|
|
<dd>
|
|
|
|
<p>For all other events. The formats and kinds in the <a href="#drag-data-store">drag
|
|
data store</a> list of items representing dragged data can be
|
|
enumerated, but the data itself is unavailable and no new data can
|
|
be added.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>A <dfn id="drag-data-store-allowed-effects-state">drag data store allowed effects state</dfn>, which is a
|
|
string.</p>
|
|
|
|
</li>
|
|
|
|
</ul><p>When a <a href="#drag-data-store">drag data store</a> is <dfn id="create-a-drag-data-store" title="create a drag
|
|
data store">created</dfn>, it must be initialized such that its
|
|
<a href="#drag-data-store-item-list">drag data store item list</a> is empty, it has no
|
|
<a href="#drag-data-store-default-feedback">drag data store default feedback</a>, its <a href="#drag-data-store-elements-list">drag data
|
|
store elements list</a> is empty, it has no <a href="#drag-data-store-bitmap">drag data store
|
|
bitmap</a> / <a href="#drag-data-store-hot-spot-coordinate">drag data store hot spot coordinate</a>,
|
|
its <a href="#drag-data-store-mode">drag data store mode</a> is <a href="#concept-dnd-p" title="concept-dnd-p">protected mode</a>, and its <a href="#drag-data-store-allowed-effects-state">drag data
|
|
store allowed effects state</a> is the string "<code title="">uninitialized</code>".<h4 id="the-datatransfer-interface"><span class="secno">7.7.3 </span>The <code><a href="#datatransfer">DataTransfer</a></code> interface</h4><p><code><a href="#datatransfer">DataTransfer</a></code> objects are used to expose the
|
|
<a href="#drag-data-store">drag data store</a> that underlies a drag-and-drop
|
|
operation.<pre class="idl">interface <dfn id="datatransfer">DataTransfer</dfn> {
|
|
attribute DOMString <a href="#dom-datatransfer-dropeffect" title="dom-DataTransfer-dropEffect">dropEffect</a>;
|
|
attribute DOMString <a href="#dom-datatransfer-effectallowed" title="dom-DataTransfer-effectAllowed">effectAllowed</a>;
|
|
|
|
readonly attribute <a href="#datatransferitems">DataTransferItems</a> <a href="#dom-datatransfer-items" title="dom-DataTransfer-items">items</a>;
|
|
|
|
void <a href="#dom-datatransfer-setdragimage" title="dom-DataTransfer-setDragImage">setDragImage</a>(in Element image, in long x, in long y);
|
|
void <a href="#dom-datatransfer-addelement" title="dom-DataTransfer-addElement">addElement</a>(in Element element);
|
|
|
|
/* old interface */
|
|
readonly attribute DOMStringList <a href="#dom-datatransfer-types" title="dom-DataTransfer-types">types</a>;
|
|
DOMString <a href="#dom-datatransfer-getdata" title="dom-DataTransfer-getData">getData</a>(in DOMString format);
|
|
void <a href="#dom-datatransfer-setdata" title="dom-DataTransfer-setData">setData</a>(in DOMString format, in DOMString data);
|
|
void <a href="#dom-datatransfer-cleardata" title="dom-DataTransfer-clearData">clearData</a>(in optional DOMString format);
|
|
readonly attribute <a href="#filelist">FileList</a> <a href="#dom-datatransfer-files" title="dom-DataTransfer-files">files</a>;
|
|
};</pre><dl class="domintro"><dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the kind of operation that is currently selected. If
|
|
the kind of operation isn't one of those that is allowed by the
|
|
<code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code>
|
|
attribute, then the operation will fail.</p>
|
|
|
|
<p>Can be set, to change the selected operation.</p>
|
|
|
|
<p>The possible values are "<code title="">none</code>", "<code title="">copy</code>", "<code title="">link</code>", and "<code title="">move</code>".</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the kinds of operations that are to be allowed.</p>
|
|
|
|
<p>Can be set, to change the allowed operations.</p>
|
|
|
|
<p>The possible values are "<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>",</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-items"><a href="#dom-datatransfer-items">items</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#datatransferitems">DataTransferItems</a></code> object, with the drag data.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-setDragImage"><a href="#dom-datatransfer-setdragimage">setDragImage</a></code>(<var title="">element</var>, <var title="">x</var>, <var title="">y</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Uses the given element to update the drag feedback, replacing any previously specified feedback.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-addElement"><a href="#dom-datatransfer-addelement">addElement</a></code>(<var title="">element</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Adds the given element to the list of elements used to render the drag feedback.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-types"><a href="#dom-datatransfer-types">types</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code>DOMStringList</code> listing the formats that
|
|
were set in the <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code>
|
|
event. In addition, if any files are being dragged, then one of
|
|
the types will be the string "<code title="">Files</code>".</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">data</var> = <var title="">dataTransfer</var> . <code title="dom-DataTransfer-getData"><a href="#dom-datatransfer-getdata">getData</a></code>(<var title="">format</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the specified data. If there is no such data, returns the empty string.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-setData"><a href="#dom-datatransfer-setdata">setData</a></code>(<var title="">format</var>, <var title="">data</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Adds the specified data.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-clearData"><a href="#dom-datatransfer-cleardata">clearData</a></code>( [ <var title="">format</var> ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Removes the data of the specified formats. Removes all data if
|
|
the argument is omitted.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">dataTransfer</var> . <code title="dom-DataTransfer-files"><a href="#dom-datatransfer-files">files</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#filelist">FileList</a></code> of the files being dragged, if any.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p><code><a href="#datatransfer">DataTransfer</a></code> objects are used during the <a href="#dndevents">drag-and-drop events</a>, and are only valid while
|
|
those events are being dispatched.<div class="impl">
|
|
|
|
<p>A <code><a href="#datatransfer">DataTransfer</a></code> object is associated with a
|
|
<a href="#drag-data-store">drag data store</a> while it is valid.</p>
|
|
|
|
<p>The <dfn id="dom-datatransfer-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. When the <code><a href="#datatransfer">DataTransfer</a></code>
|
|
object is created, the <code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code> attribute is
|
|
set to a string value. On getting, it must return its current value.
|
|
On setting, if the new value is one of "<code title="">none</code>",
|
|
"<code title="">copy</code>", "<code title="">link</code>", or
|
|
"<code title="">move</code>", then the attribute's current value
|
|
must be set to the new value. Other values must be ignored.</p>
|
|
|
|
<p>The <dfn id="dom-datatransfer-effectallowed" title="dom-DataTransfer-effectAllowed"><code>effectAllowed</code></dfn>
|
|
attribute is used in the drag-and-drop processing model to
|
|
initialize the <code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code> attribute
|
|
during the <code title="event-dragenter"><a href="#event-dragenter">dragenter</a></code> and <code title="event-dragover"><a href="#event-dragover">dragover</a></code> events. When the
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object is created, the <code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code>
|
|
attribute is set to a string value. On getting, it must return its
|
|
current value. On setting, if the new value is one of "<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>", or "<code title="">uninitialized</code>", then the attribute's current value
|
|
must be set to the new value. Other values must be ignored.</p>
|
|
|
|
<p>The <dfn id="dom-datatransfer-items" title="dom-DataTransfer-items"><code>items</code></dfn>
|
|
attribute must return a <code><a href="#datatransferitems">DataTransferItems</a></code> object
|
|
associated with the <code><a href="#datatransfer">DataTransfer</a></code> object. The same
|
|
object must be returned each time.</p>
|
|
|
|
<p>The <dfn id="dom-datatransfer-setdragimage" title="dom-DataTransfer-setDragImage"><code>setDragImage(<var title="">element</var>, <var title="">x</var>, <var title="">y</var>)</code></dfn> method must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#datatransfer">DataTransfer</a></code> object is no longer
|
|
associated with a <a href="#drag-data-store">drag data store</a>, abort these steps.
|
|
Nothing happens.</li>
|
|
|
|
<li><p>If the <a href="#drag-data-store">drag data store</a>'s <a href="#drag-data-store-mode" title="drag data
|
|
store mode">mode</a> is not in the <a href="#concept-dnd-rw" title="concept-dnd-rw">read/write mode</a>, abort these steps.
|
|
Nothing happens.</li>
|
|
|
|
<li><p>If the <var title="">element</var> argument is an
|
|
<code><a href="#the-img-element">img</a></code> element, then set the <a href="#drag-data-store-bitmap">drag data store
|
|
bitmap</a> to the element's image (at its intrinsic size);
|
|
otherwise, set the <a href="#drag-data-store-bitmap">drag data store bitmap</a> to an image
|
|
generated from the given element (the exact mechanism for doing so
|
|
is not currently specified).</li>
|
|
|
|
<li><p>Set the <a href="#drag-data-store-hot-spot-coordinate">drag data store hot spot coordinate</a> to
|
|
the given <var title="">x</var>, <var title="">y</var>
|
|
coordinate.</li>
|
|
|
|
</ol><p>The <dfn id="dom-datatransfer-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>. The method
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#datatransfer">DataTransfer</a></code> object is no longer
|
|
associated with a <a href="#drag-data-store">drag data store</a>, abort these steps.
|
|
Nothing happens.</li>
|
|
|
|
<li><p>If the <a href="#drag-data-store">drag data store</a>'s <a href="#drag-data-store-mode" title="drag data
|
|
store mode">mode</a> is not in the <a href="#concept-dnd-rw" title="concept-dnd-rw">read/write mode</a>, abort these steps.
|
|
Nothing happens.</li>
|
|
|
|
<li><p>Add the given <var title="">element</var> to the element's
|
|
<a href="#drag-data-store-elements-list">drag data store elements list</a>.</li>
|
|
|
|
</ol><p class="note">The difference between <code title="dom-DataTransfer-setDragImage"><a href="#dom-datatransfer-setdragimage">setDragImage()</a></code> and
|
|
<code title="dom-DataTransfer-addElement"><a href="#dom-datatransfer-addelement">addElement()</a></code> is
|
|
that the latter automatically generates the image based on the
|
|
current rendering of the elements added (potentially keeping it
|
|
updated as the drag continues, e.g. if the elements include an
|
|
actively playing video), whereas the former uses the exact specified
|
|
image at the time the method is invoked.</p>
|
|
|
|
<p>The <dfn id="dom-datatransfer-types" title="dom-DataTransfer-types"><code>types</code></dfn>
|
|
attribute must return a <a href="#live">live</a> <code>DOMStringList</code>
|
|
giving the strings that the following steps would produce. The same
|
|
object must be returned each time.</p>
|
|
|
|
<ol><li><p>Start with an empty list <var title="">L</var>.</li>
|
|
|
|
<li><p>If the <code><a href="#datatransfer">DataTransfer</a></code> object is no longer
|
|
associated with a <a href="#drag-data-store">drag data store</a>, the
|
|
<code>DOMStringList</code> is empty. Abort these steps; return the
|
|
empty list <var title="">L</var>.</li>
|
|
|
|
<li><p>For each item in the <a href="#drag-data-store-item-list">drag data store item list</a>
|
|
whose <a href="#the-drag-data-item-kind" title="the drag data item
|
|
kind">kind</a> is <i>Plain Unicode string</i>, add an entry to
|
|
the list <var title="">L</var> consisting of the item's <a href="#the-drag-data-item-type-string" title="the drag data item type string">type string</a>.</li>
|
|
|
|
<li><p>If there are any items in the <a href="#drag-data-store-item-list">drag data store item
|
|
list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item kind">kind</a>
|
|
is <i><a href="#file">File</a></i>, then add an entry to the list <var title="">L</var>
|
|
consisting of the string "<code title="">Files</code>". (This value
|
|
can be distinguished from the other values because it is not
|
|
lowercase.)</li>
|
|
|
|
|
|
|
|
<li><p>The strings produced by these steps are those in the list
|
|
<var title="">L</var>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-datatransfer-getdata" title="dom-DataTransfer-getData"><code>getData(<var title="">format</var>)</code></dfn> method
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#datatransfer">DataTransfer</a></code> object is no longer
|
|
associated with a <a href="#drag-data-store">drag data store</a>, return the empty
|
|
string and abort these steps.</li>
|
|
|
|
<li><p>If the <a href="#drag-data-store">drag data store</a>'s <a href="#drag-data-store-mode" title="drag data
|
|
store mode">mode</a> is in the <a href="#concept-dnd-p" title="concept-dnd-p">protected mode</a>, return the empty
|
|
string and abort these steps.</li>
|
|
|
|
<li><p>Let <var title="">format</var> be the first argument,
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
|
|
|
|
<li><p>Let <var title="">convert-to-URL</var> be false.</li>
|
|
|
|
<li><p>If <var title="">format</var> equals "<code title="">text</code>", change it to "<code title="">text/plain</code>".</li>
|
|
|
|
<li><p>If <var title="">format</var> equals "<code title="">url</code>", change it to "<code title="">text/uri-list</code>" and set <var title="">convert-to-URL</var> to true.</li>
|
|
|
|
<li><p>If there is no item in the <a href="#drag-data-store-item-list">drag data store item
|
|
list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item kind">kind</a>
|
|
is <i>Plain Unicode string</i> and whose <a href="#the-drag-data-item-type-string" title="the drag data
|
|
item type string">type string</a> is equal to <var title="">format</var>, return the empty string and abort these
|
|
steps.</li>
|
|
|
|
<li><p>Let <var title="">result</var> be the data of the item
|
|
in the <a href="#drag-data-store-item-list">drag data store item list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item kind">kind</a> is <i>Plain Unicode
|
|
string</i> and whose <a href="#the-drag-data-item-type-string" title="the drag data item type
|
|
string">type string</a> is equal to <var title="">format</var>.</li>
|
|
|
|
<li><p>If <var title="">convert-to-URL</var> is true, then parse
|
|
<var title="">result</var> as appropriate for <code title="">text/uri-list</code> data, and then set <var title="">result</var> to the first URL from the list, if any, or
|
|
the empty string otherwise. <a href="#refsRFC2483">[RFC2483]</a></li>
|
|
|
|
<li><p>Return <var title="">result</var>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-datatransfer-setdata" title="dom-DataTransfer-setData"><code>setData(<var title="">format</var>, <var title="">data</var>)</code></dfn> method
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#datatransfer">DataTransfer</a></code> object is no longer
|
|
associated with a <a href="#drag-data-store">drag data store</a>, abort these steps.
|
|
Nothing happens.</li>
|
|
|
|
<li><p>If the <a href="#drag-data-store">drag data store</a>'s <a href="#drag-data-store-mode" title="drag data
|
|
store mode">mode</a> is not the <a href="#concept-dnd-rw" title="concept-dnd-rw">read/write mode</a>, abort these steps.
|
|
Nothing happens.</li>
|
|
|
|
<li><p>Let <var title="">format</var> be the first argument,
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">format</var> equals "<code title="">text</code>", change it to "<code title="">text/plain</code>".</p>
|
|
|
|
<p>If <var title="">format</var> equals "<code title="">url</code>", change it to "<code title="">text/uri-list</code>".</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Remove the item in the <a href="#drag-data-store-item-list">drag data store item
|
|
list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item kind">kind</a>
|
|
is <i>Plain Unicode string</i> and whose <a href="#the-drag-data-item-type-string" title="the drag data
|
|
item type string">type string</a> is equal to <var title="">format</var>, if there is one.</li>
|
|
|
|
<li><p>Add an item to the <a href="#drag-data-store-item-list">drag data store item list</a>
|
|
whose <a href="#the-drag-data-item-kind" title="the drag data item kind">kind</a> is <i>Plain
|
|
Unicode string</i>, whose <a href="#the-drag-data-item-type-string" title="the drag data item type
|
|
string">type string</a> is equal to <var title="">format</var>,
|
|
and whose data is the string given by the method's second
|
|
argument.</li>
|
|
|
|
</ol><p>The <dfn id="dom-datatransfer-cleardata" title="dom-DataTransfer-clearData"><code>clearData()</code></dfn>
|
|
method must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#datatransfer">DataTransfer</a></code> object is no longer
|
|
associated with a <a href="#drag-data-store">drag data store</a>, abort these steps.
|
|
Nothing happens.</li>
|
|
|
|
<li><p>If the <a href="#drag-data-store">drag data store</a>'s <a href="#drag-data-store-mode" title="drag data
|
|
store mode">mode</a> is not the <a href="#concept-dnd-rw" title="concept-dnd-rw">read/write mode</a>, abort these steps.
|
|
Nothing happens.</li>
|
|
|
|
<li><p>If the method was called with no arguments, remove each item
|
|
in the <a href="#drag-data-store-item-list">drag data store item list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item kind">kind</a> is <i>Plain Unicode
|
|
string</i>, and abort these steps.</li>
|
|
|
|
<li><p>Let <var title="">format</var> be the first argument,
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">format</var> equals "<code title="">text</code>", change it to "<code title="">text/plain</code>".</p>
|
|
|
|
<p>If <var title="">format</var> equals "<code title="">url</code>", change it to "<code title="">text/uri-list</code>".</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Remove the item in the <a href="#drag-data-store-item-list">drag data store item
|
|
list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item kind">kind</a>
|
|
is <i>Plain Unicode string</i> and whose <a href="#the-drag-data-item-type-string" title="the drag data
|
|
item type string">type string</a> is equal to <var title="">format</var>, if there is one.</li>
|
|
|
|
</ol><p class="note">The <code title="dom-DataTransfer-clearData"><a href="#dom-datatransfer-cleardata">clearData()</a></code> method does
|
|
not affect whether any files were included in the drag, so the <code title="dom-DataTransfer-types"><a href="#dom-datatransfer-types">types</a></code> attribute's list might
|
|
still not be empty after calling <code title="dom-DataTransfer-clearData"><a href="#dom-datatransfer-cleardata">clearData()</a></code> (it would
|
|
still contain the "<code title="">Files</code>" string if any files
|
|
were included in the drag).</p>
|
|
|
|
<p>The <dfn id="dom-datatransfer-files" title="dom-DataTransfer-files"><code>files</code></dfn>
|
|
attribute must return a <a href="#live">live</a> <code><a href="#filelist">FileList</a></code>
|
|
sequence consisting of <code><a href="#file">File</a></code> objects representing the
|
|
files found by the following steps. The same object must be returned
|
|
each time. Furthermore, for a given <code><a href="#filelist">FileList</a></code> object and
|
|
a given underlying file, the same <code><a href="#file">File</a></code> object must be
|
|
used each time.</p>
|
|
|
|
<ol><li><p>Start with an empty list <var title="">L</var>.</li>
|
|
|
|
<li><p>If the <code><a href="#datatransfer">DataTransfer</a></code> object is no longer
|
|
associated with a <a href="#drag-data-store">drag data store</a>, the
|
|
<code><a href="#filelist">FileList</a></code> is empty. Abort these steps; return the
|
|
empty list <var title="">L</var>.</li>
|
|
|
|
<li><p>If the <a href="#drag-data-store">drag data store</a>'s <a href="#drag-data-store-mode" title="drag data
|
|
store mode">mode</a> is in the <a href="#concept-dnd-p" title="concept-dnd-p">protected mode</a>, abort these steps;
|
|
return the empty list <var title="">L</var>.</li>
|
|
|
|
<li><p>For each item in the <a href="#drag-data-store-item-list">drag data store item list</a>
|
|
whose <a href="#the-drag-data-item-kind" title="the drag data item
|
|
kind">kind</a> is <i><a href="#file">File</a></i> ,
|
|
add the item's data (the file, in particular its name and contents,
|
|
as well as its <a href="#the-drag-data-item-type-string" title="the drag data item type
|
|
string">type</a>) to the list <var title="">L</var>.</li>
|
|
|
|
|
|
|
|
<li><p>The files found by these steps are those in the list <var title="">L</var>.</li>
|
|
|
|
</ol><p class="note">This version of the API does not expose the types of
|
|
the files during the drag.</p>
|
|
|
|
</div><h5 id="the-datatransferitems-interface"><span class="secno">7.7.3.1 </span>The <code><a href="#datatransferitems">DataTransferItems</a></code> interface</h5><p>Each <code><a href="#datatransfer">DataTransfer</a></code> object is associated with a
|
|
<code><a href="#datatransferitems">DataTransferItems</a></code> object.<pre class="idl">interface <dfn id="datatransferitems">DataTransferItems</dfn> {
|
|
readonly attribute unsigned long <a href="#dom-datatransferitems-length" title="dom-DataTransferItems-length">length</a>;
|
|
<a href="#dom-datatransferitems-item" title="dom-DataTransferItems-item">getter</a> <a href="#datatransferitem">DataTransferItem</a> (in unsigned long index);
|
|
<a href="#dom-datatransferitems-removeitem" title="dom-DataTransferItems-removeItem">deleter</a> void (in unsigned long index);
|
|
void <a href="#dom-datatransferitems-clear" title="dom-DataTransferItems-clear">clear</a>();
|
|
|
|
<a href="#datatransferitem">DataTransferItem</a> <a href="#dom-datatransferitems-add" title="dom-DataTransferItems-add">add</a>(in DOMString data, in DOMString type); <a href="#datatransferitem">DataTransferItem</a> <a href="#dom-datatransferitems-add" title="dom-DataTransferItems-add">add</a>(in <a href="#file">File</a> data);};</pre><dl class="domintro"><dt><var title="">items</var> . <code title="dom-DataTransferItems-length"><a href="#dom-datatransferitems-length">length</a></code></dt>
|
|
|
|
<dd><p>Returns the number of items in the <a href="#drag-data-store">drag data store</a>.</dd>
|
|
|
|
|
|
<dt><var title="">items</var>[<var title="">index</var>]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#datatransferitem">DataTransferItem</a></code> object representing the <var title="">index</var>th entry in the <a href="#drag-data-store">drag data store</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><code title="">delete</code> <var title="">items</var>[<var title="">index</var>]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Removes the <var title="">index</var>th entry in the <a href="#drag-data-store">drag data store</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">items</var> . <code title="dom-DataTransferItems-clear"><a href="#dom-datatransferitems-clear">clear</a></code>()</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Removes all the entries in the <a href="#drag-data-store">drag data store</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">items</var> . <code title="dom-DataTransferItems-add"><a href="#dom-datatransferitems-add">add</a></code>(<var title="">data</var>)</dt>
|
|
<dt><var title="">items</var> . <code title="dom-DataTransferItems-add"><a href="#dom-datatransferitems-add">add</a></code>(<var title="">data</var>, <var title="">type</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Adds a new entry for the given data to the <a href="#drag-data-store">drag data
|
|
store</a>. If the data is plain text
|
|
then a <var title="">type</var> string has to be provided
|
|
also.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>While the <code><a href="#datatransferitems">DataTransferItems</a></code> object's
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object is associated with a <a href="#drag-data-store">drag
|
|
data store</a>, the <code><a href="#datatransferitems">DataTransferItems</a></code> object's
|
|
<i>mode</i> is the same as the <a href="#drag-data-store-mode">drag data store mode</a>.
|
|
When the <code><a href="#datatransferitems">DataTransferItems</a></code> object's
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object is <em>not</em> associated with a
|
|
<a href="#drag-data-store">drag data store</a>, the <code><a href="#datatransferitems">DataTransferItems</a></code>
|
|
object's <i>mode</i> is the <i>disabled mode</i>. The <a href="#drag-data-store">drag
|
|
data store</a> referenced in this section (which is used only
|
|
when the <code><a href="#datatransferitems">DataTransferItems</a></code> object is not in the
|
|
<i>disabled mode</i>) is the <a href="#drag-data-store">drag data store</a> with which
|
|
the <code><a href="#datatransferitems">DataTransferItems</a></code> object's
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object is associated.</p>
|
|
|
|
<p>The <dfn id="dom-datatransferitems-length" title="dom-DataTransferItems-length"><code>length</code></dfn>
|
|
attribute must return zero if the object is in the <i>disabled
|
|
mode</i>; otherwise it must return the number of items in the
|
|
<a href="#drag-data-store-item-list">drag data store item list</a>.</p>
|
|
|
|
<p>When a <code><a href="#datatransferitems">DataTransferItems</a></code> object is not in the
|
|
<i>disabled mode</i>, its <a href="#supported-property-indices">supported property indices</a>
|
|
are the numbers in the range
|
|
|
|
<span title="">0 .. <var title="">n</var>-1</span>,
|
|
|
|
where <var title="">n</var> is the number of items in the <a href="#drag-data-store-item-list">drag
|
|
data store item list</a>.</p>
|
|
|
|
<p>To <dfn id="dom-datatransferitems-item" title="dom-DataTransferItems-item">determine the value of
|
|
an indexed property</dfn> <var title="">i</var> of a
|
|
<code><a href="#datatransferitems">DataTransferItems</a></code> object, the user agent must return a
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object representing the <var title="">i</var>th item in the <a href="#drag-data-store">drag data store</a>. The
|
|
same object must be returned each time a particular item is obtained
|
|
from this <code><a href="#datatransferitems">DataTransferItems</a></code> object. The
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object must be associated with the
|
|
same <code><a href="#datatransfer">DataTransfer</a></code> object as the
|
|
<code><a href="#datatransferitems">DataTransferItems</a></code> object when it is first created.</p>
|
|
|
|
<p>To <dfn id="dom-datatransferitems-removeitem" title="dom-DataTransferItems-removeItem">delete an
|
|
existing indexed property</dfn> <var title="">i</var> of a
|
|
<code><a href="#datatransferitems">DataTransferItems</a></code> object, the user agent must run these
|
|
steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#datatransferitems">DataTransferItems</a></code> object is not in the
|
|
<i title="concept-dnd-rw"><a href="#concept-dnd-rw">read/write mode</a></i>, throw an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception and abort these
|
|
steps.</li>
|
|
|
|
<li><p>Remove the <var title="">i</var>th item from the <a href="#drag-data-store">drag
|
|
data store</a>.</li>
|
|
|
|
</ol><p>The <dfn id="dom-datatransferitems-clear" title="dom-DataTransferItems-clear"><code>clear</code></dfn> method,
|
|
if the <code><a href="#datatransferitems">DataTransferItems</a></code> object is in the <i title="concept-dnd-rw"><a href="#concept-dnd-rw">read/write mode</a></i>, must remove all the
|
|
items from the <a href="#drag-data-store">drag data store</a>. Otherwise, it must do
|
|
nothing.</p>
|
|
|
|
<p>The <dfn id="dom-datatransferitems-add" title="dom-DataTransferItems-add"><code>add()</code></dfn> method
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#datatransferitems">DataTransferItems</a></code> object is not in the
|
|
<i title="concept-dnd-rw"><a href="#concept-dnd-rw">read/write mode</a></i>, return null and
|
|
abort these steps.</li>
|
|
|
|
<li>
|
|
|
|
<p>Jump to the appropriate set of steps from the following list:</p>
|
|
|
|
<dl class="switch"><dt>If the first argument to the method is a string</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If there is already an item in the <a href="#drag-data-store-item-list">drag data store item
|
|
list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item
|
|
kind">kind</a> is <i>Plain Unicode string</i> and whose <a href="#the-drag-data-item-type-string" title="the drag data item type string">type string</a> is
|
|
equal to the value of the method's second argument,
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>, then throw a
|
|
<code><a href="#not_supported_err">NOT_SUPPORTED_ERR</a></code> exception and abort these
|
|
steps.</p>
|
|
|
|
<p>Otherwise, add an item to the <a href="#drag-data-store-item-list">drag data store item
|
|
list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item
|
|
kind">kind</a> is <i>Plain Unicode string</i>, whose <a href="#the-drag-data-item-type-string" title="the drag data item type string">type string</a> is
|
|
equal to the value of the method's second argument,
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>, and whose data is the
|
|
string given by the method's first argument.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the first argument to the method is a <code><a href="#file">File</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Add an item to the <a href="#drag-data-store-item-list">drag data store item list</a>
|
|
whose <a href="#the-drag-data-item-kind" title="the drag data item kind">kind</a> is
|
|
<i><a href="#file">File</a></i>, whose <a href="#the-drag-data-item-type-string" title="the drag data item type
|
|
string">type string</a> is the <code title="dom-Blob-type">type</code> of the <code><a href="#file">File</a></code>,
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>, and whose data is the
|
|
same as the <code><a href="#file">File</a></code>'s data.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
</dl></li>
|
|
|
|
<li><p><a href="#dom-datatransferitems-item" title="dom-DataTransferItems-item">Determine the value
|
|
of the indexed property</a> corresponding to the newly added
|
|
item, and return that value (a newly created
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object).</li>
|
|
|
|
</ol></div><h5 id="the-datatransferitem-interface"><span class="secno">7.7.3.2 </span>The <code><a href="#datatransferitem">DataTransferItem</a></code> interface</h5><p>Each <code><a href="#datatransferitem">DataTransferItem</a></code> object is associated with a
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object.<pre class="idl">interface <dfn id="datatransferitem">DataTransferItem</dfn> {
|
|
readonly attribute DOMString <a href="#dom-datatransferitem-kind" title="dom-DataTransferItem-kind">kind</a>;
|
|
readonly attribute DOMString <a href="#dom-datatransferitem-type" title="dom-DataTransferItem-type">type</a>;
|
|
void <a href="#dom-datatransferitem-getasstring" title="dom-DataTransferItem-getAsString">getAsString</a>(in <a href="#functionstringcallback">FunctionStringCallback</a> callback); <a href="#file">File</a> <a href="#dom-datatransferitem-getasfile" title="dom-DataTransferItem-getAsFile">getAsFile</a>();};
|
|
|
|
[Callback=FunctionOnly, NoInterfaceObject]
|
|
interface <dfn id="functionstringcallback">FunctionStringCallback</dfn> {
|
|
void <span title="dom-FunctionStringCallback-handleEvent">handleEvent</span>(in DOMString data);
|
|
};</pre><dl class="domintro"><dt><var title="">item</var> . <code title="dom-DataTransferItem-kind"><a href="#dom-datatransferitem-kind">kind</a></code></dt>
|
|
<dd>
|
|
|
|
<p>Returns <a href="#the-drag-data-item-kind">the drag data item kind</a>, one of: "string",
|
|
"file".</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">item</var> . <code title="dom-DataTransferItem-type"><a href="#dom-datatransferitem-type">type</a></code></dt>
|
|
<dd>
|
|
|
|
<p>Returns <a href="#the-drag-data-item-type-string">the drag data item type string</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">item</var> . <code title="dom-DataTransferItem-getAsString"><a href="#dom-datatransferitem-getasstring">getAsString</a></code>(<var title="">callback</var>)</dt>
|
|
<dd>
|
|
|
|
<p>Invokes the callback with the string data as the argument, if <a href="#the-drag-data-item-kind">the drag data item kind</a> is <i>Plain Unicode string</i>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt><var title="">file</var> = <var title="">item</var> . <code title="dom-DataTransferItem-getAsFile"><a href="#dom-datatransferitem-getasfile">getAsFile</a></code>()</dt>
|
|
<dd>
|
|
|
|
<p>Returns a <code><a href="#file">File</a></code> object, if <a href="#the-drag-data-item-kind">the drag data item kind</a> is <i><a href="#file">File</a></i>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>While the <code><a href="#datatransferitem">DataTransferItem</a></code> object's
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object is associated with a <a href="#drag-data-store">drag
|
|
data store</a> and that <a href="#drag-data-store">drag data store</a>'s <a href="#drag-data-store-item-list">drag
|
|
data store item list</a> still contains the item that the
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object represents, the
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object's <i>mode</i> is the same as
|
|
the <a href="#drag-data-store-mode">drag data store mode</a>. When the
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object's <code><a href="#datatransfer">DataTransfer</a></code>
|
|
object is <em>not</em> associated with a <a href="#drag-data-store">drag data
|
|
store</a>, or if the item that the <code><a href="#datatransferitem">DataTransferItem</a></code>
|
|
object represents has been removed from the relevant <a href="#drag-data-store-item-list">drag data
|
|
store item list</a>, the <code><a href="#datatransferitem">DataTransferItem</a></code> object's
|
|
<i>mode</i> is the <i>disabled mode</i>. The <a href="#drag-data-store">drag data
|
|
store</a> referenced in this section (which is used only when the
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object is not in the <i>disabled
|
|
mode</i>) is the <a href="#drag-data-store">drag data store</a> with which the
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object's <code><a href="#datatransfer">DataTransfer</a></code>
|
|
object is associated.</p>
|
|
|
|
<p>The <dfn id="dom-datatransferitem-kind" title="dom-DataTransferItem-kind"><code>kind</code></dfn> attribute
|
|
must return the empty string if the <code><a href="#datatransferitem">DataTransferItem</a></code>
|
|
object is in the <i>disabled mode</i>; otherwise it must return the
|
|
string given in the cell from the second column of the following
|
|
table from the row whose cell in the first column contains <a href="#the-drag-data-item-kind">the
|
|
drag data item kind</a> of the item represented by the
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object:</p>
|
|
|
|
<table><thead><tr><th> Kind <th> String
|
|
<tbody><tr><td> <i>Plain Unicode string</i> <td> "<code title="">string</code>"
|
|
<tr><td> <i><a href="#file">File</a></i> <td> "<code title="">file</code>"
|
|
</table><p>The <dfn id="dom-datatransferitem-type" title="dom-DataTransferItem-type"><code>type</code></dfn> attribute
|
|
must return the empty string if the <code><a href="#datatransferitem">DataTransferItem</a></code>
|
|
object is in the <i>disabled mode</i>; otherwise it must return
|
|
<a href="#the-drag-data-item-type-string">the drag data item type string</a> of the item represented
|
|
by the <code><a href="#datatransferitem">DataTransferItem</a></code> object.</p>
|
|
|
|
<p>The <dfn id="dom-datatransferitem-getasstring" title="dom-DataTransferItem-getAsString"><code>getAsString(<var title="">callback</var>)</code></dfn> method must run the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>If the <var title="">callback</var> is null, abort these
|
|
steps.</li>
|
|
|
|
<li><p>If the <code><a href="#datatransferitem">DataTransferItem</a></code> object is not in the <i title="concept-dnd-rw"><a href="#concept-dnd-rw">read/write mode</a></i> or the <i title="concept-dnd-ro"><a href="#concept-dnd-ro">read-only mode</a></i>, abort these steps. The
|
|
callback is never invoked.</li>
|
|
|
|
<li><p>If <a href="#the-drag-data-item-kind">the drag data item kind</a> is not <i>Plain
|
|
Unicode string</i>, abort these steps. The callback is never
|
|
invoked.</li>
|
|
|
|
<li><p>Otherwise, <a href="#queue-a-task">queue a task</a> to invoke <var title="">callback</var>, passing the actual data of the item
|
|
represented by the <code><a href="#datatransferitem">DataTransferItem</a></code> object as the
|
|
argument.</li>
|
|
|
|
</ol><p>The <dfn id="dom-datatransferitem-getasfile" title="dom-DataTransferItem-getAsFile"><code>getAsFile()</code></dfn>
|
|
method must run the following steps:</p>
|
|
|
|
<ol><li><p>If the <code><a href="#datatransferitem">DataTransferItem</a></code> object is not in the <i title="concept-dnd-rw"><a href="#concept-dnd-rw">read/write mode</a></i> or the <i title="concept-dnd-ro"><a href="#concept-dnd-ro">read-only mode</a></i>, return null and abort
|
|
these steps.</li>
|
|
|
|
<li><p>If <a href="#the-drag-data-item-kind">the drag data item kind</a> is not <i><a href="#file">File</a></i>,
|
|
then return null and abort these steps.</li>
|
|
|
|
<li><p>Return a new <code><a href="#file">File</a></code> object representing the
|
|
actual data of the item represented by the
|
|
<code><a href="#datatransferitem">DataTransferItem</a></code> object.</p>
|
|
|
|
</ol></div><h4 id="the-dragevent-interface"><span class="secno">7.7.4 </span>The <code><a href="#dragevent">DragEvent</a></code> interface</h4><p>The drag-and-drop processing model involves several events. They
|
|
all use the <code><a href="#dragevent">DragEvent</a></code> interface.<pre class="idl">interface <dfn id="dragevent">DragEvent</dfn> : <a href="#mouseevent">MouseEvent</a> {
|
|
readonly attribute <a href="#datatransfer">DataTransfer</a> <a href="#dom-dragevent-datatransfer" title="dom-DragEvent-dataTransfer">dataTransfer</a>;
|
|
|
|
void <a href="#dom-dragevent-initdragevent" title="dom-DragEvent-initDragEvent">initDragEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in any dummyArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean shiftKeyArg, in boolean metaKeyArg, in unsigned short buttonArg, in EventTarget relatedTargetArg, in <a href="#datatransfer">DataTransfer</a> dataTransferArg);
|
|
};</pre><dl class="domintro"><dt><var title="">event</var> . <code title="dom-DragEvent-dataTransfer"><a href="#dom-dragevent-datatransfer">dataTransfer</a></code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the <code><a href="#datatransfer">DataTransfer</a></code> object for the event.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-dragevent-initdragevent" title="dom-DragEvent-initDragEvent"><code>initDragEvent()</code></dfn>
|
|
method must initialize the event in a manner analogous to the
|
|
similarly-named method in the DOM Events interfaces, except that the
|
|
<var title="">dummyArg</var> argument must be ignored. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
<p>The <dfn id="dom-dragevent-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.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<p>When a user agent is required to <dfn id="fire-a-dnd-event">fire a DND event</dfn>
|
|
named <var title="">e</var> at an element, using a particular
|
|
<a href="#drag-data-store">drag data store</a>, the user agent must run the following
|
|
steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If <var title="">e</var> is <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code>, set the <a href="#drag-data-store-mode">drag data
|
|
store mode</a> to the <a href="#concept-dnd-rw" title="concept-dnd-rw">read/write
|
|
mode</a>.</p>
|
|
|
|
<p>If <var title="">e</var> is <code title="event-drop"><a href="#event-drop">drop</a></code>, set the <a href="#drag-data-store-mode">drag data store
|
|
mode</a> to the <a href="#concept-dnd-ro" title="concept-dnd-ro">read-only
|
|
mode</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">dataTransfer</var> be a newly created
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object associated with the given
|
|
<a href="#drag-data-store">drag data store</a>.</li>
|
|
|
|
<li><p id="effectAllowed-initialization">Set the <code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code>
|
|
attribute to the <a href="#drag-data-store">drag data store</a>'s <a href="#drag-data-store-allowed-effects-state">drag data
|
|
store allowed effects state</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p id="dropEffect-initialization">Set the <code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code> attribute to
|
|
"<code title="">none</code>" if <var title="">e</var> is <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code>, <code title="event-drag"><a href="#event-drag">drag</a></code>, or <code title="event-dragleave"><a href="#event-dragleave">dragleave</a></code>; to the value
|
|
corresponding to the <a href="#current-drag-operation">current drag operation</a> if <var title="">e</var> is <code title="event-drop"><a href="#event-drop">drop</a></code> or <code title="event-dragend"><a href="#event-dragend">dragend</a></code>; and to a value based on the
|
|
<code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code>
|
|
attribute's value and to the drag-and-drop source, as given by the
|
|
following table, otherwise (i.e. if <var title="">e</var> is <code title="event-dragenter"><a href="#event-dragenter">dragenter</a></code> or <code title="event-dragover"><a href="#event-dragover">dragover</a></code>):</p>
|
|
|
|
<table><thead><tr><th><code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code></th>
|
|
<th><code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code></th>
|
|
</thead><tr><td>"<code title="">none</code>"</td>
|
|
<td>"<code title="">none</code>"</td>
|
|
<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><td>"<code title="">link</code>", "<code title="">linkMove</code>"</td>
|
|
<td>"<code title="">link</code>"</td>
|
|
<tr><td>"<code title="">move</code>"</td>
|
|
<td>"<code title="">move</code>"</td>
|
|
<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><td>"<code title="">uninitialized</code>" when what is being dragged is a selection</td>
|
|
<td>"<code title="">copy</code>"</td>
|
|
<tr><td>"<code title="">uninitialized</code>" when what is being dragged is an <code><a href="#the-a-element">a</a></code> element with an <code>href</code> attribute</td>
|
|
<td>"<code title="">link</code>"</td>
|
|
<tr><td>Any other case</td>
|
|
<td>"<code title="">copy</code>"</td>
|
|
</table></li>
|
|
|
|
<li>
|
|
|
|
<p>Create a <code><a href="#dragevent">DragEvent</a></code> object and initialize it to
|
|
have the given name <var title="">e</var>, to bubble, to be
|
|
cancelable unless <var title="">e</var> is <code title="event-dragleave"><a href="#event-dragleave">dragleave</a></code> or <code title="event-dragend"><a href="#event-dragend">dragend</a></code>, and to have the <code title="dom-UIEvent-detail">detail</code> attribute set to zero,
|
|
the mouse and key attributes set according to the state of the
|
|
input devices as they would be for user interaction events, the
|
|
<code title="">relatedTarget</code> attribute set to null, and the
|
|
<code title="dom-DragEvent-dataTransfer"><a href="#dom-dragevent-datatransfer">dataTransfer</a></code>
|
|
attribute set to <var title="">dataTransfer</var>, the
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object created above.</p>
|
|
|
|
|
|
|
|
<p>If there is no relevant pointing device, the 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.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Dispatch the newly created <code><a href="#dragevent">DragEvent</a></code> object at
|
|
the specified target element.</li>
|
|
|
|
<li><p>Set the <a href="#drag-data-store-allowed-effects-state">drag data store allowed effects state</a>
|
|
to the current value of <var title="">dataTransfer</var>'s <code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code>
|
|
attribute.</li>
|
|
|
|
<li><p>Set the <a href="#drag-data-store-mode">drag data store mode</a> back to the <a href="#concept-dnd-p" title="concept-dnd-p">protected mode</a> if it was changed in
|
|
the first step.</li>
|
|
|
|
<li><p>Break the association between <var title="">dataTransfer</var> and the <a href="#drag-data-store">drag data
|
|
store</a>.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h4 id="drag-and-drop-processing-model"><span class="secno">7.7.5 </span>Drag-and-drop processing model</h4>
|
|
|
|
<p>When the user attempts to begin a drag operation, the user agent
|
|
must run the following steps. User agents must act as if these steps
|
|
were run even if the drag actually started in another document or
|
|
application and the user agent was not aware that the drag was
|
|
occuring until it intersected with a document under the user agent's
|
|
purview.</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Determine what is being dragged, as follows:</p>
|
|
|
|
<p>If the drag operation was invoked on a selection, then it is
|
|
the selection that is being dragged.</p>
|
|
|
|
<p>Otherwise, if the drag operation was invoked on a
|
|
<code><a href="#document">Document</a></code>, it is the first element, going up the
|
|
ancestor chain, starting at the node that the user tried to drag,
|
|
that has the IDL attribute <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code> set to true. If there is no
|
|
such element, then nothing is being dragged; abort these steps,
|
|
the drag-and-drop operation is never started.</p>
|
|
|
|
<p>Otherwise, the drag operation was invoked outside the user
|
|
agent's purview. What is being dragged is defined by the document
|
|
or application where the drag was started.</p>
|
|
|
|
<p class="note"><code><a href="#the-img-element">img</a></code> elements and <code><a href="#the-a-element">a</a></code>
|
|
elements with an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>
|
|
attribute have their <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code>
|
|
attribute set to true by default.</p>
|
|
|
|
</li>
|
|
|
|
<li><p><a href="#create-a-drag-data-store">Create a drag data store</a>. All the DND events
|
|
fired subsequently by the steps in this section must use this
|
|
<a href="#drag-data-store">drag data store</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Establish which DOM node is the <dfn id="source-node">source node</dfn>, as
|
|
follows:</p>
|
|
|
|
<p>If it is a selection that is being dragged, then the
|
|
<a href="#source-node">source node</a> is the text 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 <a href="#source-node">source node</a> is the first
|
|
text node containing a part of the selection.</p>
|
|
|
|
<p>Otherwise, if it is an element that is being dragged, then the
|
|
<a href="#source-node">source node</a> is the element that is being dragged.</p>
|
|
|
|
<p>Otherwise, the <a href="#source-node">source node</a> is part of another
|
|
document or application. When this specification requires that an
|
|
event be dispatched at the <a href="#source-node">source node</a> in this case,
|
|
the user agent must instead follow the platform-specific
|
|
conventions relevant to that situation.</p>
|
|
|
|
<p class="note">Multiple events are fired on the <a href="#source-node">source
|
|
node</a> during the course of the drag-and-drop operation.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Determine the <dfn id="list-of-dragged-nodes">list of dragged nodes</dfn>, as follows:</p>
|
|
|
|
<p>If it is a selection that is being dragged, then the <a href="#list-of-dragged-nodes">list
|
|
of dragged nodes</a> contains, in <a href="#tree-order">tree order</a>,
|
|
every node that is partially or completely included in the
|
|
selection (including all their ancestors).</p>
|
|
|
|
<p>Otherwise, the <a href="#list-of-dragged-nodes">list of dragged nodes</a> contains only
|
|
the <a href="#source-node">source node</a>, if any.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If it is a selection that is being dragged, then add an item to
|
|
the <a href="#drag-data-store-item-list">drag data store item list</a>, with its properties
|
|
set as follows:</p>
|
|
|
|
<dl><dt><a href="#the-drag-data-item-type-string">The drag data item type string</a>
|
|
<dd>"<code>text/plain</code>"</dd>
|
|
|
|
<dt><a href="#the-drag-data-item-kind">The drag data item kind</a>
|
|
<dd><i>Plain Unicode string</i></dd>
|
|
|
|
<dt>The actual data</dt>
|
|
<dd>The text of the selection</dd>
|
|
|
|
</dl><p>Otherwise, if any files are being dragged, then add one item
|
|
per file to the <a href="#drag-data-store-item-list">drag data store item list</a>, with their
|
|
properties set as follows:</p>
|
|
|
|
<dl><dt><a href="#the-drag-data-item-type-string">The drag data item type string</a>
|
|
<dd>The MIME type of the file, if known, or "<code>application/octet-stream</code>" otherwise.</dd>
|
|
|
|
<dt><a href="#the-drag-data-item-kind">The drag data item kind</a>
|
|
<dd><i><a href="#file">File</a></i></dd>
|
|
|
|
<dt>The actual data</dt>
|
|
<dd>The file's contents and name.</dd>
|
|
|
|
</dl><p class="note">Dragging files can currently only happen from
|
|
outside a <a href="#browsing-context">browsing context</a>, for example from a file
|
|
system manager application.</p>
|
|
|
|
<p>If the drag initiated outside of the application, the user
|
|
agent must add items to the <a href="#drag-data-store-item-list">drag data store item list</a>
|
|
as appropriate for the data being dragged, honoring platform
|
|
conventions where appropriate; however, if the platform
|
|
conventions do not use <a href="#mime-type" title="MIME type">MIME types</a>
|
|
to label dragged data, the user agent must make a best-effort
|
|
attempt to map the types to MIME types, and, in any case, all the
|
|
<a href="#the-drag-data-item-type-string" title="the drag data item type string">drag data item type
|
|
strings</a> must be <a href="#converted-to-ascii-lowercase">converted to ASCII
|
|
lowercase</a>.</p>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li>Perform <dfn id="drag-and-drop-initialization-steps">drag-and-drop initialization steps</dfn> defined
|
|
in any <a href="#other-applicable-specifications">other applicable specifications</a>.</li>
|
|
|
|
|
|
<li>
|
|
|
|
<p>Run the following substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">urls</var> be an empty list of <a href="#absolute-url" title="absolute URL">absolute URLs</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each <var title="">node</var> in the <a href="#list-of-dragged-nodes">list of
|
|
dragged nodes</a>:</p>
|
|
|
|
<dl><dt>If the node is an <code><a href="#the-a-element">a</a></code> element with an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute</dt>
|
|
|
|
<dd>Add to <var title="">urls</var> the result of <a href="#resolve-a-url" title="resolve a url">resolving</a> the element's <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> content attribute
|
|
relative to the element.</dd>
|
|
|
|
<dt>If the node is an <code><a href="#the-img-element">img</a></code> element with an <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute</dt>
|
|
|
|
<dd>Add to <var title="">urls</var> the result of <a href="#resolve-a-url" title="resolve a url">resolving</a> the element's <code title="attr-img-src"><a href="#attr-img-src">src</a></code> content attribute relative to
|
|
the element.</dd>
|
|
|
|
|
|
|
|
</dl></li>
|
|
|
|
<li><p>If <var title="">urls</var> is still empty, abort these
|
|
substeps.</li>
|
|
|
|
<li><p>Let <var title="">url string</var> be the result of
|
|
concatenating the strings in <var title="">urls</var>, in the
|
|
order they were added, separated by a U+000D CARRIAGE RETURN
|
|
U+000A LINE FEED character pair (CRLF).</li>
|
|
|
|
<li><p>Add one item to the <a href="#drag-data-store-item-list">drag data store item
|
|
list</a>, with its properties set as follows:</p>
|
|
|
|
<dl><dt><a href="#the-drag-data-item-type-string">The drag data item type string</a>
|
|
<dd><code>text/uri-list</code></dd>
|
|
|
|
<dt><a href="#the-drag-data-item-kind">The drag data item kind</a>
|
|
<dd><i>Plain Unicode string</i></dd>
|
|
|
|
<dt>The actual data</dt>
|
|
<dd><var title="">url string</var></dd>
|
|
|
|
</dl></li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>If it is an element that is being dragged, then set the
|
|
<a href="#drag-data-store-elements-list">drag data store elements list</a> to contain just the
|
|
<a href="#source-node">source node</a>.</p>
|
|
|
|
<p>Otherwise, update the <a href="#drag-data-store-default-feedback">drag data store default
|
|
feedback</a> as appropriate for the user agent (if the user is
|
|
dragging the selection, then the selection would likely be the
|
|
basis for this feedback; if the drag began outside the user agent,
|
|
then the platform conventions for determining the drag feedback
|
|
should be used).</p>
|
|
|
|
<p class="note">Script can use the <code title="dom-DataTransfer-addElement"><a href="#dom-datatransfer-addelement">addElement()</a></code> method to
|
|
add further elements to the list of what is being dragged. (This
|
|
list is only used for rendering the drag feedback.)</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#fire-a-dnd-event">Fire a DND event</a> named <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code> at the <a href="#source-node">source
|
|
node</a>.</p>
|
|
|
|
<p>If the event is canceled, then the drag-and-drop operation
|
|
should not occur; abort these steps.</p>
|
|
<p class="note">Since events with no event listeners 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>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#initiate-the-drag-and-drop-operation">Initiate the drag-and-drop operation</a> in a manner
|
|
consistent with platform conventions, and as described below.</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 <a href="#drag-data-store-bitmap">drag data store bitmap</a>, if any. In this
|
|
case, the <a href="#drag-data-store-hot-spot-coordinate">drag data store hot spot coordinate</a> 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="#refsCSS">[CSS]</a></li>
|
|
|
|
<li>The elements in the <a href="#drag-data-store-elements-list">drag data store elements
|
|
list</a>, if any.</li>
|
|
|
|
<li>The <a href="#drag-data-store-default-feedback">drag data store default feedback</a>.</li>
|
|
|
|
</ol></li>
|
|
|
|
</ol><p>From the moment that the user agent is to <dfn id="initiate-the-drag-and-drop-operation">initiate the
|
|
drag-and-drop operation</dfn>, 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
|
|
<span>undo transaction history</span> 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-user-selection">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-user-selection">immediate user selection</a> is not necessarily the
|
|
<dfn id="current-target-element">current target element</dfn>, which is the element currently
|
|
selected for the drop part of the drag-and-drop operation.</p>
|
|
|
|
<p>The <a href="#immediate-user-selection">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="#current-target-element">current target element</a> changes when the <a href="#immediate-user-selection">immediate
|
|
user selection</a> changes, based on the results of event
|
|
listeners in the document, as described below.</p>
|
|
|
|
<p>Both the <a href="#current-target-element">current target element</a> and the
|
|
<a href="#immediate-user-selection">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="#current-target-element">current target element</a> is initially null.</p>
|
|
|
|
<p>In addition, there is also a <dfn id="current-drag-operation">current drag operation</dfn>,
|
|
which can take on the values "<code title="">none</code>", "<code title="">copy</code>", "<code title="">link</code>", and "<code title="">move</code>". Initially, it has the value "<code title="">none</code>". It is updated by the user agent as described
|
|
in the steps below.</p>
|
|
|
|
<p>User agents must, as soon as the drag operation is <a href="#initiate-the-drag-and-drop-operation" title="initiate the drag-and-drop operation">initiated</a> and
|
|
every 350ms (±200ms) thereafter for as long as the drag
|
|
operation is ongoing, <a href="#queue-a-task">queue a task</a> to perform the
|
|
following steps in sequence:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the user agent is still performing the previous iteration of
|
|
the sequence (if any) when the next iteration becomes due, abort
|
|
these steps for this iteration (effectively "skipping missed
|
|
frames" of the drag-and-drop operation).</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#fire-a-dnd-event">Fire a DND event</a> named <code title="event-drag"><a href="#event-drag">drag</a></code> event at the <a href="#source-node">source
|
|
node</a>. If this event is canceled, the user agent must set
|
|
the <a href="#current-drag-operation">current drag operation</a> to "<code title="">none</code>" (no drag operation).</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <code title="event-drag"><a href="#event-drag">drag</a></code> event was not
|
|
canceled and the user has not ended the drag-and-drop operation,
|
|
check the state of the drag-and-drop operation, as follows:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the user is indicating a different <a href="#immediate-user-selection">immediate user
|
|
selection</a> than during the last iteration (or if this is
|
|
the first iteration), and if this <a href="#immediate-user-selection">immediate user
|
|
selection</a> is not the same as the <a href="#current-target-element">current target
|
|
element</a>, then update the <a href="#current-target-element">current target
|
|
element</a> as follows:</p>
|
|
|
|
<dl class="switch"><dt>If the new <a href="#immediate-user-selection">immediate user selection</a> is null</dt>
|
|
|
|
<dd><p>Set the <a href="#current-target-element">current target element</a> to null
|
|
also.</dd>
|
|
|
|
<dt>If the new <a href="#immediate-user-selection">immediate user selection</a> is in a
|
|
non-DOM document or application</dt>
|
|
|
|
<dd><p>Set the <a href="#current-target-element">current target element</a> to the
|
|
<a href="#immediate-user-selection">immediate user selection</a>.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p><a href="#fire-a-dnd-event">Fire a DND event</a> named <code title="event-dragenter"><a href="#event-dragenter">dragenter</a></code> at the
|
|
<a href="#immediate-user-selection">immediate user selection</a>.</p>
|
|
|
|
<p>If the event is canceled, then set the <a href="#current-target-element">current target
|
|
element</a> to the <a href="#immediate-user-selection">immediate user
|
|
selection</a>.</p>
|
|
|
|
<p>Otherwise, run the appropriate step from the following
|
|
list:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#current-target-element">current target element</a> is a text
|
|
field (e.g. <code><a href="#the-textarea-element">textarea</a></code>, or an <code><a href="#the-input-element">input</a></code>
|
|
element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute is in the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state) or an
|
|
<a href="#editable">editable</a> element, and the <a href="#drag-data-store-item-list">drag data store
|
|
item list</a> has an item with <a href="#the-drag-data-item-type-string">the drag data item
|
|
type string</a> "<code>text/plain</code>" and <a href="#the-drag-data-item-kind">the
|
|
drag data item kind</a> <i>Plain Unicode string</i></dt>
|
|
|
|
<dd><p>Set the <a href="#current-target-element">current target element</a> to the
|
|
<a href="#immediate-user-selection">immediate user selection</a> anyway.</dd>
|
|
|
|
|
|
<dt>If the <a href="#current-target-element">current target element</a> is an element
|
|
with a <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute
|
|
that <a href="#concept-dropzone-match" title="concept-dropzone-match">matches</a> the
|
|
<a href="#drag-data-store">drag data store</a></dt>
|
|
|
|
<dd><p>Set the <a href="#current-target-element">current target element</a> to the
|
|
<a href="#immediate-user-selection">immediate user selection</a> anyway.</dd>
|
|
|
|
|
|
<dt>If the <a href="#current-target-element">current target element</a> is
|
|
<a href="#the-body-element-0">the body element</a></dt>
|
|
|
|
<dd><p>Leave the <a href="#current-target-element">current target element</a>
|
|
unchanged.</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>
|
|
|
|
<p><a href="#fire-a-dnd-event">Fire a DND event</a> named <code title="event-dragenter"><a href="#event-dragenter">dragenter</a></code> at <a href="#the-body-element-0">the body
|
|
element</a>, and set the <a href="#current-target-element">current target
|
|
element</a> to <a href="#the-body-element-0">the body element</a>, regardless
|
|
of whether that event was canceled or not.</p>
|
|
|
|
<p class="note">If <a href="#the-body-element-0">the body element</a> is null,
|
|
then the event will be fired at the <code><a href="#document">Document</a></code>
|
|
object (as required by the definition of <a href="#the-body-element-0">the body
|
|
element</a>), but the <a href="#current-target-element">current target element</a>
|
|
would be set to null, not the <code><a href="#document">Document</a></code>
|
|
object.</dd>
|
|
|
|
</dl></dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>If the previous step caused the <a href="#current-target-element">current target
|
|
element</a> to change, and if the previous target element was
|
|
not null or a part of a non-DOM document, then <a href="#fire-a-dnd-event">fire a DND
|
|
event</a> named <code title="event-dragleave"><a href="#event-dragleave">dragleave</a></code> at the previous target
|
|
element.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#current-target-element">current target element</a> is a DOM element,
|
|
then <a href="#fire-a-dnd-event">fire a DND event</a> named <code title="event-dragover"><a href="#event-dragover">dragover</a></code> at this <a href="#current-target-element">current
|
|
target element</a>.</p>
|
|
|
|
<p>If the <code title="event-dragover"><a href="#event-dragover">dragover</a></code> event is
|
|
not canceled, run the appropriate step from the following
|
|
list:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#current-target-element">current target element</a> is a text field
|
|
(e.g. <code><a href="#the-textarea-element">textarea</a></code>, or an <code><a href="#the-input-element">input</a></code> element
|
|
whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in
|
|
the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state) or an
|
|
<a href="#editable">editable</a> element, and the <a href="#drag-data-store-item-list">drag data store
|
|
item list</a> has an item with <a href="#the-drag-data-item-type-string">the drag data item type
|
|
string</a> "<code>text/plain</code>" and <a href="#the-drag-data-item-kind">the drag data
|
|
item kind</a> <i>Plain Unicode string</i></dt>
|
|
|
|
<dd><p>Set the <a href="#current-drag-operation">current drag operation</a> to either
|
|
"<code title="">copy</code>" or "<code title="">move</code>",
|
|
as appropriate given the platform conventions.</dd>
|
|
|
|
|
|
<dt>If the <a href="#current-target-element">current target element</a> is an element
|
|
with a <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute
|
|
that <a href="#concept-dropzone-match" title="concept-dropzone-match">matches</a> the
|
|
<a href="#drag-data-store">drag data store</a> and <a href="#concept-dropzone-operation" title="concept-dropzone-operation">specifies an
|
|
operation</a></dt>
|
|
|
|
<dd><p>Set the <a href="#current-drag-operation">current drag operation</a> to the
|
|
operation <a href="#concept-dropzone-operation" title="concept-dropzone-operation">specified</a> by the
|
|
<code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute of the
|
|
<a href="#current-target-element">current target element</a>.</p>
|
|
|
|
|
|
<dt>If the <a href="#current-target-element">current target element</a> is an element
|
|
with a <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute
|
|
that <a href="#concept-dropzone-match" title="concept-dropzone-match">matches</a> the
|
|
<a href="#drag-data-store">drag data store</a> and does not <a href="#concept-dropzone-operation" title="concept-dropzone-operation">specify an
|
|
operation</a></dt>
|
|
|
|
<dd><p>Set the <a href="#current-drag-operation">current drag operation</a> to "<code title="">copy</code>".</p>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd><p>Reset the <a href="#current-drag-operation">current drag operation</a> to "<code title="">none</code>".</dd>
|
|
|
|
</dl><p>Otherwise (if the <code title="event-dragover"><a href="#event-dragover">dragover</a></code> event <em>is</em>
|
|
canceled), set the <a href="#current-drag-operation">current drag operation</a> based on
|
|
the values of the <code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code> and
|
|
<code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code>
|
|
attributes of the <code><a href="#dragevent">DragEvent</a></code> object's <code title="dom-DragEvent-dataTransfer"><a href="#dom-dragevent-datatransfer">dataTransfer</a></code> object as
|
|
they stood after the event dispatch finished, as per the
|
|
following table:</p>
|
|
|
|
<table><thead><tr><th><code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code></th>
|
|
<th><code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code></th>
|
|
<th>Drag operation</th>
|
|
</thead><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>"<code title="">copy</code>"</td>
|
|
<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>"<code title="">link</code>"</td>
|
|
<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>"<code title="">move</code>"</td>
|
|
<tr><td colspan="2">Any other case</td>
|
|
<td>"<code title="">none</code>"</td>
|
|
</table></li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, if the <a href="#current-target-element">current target element</a> is not
|
|
a DOM element, use platform-specific mechanisms to determine
|
|
what drag operation is being performed (none, copy, link, or
|
|
move), and set the <i><a href="#current-drag-operation">current drag operation</a></i>
|
|
accordingly.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Update the drag feedback (e.g. the mouse cursor) to match the
|
|
<a href="#current-drag-operation">current drag operation</a>, as follows:</p>
|
|
|
|
<table><thead><tr><th>Drag operation</th>
|
|
<th>Feedback</th>
|
|
</thead><tr><td>"<code title="">copy</code>"</td>
|
|
<td>Data will be copied if dropped here.</td>
|
|
<tr><td>"<code title="">link</code>"</td>
|
|
<td>Data will be linked if dropped here.</td>
|
|
<tr><td>"<code title="">move</code>"</td>
|
|
<td>Data will be moved if dropped here.</td>
|
|
<tr><td>"<code title="">none</code>"</td>
|
|
<td>No operation allowed, dropping here will cancel the drag-and-drop operation.</td>
|
|
</table></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="#event-drag">drag</a></code> event
|
|
was canceled, then this will be the last iteration. Run the
|
|
following steps, then stop the drag-and-drop operation:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If the <a href="#current-drag-operation">current drag operation</a> is "<code title="">none</code>" (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="#current-target-element">current target
|
|
element</a> is null, then the drag operation failed. Run
|
|
these substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">dropped</var> be false.</li>
|
|
|
|
<li><p>If the <a href="#current-target-element">current target element</a> is a DOM
|
|
element, <a href="#fire-a-dnd-event">fire a DND event</a> named <code title="event-dragleave"><a href="#event-dragleave">dragleave</a></code> at it; otherwise, if
|
|
it is not null, use platform-specific conventions for drag
|
|
cancellation.</p>
|
|
|
|
</ol><p>Otherwise, the drag operation was as success; run these substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">dropped</var> be true.</li>
|
|
|
|
<li><p>If the <a href="#current-target-element">current target element</a> is a DOM
|
|
element, <a href="#fire-a-dnd-event">fire a DND event</a> named <code title="event-drop"><a href="#event-drop">drop</a></code> at it; otherwise, use
|
|
platform-specific conventions for indicating a drop.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the event is canceled, set the <a href="#current-drag-operation">current drag
|
|
operation</a> to the value of the <code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code> attribute
|
|
of the <code><a href="#dragevent">DragEvent</a></code> object's <code title="dom-DragEvent-dataTransfer"><a href="#dom-dragevent-datatransfer">dataTransfer</a></code> object
|
|
as it stood after the event dispatch finished.</p>
|
|
|
|
<p>Otherwise, the event is not canceled; perform the event's
|
|
default action, which depends on the exact target as
|
|
follows:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#current-target-element">current target element</a> is a text
|
|
field (e.g. <code><a href="#the-textarea-element">textarea</a></code>, or an <code><a href="#the-input-element">input</a></code>
|
|
element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute is in the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state) or an
|
|
<a href="#editable">editable</a> element, and the <a href="#drag-data-store-item-list">drag data store
|
|
item list</a> has an item with <a href="#the-drag-data-item-type-string">the drag data item
|
|
type string</a> "<code>text/plain</code>" and <a href="#the-drag-data-item-kind">the
|
|
drag data item kind</a> <i>Plain Unicode string</i></dt>
|
|
|
|
<dd><p>Insert the actual data of the first item in the
|
|
<a href="#drag-data-store-item-list">drag data store item list</a> to have <a href="#the-drag-data-item-type-string" title="the drag data item type string">a drag data item type
|
|
string</a> of "<code>text/plain</code>" and <a href="#the-drag-data-item-kind" title="the drag data item kind">a drag data item kind</a>
|
|
that is <i>Plain Unicode string</i> into the text field or
|
|
<a href="#editable">editable</a> element 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><p>Reset the <a href="#current-drag-operation">current drag operation</a> to
|
|
"<code title="">none</code>".</dd>
|
|
|
|
</dl></li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#fire-a-dnd-event">Fire a DND event</a> named <code title="event-dragend"><a href="#event-dragend">dragend</a></code> at the <a href="#source-node">source
|
|
node</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Run the appropriate steps from the following list as the
|
|
default action of the <code title="event-dragend"><a href="#event-dragend">dragend</a></code>
|
|
event:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#current-target-element">current target element</a> is a text field
|
|
(e.g. <code><a href="#the-textarea-element">textarea</a></code>, or an <code><a href="#the-input-element">input</a></code> element
|
|
whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in
|
|
the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state), and
|
|
<var title="">dropped</var> is true, and the <a href="#current-drag-operation">current drag
|
|
operation</a> is "<code title="">move</code>", 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="#current-target-element">current target element</a> is a text field
|
|
(e.g. <code><a href="#the-textarea-element">textarea</a></code>, or an <code><a href="#the-input-element">input</a></code> element
|
|
whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in
|
|
the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a> state), and
|
|
<var title="">dropped</var> is true, and the <a href="#current-drag-operation">current drag
|
|
operation</a> is "<code title="">move</code>", 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><p class="note">User agents are encouraged to consider how to react
|
|
to drags near the edge of scrollable regions. For example, if a user
|
|
drags a link to the bottom of the viewport on a long page, it might
|
|
make sense to scroll the page so that the user can drop the link
|
|
lower on the page.</p>
|
|
|
|
<p class="note">This model is independent of which
|
|
<code><a href="#document">Document</a></code> object the nodes involved are from; the events
|
|
are fired as described above and the rest of the processing model
|
|
runs as described above, irrespective of how many documents are
|
|
involved in the operation.</p>
|
|
|
|
</div><h4 id="dndevents"><span class="secno">7.7.6 </span>Events summary</h4><p><i>This section is non-normative.</i><p>The following events are involved in the drag-and-drop
|
|
model.<table><thead><tr><th> Event Name </th>
|
|
<th> Target </th>
|
|
|
|
<th> Cancelable? </th>
|
|
<th> <a href="#drag-data-store-mode">Drag data store mode</a> </th>
|
|
|
|
<th> <code title="dom-DataTransfer-dropEffect"><a href="#dom-datatransfer-dropeffect">dropEffect</a></code> </th>
|
|
<th> Default Action </th>
|
|
<tbody><tr><td><dfn id="event-dragstart" title="event-dragstart"><code>dragstart</code></dfn></td>
|
|
<td><a href="#source-node">Source node</a></td>
|
|
|
|
<td>✓ Cancelable</td>
|
|
<td><a href="#concept-dnd-rw" title="concept-dnd-rw">Read/write mode</a>
|
|
|
|
<td>"<code title="">none</code>"</td>
|
|
<td>Initiate the drag-and-drop operation</td>
|
|
<tr><td><dfn id="event-drag" title="event-drag"><code>drag</code></dfn></td>
|
|
<td><a href="#source-node">Source node</a></td>
|
|
|
|
<td>✓ Cancelable</td>
|
|
<td><a href="#concept-dnd-p" title="concept-dnd-p">Protected mode</a>
|
|
|
|
<td>"<code title="">none</code>"</td>
|
|
<td>Continue the drag-and-drop operation</td>
|
|
<tr><td><dfn id="event-dragenter" title="event-dragenter"><code>dragenter</code></dfn></td>
|
|
<td><a href="#immediate-user-selection">Immediate user selection</a> or <a href="#the-body-element-0">the body element</a></td>
|
|
|
|
<td>✓ Cancelable</td>
|
|
<td><a href="#concept-dnd-p" title="concept-dnd-p">Protected mode</a>
|
|
|
|
<td><a href="#dropEffect-initialization">Based on <code>effectAllowed</code> value</a></td>
|
|
<td>Reject <a href="#immediate-user-selection">immediate user selection</a> as potential <a href="#current-target-element" title="current target element">target element</a></td>
|
|
<tr><td><dfn id="event-dragleave" title="event-dragleave"><code>dragleave</code></dfn></td>
|
|
<td><a href="#current-target-element" title="current target element">Previous target element</a></td>
|
|
|
|
<td>—</td>
|
|
<td><a href="#concept-dnd-p" title="concept-dnd-p">Protected mode</a>
|
|
|
|
<td>"<code title="">none</code>"</td>
|
|
<td>None</td>
|
|
<tr><td><dfn id="event-dragover" title="event-dragover"><code>dragover</code></dfn></td>
|
|
<td><a href="#current-target-element">Current target element</a></td>
|
|
|
|
<td>✓ Cancelable</td>
|
|
<td><a href="#concept-dnd-p" title="concept-dnd-p">Protected mode</a>
|
|
|
|
<td><a href="#dropEffect-initialization">Based on <code>effectAllowed</code> value</a></td>
|
|
<td>Reset the <a href="#current-drag-operation">current drag operation</a> to "none"</td>
|
|
<tr><td><dfn id="event-drop" title="event-drop"><code>drop</code></dfn></td>
|
|
<td><a href="#current-target-element">Current target element</a></td>
|
|
|
|
<td>✓ Cancelable</td>
|
|
<td><a href="#concept-dnd-ro" title="concept-dnd-ro">Read-only mode</a>
|
|
|
|
<td><a href="#current-drag-operation">Current drag operation</a></td>
|
|
<td>Varies</td>
|
|
<tr><td><dfn id="event-dragend" title="event-dragend"><code>dragend</code></dfn></td>
|
|
<td><a href="#source-node">Source node</a></td>
|
|
|
|
<td>—</td>
|
|
<td><a href="#concept-dnd-p" title="concept-dnd-p">Protected mode</a>
|
|
|
|
<td><a href="#current-drag-operation">Current drag operation</a></td>
|
|
<td>Varies</td>
|
|
</table><p>Not shown in the above table: all these events bubble, and the
|
|
<code title="dom-DataTransfer-effectAllowed"><a href="#dom-datatransfer-effectallowed">effectAllowed</a></code>
|
|
attribute always has the value it had after the previous event was
|
|
fired, defaulting to "<code title="">uninitialized</code>" in the
|
|
<code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code> event.<h4 id="the-draggable-attribute"><span class="secno">7.7.7 </span>The <dfn title="attr-draggable"><code>draggable</code></dfn> attribute</h4><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code> content attribute set. The
|
|
<code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code> attribute is an
|
|
<a href="#enumerated-attribute">enumerated attribute</a>. It has three states. The first
|
|
state is <i>true</i> and it has the keyword <code title="">true</code>. The second state is <i>false</i> and it has
|
|
the keyword <code title="">false</code>. The third state is
|
|
<i>auto</i>; it has no keywords but it is the <i>missing value
|
|
default</i>.<p>The <i>true</i> state means the element is draggable; the
|
|
<i>false</i> state means that it is not. The <i>auto</i> state
|
|
uses the default behavior of the user agent.<dl class="domintro"><dt><var title="">element</var> . <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code> [ = <var title="">value</var> ]</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the element is draggable; otherwise, returns
|
|
false.</p>
|
|
|
|
<p>Can be set, to override the default and set the <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code> content attribute.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="dom-draggable" title="dom-draggable"><code>draggable</code></dfn> IDL
|
|
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="#dom-draggable">draggable</a></code> IDL
|
|
attribute is true become draggable as well.</p>
|
|
|
|
<p>If an element's <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code>
|
|
content attribute has the state <i>true</i>, the <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code> IDL attribute must return
|
|
true.</p>
|
|
|
|
<p>Otherwise, if the element's <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code> content attribute has the
|
|
state <i>false</i>, the <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code> IDL attribute must return
|
|
false.</p>
|
|
|
|
<p>Otherwise, the element's <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code> content attribute has the
|
|
state <i>auto</i>. If the element is an <code><a href="#the-img-element">img</a></code> element,
|
|
or, if the element is an <code><a href="#the-a-element">a</a></code> element with an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> content attribute, the <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code> IDL attribute must return
|
|
true.</p>
|
|
|
|
<p>Otherwise, the <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code> DOM
|
|
must return false.</p>
|
|
|
|
<p>If the <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code> IDL attribute
|
|
is set to the value false, the <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code> content attribute must be
|
|
set to the literal value <code title="">false</code>. If the <code title="dom-draggable"><a href="#dom-draggable">draggable</a></code> IDL attribute is set to the
|
|
value true, the <code title="attr-draggable"><a href="#the-draggable-attribute">draggable</a></code>
|
|
content attribute must be set to the literal value <code title="">true</code>.</p>
|
|
|
|
</div><h4 id="the-dropzone-attribute"><span class="secno">7.7.8 </span>The <dfn title="attr-dropzone"><code>dropzone</code></dfn> attribute</h4><p>All <a href="#html-elements">HTML elements</a> may have the <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> content attribute set. When
|
|
specified, its value must be an <a href="#unordered-set-of-unique-space-separated-tokens">unordered set of unique
|
|
space-separated tokens</a> that are <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a>. The allowed values are the following:<dl><dt><dfn id="attr-dropzone-copy" title="attr-dropzone-copy"><code>copy</code></dfn></dt>
|
|
|
|
<dd><p>Indicates that dropping an accepted item on the element will
|
|
result in a copy of the dragged data.</p>
|
|
|
|
|
|
<dt><dfn id="attr-dropzone-move" title="attr-dropzone-move"><code>move</code></dfn></dt>
|
|
|
|
<dd><p>Indicates that dropping an accepted item on the element will
|
|
result in the dragged data being moved to the new location.</p>
|
|
|
|
|
|
<dt><dfn id="attr-dropzone-link" title="attr-dropzone-link"><code>link</code></dfn></dt>
|
|
|
|
<dd><p>Indicates that dropping an accepted item on the element will
|
|
result in a link to the original data.</p>
|
|
|
|
|
|
<dt>Any keyword with three characters or more, beginning with the
|
|
two characters U+0073 LATIN SMALL LETTER S and U+003A COLON or
|
|
U+0053 LATIN CAPITAL LETTER S and U+003A COLON (i.e. an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">s:</code>")<dt>
|
|
|
|
</dt><dd><p>Indicates that items with <a href="#the-drag-data-item-kind">the drag data item
|
|
kind</a> <i>Plain Unicode string</i> and <a href="#the-drag-data-item-type-string">the drag data
|
|
item type string</a> set to a value that matches the remainder
|
|
of the keyword are accepted.</dd>
|
|
|
|
|
|
<dt>Any keyword with three characters or more, beginning with the
|
|
two characters U+0066 LATIN SMALL LETTER F and U+003A COLON or
|
|
U+0046 LATIN CAPITAL LETTER F and U+003A COLON (i.e. an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">f:</code>")<dt>
|
|
|
|
</dt><dd><p>Indicates that items with <a href="#the-drag-data-item-kind">the drag data item
|
|
kind</a> <i><a href="#file">File</a></i> and <a href="#the-drag-data-item-type-string">the drag data item type
|
|
string</a> set to a value that matches the remainder of the
|
|
keyword are accepted.</dd>
|
|
|
|
|
|
</dl><p>The <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> content
|
|
attribute's values must not have more than one of the three feedback
|
|
values (<code title="attr-dropzone-copy"><a href="#attr-dropzone-copy">copy</a></code>, <code title="attr-dropzone-move"><a href="#attr-dropzone-move">move</a></code>, and <code title="attr-dropzone-link"><a href="#attr-dropzone-link">link</a></code>) specified. If none are
|
|
specified, the <code title="attr-dropzone-copy"><a href="#attr-dropzone-copy">copy</a></code> value is
|
|
implied.<div class="impl">
|
|
|
|
<p>A <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute <dfn id="concept-dropzone-match" title="concept-dropzone-match">matches a drag data store</dfn> if
|
|
the <a href="#dropzone-processing-steps"><code title="attr-dropzone">dropzone</code> processing
|
|
steps</a> result in a match.</p>
|
|
|
|
<p>A <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute <dfn id="concept-dropzone-operation" title="concept-dropzone-operation">specifies an operation</dfn> if
|
|
the <a href="#dropzone-processing-steps"><code title="attr-dropzone">dropzone</code> processing
|
|
steps</a> result in a specified operation. The specified
|
|
operation is as given by those steps.</p>
|
|
|
|
<p>The <dfn id="dropzone-processing-steps"><code title="attr-dropzone">dropzone</code> processing
|
|
steps</dfn> are as follows. They either result in a match or not,
|
|
and separate from this result either in a specified operation or
|
|
not, as defined below.</p>
|
|
|
|
<ol><li><p>Let <var title="">value</var> be the value of the <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute.</li>
|
|
|
|
<li><p>Let <var title="">keywords</var> be the result of <a href="#split-a-string-on-spaces" title="split a string on spaces">splitting <var title="">value</var> on spaces</a>.</li>
|
|
|
|
<li><p>Let <var title="">matched</var> be false.</li>
|
|
|
|
<li><p>Let <var title="">operation</var> be unspecified.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each value in <var title="">keywords</var>, if any, in the
|
|
order that they were found in <var title="">value</var>, run the
|
|
following steps.</p>
|
|
|
|
<ol><li><p>Let <var title="">keyword</var> be the keyword.</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">keyword</var> is one of "<code title="attr-dropzone-copy"><a href="#attr-dropzone-copy">copy</a></code>", "<code title="attr-dropzone-move"><a href="#attr-dropzone-move">move</a></code>", or "<code title="attr-dropzone-link"><a href="#attr-dropzone-link">link</a></code>", then: run the following
|
|
substeps:</p>
|
|
|
|
<ol><li><p>If <var title="">operation</var> is still unspecified,
|
|
then let <var title="">operation</var> be the string given by
|
|
<var title="">keyword</var>.</li>
|
|
|
|
<li><p>Skip to the step labeled <i>end of keyword</i>
|
|
below.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>If <var title="">keyword</var> is shorter than three
|
|
characters in length, then skip to the step labeled <i>end of
|
|
keyword</i> below.</li>
|
|
|
|
<li><p>If the second character in <var title="">keyword</var> is
|
|
not a U+003A COLON character (:), then skip to the step labeled
|
|
<i>end of keyword</i> below.</li>
|
|
|
|
<li><p>Let <var title="">kind code</var> be the first character
|
|
in <var title="">keyword</var>, <a href="#converted-to-ascii-lowercase">converted to ASCII
|
|
lowercase</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Jump to the appropriate step from the list below, based on
|
|
the value of <var title="">kind code</var>:</p>
|
|
|
|
<dl class="switch"><dt>If <var title="">kind code</var> is a U+0073 LATIN SMALL LETTER S character</dt>
|
|
<dd>
|
|
|
|
<p>Let <var title="">kind</var> be
|
|
<i>Plain Unicode string</i>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If <var title="">kind code</var> is a U+0066 LATIN SMALL LETTER F character</dt>
|
|
<dd>
|
|
|
|
<p>Let <var title="">kind</var> be
|
|
<i><a href="#file">File</a></i>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
<dd>
|
|
|
|
<p>Skip to the step labeled <i>end of keyword</i> below.</p>
|
|
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>Let <var title="">type</var> be the string consisting of
|
|
all but the first two characters of <var title="">keyword</var>,
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
|
|
|
|
<li><p>If there exist any items in the <a href="#drag-data-store-item-list">drag data store item
|
|
list</a> whose <a href="#the-drag-data-item-kind" title="the drag data item kind">drag data
|
|
item kind</a> is the
|
|
kind given in <var title="">kind</var> and whose <span title="the drag data item type">drag data item type</span> is
|
|
<var title="">type</var>, then let <var title="">matched</var> be
|
|
true.</li>
|
|
|
|
<li><p><i>End of keyword</i>: Go on to the next keyword, if any,
|
|
or the next step in the overall algorithm, if there are no
|
|
more.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>The algorithm results in a match if <var title="">matched</var>
|
|
is true, and does not otherwise.</p>
|
|
|
|
<p>The algorithm results in a specified operation if <var title="">operation</var> is not unspecified. The specified
|
|
operation, if one is specified, is the one given by <var title="">operation</var>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p>The <dfn id="dom-dropzone" title="dom-dropzone"><code>dropzone</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the content attribute of the
|
|
same name.</p>
|
|
|
|
</div><div class="example">
|
|
|
|
<p>In this example, a <code><a href="#the-div-element">div</a></code> element is made into a drop
|
|
target for image files using the <code title="attr-dropzone"><a href="#the-dropzone-attribute">dropzone</a></code> attribute. Images dropped
|
|
into the target are then displayed.</p>
|
|
|
|
<pre><div dropzone="copy f:image/png f:image/gif f:image/jpeg" ondrop="receive(event, this)">
|
|
<p>Drop an image here to have it displayed.</p>
|
|
</div>
|
|
<script>
|
|
function receive(event, element) {
|
|
var data = event.dataTransfer.items;
|
|
for (var i = 0; i < data.length; i += 1) {
|
|
if ((data[i].kind == 'file') && (data[i].type.match('^image/'))) {
|
|
var img = new Image();
|
|
img.src = window.createObjectURL(data[i].getAsFile());
|
|
element.appendChild(img);
|
|
}
|
|
}
|
|
}
|
|
</script></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="security-risks-in-the-drag-and-drop-model"><span class="secno">7.7.9 </span>Security risks in the drag-and-drop model</h4>
|
|
|
|
<p>User agents must not make the data added to the
|
|
<code><a href="#datatransfer">DataTransfer</a></code> object during the <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code> event available to scripts
|
|
until the <code title="event-drop"><a href="#event-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 consider a drop to be
|
|
successful only 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="#event-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>
|
|
|
|
</div><h3 id="editing-apis"><span class="secno">7.8 </span>Editing APIs</h3><dl class="domintro"><dt><var title="">document</var> . <code title="dom-document-execCommand"><a href="#execCommand">execCommand</a></code>(<var title="">commandId</var> [, <var title="">showUI</var> [, <var title="">value</var> ] ] )</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Runs the action specified by the first argument, as described
|
|
in the list below. The second and third arguments sometimes affect
|
|
the action. (If they don't they are ignored.)</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-queryCommandEnabled"><a href="#dom-document-querycommandenabled">queryCommandEnabled</a></code>(<var title="">commandId</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns whether the given command is enabled, as described in the list below.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-queryCommandIndeterm"><a href="#dom-document-querycommandindeterm">queryCommandIndeterm</a></code>(<var title="">commandId</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns whether the given command is indeterminate, as described in the list below.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-queryCommandState"><a href="#dom-document-querycommandstate">queryCommandState</a></code>(<var title="">commandId</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the state of the command, as described in the list below.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-queryCommandSupported"><a href="#dom-document-querycommandsupported">queryCommandSupported</a></code>(<var title="">commandId</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns true if the command is supported; otherwise, returns false.</p>
|
|
|
|
</dd>
|
|
|
|
<dt><var title="">document</var> . <code title="dom-document-queryCommandValue"><a href="#dom-document-querycommandvalue">queryCommandValue</a></code>(<var title="">commandId</var>)</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Returns the value of the command, as described in the list below.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><div class="impl">
|
|
|
|
<p>The <dfn id="execCommand" title="dom-document-execCommand"><code>execCommand(<var title="">commandId</var>, <var title="">showUI</var>, <var title="">value</var>)</code></dfn> method on the
|
|
<code><a href="#htmldocument">HTMLDocument</a></code> 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.</p>
|
|
|
|
<p>There are three variants to this method, with one, two, and three
|
|
arguments respectively. The <var title="">showUI</var> and <var title="">value</var> parameters, even if specified, are ignored
|
|
except where otherwise stated.</p>
|
|
|
|
<p>When <code title="dom-document-execCommand"><a href="#execCommand">execCommand()</a></code>
|
|
is invoked, the user agent must run the following steps:</p>
|
|
|
|
<ol><li>If the given <var title="">commandId</var> maps to an entry in
|
|
the list below whose "Enabled When" entry has a condition that is
|
|
currently false, do nothing; abort these steps.</li>
|
|
|
|
<li>Otherwise, execute the "Action" listed below for the given <var title="">commandId</var>.</li>
|
|
|
|
</ol></div><p>A document is <dfn id="ready-for-editing-host-commands">ready for editing host commands</dfn> if it
|
|
has a selection that is entirely within an <a href="#editing-host">editing
|
|
host</a>, or if it has no selection but its caret is inside an
|
|
<a href="#editing-host">editing host</a>.<div class="impl">
|
|
|
|
<p>The <dfn id="dom-document-querycommandenabled" title="dom-document-queryCommandEnabled"><code>queryCommandEnabled(<var title="">commandId</var>)</code></dfn> method, when invoked, must
|
|
return true if the condition listed below under "Enabled When" for
|
|
the given <var title="">commandId</var> is true, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <dfn id="dom-document-querycommandindeterm" title="dom-document-queryCommandIndeterm"><code>queryCommandIndeterm(<var title="">commandId</var>)</code></dfn> method, when invoked, must
|
|
return true if the condition listed below under "Indeterminate When"
|
|
for the given <var title="">commandId</var> is true, and false
|
|
otherwise.</p>
|
|
|
|
<p>The <dfn id="dom-document-querycommandstate" title="dom-document-queryCommandState"><code>queryCommandState(<var title="">commandId</var>)</code></dfn> method, when invoked, must
|
|
return the value expressed below under "State" for the given <var title="">commandId</var>.</p>
|
|
|
|
<p>The <dfn id="dom-document-querycommandsupported" title="dom-document-queryCommandSupported"><code>queryCommandSupported(<var title="">commandId</var>)</code></dfn> method, when invoked, must
|
|
return true if the given <var title="">commandId</var> is in the
|
|
list below, and false otherwise.</p>
|
|
|
|
<p>The <dfn id="dom-document-querycommandvalue" title="dom-document-queryCommandValue"><code>queryCommandValue(<var title="">commandId</var>)</code></dfn> method, when invoked, must
|
|
return the value expressed below under "Value" for the given <var title="">commandId</var>.</p>
|
|
|
|
</div><p>The possible values for <var title="">commandId</var>, and their
|
|
corresponding meanings, are as follows. <span class="impl">These
|
|
values must be compared to the argument in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner.</span><dl><dt><dfn id="command-bold" title="command-bold"><code>bold</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Toggles whether the selection is bold.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had requested that the selection <a href="#contenteditable-wrapSemantic">be wrapped in the
|
|
semantics</a> of the <em><code><a href="#the-b-element">b</a></code></em> element (or, again,
|
|
unwrapped, or have that semantic inserted or removed, as defined by
|
|
the UA).</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: True if the selection, or the caret, if
|
|
there is no selection, is, or is contained within, a
|
|
<code><a href="#the-b-element">b</a></code> element. False otherwise.</dd>
|
|
<dd><strong>Value</strong>: The string "<code title="">true</code>"
|
|
if the expression given for the "State" above is true, the string
|
|
"<code title="">false</code>" otherwise.</dd>
|
|
|
|
<dt><dfn id="command-createlink" title="command-createLink"><code>createLink</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Toggles whether the selection is a
|
|
link or not. If the second argument is true, and a link is to be
|
|
added, the user agent will ask the user for the address. Otherwise,
|
|
the third argument will be used as the address.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had requested that the selection <a href="#contenteditable-wrapSemantic">be wrapped in the
|
|
semantics</a> of the <em><code><a href="#the-a-element">a</a></code></em> element (or, again,
|
|
unwrapped, or have that semantic inserted or removed, as defined by
|
|
the UA). If the user agent creates an <code><a href="#the-a-element">a</a></code> element or
|
|
modifies an existing <code><a href="#the-a-element">a</a></code> element, then if the <var title="">showUI</var> argument is present and has the value false,
|
|
then the value of the <var title="">value</var> argument must be
|
|
used as the <a href="#url">URL</a> of the link. Otherwise, the user agent
|
|
should prompt the user for the URL of the link.</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-delete" title="command-delete"><code>delete</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Deletes the selection or the
|
|
character before the cursor.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had performed <a href="#contenteditable-delete">a backspace
|
|
operation</a>.</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-formatblock" title="command-formatBlock"><code>formatBlock</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Wraps the selection in the element
|
|
given by the third argument. If the third argument doesn't
|
|
specify an element that is a <dfn id="formatblock-candidate"><code title="">formatBlock</code>
|
|
candidate</dfn>, does nothing.</dd>
|
|
<dd class="impl">
|
|
<p><strong>Action</strong>: The user agent must run the following
|
|
steps:</p>
|
|
<ol><li><p>If the <var title="">value</var> argument wasn't
|
|
specified, abort these steps without doing anything.</li>
|
|
<li><p>If the <var title="">value</var> 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 <var title="">value</var>.</li>
|
|
<li>
|
|
<p>If <var title="">value</var> is (now) an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the tag name of an element
|
|
defined by this specification that is defined to be a
|
|
<a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>, then,
|
|
for every position in the selection, take the nearest
|
|
<a href="#formatblock-candidate"><code title="">formatBlock</code> candidate</a>
|
|
ancestor element of that position that contains only
|
|
<a href="#phrasing-content">phrasing content</a>, and, if that element is
|
|
<a href="#editable">editable</a>, is not an <a href="#editing-host">editing host</a>, and
|
|
has a parent element whose content model allows that parent to
|
|
contain any <a href="#flow-content">flow content</a>, replace it with an
|
|
element in the HTML namespace whose name is <var title="">value</var>, and move all the children that were in it
|
|
to the new element, and copy all the attributes that were on it
|
|
to the new element.</p>
|
|
<p>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.</p>
|
|
</li>
|
|
</ol></dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-forwarddelete" title="command-forwardDelete"><code>forwardDelete</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Deletes the selection or the
|
|
character after the cursor.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had performed <a href="#contenteditable-delete">a forward delete
|
|
operation</a>.</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-insertimage" title="command-insertImage"><code>insertImage</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Toggles whether the selection is an
|
|
image or not. If the second argument is true, and an image is to be
|
|
added, the user agent will ask the user for the address. Otherwise,
|
|
the third argument will be used as the address.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act
|
|
as if the user had requested that the selection <a href="#contenteditable-wrapSemantic">be wrapped in the
|
|
semantics</a> of the <em><code><a href="#the-img-element">img</a></code></em> element (or, again,
|
|
unwrapped, or have that semantic inserted or removed, as defined by
|
|
the UA). If the user agent creates an <code><a href="#the-img-element">img</a></code> element or
|
|
modifies an existing <code><a href="#the-img-element">img</a></code> element, then if the <var title="">showUI</var> argument is present and has the value false,
|
|
then the value of the <var title="">value</var> argument must be
|
|
used as the <a href="#url">URL</a> of the image. Otherwise, the user
|
|
agent should prompt the user for the URL of the image.</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-inserthtml" title="command-insertHTML"><code>insertHTML</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Replaces the selection with the value
|
|
of the third argument parsed as HTML.</dd>
|
|
<dd class="impl">
|
|
<p><strong>Action</strong>: The user agent must run the following
|
|
steps:</p>
|
|
<ol><li><p>If the document is an <a href="#xml-documents" title="XML documents">XML
|
|
document</a>, then throw an <code><a href="#invalid_access_err">INVALID_ACCESS_ERR</a></code>
|
|
exception and abort these steps.</li>
|
|
<li><p>If the <var title="">value</var> argument wasn't
|
|
specified, abort these steps without doing anything.</li>
|
|
<li><p>If there is a selection, act as if the user had requested
|
|
that <a href="#contenteditable-delete">the selection be
|
|
deleted</a>.</li>
|
|
<li><p>Invoke the <a href="#html-fragment-parsing-algorithm">HTML fragment parsing algorithm</a>
|
|
with an arbitrary orphan <code><a href="#the-body-element">body</a></code> element owned by the
|
|
same <code><a href="#document">Document</a></code> as the <i title="">context</i> element
|
|
and with the <var title="">value</var> argument as <i title="">input</i>.</li>
|
|
<li><p>Insert the nodes returned by the previous step into the
|
|
document at the location of the caret, firing any mutation events
|
|
as appropriate.</li>
|
|
</ol></dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-insertlinebreak" title="command-insertLineBreak"><code>insertLineBreak</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Inserts a line break.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had <a href="#contenteditable-br">requested a line
|
|
separator</a>.</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-insertorderedlist" title="command-insertOrderedList"><code>insertOrderedList</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Toggles whether the selection is an ordered list.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had requested that the selection <a href="#contenteditable-wrapSemantic">be wrapped in the
|
|
semantics</a> of the <code><a href="#the-ol-element">ol</a></code> element (or unwrapped, or, if
|
|
there is no selection, have that semantic inserted or removed
|
|
— the exact behavior is UA-defined).</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-insertunorderedlist" title="command-insertUnorderedList"><code>insertUnorderedList</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Toggles whether the selection is an unordered list.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had requested that the selection <a href="#contenteditable-wrapSemantic">be wrapped in the
|
|
semantics</a> of the <code><a href="#the-ul-element">ul</a></code> element (or unwrapped, or, if
|
|
there is no selection, have that semantic inserted or removed
|
|
— the exact behavior is UA-defined).</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-insertparagraph" title="command-insertParagraph"><code>insertParagraph</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Inserts a paragraph break.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had performed a <a href="#contenteditable-breakBlock">break
|
|
block</a> editing action.</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-inserttext" title="command-insertText"><code>insertText</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Inserts the text given in the third parameter.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had <a href="#contenteditable-insertText">inserted text</a>
|
|
corresponding to the <var title="">value</var> parameter.</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-italic" title="command-italic"><code>italic</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Toggles whether the selection is italic.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had requested that the selection <a href="#contenteditable-wrapSemantic">be wrapped in the
|
|
semantics</a> of the <em><code><a href="#the-i-element">i</a></code></em> element (or, again,
|
|
unwrapped, or have that semantic inserted or removed, as defined by
|
|
the UA).</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: True if the selection, or the caret, if
|
|
there is no selection, is, or is contained within, a
|
|
<code><a href="#the-i-element">i</a></code> element. False otherwise.</dd>
|
|
<dd><strong>Value</strong>: The string "<code title="">true</code>"
|
|
if the expression given for the "State" above is true, the string
|
|
"<code title="">false</code>" otherwise.</dd>
|
|
|
|
<dt><dfn id="command-redo" title="command-redo"><code>redo</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Acts as if the user had requested a redo.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must <span title="do-redo">move forward one step</span> in its <span>undo
|
|
transaction history</span>, restoring the associated state. If the
|
|
<span>undo position</span> is at the end of the <span>undo
|
|
transaction history</span>, the user agent must do nothing.
|
|
</dd>
|
|
<dd><strong>Enabled When</strong>: The <span>undo position</span>
|
|
is not at the end of the <span>undo transaction
|
|
history</span>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-selectall" title="command-selectAll"><code>selectAll</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Selects all the editable content.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must change the
|
|
selection so that all the content in the currently focused
|
|
<a href="#editing-host">editing host</a> is selected. If no <a href="#editing-host">editing
|
|
host</a> is focused, then the content of the entire document
|
|
must be selected.</dd>
|
|
<dd><strong>Enabled When</strong>: Always.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-subscript" title="command-subscript"><code>subscript</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Toggles whether the selection is subscripted.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had requested that the selection <a href="#contenteditable-wrapSemantic">be wrapped in the
|
|
semantics</a> of the <em><code><a href="#the-sub-and-sup-elements">sub</a></code></em> element (or, again,
|
|
unwrapped, or have that semantic inserted or removed, as defined by
|
|
the UA).</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: True if the selection, or the caret, if
|
|
there is no selection, is, or is contained within, a
|
|
<code><a href="#the-sub-and-sup-elements">sub</a></code> element. False otherwise.</dd>
|
|
<dd><strong>Value</strong>: The string "<code title="">true</code>"
|
|
if the expression given for the "State" above is true, the string
|
|
"<code title="">false</code>" otherwise.</dd>
|
|
|
|
<dt><dfn id="command-superscript" title="command-superscript"><code>superscript</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Toggles whether the selection is superscripted.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must act as if the user
|
|
had requested that the selection <a href="#contenteditable-wrapSemantic">be wrapped in the
|
|
semantics</a> of the <code><a href="#the-sub-and-sup-elements">sup</a></code> element (or unwrapped, or, if
|
|
there is no selection, have that semantic inserted or removed
|
|
— the exact behavior is UA-defined).</dd>
|
|
<dd><strong>Enabled When</strong>: The document is <a href="#ready-for-editing-host-commands">ready for
|
|
editing host commands</a>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: True if the selection, or the caret, if
|
|
there is no selection, is, or is contained within, a
|
|
<code><a href="#the-sub-and-sup-elements">sup</a></code> element. False otherwise.</dd>
|
|
<dd><strong>Value</strong>: The string "<code title="">true</code>"
|
|
if the expression given for the "State" above is true, the string
|
|
"<code title="">false</code>" otherwise.</dd>
|
|
|
|
<dt><dfn id="command-undo" title="command-undo"><code>undo</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Acts as if the user had requested an undo.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must <span title="do-undo">move back one step</span> in its <span>undo
|
|
transaction history</span>, restoring the associated state. If the
|
|
<span>undo position</span> is at the start of the <span>undo
|
|
transaction history</span>, the user agent must do nothing.
|
|
</dd>
|
|
<dd><strong>Enabled When</strong>: The <span>undo position</span>
|
|
is not at the start of the <span>undo transaction
|
|
history</span>.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-unlink" title="command-unlink"><code>unlink</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Removes all links from the selection.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must remove all
|
|
<code><a href="#the-a-element">a</a></code> elements that have <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attributes and that are partially
|
|
or completely included in the current selection.</dd>
|
|
<dd><strong>Enabled When</strong>: The document has a selection
|
|
that is entirely within an <a href="#editing-host">editing host</a> and that
|
|
contains (either partially or completely) at least one
|
|
<code><a href="#the-a-element">a</a></code> element that has an <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt><dfn id="command-unselect" title="command-unselect"><code>unselect</code></dfn></dt>
|
|
<dd><strong>Summary</strong>: Unselects everything.</dd>
|
|
<dd class="impl"><strong>Action</strong>: The user agent must change the
|
|
selection so that nothing is selected.</dd>
|
|
<dd><strong>Enabled When</strong>: Always.</dd>
|
|
<dd><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd><strong>State</strong>: Always false.</dd>
|
|
<dd><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
<dt class="impl"><code><var title="">vendorID</var>-<var title="">customCommandID</var></code></dt>
|
|
<dd class="impl"><strong>Action</strong>: User agents may implement
|
|
vendor-specific extensions to this API. Vendor-specific extensions
|
|
to the list of commands should use the syntax <code><var title="">vendorID</var>-<var title="">customCommandID</var></code>
|
|
so as to prevent clashes between extensions from different vendors
|
|
and future additions to this specification.</dd>
|
|
<dd class="impl"><strong>Enabled When</strong>: UA-defined.</dd>
|
|
<dd class="impl"><strong>Indeterminate When</strong>: UA-defined.</dd>
|
|
<dd class="impl"><strong>State</strong>: UA-defined.</dd>
|
|
<dd class="impl"><strong>Value</strong>: UA-defined.</dd>
|
|
|
|
<dt class="impl">Anything else</dt>
|
|
<dd class="impl"><strong>Action</strong>: User agents must do nothing.</dd>
|
|
<dd class="impl"><strong>Enabled When</strong>: Never.</dd>
|
|
<dd class="impl"><strong>Indeterminate When</strong>: Never.</dd>
|
|
<dd class="impl"><strong>State</strong>: Always false.</dd>
|
|
<dd class="impl"><strong>Value</strong>: Always the string "<code title="">false</code>".</dd>
|
|
|
|
</dl><h2 id="syntax"><span class="secno">8 </span><dfn>The HTML syntax</dfn></h2><p class="note">This section only describes the rules for resources
|
|
labeled with an <a href="#html-mime-type">HTML MIME type</a>. Rules for XML resources
|
|
are discussed in the section below entitled "<a href="#the-xhtml-syntax">The XHTML
|
|
syntax</a>".<h3 id="writing"><span class="secno">8.1 </span>Writing HTML documents</h3><div class="impl">
|
|
|
|
<p><i>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").</i></p>
|
|
|
|
</div><p>Documents must consist of the following parts, in the given
|
|
order:<ol><li>Optionally, a single U+FEFF BYTE ORDER MARK (BOM) character.</li>
|
|
|
|
<li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
|
|
<a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
<li>A <a href="#syntax-doctype" title="syntax-doctype">DOCTYPE</a>.
|
|
|
|
<li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
|
|
<a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
<li>The root element, in the form of an <code><a href="#the-html-element">html</a></code> <a href="#syntax-elements" title="syntax-elements">element</a>.</li>
|
|
|
|
<li>Any number of <a href="#syntax-comments" title="syntax-comments">comments</a> and
|
|
<a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
</ol><p>The various types of content mentioned above are described in the
|
|
next few sections.<p>In addition, there are some restrictions on how <a href="#character-encoding-declaration" title="character encoding declaration">character encoding
|
|
declarations</a> are to be serialized, as discussed in the
|
|
section on that topic.<div class="note">
|
|
|
|
<p>Space characters before the root <code><a href="#the-html-element">html</a></code> element, and
|
|
space characters at the start of the <code><a href="#the-html-element">html</a></code> element and
|
|
before the <code><a href="#the-head-element">head</a></code> element, will be dropped when the
|
|
document is parsed; space characters <em>after</em> the root
|
|
<code><a href="#the-html-element">html</a></code> element will be parsed as if they were at the end
|
|
of the <code><a href="#the-body-element">body</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 DOCTYPE,
|
|
after any comments that are before the root element, after the
|
|
<code><a href="#the-html-element">html</a></code> element's start tag (if it is not <a href="#syntax-tag-omission" title="syntax-tag-omission">omitted</a>), and after any comments
|
|
that are inside the <code><a href="#the-html-element">html</a></code> element but before the
|
|
<code><a href="#the-head-element">head</a></code> element.</p>
|
|
|
|
</div><p>Many strings in the HTML syntax (e.g. the names of elements and
|
|
their attributes) are case-insensitive, but only for characters in
|
|
the ranges U+0041 to U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL
|
|
LETTER Z) and U+0061 to U+007A (LATIN SMALL LETTER A to LATIN SMALL
|
|
LETTER Z). For convenience, in this section this is just referred to
|
|
as "case-insensitive".<h4 id="the-doctype"><span class="secno">8.1.1 </span>The DOCTYPE</h4><p>A <dfn id="syntax-doctype" title="syntax-doctype">DOCTYPE</dfn> is a required preamble.<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>A DOCTYPE must consist of the following components, in this
|
|
order:<ol class="brief"><li>A string that is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title=""><!DOCTYPE</code>".</li>
|
|
<li>One or more <a href="#space-character" title="space character">space characters</a>.</li>
|
|
<li>A string that is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">html</code>".</li>
|
|
<li>Optionally, a <a href="#doctype-legacy-string">DOCTYPE legacy string</a> or an <a href="#obsolete-permitted-doctype-string">obsolete permitted DOCTYPE string</a> (defined below).</li>
|
|
<li>Zero or more <a href="#space-character" title="space character">space characters</a>.</li>
|
|
<li>A U+003E GREATER-THAN SIGN character (>).</li>
|
|
</ol><p class="note">In other words, <code><!DOCTYPE html></code>,
|
|
case-insensitively.<hr><p>For the purposes of HTML generators that cannot output HTML
|
|
markup with the short DOCTYPE "<code title=""><!DOCTYPE
|
|
html></code>", a <dfn id="doctype-legacy-string">DOCTYPE legacy string</dfn> may be inserted
|
|
into the DOCTYPE (in the position defined above). This string must
|
|
consist of:<ol class="brief"><li>One or more <a href="#space-character" title="space character">space characters</a>.</li>
|
|
<li>A string that is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">SYSTEM</code>".</li>
|
|
<li>One or more <a href="#space-character" title="space character">space characters</a>.</li>
|
|
<li>A U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (the <i>quote mark</i>).</li>
|
|
<li>The literal string "<code><a href="#about:legacy-compat">about:legacy-compat</a></code>".</li>
|
|
<li>A matching U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (i.e. the same character as in the earlier step labeled <i>quote mark</i>).</li>
|
|
</ol><p class="note">In other words, <code><!DOCTYPE html SYSTEM
|
|
"about:legacy-compat"></code> or <code><!DOCTYPE html SYSTEM
|
|
'about:legacy-compat'></code>, case-insensitively except for the
|
|
part in single or double quotes.<p>The <a href="#doctype-legacy-string">DOCTYPE legacy string</a> should not be used unless
|
|
the document is generated from a system that cannot output the
|
|
shorter string.<hr><p>To help authors transition from HTML4 and XHTML1, an
|
|
<dfn id="obsolete-permitted-doctype-string">obsolete permitted DOCTYPE string</dfn> can be inserted into
|
|
the DOCTYPE (in the position defined above). This string must
|
|
consist of:<ol class="brief"><li>One or more <a href="#space-character" title="space character">space characters</a>.</li>
|
|
<li>A string that is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">PUBLIC</code>".</li>
|
|
<li>One or more <a href="#space-character" title="space character">space characters</a>.</li>
|
|
<li>A U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (the <i>first quote mark</i>).</li>
|
|
<li>The string from one of the cells in the first column of the table below. The row to which this cell belongs is the <i>selected row</i>.</li>
|
|
<li>A matching U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (i.e. the same character as in the earlier step labeled <i>first quote mark</i>).</li>
|
|
<li>If the cell in the second column of the <i>selected row</i> is not blank, one or more <a href="#space-character" title="space character">space characters</a>.</li>
|
|
<li>If the cell in the second column of the <i>selected row</i> is not blank, a U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (the <i>third quote mark</i>).</li>
|
|
<li>If the cell in the second column of the <i>selected row</i> is not blank, the string from the cell in the second column of the <i>selected row</i>.</li>
|
|
<li>If the cell in the second column of the <i>selected row</i> is not blank, a matching U+0022 QUOTATION MARK or U+0027 APOSTROPHE character (i.e. the same character as in the earlier step labeled <i>third quote mark</i>).</li>
|
|
</ol><table><caption>
|
|
Allowed values for public and system identifiers in an <a href="#obsolete-permitted-doctype-string">obsolete permitted DOCTYPE string</a>.
|
|
</caption>
|
|
<thead><tr><th> Public identifier
|
|
<th> System identifier
|
|
<tbody><tr><td> <code title="">-//W3C//DTD HTML 4.0//EN</code>
|
|
<td>
|
|
<tr><td> <code title="">-//W3C//DTD HTML 4.0//EN</code>
|
|
<td> <code title="">http://www.w3.org/TR/REC-html40/strict.dtd</code>
|
|
<tr><td> <code title="">-//W3C//DTD HTML 4.01//EN</code>
|
|
<td>
|
|
<tr><td> <code title="">-//W3C//DTD HTML 4.01//EN</code>
|
|
<td> <code title="">http://www.w3.org/TR/html4/strict.dtd</code>
|
|
<tr><td> <code title="">-//W3C//DTD XHTML 1.0 Strict//EN</code>
|
|
<td> <code title="">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</code>
|
|
<tr><td> <code title="">-//W3C//DTD XHTML 1.1//EN</code>
|
|
<td> <code title="">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</code>
|
|
</table><p>A <a href="#syntax-doctype" title="syntax-doctype">DOCTYPE</a> containing an
|
|
<a href="#obsolete-permitted-doctype-string">obsolete permitted DOCTYPE string</a> is an <dfn id="obsolete-permitted-doctype">obsolete
|
|
permitted DOCTYPE</dfn>. Authors should not use <a href="#obsolete-permitted-doctype" title="obsolete permitted DOCTYPE">obsolete permitted
|
|
DOCTYPEs</a>, as they are unnecessarily long.<h4 id="elements-0"><span class="secno">8.1.2 </span>Elements</h4><p>There are five different kinds of <dfn id="syntax-elements" title="syntax-elements">elements</dfn>: <a href="#void-elements">void elements</a>,
|
|
<a href="#raw-text-elements">raw text elements</a>, <a href="#rcdata-elements">RCDATA elements</a>,
|
|
<a href="#foreign-elements">foreign elements</a>, and <a href="#normal-elements">normal elements</a>.<dl><dt><dfn id="void-elements">Void elements</dfn></dt>
|
|
|
|
<dd><code><a href="#the-area-element">area</a></code>, <code><a href="#the-base-element">base</a></code>, <code><a href="#the-br-element">br</a></code>,
|
|
<code><a href="#the-col-element">col</a></code>, <code><a href="#the-command-element">command</a></code>, <code><a href="#the-embed-element">embed</a></code>,
|
|
<code><a href="#the-hr-element">hr</a></code>, <code><a href="#the-img-element">img</a></code>, <code><a href="#the-input-element">input</a></code>,
|
|
<code><a href="#the-keygen-element">keygen</a></code>, <code><a href="#the-link-element">link</a></code>, <code><a href="#the-meta-element">meta</a></code>,
|
|
<code><a href="#the-param-element">param</a></code>, <code><a href="#the-source-element">source</a></code>, <code><a href="#the-track-element">track</a></code>,
|
|
<code><a href="#the-wbr-element">wbr</a></code></dd>
|
|
|
|
|
|
<dt><dfn id="raw-text-elements">Raw text elements</dfn></dt>
|
|
|
|
<dd><code><a href="#the-script-element">script</a></code>, <code><a href="#the-style-element">style</a></code></dd>
|
|
<dt><dfn id="rcdata-elements">RCDATA elements</dfn></dt>
|
|
|
|
<dd><code><a href="#the-textarea-element">textarea</a></code>, <code><a href="#the-title-element">title</a></code></dd>
|
|
|
|
<dt><dfn id="foreign-elements">Foreign elements</dfn></dt>
|
|
|
|
<dd>Elements from the <a href="#mathml-namespace">MathML namespace</a>
|
|
and the <a href="#svg-namespace">SVG namespace</a>.</dd>
|
|
|
|
<dt><dfn id="normal-elements">Normal elements</dfn></dt>
|
|
|
|
<dd>All other allowed <a href="#html-elements">HTML elements</a> are normal
|
|
elements.</dd>
|
|
|
|
</dl><p><dfn id="syntax-tags" title="syntax-tags">Tags</dfn> are used to delimit the start
|
|
and end of elements in the markup. <a href="#raw-text-elements" title="raw text
|
|
elements">Raw text</a>, <a href="#rcdata-elements" title="RCDATA
|
|
elements">RCDATA</a>, and <a href="#normal-elements" title="normal
|
|
elements">normal</a> elements have a <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> to indicate where they
|
|
begin, and an <a href="#syntax-end-tag" title="syntax-end-tag">end tag</a> to
|
|
indicate where they end. The start and end tags of certain
|
|
<a href="#normal-elements">normal elements</a> can be <a href="#syntax-tag-omission" title="syntax-tag-omission">omitted</a>, as described
|
|
later. Those that cannot be omitted must not be omitted. <a href="#void-elements">Void
|
|
elements</a> only have a start tag; end tags must not be
|
|
specified for <a href="#void-elements">void elements</a>. <a href="#foreign-elements">Foreign
|
|
elements</a> 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.<p>The contents of the element must be placed between just after the
|
|
start tag (which <a href="#syntax-tag-omission" title="syntax-tag-omission">might be implied,
|
|
in certain cases</a>) and just before the end tag (which again,
|
|
<a href="#syntax-tag-omission" title="syntax-tag-omission">might be implied in certain
|
|
cases</a>). The exact allowed contents of each individual element
|
|
depend 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 five types of
|
|
elements have additional <em>syntactic</em> requirements.<p><a href="#void-elements">Void elements</a> can't have any contents (since there's
|
|
no end tag, no content can be put between the start tag and the end
|
|
tag).<p><a href="#raw-text-elements">Raw text elements</a> can have <a href="#syntax-text" title="syntax-text">text</a>, though it has <a href="#cdata-rcdata-restrictions">restrictions</a> described
|
|
below.<p><a href="#rcdata-elements">RCDATA elements</a> can have <a href="#syntax-text" title="syntax-text">text</a> and <a href="#syntax-charref" title="syntax-charref">character references</a>, but the text
|
|
must not contain an <a href="#syntax-ambiguous-ampersand" title="syntax-ambiguous-ampersand">ambiguous ampersand</a>.
|
|
There are also <a href="#cdata-rcdata-restrictions">further
|
|
restrictions</a> described below.<p><a href="#foreign-elements">Foreign elements</a> 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). <a href="#foreign-elements">Foreign elements</a> whose start tag is <em>not</em>
|
|
marked as self-closing can have <a href="#syntax-text" title="syntax-text">text</a>, <a href="#syntax-charref" title="syntax-charref">character references</a>, <a href="#syntax-cdata" title="syntax-cdata">CDATA sections</a>, other <a href="#syntax-elements" title="syntax-elements">elements</a>, and <a href="#syntax-comments" title="syntax-comments">comments</a>, but the text must not
|
|
contain the character U+003C LESS-THAN SIGN (<) or an <a href="#syntax-ambiguous-ampersand" title="syntax-ambiguous-ampersand">ambiguous ampersand</a>.<div class="note">
|
|
|
|
<p>The HTML syntax does not support namespace
|
|
declarations, even in <a href="#foreign-elements">foreign elements</a>.</p>
|
|
|
|
<p>For instance, consider the following HTML fragment:</p>
|
|
|
|
<pre><p>
|
|
<svg>
|
|
<metadata>
|
|
<!-- this is invalid -->
|
|
<cdr:license xmlns:cdr="http://www.example.com/cdr/metadata" name="MIT"/>
|
|
</metadata>
|
|
</svg>
|
|
</p></pre>
|
|
|
|
<p>The innermost element, <code title="">cdr:license</code>, is
|
|
actually in the SVG namespace, as the "<code title="">xmlns:cdr</code>" attribute has no effect (unlike in
|
|
XML). In fact, as the comment in the fragment above says, the
|
|
fragment is actually non-conforming. This is because the SVG
|
|
specification does not define any elements called "<code title="">cdr:license</code>" in the SVG namespace.</p>
|
|
|
|
</div><p><a href="#normal-elements">Normal elements</a> can have <a href="#syntax-text" title="syntax-text">text</a>, <a href="#syntax-charref" title="syntax-charref">character references</a>, other <a href="#syntax-elements" title="syntax-elements">elements</a>, and <a href="#syntax-comments" title="syntax-comments">comments</a>, but the text must not
|
|
contain the character U+003C LESS-THAN SIGN (<) or an <a href="#syntax-ambiguous-ampersand" title="syntax-ambiguous-ampersand">ambiguous ampersand</a>. Some
|
|
<a href="#normal-elements">normal elements</a> 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>Tags contain a <dfn id="syntax-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 U+0030 DIGIT ZERO (0) to U+0039 DIGIT
|
|
NINE (9), U+0061 LATIN SMALL LETTER A to U+007A LATIN SMALL LETTER
|
|
Z, and U+0041 LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER
|
|
Z. In the HTML syntax, tag names, even those for <a href="#foreign-elements">foreign
|
|
elements</a>, 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.<h5 id="start-tags"><span class="secno">8.1.2.1 </span>Start tags</h5><p><dfn id="syntax-start-tag" title="syntax-start-tag">Start tags</dfn> must have the
|
|
following format:<ol><li>The first character of a start tag must be a U+003C LESS-THAN
|
|
SIGN character (<).</li>
|
|
|
|
<li>The next few characters of a start tag must be the element's
|
|
<a href="#syntax-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-character" title="space character">space
|
|
characters</a>.</li>
|
|
|
|
<li>Then, the start tag may have a number of attributes, the <a href="#syntax-attributes" title="syntax-attributes">syntax for which</a> is described
|
|
below. Attributes must be separated from each other by one or more
|
|
<a href="#space-character" title="space character">space characters</a>.</li>
|
|
|
|
<li>After the attributes, or after the <a href="#syntax-tag-name" title="syntax-tag-name">tag name</a> if there are no attributes,
|
|
there may be one or more <a href="#space-character" title="space character">space
|
|
characters</a>. (Some attributes are required to be followed by
|
|
a space. See the <a href="#syntax-attributes" title="syntax-attributes">attributes
|
|
section</a> below.)</li>
|
|
|
|
<li>Then, if the element is one of the <a href="#void-elements">void elements</a>,
|
|
or if the element is a <a href="#foreign-elements" title="foreign elements">foreign
|
|
element</a>, then there may be a single U+002F SOLIDUS character
|
|
(/). This character has no effect on <a href="#void-elements">void elements</a>,
|
|
but on <a href="#foreign-elements">foreign elements</a> it marks the start tag as
|
|
self-closing.</li>
|
|
|
|
<li>Finally, start tags must be closed by a U+003E GREATER-THAN
|
|
SIGN character (>).</li>
|
|
|
|
</ol><h5 id="end-tags"><span class="secno">8.1.2.2 </span>End tags</h5><p><dfn id="syntax-end-tag" title="syntax-end-tag">End tags</dfn> must have the
|
|
following format:<ol><li>The first character of an end tag must be a U+003C LESS-THAN
|
|
SIGN character (<).</li>
|
|
|
|
<li>The second character of an end tag must be a U+002F SOLIDUS
|
|
character (/).</li>
|
|
|
|
<li>The next few characters of an end tag must be the element's
|
|
<a href="#syntax-tag-name" title="syntax-tag-name">tag name</a>.</li>
|
|
|
|
<li>After the tag name, there may be one or more <a href="#space-character" title="space
|
|
character">space characters</a>.</li>
|
|
|
|
<li>Finally, end tags must be closed by a U+003E GREATER-THAN SIGN
|
|
character (>).</li>
|
|
|
|
</ol><h5 id="attributes-0"><span class="secno">8.1.2.3 </span>Attributes</h5><p><dfn id="syntax-attributes" title="syntax-attributes">Attributes</dfn> for an element
|
|
are expressed inside the element's start tag.<p>Attributes have a name and a value. <dfn id="syntax-attribute-name" title="syntax-attribute-name">Attribute names</dfn> must consist of
|
|
one or more characters other than the <a href="#space-character" title="space
|
|
character">space characters</a>, U+0000 NULL, U+0022 QUOTATION
|
|
MARK ("), U+0027 APOSTROPHE ('), U+003E GREATER-THAN SIGN
|
|
(>), U+002F SOLIDUS (/), and U+003D EQUALS SIGN (=) characters,
|
|
the control characters, and any characters that are not defined by
|
|
Unicode. In the HTML syntax, attribute names, even those for
|
|
<a href="#foreign-elements">foreign elements</a>, may be written with any mix of lower-
|
|
and uppercase letters that are an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the attribute's name.<p><dfn id="syntax-attribute-value" title="syntax-attribute-value">Attribute values</dfn> are a
|
|
mixture of <a href="#syntax-text" title="syntax-text">text</a> and <a href="#syntax-charref" title="syntax-charref">character references</a>, except with the
|
|
additional restriction that the text cannot contain an <a href="#syntax-ambiguous-ampersand" title="syntax-ambiguous-ampersand">ambiguous ampersand</a>.<p>Attributes can be specified in four different ways:<dl><dt>Empty attribute syntax</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Just the <a href="#syntax-attribute-name" title="syntax-attribute-name">attribute
|
|
name</a>. The value is implicitly the empty string.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>In the following example, the <code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></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-character">space
|
|
character</a> separating the two.</p>
|
|
|
|
</dd>
|
|
|
|
<dt id="unquoted">Unquoted attribute value syntax</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <a href="#syntax-attribute-name" title="syntax-attribute-name">attribute name</a>,
|
|
followed by zero or more <a href="#space-character" title="space character">space
|
|
characters</a>, followed by a single U+003D EQUALS SIGN
|
|
character, followed by zero or more <a href="#space-character" title="space
|
|
character">space characters</a>, followed by the <a href="#syntax-attribute-value" 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-character" title="space character">space
|
|
characters</a>, any U+0022 QUOTATION MARK characters ("),
|
|
U+0027 APOSTROPHE characters ('), U+003D EQUALS SIGN
|
|
characters (=), U+003C LESS-THAN SIGN characters (<), U+003E
|
|
GREATER-THAN SIGN characters (>), or U+0060 GRAVE ACCENT
|
|
characters (`), and must not be the empty string.</p>
|
|
|
|
|
|
|
|
<div class="example">
|
|
|
|
<p>In the following example, the <code title="attr-input-value"><a href="#attr-input-value">value</a></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 the optional U+002F SOLIDUS
|
|
character (/) allowed in step 6 of the <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> syntax above, then there
|
|
must be a <a href="#space-character">space character</a> separating the two.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Single-quoted attribute value syntax</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <a href="#syntax-attribute-name" title="syntax-attribute-name">attribute name</a>,
|
|
followed by zero or more <a href="#space-character" title="space character">space
|
|
characters</a>, followed by a single U+003D EQUALS SIGN
|
|
character, followed by zero or more <a href="#space-character" title="space
|
|
character">space characters</a>, followed by a single U+0027
|
|
APOSTROPHE character ('), followed by the <a href="#syntax-attribute-value" 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 characters ('), and
|
|
finally followed by a second single U+0027 APOSTROPHE character
|
|
(').</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>In the following example, the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is given with the
|
|
single-quoted attribute value syntax:</p>
|
|
|
|
<pre><input <em>type='checkbox'</em>></pre>
|
|
|
|
</div>
|
|
|
|
<p>If an attribute using the single-quoted attribute syntax is to
|
|
be followed by another attribute, then there must be a <a href="#space-character">space
|
|
character</a> separating the two.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Double-quoted attribute value syntax</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The <a href="#syntax-attribute-name" title="syntax-attribute-name">attribute name</a>,
|
|
followed by zero or more <a href="#space-character" title="space character">space
|
|
characters</a>, followed by a single U+003D EQUALS SIGN
|
|
character, followed by zero or more <a href="#space-character" title="space
|
|
character">space characters</a>, followed by a single U+0022
|
|
QUOTATION MARK character ("), followed by the <a href="#syntax-attribute-value" 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 characters ("),
|
|
and finally followed by a second single U+0022 QUOTATION MARK
|
|
character (").</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>In the following example, the <code title="attr-fe-name"><a href="#attr-fe-name">name</a></code> attribute is given with the
|
|
double-quoted attribute value syntax:</p>
|
|
|
|
<pre><input <em>name="be evil"</em>></pre>
|
|
|
|
</div>
|
|
|
|
<p>If an attribute using the double-quoted attribute syntax is to
|
|
be followed by another attribute, then there must be a <a href="#space-character">space
|
|
character</a> separating the two.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>There must never be two or more attributes on the same start tag
|
|
whose names are an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for
|
|
each other.<hr><p>When a <a href="#foreign-elements" title="foreign elements">foreign element</a> has
|
|
one of the namespaced attributes given by the local name and
|
|
namespace of the first and second cells of a row from the following
|
|
table, it must be written using the name given by the third cell
|
|
from the same row.<table><thead><tr><th> Local name <th> Namespace <th> Attribute name
|
|
<tbody><tr><td> <code title="">actuate</code> <td> <a href="#xlink-namespace">XLink namespace</a> <td> <code title="">xlink:actuate</code>
|
|
<tr><td> <code title="">arcrole</code> <td> <a href="#xlink-namespace">XLink namespace</a> <td> <code title="">xlink:arcrole</code>
|
|
<tr><td> <code title="">href</code> <td> <a href="#xlink-namespace">XLink namespace</a> <td> <code title="">xlink:href</code>
|
|
<tr><td> <code title="">role</code> <td> <a href="#xlink-namespace">XLink namespace</a> <td> <code title="">xlink:role</code>
|
|
<tr><td> <code title="">show</code> <td> <a href="#xlink-namespace">XLink namespace</a> <td> <code title="">xlink:show</code>
|
|
<tr><td> <code title="">title</code> <td> <a href="#xlink-namespace">XLink namespace</a> <td> <code title="">xlink:title</code>
|
|
<tr><td> <code title="">type</code> <td> <a href="#xlink-namespace">XLink namespace</a> <td> <code title="">xlink:type</code>
|
|
<tr><td> <code title="">base</code> <td> <a href="#xml-namespace">XML namespace</a> <td> <code title="">xml:base</code>
|
|
<tr><td> <code title="">lang</code> <td> <a href="#xml-namespace">XML namespace</a> <td> <code title="">xml:lang</code>
|
|
<tr><td> <code title="">space</code> <td> <a href="#xml-namespace">XML namespace</a> <td> <code title="">xml:space</code>
|
|
<tr><td> <code title="">xmlns</code> <td> <a href="#xmlns-namespace">XMLNS namespace</a> <td> <code title="">xmlns</code>
|
|
<tr><td> <code title="">xlink</code> <td> <a href="#xmlns-namespace">XMLNS namespace</a> <td> <code title="">xmlns:xlink</code>
|
|
</table><p>No other namespaced attribute can be expressed in <a href="#syntax">the
|
|
HTML syntax</a>.<h5 id="optional-tags"><span class="secno">8.1.2.4 </span>Optional tags</h5><p>Certain tags can be <dfn id="syntax-tag-omission" title="syntax-tag-omission">omitted</dfn>.<p class="note">Omitting an element's <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> does not mean the element
|
|
is not present; it is implied, but it is still there. An HTML
|
|
document always has a root <code><a href="#the-html-element">html</a></code> element, even if the
|
|
string <code title=""><html></code> doesn't appear anywhere in
|
|
the markup.</p><p>An <code><a href="#the-html-element">html</a></code> element's <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> may be omitted if the
|
|
first thing inside the <code><a href="#the-html-element">html</a></code> element is not a <a href="#syntax-comments" title="syntax-comments">comment</a>.</p><p>An <code><a href="#the-html-element">html</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-html-element">html</a></code> element is not
|
|
immediately followed by a <a href="#syntax-comments" title="syntax-comments">comment</a>.</p><p>A <code><a href="#the-head-element">head</a></code> element's <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> may be omitted if the
|
|
element is empty, or if the first thing inside the
|
|
<code><a href="#the-head-element">head</a></code> element is an element.</p><p>A <code><a href="#the-head-element">head</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-head-element">head</a></code> element is not
|
|
immediately followed by a <a href="#space-character">space character</a> or a <a href="#syntax-comments" title="syntax-comments">comment</a>.</p><p>A <code><a href="#the-body-element">body</a></code> element's <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> may be omitted if the
|
|
element is empty, or if the first thing inside the <code><a href="#the-body-element">body</a></code>
|
|
element is not a <a href="#space-character">space character</a> or a <a href="#syntax-comments" title="syntax-comments">comment</a>, except if the first thing
|
|
inside the <code><a href="#the-body-element">body</a></code> element is a <code><a href="#the-script-element">script</a></code> or
|
|
<code><a href="#the-style-element">style</a></code> element. </p><p>A <code><a href="#the-body-element">body</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-body-element">body</a></code> element is not
|
|
immediately followed by a <a href="#syntax-comments" title="syntax-comments">comment</a>.</p><p>A <code><a href="#the-li-element">li</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-li-element">li</a></code> element is
|
|
immediately followed by another <code><a href="#the-li-element">li</a></code> element or if there
|
|
is no more content in the parent element.</p><p>A <code><a href="#the-dt-element">dt</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-dt-element">dt</a></code> element is
|
|
immediately followed by another <code><a href="#the-dt-element">dt</a></code> element or a
|
|
<code><a href="#the-dd-element">dd</a></code> element.</p><p>A <code><a href="#the-dd-element">dd</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-dd-element">dd</a></code> element is
|
|
immediately followed by another <code><a href="#the-dd-element">dd</a></code> element or a
|
|
<code><a href="#the-dt-element">dt</a></code> element, or if there is no more content in the
|
|
parent element.</p><p>A <code><a href="#the-p-element">p</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-p-element">p</a></code> element is
|
|
immediately followed by an <code><a href="#the-address-element">address</a></code>,
|
|
<code><a href="#the-article-element">article</a></code>, <code><a href="#the-aside-element">aside</a></code>, <code><a href="#the-blockquote-element">blockquote</a></code>,
|
|
<code><a href="#dir">dir</a></code>, <code><a href="#the-div-element">div</a></code>, <code><a href="#the-dl-element">dl</a></code>,
|
|
<code><a href="#the-fieldset-element">fieldset</a></code>, <code><a href="#the-footer-element">footer</a></code>, <code><a href="#the-form-element">form</a></code>,
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>,
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code>, <code><a href="#the-header-element">header</a></code>,
|
|
<code><a href="#the-hgroup-element">hgroup</a></code>, <code><a href="#the-hr-element">hr</a></code>, <code><a href="#the-menu-element">menu</a></code>,
|
|
<code><a href="#the-nav-element">nav</a></code>, <code><a href="#the-ol-element">ol</a></code>, <code><a href="#the-p-element">p</a></code>, <code><a href="#the-pre-element">pre</a></code>,
|
|
<code><a href="#the-section-element">section</a></code>, <code><a href="#the-table-element">table</a></code>, or <code><a href="#the-ul-element">ul</a></code>,
|
|
element, or if there is no more content in the parent element and
|
|
the parent element is not an <code><a href="#the-a-element">a</a></code> element.</p><p>An <code><a href="#the-rt-element">rt</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-rt-element">rt</a></code> element is
|
|
immediately followed by an <code><a href="#the-rt-element">rt</a></code> or <code><a href="#the-rp-element">rp</a></code>
|
|
element, or if there is no more content in the parent element.</p><p>An <code><a href="#the-rp-element">rp</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-rp-element">rp</a></code> element is
|
|
immediately followed by an <code><a href="#the-rt-element">rt</a></code> or <code><a href="#the-rp-element">rp</a></code>
|
|
element, or if there is no more content in the parent element.</p><p>An <code><a href="#the-optgroup-element">optgroup</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end tag</a> may be omitted if the
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element is immediately followed by
|
|
another <code><a href="#the-optgroup-element">optgroup</a></code> element, or if there is no
|
|
more content in the parent element.</p><p>An <code><a href="#the-option-element">option</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-option-element">option</a></code> element is
|
|
immediately followed by another <code><a href="#the-option-element">option</a></code> element, or if
|
|
it is immediately followed by an <code><a href="#the-optgroup-element">optgroup</a></code> element, or
|
|
if there is no more content in the parent element.</p><p>A <code><a href="#the-colgroup-element">colgroup</a></code> element's <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> may be omitted if the
|
|
first thing inside the <code><a href="#the-colgroup-element">colgroup</a></code> element is a
|
|
<code><a href="#the-col-element">col</a></code> element, and if the element is not immediately
|
|
preceded by another <code><a href="#the-colgroup-element">colgroup</a></code> element whose <a href="#syntax-end-tag" title="syntax-end-tag">end tag</a> has been omitted. (It can't be
|
|
omitted if the element is empty.)</p><p>A <code><a href="#the-colgroup-element">colgroup</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end tag</a> may be omitted if the
|
|
<code><a href="#the-colgroup-element">colgroup</a></code> element is not immediately followed by a
|
|
<a href="#space-character">space character</a> or a <a href="#syntax-comments" title="syntax-comments">comment</a>.</p><p>A <code><a href="#the-thead-element">thead</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-thead-element">thead</a></code> element is
|
|
immediately followed by a <code><a href="#the-tbody-element">tbody</a></code> or <code><a href="#the-tfoot-element">tfoot</a></code>
|
|
element.</p><p>A <code><a href="#the-tbody-element">tbody</a></code> element's <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> may be omitted if the
|
|
first thing inside the <code><a href="#the-tbody-element">tbody</a></code> element is a
|
|
<code><a href="#the-tr-element">tr</a></code> element, and if the element is not immediately
|
|
preceded by a <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, or
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> element whose <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> has been omitted. (It can't be omitted if the element is
|
|
empty.)</p><p>A <code><a href="#the-tbody-element">tbody</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-tbody-element">tbody</a></code> element is
|
|
immediately followed by a <code><a href="#the-tbody-element">tbody</a></code> or <code><a href="#the-tfoot-element">tfoot</a></code>
|
|
element, or if there is no more content in the parent element.</p><p>A <code><a href="#the-tfoot-element">tfoot</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-tfoot-element">tfoot</a></code> element is
|
|
immediately followed by a <code><a href="#the-tbody-element">tbody</a></code> element, or if there is
|
|
no more content in the parent element.</p><p>A <code><a href="#the-tr-element">tr</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-tr-element">tr</a></code> element is
|
|
immediately followed by another <code><a href="#the-tr-element">tr</a></code> element, or if there
|
|
is no more content in the parent element.</p><p>A <code><a href="#the-td-element">td</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-td-element">td</a></code> element is
|
|
immediately followed by a <code><a href="#the-td-element">td</a></code> or <code><a href="#the-th-element">th</a></code>
|
|
element, or if there is no more content in the parent element.</p><p>A <code><a href="#the-th-element">th</a></code> element's <a href="#syntax-end-tag" title="syntax-end-tag">end
|
|
tag</a> may be omitted if the <code><a href="#the-th-element">th</a></code> element is
|
|
immediately followed by a <code><a href="#the-td-element">td</a></code> or <code><a href="#the-th-element">th</a></code>
|
|
element, or if there is no more content in the parent element.<p><strong>However</strong>, a <a href="#syntax-start-tag" title="syntax-start-tag">start
|
|
tag</a> must never be omitted if it has any attributes.<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>A <code><a href="#the-table-element">table</a></code> element must not contain <code><a href="#the-tr-element">tr</a></code>
|
|
elements, even though these elements are technically allowed inside
|
|
<code><a href="#the-table-element">table</a></code> elements according to the content models
|
|
described in this specification. (If a <code><a href="#the-tr-element">tr</a></code> element is
|
|
put inside a <code><a href="#the-table-element">table</a></code> in the markup, it will in fact imply
|
|
a <code><a href="#the-tbody-element">tbody</a></code> start tag before it.)<p>A single <a href="#syntax-newlines" title="syntax-newlines">newline</a> may be
|
|
placed immediately after the <a href="#syntax-start-tag" title="syntax-start-tag">start
|
|
tag</a> of <code><a href="#the-pre-element">pre</a></code> and <code><a href="#the-textarea-element">textarea</a></code>
|
|
elements. This does not affect the processing of the element. The
|
|
otherwise optional <a href="#syntax-newlines" title="syntax-newlines">newline</a>
|
|
<em>must</em> be included if the element's contents themselves start
|
|
with a <a href="#syntax-newlines" title="syntax-newlines">newline</a> (because
|
|
otherwise the leading newline in the contents would be treated like
|
|
the optional newline, and ignored).<div class="example">
|
|
<p>The following two <code><a href="#the-pre-element">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 raw text and RCDATA elements</h5><p>The text in <a href="#raw-text-elements" title="raw text elements">raw text</a> and
|
|
<a href="#rcdata-elements">RCDATA elements</a> must not contain any occurrences 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 (tab), U+000A LINE FEED (LF), U+000C FORM FEED (FF), U+000D
|
|
CARRIAGE RETURN (CR), U+0020 SPACE, U+003E GREATER-THAN SIGN (>), or
|
|
U+002F SOLIDUS (/).<h4 id="text-0"><span class="secno">8.1.3 </span>Text</h4><p><dfn id="syntax-text" title="syntax-text">Text</dfn> is allowed inside elements,
|
|
attribute values, and comments. Text must consist of Unicode
|
|
characters. Text must not contain U+0000 characters. Text must not
|
|
contain permanently undefined Unicode characters (noncharacters).
|
|
Text must not contain control characters other than <a href="#space-character" 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.<h5 id="newlines"><span class="secno">8.1.3.1 </span>Newlines</h5><p><dfn id="syntax-newlines" 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>Where <a href="#syntax-charref" title="syntax-charref">character references</a>
|
|
are allowed, a character reference of a U+000A LINE FEED (LF)
|
|
character (but not a U+000D CARRIAGE RETURN (CR) character) also
|
|
represents a <a href="#syntax-newlines" title="syntax-newlines">newline</a>.<h4 id="character-references"><span class="secno">8.1.4 </span>Character references</h4><p>In certain cases described in other sections, <a href="#syntax-text" title="syntax-text">text</a> may be mixed with <dfn id="syntax-charref" title="syntax-charref">character references</dfn>. These can be used
|
|
to escape characters that couldn't otherwise legally be included in
|
|
<a href="#syntax-text" title="syntax-text">text</a>.<p>Character references must start with a U+0026 AMPERSAND character
|
|
(&). Following this, there are three possible kinds of character
|
|
references:<dl><dt>Named character references</dt>
|
|
|
|
<dd>The ampersand must be followed by one of the names given in the
|
|
<a href="#named-character-references">named character references</a> section, using the same
|
|
case. <span class="impl">The name must be one that is terminated by
|
|
a U+003B SEMICOLON character (;).</span></dd>
|
|
|
|
|
|
<dt>Decimal numeric character reference</dt>
|
|
|
|
<dd>The ampersand must be followed by a U+0023 NUMBER SIGN
|
|
character (#), followed by one or more digits in the range U+0030
|
|
DIGIT ZERO (0) to U+0039 DIGIT NINE (9), representing a base-ten
|
|
integer that corresponds to a Unicode code point that is allowed
|
|
according to the definition below. The digits must then be followed
|
|
by a U+003B SEMICOLON character (;).</dd>
|
|
|
|
|
|
<dt>Hexadecimal numeric character reference</dt>
|
|
|
|
<dd>The ampersand must be followed by a U+0023 NUMBER SIGN
|
|
character (#), which must be followed by either a U+0078 LATIN
|
|
SMALL LETTER X character (x) or a U+0058 LATIN CAPITAL LETTER X
|
|
character (X), which must then be followed by one or more digits in
|
|
the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), U+0061
|
|
LATIN SMALL LETTER A to U+0066 LATIN SMALL LETTER F, and U+0041
|
|
LATIN CAPITAL LETTER A to U+0046 LATIN CAPITAL LETTER F,
|
|
representing a base-sixteen integer that corresponds to a Unicode
|
|
code point that is allowed according to the definition below. The
|
|
digits must then be followed by a U+003B SEMICOLON character
|
|
(;).</dd>
|
|
|
|
</dl><p>The numeric character reference forms described above are allowed
|
|
to reference any Unicode code point other than U+0000, U+000D,
|
|
permanently undefined Unicode characters (noncharacters), and
|
|
control characters other than <a href="#space-character" title="space character">space
|
|
characters</a>.<p>An <dfn id="syntax-ambiguous-ampersand" title="syntax-ambiguous-ampersand">ambiguous
|
|
ampersand</dfn> is a U+0026 AMPERSAND character (&) that is
|
|
followed by one or more characters in the range U+0030 DIGIT ZERO
|
|
(0) to U+0039 DIGIT NINE (9), U+0061 LATIN SMALL LETTER A to U+007A
|
|
LATIN SMALL LETTER Z, and U+0041 LATIN CAPITAL LETTER A to U+005A
|
|
LATIN CAPITAL LETTER Z, followed by a U+003B SEMICOLON character
|
|
(;), where these characters do not match any of the names given in
|
|
the <a href="#named-character-references">named character references</a> section.<h4 id="cdata-sections"><span class="secno">8.1.5 </span>CDATA sections</h4><p><dfn id="syntax-cdata" title="syntax-cdata">CDATA sections</dfn> must consist of
|
|
the following components, in this order:<ol><li>The string "<code title=""><![CDATA[</code>".</li>
|
|
|
|
<li>Optionally, <a href="#syntax-text" title="syntax-text">text</a>, with the
|
|
additional restriction that the text must not contain the string
|
|
"<code title="">]]></code>".</li>
|
|
|
|
<li>The string "<code title="">]]></code>".</li>
|
|
|
|
</ol><div class="example">
|
|
|
|
<p>CDATA sections can only be used in foreign content (MathML or
|
|
SVG). In this example, a CDATA section is used to escape the
|
|
contents of an <code>ms</code> element:</p>
|
|
|
|
<pre><p>You can add a string to a number, but this stringifies the number:</p>
|
|
<math>
|
|
<ms><![CDATA[x<y]]></ms>
|
|
<mo>+</mo>
|
|
<mn>3</mn>
|
|
<mo>=</mo>
|
|
<ms><![CDATA[x<y3]]></ms>
|
|
</math></pre>
|
|
|
|
</div><h4 id="comments"><span class="secno">8.1.6 </span>Comments</h4><p><dfn id="syntax-comments" 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="#syntax-text" title="syntax-text">text</a>, with the additional
|
|
restriction that the text must not start with a single U+003E
|
|
GREATER-THAN SIGN character (>), nor start with a U+002D
|
|
HYPHEN-MINUS character (-) followed by a U+003E GREATER-THAN SIGN
|
|
(>) character, nor contain two consecutive U+002D HYPHEN-MINUS
|
|
characters (<code title="">--</code>), nor end with a U+002D
|
|
HYPHEN-MINUS 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>).<div class="impl">
|
|
|
|
<h3 id="parsing"><span class="secno">8.2 </span>Parsing HTML documents</h3>
|
|
|
|
<p><i>This section only applies to user agents, data mining tools,
|
|
and conformance checkers.</i></p>
|
|
|
|
<p class="note">The rules for parsing XML documents into DOM trees
|
|
are covered by the next section, entitled "<a href="#the-xhtml-syntax">The XHTML
|
|
syntax</a>".</p>
|
|
|
|
<p>For <a href="#html-documents">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-parser">HTML
|
|
parser</dfn>.</p>
|
|
|
|
<div class="note">
|
|
|
|
<p>While the HTML syntax described in this specification 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 serialization
|
|
of HTML.</p>
|
|
|
|
</div>
|
|
|
|
<p>This specification defines the parsing rules for HTML documents,
|
|
whether they are syntactically correct or not. Certain points in the
|
|
parsing algorithm are said to be <dfn id="parse-error" 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 condition exists
|
|
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>
|
|
|
|
<p>For the purposes of conformance checkers, if a resource is
|
|
determined to be in <a href="#syntax">the HTML syntax</a>, then it is an
|
|
<a href="#html-documents" title="HTML documents">HTML document</a>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="overview-of-the-parsing-model"><span class="secno">8.2.1 </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="#tokenization">tokenization</a> stage followed by a <a href="#tree-construction">tree
|
|
construction</a> stage. The output is a <code><a href="#document">Document</a></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><a href="#document">Document</a></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 tokenization stage
|
|
comes from the network, but <a href="#dynamic-markup-insertion" title="dynamic markup
|
|
insertion">it can also come from script</a> running in the user
|
|
agent, e.g. using the <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code> API.</p>
|
|
|
|
<p><img alt="" height="554" src="parsing-model-overview.png" width="427"></p>
|
|
|
|
<p id="nestedParsing">There is only one set of states for the
|
|
tokenizer 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 tokenizer 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" end tag token:</p>
|
|
|
|
<pre>...
|
|
<script>
|
|
document.write('<p>');
|
|
</script>
|
|
...</pre>
|
|
|
|
</div>
|
|
|
|
<p>To handle these cases, parsers have a <dfn id="script-nesting-level">script nesting
|
|
level</dfn>, which must be initially set to zero, and a <dfn id="parser-pause-flag">parser
|
|
pause flag</dfn>, which must be initially set to false.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-input-stream"><span class="secno">8.2.2 </span>The <dfn>input stream</dfn></h4>
|
|
|
|
<p>The stream of Unicode characters that comprises the input to the
|
|
tokenization 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="#refsXML">[XML]</a></p>
|
|
|
|
|
|
<h5 id="determining-the-character-encoding"><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="encoding-sniffing-algorithm">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-type" 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="concept-encoding-confidence" title="concept-encoding-confidence">confidence</dfn>. The
|
|
confidence is either <i>tentative</i>, <i>certain</i>, or
|
|
<i>irrelevant</i>. The encoding used, and whether the confidence in
|
|
that encoding is <i>tentative</i> or <i>certain</i>, is <a href="#meta-charset-during-parse">used during the parsing</a> to
|
|
determine whether to <a href="#change-the-encoding">change the encoding</a>. If no
|
|
encoding is necessary, e.g. because the parser is operating on a
|
|
stream of Unicode characters and doesn't have to use an encoding at
|
|
all, then the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> is
|
|
<i>irrelevant</i>.</p>
|
|
|
|
<ol><li><p>If the user has explicitly instructed the user agent to
|
|
override the document's character encoding with a specific
|
|
encoding, optionally return that encoding with the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a>
|
|
<i>certain</i> and abort these steps.</li>
|
|
|
|
<li><p>If the transport layer specifies an encoding, and it is
|
|
supported, return that encoding with the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a>
|
|
<i>certain</i>, and abort these steps.</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 1024
|
|
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>
|
|
|
|
<p class="note">The authoring conformance requirements for
|
|
character encoding declarations limit them to only appearing <a href="#charset1024">in the first 1024 bytes</a>. User agents are
|
|
therefore encouraged to use the preparse algorithm below (part of
|
|
these steps) on the first 1024 bytes, but not to stall beyond
|
|
that.</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="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a>
|
|
<i>certain</i>, and abort these steps:</p>
|
|
|
|
|
|
<table><thead><tr><th>Bytes in Hexadecimal
|
|
<th>Encoding
|
|
<tbody><tr><td>FE FF
|
|
<td>Big-endian UTF-16
|
|
<tr><td>FF FE
|
|
<td>Little-endian UTF-16
|
|
<tr><td>EF BB BF
|
|
<td>UTF-8
|
|
</table><p class="note">This step looks for Unicode Byte Order Marks
|
|
(BOMs).</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>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, 0x0C, 0x0D, 0x20, 0x2F (case-insensitive ASCII '<meta' followed by a space or slash)</dt>
|
|
<dd>
|
|
|
|
<ol><li><p>Advance the <var title="">position</var> pointer so
|
|
that it points at the next 0x09, 0x0A, 0x0C, 0x0D, 0x20, or
|
|
0x2F byte (the one in sequence of characters matched
|
|
above).</li>
|
|
|
|
<li><p>Let <var title="">attribute list</var> be an empty
|
|
list of strings.</li>
|
|
<li><p>Let <var title="">got pragma</var> be false.</li>
|
|
|
|
<li><p>Let <var title="">need pragma</var> be null.</li>
|
|
|
|
<li><p>Let <var title="">charset</var> be the null value
|
|
(which, for the purposes of this algorithm, is distinct from
|
|
an unrecognised encoding or the empty string).</li>
|
|
|
|
<li><p><i>Attributes</i>: <a href="#concept-get-attributes-when-sniffing" title="concept-get-attributes-when-sniffing">Get an
|
|
attribute</a> and its value. If no attribute was sniffed,
|
|
then jump to the <i>processing</i> step below.</li>
|
|
|
|
<li><p>If the attribute's name is already in <var title="">attribute list</var>, then return to the step
|
|
labeled <i>attributes</i>.</p>
|
|
|
|
<li><p>Add the attribute's name to <var title="">attribute
|
|
list</var>.</p>
|
|
|
|
<li>
|
|
|
|
<p>Run the appropriate step from the following list, if one
|
|
applies:</p>
|
|
|
|
<dl class="switch"><dt>If the attribute's name is "<code title="">http-equiv</code>"</dt>
|
|
|
|
<dd><p>If the attribute's value is "<code title="">content-type</code>", then set <var title="">got
|
|
pragma</var> to true.</dd>
|
|
|
|
<dt>If the attribute's name is "<code title="">content</code>"</dt>
|
|
|
|
<dd><p>Apply the <a href="#algorithm-for-extracting-an-encoding-from-a-meta-element">algorithm for extracting an encoding
|
|
from a <code>meta</code> element</a>, giving the
|
|
attribute's value as the string to parse. If an encoding is
|
|
returned, and if <var title="">charset</var> is still set
|
|
to null, let <var title="">charset</var> be the encoding
|
|
returned, and set <var title="">need pragma</var> to
|
|
true.</dd>
|
|
|
|
<dt>If the attribute's name is "<code title="">charset</code>"</dt>
|
|
|
|
<dd><p>Let <var title="">charset</var> be the encoding
|
|
corresponding to the attribute's value, and set <var title="">need pragma</var> to false.</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>Return to the step labeled <i>attributes</i>.</li>
|
|
|
|
<li><p><i>Processing</i>: If <var title="">need pragma</var>
|
|
is null, then jump to the second step of the overall "two
|
|
step" algorithm.</li>
|
|
|
|
<li><p>If <var title="">mode</var> is true but <var title="">got pragma</var> is false, then jump to the second
|
|
step of the overall "two step" algorithm.</li>
|
|
|
|
<li><p>If <var title="">charset</var> is a UTF-16 encoding,
|
|
change the value of <var title="">charset</var> to
|
|
UTF-8.</li>
|
|
|
|
<li><p>If <var title="">charset</var> is not a supported
|
|
character encoding, then jump to the second step of the
|
|
overall "two step" algorithm.</li>
|
|
|
|
<li><p>Return the encoding given by <var title="">charset</var>, with <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a>
|
|
<i>tentative</i>, and abort all these steps.</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),
|
|
0x0C (ASCII FF), 0x0D (ASCII CR), 0x20 (ASCII space), or 0x3E
|
|
(ASCII >) byte.</li>
|
|
|
|
<li><p>Repeatedly <a href="#concept-get-attributes-when-sniffing" 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.</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="concept-get-attributes-when-sniffing" 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), 0x0C (ASCII FF), 0x0D (ASCII CR),
|
|
0x20 (ASCII space), or 0x2F (ASCII /) then advance <var title="">position</var> to the next byte and redo this
|
|
substep.</li>
|
|
|
|
<li><p>If the byte at <var title="">position</var> is 0x3E (ASCII
|
|
>), then abort the "get an attribute" algorithm. There isn't
|
|
one.</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.</li>
|
|
|
|
<li><p><i>Attribute name</i>: 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 labeled <i>value</i>.</dd>
|
|
|
|
<dt>If it is 0x09 (ASCII TAB), 0x0A (ASCII LF), 0x0C (ASCII
|
|
FF), 0x0D (ASCII CR), or 0x20 (ASCII space)</dt>
|
|
|
|
<dd>Jump to the step below labeled <i>spaces</i>.</dd>
|
|
|
|
<dt>If it is 0x2F (ASCII /) or 0x3E (ASCII >)</dt>
|
|
|
|
<dd>Abort the "get an attribute" algorithm. 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 code point <span title=""><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 code point 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.</li>
|
|
|
|
<li><p><i>Spaces</i>: If the byte at <var title="">position</var> is one of 0x09 (ASCII TAB), 0x0A (ASCII
|
|
LF), 0x0C (ASCII FF), 0x0D (ASCII CR), or 0x20 (ASCII space) then
|
|
advance <var title="">position</var> to the next byte, then,
|
|
repeat this step.</li>
|
|
|
|
<li><p>If the byte at <var title="">position</var> is
|
|
<em>not</em> 0x3D (ASCII =), abort the "get an attribute"
|
|
algorithm. The attribute's name is the value of <var title="">attribute name</var>, its value is the empty
|
|
string.</li>
|
|
|
|
<li><p>Advance <var title="">position</var> past the 0x3D (ASCII
|
|
=) byte.</li>
|
|
|
|
<li><p><i>Value</i>: If the byte at <var title="">position</var> is one of 0x09 (ASCII TAB), 0x0A (ASCII
|
|
LF), 0x0C (ASCII FF), 0x0D (ASCII CR), or 0x20 (ASCII space) then
|
|
advance <var title="">position</var> to the next byte, then,
|
|
repeat this step.</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 (ASCII ')</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 advance <var title="">position</var> to the next byte and abort the "get
|
|
an attribute" algorithm. 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 code point 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 code point 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 0x3E (ASCII >)</dt>
|
|
|
|
<dd>Abort the "get an attribute" algorithm. 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 code point <span title=""><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>). Advance <var title="">position</var> to the next byte.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
|
|
<dd>Append the Unicode character with the same code point as the
|
|
value of the byte at <var title="">position</var>) to <var title="">attribute value</var>. Advance <var title="">position</var> to the next byte.</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), 0x0C (ASCII
|
|
FF), 0x0D (ASCII CR), 0x20 (ASCII space), or 0x3E (ASCII
|
|
>)</dt>
|
|
|
|
<dd>Abort the "get an attribute" algorithm. 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 code point <span title=""><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 code point 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.</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="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a>
|
|
<i>tentative</i>, and abort these steps.</li>
|
|
|
|
<li>
|
|
|
|
<p>The user agent may attempt to autodetect the character encoding
|
|
from applying frequency analysis or other algorithms to the data
|
|
stream. Such algorithms may use information about the resource
|
|
other than the resource's contents, including the address of the
|
|
resource. If autodetection succeeds in determining a character
|
|
encoding, then return that encoding, with the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a>
|
|
<i>tentative</i>, and abort these steps. <a href="#refsUNIVCHARDET">[UNIVCHARDET]</a></p>
|
|
|
|
<p class="note">The UTF-8 encoding has a highly detectable bit
|
|
pattern. Documents that contain bytes with values greater than
|
|
0x7F which match the UTF-8 pattern are very likely to be UTF-8,
|
|
while documents with byte sequences that do not match it are very
|
|
likely not. User-agents are therefore encouraged to search for
|
|
this common encoding. <a href="#refsPPUTF8">[PPUTF8]</a> <a href="#refsUTF8DET">[UTF8DET]</a></p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Otherwise, return an implementation-defined or user-specified
|
|
default character encoding, with the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a>
|
|
<i>tentative</i>.</p>
|
|
|
|
<p>In controlled environments or in environments where the
|
|
encoding of documents can be prescribed (for example, for user
|
|
agents intended for dedicated use in new networks), the
|
|
comprehensive <code title="">UTF-8</code> encoding is
|
|
suggested.</p>
|
|
|
|
<p>In other environments, the default encoding is typically
|
|
dependent on the user's locale (an approximation of the languages,
|
|
and thus often encodings, of the pages that the user is likely to
|
|
frequent). The following table gives suggested defaults based on
|
|
the user's locale, for compatibility with legacy content. Locales
|
|
are identified by BCP 47 language tags. <a href="#refsBCP47">[BCP47]</a></p>
|
|
|
|
|
|
<table><thead><tr><th>Locale language
|
|
<th>Suggested default encoding
|
|
<tbody><tr><td>ar
|
|
<td>UTF-8
|
|
|
|
<tr><td>be
|
|
<td>ISO-8859-5
|
|
|
|
<tr><td>bg
|
|
<td>windows-1251
|
|
|
|
<tr><td>cs<!-- -CZ -->
|
|
<td>ISO-8859-2
|
|
|
|
<tr><td>cy
|
|
<td>UTF-8
|
|
|
|
<tr><td>fa<!-- -IR -->
|
|
<td>UTF-8
|
|
|
|
<tr><td>he<!-- -IL -->
|
|
<td>windows-1255
|
|
|
|
<tr><td>hr
|
|
<td>UTF-8
|
|
|
|
<tr><td>hu<!-- -HU -->
|
|
<td>ISO-8859-2
|
|
|
|
<tr><td>ja
|
|
<td>Windows-31J
|
|
|
|
<tr><td>kk
|
|
<td>UTF-8
|
|
|
|
<tr><td>ko<!-- -KR -->
|
|
<td>windows-949 <!-- EUC-KR -->
|
|
|
|
<tr><td>ku
|
|
<td>windows-1254 <!-- ISO-8859-9 -->
|
|
|
|
<tr><td>lt
|
|
<td>windows-1257
|
|
|
|
<tr><td>lv<!-- -LV -->
|
|
<td>ISO-8859-13
|
|
|
|
<tr><td>mk<!-- -MK -->
|
|
<td>UTF-8
|
|
|
|
<tr><td>or
|
|
<td>UTF-8
|
|
|
|
<tr><td>pl<!-- -PL -->
|
|
<td>ISO-8859-2
|
|
|
|
<tr><td>ro
|
|
<td>UTF-8
|
|
|
|
<tr><td>ru
|
|
<td>windows-1251
|
|
|
|
<tr><td>sk
|
|
<td>windows-1250
|
|
|
|
<tr><td>sl
|
|
<td>ISO-8859-2
|
|
|
|
<tr><td>sr
|
|
<td>UTF-8
|
|
|
|
<tr><td>th
|
|
<td>windows-874 <!-- TIS-620 -->
|
|
|
|
<tr><td>tr<!-- -TR -->
|
|
<td>windows-1254 <!-- ISO-8859-9 -->
|
|
|
|
<tr><td>uk
|
|
<td>windows-1251
|
|
|
|
<tr><td>vi
|
|
<td>UTF-8
|
|
|
|
<tr><td>zh-CN
|
|
<td>GB18030
|
|
|
|
<tr><td>zh-TW
|
|
<td>Big5
|
|
|
|
<tr><td>All other locales
|
|
<td>windows-1252
|
|
|
|
</table></li>
|
|
|
|
</ol><p>The <a href="#document-s-character-encoding">document's character encoding</a> 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.</p>
|
|
|
|
<p class="note">This algorithm is a <a href="#willful-violation">willful violation</a>
|
|
of the HTTP specification, which requires that the encoding be
|
|
assumed to be ISO-8859-1 in the absence of a <a href="#character-encoding-declaration">character
|
|
encoding declaration</a> to the contrary, and of RFC 2046,
|
|
which requires that the encoding be assumed to be US-ASCII in the
|
|
absence of a <a href="#character-encoding-declaration">character encoding declaration</a> to the
|
|
contrary. This specification's third approach is motivated by a
|
|
desire to be maximally compatible with legacy content. <a href="#refsHTTP">[HTTP]</a> <a href="#refsRFC2046">[RFC2046]</a></p>
|
|
|
|
|
|
<h5 id="character-encodings-0"><span class="secno">8.2.2.2 </span>Character encodings</h5>
|
|
|
|
<p>User agents must at a minimum support the UTF-8 and Windows-1252
|
|
encodings, but may support more. <a href="#refsRFC3629">[RFC3629]</a> <a href="#refsWIN1252">[WIN1252]</a></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 <a href="#preferred-mime-name">preferred MIME name</a> of
|
|
every character encoding they support, and should support all the
|
|
IANA-registered names and aliases of every character encoding they
|
|
support. <a href="#refsIANACHARSET">[IANACHARSET]</a></p>
|
|
|
|
<p>When 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 remove any leading or trailing <a href="#space-character" title="space character">space characters</a> in both names, and
|
|
then perform the comparison in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner.</p>
|
|
|
|
<hr><p>When a user agent would otherwise use an encoding given in the
|
|
first column of the following table to either convert content to
|
|
Unicode characters or convert Unicode characters to bytes, it must
|
|
instead use the encoding given in the cell in the second column of
|
|
the same row. When a byte or sequence of bytes is treated
|
|
differently due to this encoding aliasing, it is said to have been
|
|
<dfn id="misinterpreted-for-compatibility">misinterpreted for compatibility</dfn>.</p>
|
|
|
|
<table id="table-encoding-overrides"><caption>Character encoding overrides</caption>
|
|
<thead><tr><th> Input encoding <th> Replacement encoding <th> References
|
|
<tbody><tr><td> EUC-KR <td> windows-949 <td>
|
|
<a href="#refsEUCKR">[EUCKR]</a>
|
|
<a href="#refsWIN949">[WIN949]</a>
|
|
<tr><td> EUC-JP <td> CP51932 <td>
|
|
<a href="#refsEUCJP">[EUCJP]</a>
|
|
<a href="#refsCP51932">[CP51932]</a>
|
|
<tr><td> GB2312 <td> GBK <td>
|
|
<a href="#refsRFC1345">[RFC1345]</a>
|
|
<a href="#refsGBK">[GBK]</a>
|
|
<tr><td> GB_2312-80 <td> GBK <td>
|
|
<a href="#refsRFC1345">[RFC1345]</a>
|
|
<a href="#refsGBK">[GBK]</a>
|
|
<tr><td> ISO-8859-1 <td> windows-1252 <td>
|
|
<a href="#refsRFC1345">[RFC1345]</a>
|
|
<a href="#refsWIN1252">[WIN1252]</a>
|
|
<tr><td> ISO-8859-9 <td> windows-1254 <td>
|
|
<a href="#refsRFC1345">[RFC1345]</a>
|
|
<a href="#refsWIN1254">[WIN1254]</a>
|
|
<tr><td> ISO-8859-11 <td> windows-874 <td>
|
|
<a href="#refsISO885911">[ISO885911]</a>
|
|
<a href="#refsWIN874">[WIN874]</a>
|
|
<tr><td> KS_C_5601-1987 <td> windows-949 <td>
|
|
<a href="#refsRFC1345">[RFC1345]</a>
|
|
<a href="#refsWIN949">[WIN949]</a>
|
|
<tr><td> Shift_JIS <td> Windows-31J <td>
|
|
<a href="#refsSHIFTJIS">[SHIFTJIS]</a>
|
|
<a href="#refsWIN31J">[WIN31J]</a>
|
|
<tr><td> TIS-620 <td> windows-874 <td>
|
|
<a href="#refsTIS620">[TIS620]</a>
|
|
<a href="#refsWIN874">[WIN874]</a>
|
|
<tr><td> US-ASCII <td> windows-1252 <td>
|
|
<a href="#refsRFC1345">[RFC1345]</a>
|
|
<a href="#refsWIN1252">[WIN1252]</a>
|
|
</table><p class="note">The requirement to treat certain encodings as other
|
|
encodings according to the table above is a <a href="#willful-violation">willful
|
|
violation</a> of the W3C Character Model specification, motivated
|
|
by a desire for compatibility with legacy content. <a href="#refsCHARMOD">[CHARMOD]</a></p>
|
|
|
|
<p>When a user agent is to use the UTF-16 encoding but no BOM has
|
|
been found, user agents must default to UTF-16LE.</p>
|
|
|
|
<p class="note">The requirement to default UTF-16 to LE rather than
|
|
BE is a <a href="#willful-violation">willful violation</a> of RFC 2781, motivated by a
|
|
desire for compatibility with legacy content. <a href="#refsRFC2781">[RFC2781]</a></p>
|
|
|
|
<hr><p>User agents must not support the CESU-8, UTF-7, BOCU-1 and SCSU
|
|
encodings. <a href="#refsCESU8">[CESU8]</a> <a href="#refsUTF7">[UTF7]</a> <a href="#refsBOCU1">[BOCU1]</a> <a href="#refsSCSU">[SCSU]</a></p>
|
|
|
|
<p>Support for encodings based on EBCDIC is not recommended. This
|
|
encoding is rarely used for publicly-facing Web content.</p>
|
|
|
|
<p>Support for UTF-32 is not recommended. This encoding is rarely
|
|
used, and frequently implemented incorrectly.</p>
|
|
|
|
<p class="note">This specification does not make any attempt to
|
|
support EBCDIC-based encodings and UTF-32 in its algorithms; support
|
|
and use of these encodings can thus lead to unexpected behavior in
|
|
implementations of this specification.</p>
|
|
|
|
|
|
|
|
<h5 id="preprocessing-the-input-stream"><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 tokenizer, as described by
|
|
the rules for that encoding, except that the leading U+FEFF BYTE
|
|
ORDER MARK character, if any, must not be stripped by the encoding
|
|
layer (it is stripped by the rule below).</p>
|
|
<p>Bytes or sequences of bytes in the original byte stream that
|
|
could not be converted to Unicode code points must be converted to
|
|
U+FFFD REPLACEMENT CHARACTERs. Specifically, if the encoding is
|
|
UTF-8, the bytes must be <a href="#decoded-as-utf-8-with-error-handling" title="decoded as UTF-8, with error
|
|
handling">decoded with the error handling</a> defined in this
|
|
specification.</p>
|
|
|
|
<p class="note">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.</p>
|
|
|
|
<p>Any byte or sequence of bytes in the original byte stream that is
|
|
<a href="#misinterpreted-for-compatibility">misinterpreted for compatibility</a> is a <a href="#parse-error">parse
|
|
error</a>.</p>
|
|
|
|
<p>One leading U+FEFF BYTE ORDER MARK character must be ignored if
|
|
any are present.</p>
|
|
|
|
<p class="note">The requirement to strip a U+FEFF BYTE ORDER MARK
|
|
character regardless of whether that character was used to determine
|
|
the byte order is a <a href="#willful-violation">willful violation</a> of Unicode,
|
|
motivated by a desire to increase the resilience of user agents in
|
|
the face of naïve transcoders.</p>
|
|
|
|
<p>Any occurrences of any characters in the ranges U+0001 to U+0008,
|
|
U+000E to U+001F, U+007F
|
|
to U+009F, U+FDD0
|
|
to U+FDEF, and characters U+000B, 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 <a href="#parse-error" title="parse error">parse
|
|
errors</a>. These are all control characters or permanently
|
|
undefined Unicode characters (noncharacters).</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="#tokenization">tokenization</a> stage.</p>
|
|
|
|
<p>The <dfn id="next-input-character">next input character</dfn> is the first character in the
|
|
input stream that has not yet been <dfn id="consumed">consumed</dfn>. Initially,
|
|
the <i><a href="#next-input-character">next input character</a></i> is the first character in the
|
|
input. The <dfn id="current-input-character">current input character</dfn> is the last character
|
|
to have been <i><a href="#consumed">consumed</a></i>.</p>
|
|
|
|
<p>The <dfn id="insertion-point">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"><a href="#dom-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
|
|
undefined.</p>
|
|
|
|
<p>The "EOF" character in the tables below is a conceptual character
|
|
representing the end of the <a href="#the-input-stream">input stream</a>. If the parser
|
|
is a <a href="#script-created-parser">script-created parser</a>, then the end of the
|
|
<a href="#the-input-stream">input stream</a> is reached when an <dfn id="explicit-eof-character">explicit "EOF"
|
|
character</dfn> (inserted by the <code title="dom-document-close"><a href="#dom-document-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-the-encoding-while-parsing"><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-the-encoding">change the
|
|
encoding</dfn>, it must run the following steps. This might happen
|
|
if the <a href="#encoding-sniffing-algorithm">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 identical or equivalent to the encoding
|
|
that is already being used to interpret the input stream, then set
|
|
the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> to
|
|
<i>certain</i> and abort these steps. This happens when the
|
|
encoding information found in the file matches what the
|
|
<a href="#encoding-sniffing-algorithm">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 the encoding that is already being used to interpret the
|
|
input stream is a UTF-16 encoding, then set the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> to
|
|
<i>certain</i> and abort these steps. The new encoding is ignored;
|
|
if it was anything but the same encoding, then it would be clearly
|
|
incorrect.</li>
|
|
|
|
<li>If the new encoding is a UTF-16 encoding, change it to
|
|
UTF-8.</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="#document-s-character-encoding">document's character encoding</a> and the encoding used to
|
|
convert the input stream to the new encoding, set the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> to
|
|
<i>certain</i>, and abort these steps.</li>
|
|
|
|
<li>Otherwise, <a href="#navigate">navigate</a> to the
|
|
document again, with <a href="#replacement-enabled">replacement enabled</a>, and using
|
|
the same <a href="#source-browsing-context">source browsing context</a>, but this time skip
|
|
the <a href="#encoding-sniffing-algorithm">encoding sniffing algorithm</a> and instead just set
|
|
the encoding to the new encoding and the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> to
|
|
<i>certain</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. If this is not possible and contacting the
|
|
network layer would involve repeating a request that uses a method
|
|
other than HTTP GET (<a href="#concept-http-equivalent-get" title="concept-http-equivalent-get">or
|
|
equivalent</a> for non-HTTP URLs), then instead set the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> to
|
|
<i>certain</i> and ignore the new encoding. The resource will be
|
|
misinterpreted. User agents may notify the user of the situation,
|
|
to aid in application development.</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h4 id="parse-state"><span class="secno">8.2.3 </span>Parse state</h4>
|
|
|
|
<h5 id="the-insertion-mode"><span class="secno">8.2.3.1 </span>The insertion mode</h5>
|
|
|
|
<p>The <dfn id="insertion-mode">insertion mode</dfn> is a state variable that controls
|
|
the primary operation of the tree construction stage.</p>
|
|
|
|
<p>Initially, the <a href="#insertion-mode">insertion mode</a> is "<a href="#the-initial-insertion-mode" title="insertion mode: initial">initial</a>". It can change to
|
|
"<a href="#the-before-html-insertion-mode" title="insertion mode: before html">before html</a>",
|
|
"<a href="#the-before-head-insertion-mode" title="insertion mode: before head">before head</a>",
|
|
"<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>", "<a href="#parsing-main-inheadnoscript" title="insertion mode: in head noscript">in head noscript</a>",
|
|
"<a href="#the-after-head-insertion-mode" title="insertion mode: after head">after head</a>", "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>", "<a href="#parsing-main-incdata" title="insertion mode: text">text</a>", "<a href="#parsing-main-intable" title="insertion
|
|
mode: in table">in table</a>", "<a href="#parsing-main-intabletext" title="insertion mode: in
|
|
table text">in table text</a>", "<a href="#parsing-main-incaption" title="insertion mode: in
|
|
caption">in caption</a>", "<a href="#parsing-main-incolgroup" title="insertion mode: in column
|
|
group">in column group</a>", "<a href="#parsing-main-intbody" title="insertion mode: in
|
|
table body">in table body</a>", "<a href="#parsing-main-intr" title="insertion mode: in
|
|
row">in row</a>", "<a href="#parsing-main-intd" title="insertion mode: in cell">in
|
|
cell</a>", "<a href="#parsing-main-inselect" title="insertion mode: in select">in
|
|
select</a>", "<a href="#parsing-main-inselectintable" title="insertion mode: in select in table">in
|
|
select in table</a>", "<a href="#parsing-main-afterbody" title="insertion mode: after
|
|
body">after body</a>", "<a href="#parsing-main-inframeset" title="insertion mode: in
|
|
frameset">in frameset</a>", "<a href="#parsing-main-afterframeset" title="insertion mode: after
|
|
frameset">after frameset</a>", "<a href="#the-after-after-body-insertion-mode" title="insertion mode:
|
|
after after body">after after body</a>", and "<a href="#the-after-after-frameset-insertion-mode" title="insertion mode: after after frameset">after after
|
|
frameset</a>" during the course of the parsing, as described in
|
|
the <a href="#tree-construction">tree construction</a> stage. The insertion mode affects
|
|
how tokens are processed and whether CDATA sections are
|
|
supported.</p>
|
|
|
|
<p>Several of these modes, namely "<a href="#parsing-main-inhead" title="insertion mode: in
|
|
head">in head</a>", "<a href="#parsing-main-inbody" title="insertion mode: in body">in
|
|
body</a>", "<a href="#parsing-main-intable" title="insertion mode: in table">in
|
|
table</a>", and "<a href="#parsing-main-inselect" title="insertion mode: in select">in
|
|
select</a>", are special, in that the other modes defer to them
|
|
at various times. When the algorithm below says that the user agent
|
|
is to do something "<dfn id="using-the-rules-for">using the rules for</dfn> the <var title="">m</var> insertion mode", where <var title="">m</var> is one
|
|
of these modes, the user agent must use the rules described under
|
|
the <var title="">m</var> <a href="#insertion-mode">insertion mode</a>'s section, but
|
|
must leave the <a href="#insertion-mode">insertion mode</a> unchanged unless the
|
|
rules in <var title="">m</var> themselves switch the <a href="#insertion-mode">insertion
|
|
mode</a> to a new value.</p>
|
|
|
|
<p>When the insertion mode is switched to "<a href="#parsing-main-incdata" title="insertion
|
|
mode: text">text</a>" or "<a href="#parsing-main-intabletext" title="insertion mode: in table
|
|
text">in table text</a>", the <dfn id="original-insertion-mode">original insertion mode</dfn>
|
|
is also set. This is the insertion mode to which the tree
|
|
construction stage will return.</p>
|
|
|
|
<hr><p>When the steps below require the UA to <dfn id="reset-the-insertion-mode-appropriately">reset the insertion
|
|
mode appropriately</dfn>, it means the UA must follow these
|
|
steps:</p>
|
|
|
|
<ol><li>Let <var title="">last</var> be false.</li>
|
|
|
|
<li>Let <var title="">node</var> be the last node in the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</li>
|
|
|
|
<li><i>Loop</i>: If <var title="">node</var> is the first node in
|
|
the stack of open elements, then set <var title="">last</var> to
|
|
true and set <var title="">node</var> to the <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element.
|
|
(<a href="#fragment-case">fragment case</a>)</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#the-select-element">select</a></code> element,
|
|
then switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inselect" title="insertion mode: in select">in select</a>" and abort these
|
|
steps. (<a href="#fragment-case">fragment case</a>)</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#the-td-element">td</a></code> or
|
|
<code><a href="#the-th-element">th</a></code> element and <var title="">last</var> is false, then
|
|
switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intd" title="insertion
|
|
mode: in cell">in cell</a>" and abort these steps.</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#the-tr-element">tr</a></code> element, then
|
|
switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intr" title="insertion
|
|
mode: in row">in row</a>" and abort these steps.</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#the-tbody-element">tbody</a></code>,
|
|
<code><a href="#the-thead-element">thead</a></code>, or <code><a href="#the-tfoot-element">tfoot</a></code> element, then switch the
|
|
<a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intbody" title="insertion mode: in
|
|
table body">in table body</a>" and abort these steps.</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#the-caption-element">caption</a></code> element,
|
|
then switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-incaption" title="insertion mode: in caption">in caption</a>" and abort
|
|
these steps.</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#the-colgroup-element">colgroup</a></code> element,
|
|
then switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-incolgroup" title="insertion mode: in column group">in column group</a>" and
|
|
abort these steps. (<a href="#fragment-case">fragment case</a>)</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#the-table-element">table</a></code> element,
|
|
then switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intable" title="insertion mode: in table">in table</a>" and abort these
|
|
steps.</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#the-head-element">head</a></code> element,
|
|
then switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" ("<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>"! <em> not "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>"</em>!) and abort
|
|
these steps. (<a href="#fragment-case">fragment case</a>)</li>
|
|
<li>If <var title="">node</var> is a <code><a href="#the-body-element">body</a></code> element,
|
|
then switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" and abort these
|
|
steps.</li>
|
|
|
|
<li>If <var title="">node</var> is a <code><a href="#frameset">frameset</a></code> element,
|
|
then switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inframeset" title="insertion mode: in frameset">in frameset</a>" and abort
|
|
these steps. (<a href="#fragment-case">fragment case</a>)</li>
|
|
|
|
<li>If <var title="">node</var> is an <code><a href="#the-html-element">html</a></code> element,
|
|
then switch the <a href="#insertion-mode">insertion mode</a>
|
|
to "<a href="#the-before-head-insertion-mode" title="insertion mode: before head">before
|
|
head</a>" Then, abort these steps. (<a href="#fragment-case">fragment
|
|
case</a>)</li>
|
|
<li>If <var title="">last</var> is true, then switch the
|
|
<a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inbody" title="insertion mode: in
|
|
body">in body</a>" and abort these steps. (<a href="#fragment-case">fragment
|
|
case</a>)</li>
|
|
|
|
<li>Let <var title="">node</var> now be the node before <var title="">node</var> in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</li>
|
|
|
|
<li>Return to the step labeled <i>loop</i>.</li>
|
|
|
|
</ol><h5 id="the-stack-of-open-elements"><span class="secno">8.2.3.2 </span>The stack of open elements</h5>
|
|
|
|
<p>Initially, the <dfn id="stack-of-open-elements">stack of open elements</dfn> 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 <a href="#adoptionAgency">the handling for misnested tags</a>).</p>
|
|
|
|
<p>The "<a href="#the-before-html-insertion-mode" title="insertion mode: before html">before
|
|
html</a>" <a href="#insertion-mode">insertion mode</a> creates the
|
|
<code><a href="#the-html-element">html</a></code> root element node, which is then added to the
|
|
stack.</p>
|
|
|
|
<p>In the <a href="#fragment-case">fragment case</a>, the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> is initialized to contain an <code><a href="#the-html-element">html</a></code>
|
|
element that is created as part of <a href="#html-fragment-parsing-algorithm" title="html fragment
|
|
parsing algorithm">that algorithm</a>. (The <a href="#fragment-case">fragment
|
|
case</a> skips the "<a href="#the-before-html-insertion-mode" title="insertion mode: before
|
|
html">before html</a>" <a href="#insertion-mode">insertion mode</a>.)</p>
|
|
|
|
<p>The <code><a href="#the-html-element">html</a></code> node, however it is created, is the topmost
|
|
node of the stack. It only gets popped off the stack when the parser
|
|
<a href="#stop-parsing" title="stop parsing">finishes</a>.</p>
|
|
|
|
<p>The <dfn id="current-node">current node</dfn> is the bottommost node in this
|
|
stack.</p>
|
|
|
|
<p>The <dfn id="current-table">current table</dfn> is the last <code><a href="#the-table-element">table</a></code>
|
|
element in the <a href="#stack-of-open-elements">stack of open elements</a>, if there is
|
|
one. If there is no <code><a href="#the-table-element">table</a></code> element in the <a href="#stack-of-open-elements">stack of
|
|
open elements</a> (<a href="#fragment-case">fragment case</a>), then the
|
|
<a href="#current-table">current table</a> is the first element in the <a href="#stack-of-open-elements">stack
|
|
of open elements</a> (the <code><a href="#the-html-element">html</a></code> element).</p>
|
|
|
|
<p>Elements in the stack fall into the following categories:</p>
|
|
|
|
<dl><dt><dfn id="special">Special</dfn></dt>
|
|
<dd><p>The following elements have varying levels of special
|
|
parsing rules: HTML's <code><a href="#the-address-element">address</a></code>, <code><a href="#the-applet-element">applet</a></code>,
|
|
<code><a href="#the-area-element">area</a></code>, <code><a href="#the-article-element">article</a></code>, <code><a href="#the-aside-element">aside</a></code>,
|
|
<code><a href="#the-base-element">base</a></code>, <code><a href="#basefont">basefont</a></code>, <code><a href="#bgsound">bgsound</a></code>,
|
|
<code><a href="#the-blockquote-element">blockquote</a></code>, <code><a href="#the-body-element">body</a></code>, <code><a href="#the-br-element">br</a></code>,
|
|
<code><a href="#the-button-element">button</a></code>, <code><a href="#the-caption-element">caption</a></code>, <code><a href="#center">center</a></code>,
|
|
<code><a href="#the-col-element">col</a></code>, <code><a href="#the-colgroup-element">colgroup</a></code>, <code><a href="#the-command-element">command</a></code>,
|
|
<code><a href="#the-dd-element">dd</a></code>, <code><a href="#the-details-element">details</a></code>, <code><a href="#dir">dir</a></code>,
|
|
<code><a href="#the-div-element">div</a></code>, <code><a href="#the-dl-element">dl</a></code>, <code><a href="#the-dt-element">dt</a></code>,
|
|
<code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-fieldset-element">fieldset</a></code>, <code><a href="#the-figcaption-element">figcaption</a></code>,
|
|
<code><a href="#the-figure-element">figure</a></code>, <code><a href="#the-footer-element">footer</a></code>, <code><a href="#the-form-element">form</a></code>,
|
|
<code><a href="#frame">frame</a></code>, <code><a href="#frameset">frameset</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>,
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>,
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code>, <code><a href="#the-head-element">head</a></code>, <code><a href="#the-header-element">header</a></code>,
|
|
<code><a href="#the-hgroup-element">hgroup</a></code>, <code><a href="#the-hr-element">hr</a></code>, <code><a href="#the-html-element">html</a></code>,
|
|
<code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, <code><a href="#the-input-element">input</a></code>,
|
|
<code><a href="#isindex-0">isindex</a></code>, <code><a href="#the-li-element">li</a></code>, <code><a href="#the-link-element">link</a></code>,
|
|
<code><a href="#listing">listing</a></code>, <code><a href="#the-marquee-element">marquee</a></code>, <code><a href="#the-menu-element">menu</a></code>,
|
|
<code><a href="#the-meta-element">meta</a></code>, <code><a href="#the-nav-element">nav</a></code>, <code><a href="#noembed">noembed</a></code>,
|
|
<code><a href="#noframes">noframes</a></code>, <code><a href="#the-noscript-element">noscript</a></code>, <code><a href="#the-object-element">object</a></code>,
|
|
<code><a href="#the-ol-element">ol</a></code>, <code><a href="#the-p-element">p</a></code>, <code><a href="#the-param-element">param</a></code>,
|
|
<code><a href="#plaintext">plaintext</a></code>, <code><a href="#the-pre-element">pre</a></code>, <code><a href="#the-script-element">script</a></code>,
|
|
<code><a href="#the-section-element">section</a></code>, <code><a href="#the-select-element">select</a></code>, <code><a href="#the-style-element">style</a></code>,
|
|
<code><a href="#the-summary-element">summary</a></code>, <code><a href="#the-table-element">table</a></code>, <code><a href="#the-tbody-element">tbody</a></code>,
|
|
<code><a href="#the-td-element">td</a></code>, <code><a href="#the-textarea-element">textarea</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>,
|
|
<code><a href="#the-th-element">th</a></code>, <code><a href="#the-thead-element">thead</a></code>, <code><a href="#the-title-element">title</a></code>,
|
|
<code><a href="#the-tr-element">tr</a></code>, <code><a href="#the-ul-element">ul</a></code>, <code><a href="#the-wbr-element">wbr</a></code>, and
|
|
<code><a href="#xmp">xmp</a></code>; MathML's <code title="">mi</code>, <code title="">mo</code>, <code title="">mn</code>, <code title="">ms</code>, <code title="">mtext</code>, and <code title="">annotation-xml</code>; and SVG's <code title="">foreignObject</code>, <code title="">desc</code>, and
|
|
<code title="">title</code>.</dd>
|
|
<dt><dfn id="formatting">Formatting</dfn></dt>
|
|
<dd><p>The following HTML elements are those that end up in the
|
|
<a href="#list-of-active-formatting-elements">list of active formatting elements</a>: <code><a href="#the-a-element">a</a></code>,
|
|
<code><a href="#the-b-element">b</a></code>, <code><a href="#big">big</a></code>, <code><a href="#the-code-element">code</a></code>,
|
|
<code><a href="#the-em-element">em</a></code>, <code><a href="#font">font</a></code>, <code><a href="#the-i-element">i</a></code>,
|
|
<code><a href="#nobr">nobr</a></code>, <code><a href="#the-s-element">s</a></code>, <code><a href="#the-small-element">small</a></code>,
|
|
<code><a href="#strike">strike</a></code>, <code><a href="#the-strong-element">strong</a></code>, <code><a href="#tt">tt</a></code>, and
|
|
<code><a href="#the-u-element">u</a></code>.</dd>
|
|
|
|
<dt><dfn id="ordinary">Ordinary</dfn></dt>
|
|
<dd><p>All other elements found while parsing an HTML
|
|
document.</dd>
|
|
|
|
</dl><p>The <a href="#stack-of-open-elements">stack of open elements</a> is said to <dfn id="has-an-element-in-the-specific-scope" title="has an element in the specific scope">have an element in a
|
|
specific scope</dfn> consisting of a list of element types <var title="">list</var> when the following algorithm terminates in a
|
|
match state:</p>
|
|
|
|
<ol><li><p>Initialize <var title="">node</var> to be the <a href="#current-node">current
|
|
node</a> (the bottommost node of the stack).</li>
|
|
|
|
<li><p>If <var title="">node</var> is the target node, terminate in
|
|
a match state.</li>
|
|
|
|
<li><p>Otherwise, if <var title="">node</var> is one of the element
|
|
types in <var title="">list</var>, terminate in a failure
|
|
state.</li>
|
|
|
|
<li><p>Otherwise, set <var title="">node</var> to the previous
|
|
entry in the <a href="#stack-of-open-elements">stack of open elements</a> 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 — an
|
|
<code><a href="#the-html-element">html</a></code> element — is reached.)</li>
|
|
|
|
</ol><p>The <a href="#stack-of-open-elements">stack of open elements</a> is said to <dfn id="has-an-element-in-scope" title="has an element in scope">have an element in scope</dfn> when
|
|
it <a href="#has-an-element-in-the-specific-scope">has an element in the specific scope</a> consisting
|
|
of the following element types:</p>
|
|
|
|
<ul class="brief"><li><code><a href="#the-applet-element">applet</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-caption-element">caption</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-html-element">html</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-table-element">table</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-td-element">td</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-th-element">th</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-marquee-element">marquee</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-object-element">object</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code title="">mi</code> in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li><code title="">mo</code> in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li><code title="">mn</code> in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li><code title="">ms</code> in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li><code title="">mtext</code> in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li><code title="">annotation-xml</code> in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li><code title="">foreignObject</code> in the <a href="#svg-namespace">SVG namespace</a></li>
|
|
<li><code title="">desc</code> in the <a href="#svg-namespace">SVG namespace</a></li>
|
|
<li><code title="">title</code> in the <a href="#svg-namespace">SVG namespace</a></li>
|
|
</ul><p>The <a href="#stack-of-open-elements">stack of open elements</a> is said to <dfn id="has-an-element-in-list-item-scope" title="has an element in list item scope">have an element in list
|
|
item scope</dfn> when it <a href="#has-an-element-in-the-specific-scope">has an element in the specific
|
|
scope</a> consisting of the following element types:</p>
|
|
|
|
<ul class="brief"><li>All the element types listed above for the <i><a href="#has-an-element-in-scope">has an element
|
|
in scope</a></i> algorithm.</li>
|
|
<li><code><a href="#the-ol-element">ol</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-ul-element">ul</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
</ul><p>The <a href="#stack-of-open-elements">stack of open elements</a> is said to <dfn id="has-an-element-in-button-scope" title="has an element in button scope">have an element in button
|
|
scope</dfn> when it <a href="#has-an-element-in-the-specific-scope">has an element in the specific
|
|
scope</a> consisting of the following element types:</p>
|
|
|
|
<ul class="brief"><li>All the element types listed above for the <i><a href="#has-an-element-in-scope">has an element
|
|
in scope</a></i> algorithm.</li>
|
|
<li><code><a href="#the-button-element">button</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
</ul><p>The <a href="#stack-of-open-elements">stack of open elements</a> is said to <dfn id="has-an-element-in-table-scope" title="has an element in table scope">have an element in table
|
|
scope</dfn> when it <a href="#has-an-element-in-the-specific-scope">has an element in the specific
|
|
scope</a> consisting of the following element types:</p>
|
|
|
|
<ul class="brief"><li><code><a href="#the-html-element">html</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-table-element">table</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
</ul><p>The <a href="#stack-of-open-elements">stack of open elements</a> is said to <dfn id="has-an-element-in-select-scope" title="has an element in select scope">have an element in select
|
|
scope</dfn> when it <a href="#has-an-element-in-the-specific-scope">has an element in the specific
|
|
scope</a> consisting of all element types <em>except</em> the
|
|
following:</p>
|
|
|
|
<ul class="brief"><li><code><a href="#the-optgroup-element">optgroup</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
<li><code><a href="#the-option-element">option</a></code> in the <a href="#html-namespace-0">HTML namespace</a></li>
|
|
</ul><p>Nothing happens if at any time any of the elements in the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> are moved to a new location in,
|
|
or removed from, the <code><a href="#document">Document</a></code> 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.</p>
|
|
|
|
<p class="note">In some cases (namely, when <a href="#adoptionAgency">closing misnested formatting elements</a>),
|
|
the stack is manipulated in a random-access fashion.</p>
|
|
|
|
|
|
<h5 id="the-list-of-active-formatting-elements"><span class="secno">8.2.3.3 </span>The list of active formatting elements</h5>
|
|
|
|
<p>Initially, the <dfn id="list-of-active-formatting-elements">list of active formatting elements</dfn> is
|
|
empty. It is used to handle mis-nested <a href="#formatting" title="formatting">formatting element tags</a>.</p>
|
|
|
|
<p>The list contains elements in the <a href="#formatting">formatting</a>
|
|
category, and scope markers. The scope markers are inserted when
|
|
entering <code><a href="#the-applet-element">applet</a></code> elements, buttons, <code><a href="#the-object-element">object</a></code>
|
|
elements, marquees, table cells, and table captions, and are used to
|
|
prevent formatting from "leaking" <em>into</em> <code><a href="#the-applet-element">applet</a></code>
|
|
elements, buttons, <code><a href="#the-object-element">object</a></code> elements, marquees, and
|
|
tables.</p>
|
|
|
|
<p class="note">The scope markers are unrelated to the concept of an
|
|
element being <a href="#has-an-element-in-scope" title="has an element in scope">in
|
|
scope</a>.</p>
|
|
|
|
<p>In addition, each element in the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a> is associated with the token for which it was
|
|
created, so that further elements can be created for that token if
|
|
necessary.</p>
|
|
|
|
<p>When the steps below require the UA to <dfn id="push-onto-the-list-of-active-formatting-elements">push onto the list of
|
|
active formatting elements</dfn> an element <var title="">element</var>, the UA must perform the following steps:</p>
|
|
|
|
<ol><li><p>If there are already three elements in the <a href="#list-of-active-formatting-elements">list of
|
|
active formatting elements</a> after the last list marker, if
|
|
any, or anywhere in the list if there are no list markers, that
|
|
have the same tag name, namespace, and attributes as <var title="">element</var>, then remove the earliest such element from
|
|
the <a href="#list-of-active-formatting-elements">list of active formatting elements</a>. For these
|
|
purposes, the attributes must be compared as they were when the
|
|
elements were created by the parser; two elements have the same
|
|
attributes if all their parsed attributes can be paired such that
|
|
the two attributes in each pair have identical names, namespaces,
|
|
and values (the order of the attributes does not matter).</p>
|
|
|
|
<p class="note">This is the Noah's Ark clause. But with three per
|
|
family instead of two.</li>
|
|
<li><p>Add <var title="">element</var> to the <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a>.</li>
|
|
|
|
</ol><p>When the steps below require the UA to <dfn id="reconstruct-the-active-formatting-elements">reconstruct the
|
|
active formatting elements</dfn>, the UA must perform the following
|
|
steps:</p>
|
|
|
|
<ol><li>If there are no entries in the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a>, then there is nothing to reconstruct; stop this
|
|
algorithm.</li>
|
|
|
|
<li>If the last (most recently added) entry in the <a href="#list-of-active-formatting-elements">list of
|
|
active formatting elements</a> is a marker, or if it is an
|
|
element that is in the <a href="#stack-of-open-elements">stack of open elements</a>, then
|
|
there is nothing to reconstruct; stop this algorithm.</li>
|
|
|
|
<li>Let <var title="">entry</var> be the last (most recently added)
|
|
element in the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a>.</li>
|
|
|
|
<li>If there are no entries before <var title="">entry</var> in the
|
|
<a href="#list-of-active-formatting-elements">list of active formatting elements</a>, then jump to step
|
|
8.</li>
|
|
|
|
<li>Let <var title="">entry</var> be the entry one earlier than
|
|
<var title="">entry</var> in the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a>.</li>
|
|
|
|
<li>If <var title="">entry</var> is neither a marker nor an element
|
|
that is also in the <a href="#stack-of-open-elements">stack of open elements</a>, go to step
|
|
4.</li>
|
|
|
|
<li>Let <var title="">entry</var> be the element one later than
|
|
<var title="">entry</var> in the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a>.</li>
|
|
|
|
<li><a href="#create-an-element-for-the-token">Create an element for the token</a> for which the
|
|
element <var title="">entry</var> was created, to obtain <var title="">new element</var>.</li>
|
|
|
|
<li>Append <var title="">new element</var> to the <a href="#current-node">current
|
|
node</a> and push it onto the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> so that it is the new <a href="#current-node">current
|
|
node</a>.</li>
|
|
|
|
<li>Replace the entry for <var title="">entry</var> in the list
|
|
with an entry for <var title="">new element</var>.</li>
|
|
|
|
<li>If the entry for <var title="">new element</var> in the
|
|
<a href="#list-of-active-formatting-elements">list of active formatting elements</a> is not the last
|
|
entry in the list, return to step 7.</li>
|
|
|
|
</ol><p>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.</p>
|
|
|
|
<p class="note">The way this specification is written, the
|
|
<a href="#list-of-active-formatting-elements">list of active formatting elements</a> 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).</p>
|
|
|
|
<p>When the steps below require the UA to <dfn id="clear-the-list-of-active-formatting-elements-up-to-the-last-marker">clear the list of
|
|
active formatting elements up to the last marker</dfn>, the UA must
|
|
perform the following steps:</p>
|
|
|
|
<ol><li>Let <var title="">entry</var> be the last (most recently added)
|
|
entry in the <a href="#list-of-active-formatting-elements">list of active formatting elements</a>.</li>
|
|
|
|
<li>Remove <var title="">entry</var> from the <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a>.</li>
|
|
|
|
<li>If <var title="">entry</var> was a marker, then stop the
|
|
algorithm at this point. The list has been cleared up to the last
|
|
marker.</li>
|
|
|
|
<li>Go to step 1.</li>
|
|
|
|
</ol><h5 id="the-element-pointers"><span class="secno">8.2.3.4 </span>The element pointers</h5>
|
|
|
|
<p>Initially, the <dfn id="head-element-pointer"><code title="">head</code> element
|
|
pointer</dfn> and the <dfn id="form-element-pointer"><code title="">form</code> element
|
|
pointer</dfn> are both null.</p>
|
|
|
|
<p>Once a <code><a href="#the-head-element">head</a></code> element has been parsed (whether
|
|
implicitly or explicitly) the <a href="#head-element-pointer"><code title="">head</code>
|
|
element pointer</a> gets set to point to this node.</p>
|
|
|
|
<p>The <a href="#form-element-pointer"><code title="">form</code> element pointer</a>
|
|
points to the last <code><a href="#the-form-element">form</a></code> 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.</p>
|
|
|
|
|
|
<h5 id="other-parsing-state-flags"><span class="secno">8.2.3.5 </span>Other parsing state flags</h5>
|
|
|
|
<p>The <dfn id="scripting-flag">scripting flag</dfn> is set to "enabled" if <a href="#concept-n-script" title="concept-n-script">scripting was enabled</a> for the
|
|
<code><a href="#document">Document</a></code> with which the parser is associated when the
|
|
parser was created, and "disabled" otherwise.</p>
|
|
|
|
<p class="note">The <a href="#scripting-flag">scripting flag</a> can be enabled even
|
|
when the parser was originally created for the <a href="#html-fragment-parsing-algorithm">HTML fragment
|
|
parsing algorithm</a>, even though <code><a href="#the-script-element">script</a></code> elements
|
|
don't execute in that case.</p>
|
|
|
|
<p>The <dfn id="frameset-ok-flag">frameset-ok flag</dfn> is set to "ok" when the parser is
|
|
created. It is set to "not ok" after certain tokens are seen.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="tokenization"><span class="secno">8.2.4 </span><dfn>Tokenization</dfn></h4>
|
|
|
|
<p>Implementations must act as if they used the following state
|
|
machine to tokenize 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 behavior and can consume several characters
|
|
before switching to another state. In some cases, the tokenizer
|
|
state is also changed by the tree construction stage.</p>
|
|
|
|
<p>The exact behavior of certain states depends on the
|
|
<a href="#insertion-mode">insertion mode</a> and the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>. Certain states also use a <dfn id="temporary-buffer"><var>temporary
|
|
buffer</var></dfn> to track progress.</p>
|
|
|
|
<p>The output of the tokenization 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 <i>force-quirks
|
|
flag</i>. When a DOCTYPE token is created, its name, public
|
|
identifier, and system identifier must be marked as missing (which
|
|
is a distinct state from the empty string), and the <i>force-quirks
|
|
flag</i> must be set to <i>off</i> (its other state is
|
|
<i>on</i>). Start and end tag tokens have a tag name, a
|
|
<i>self-closing flag</i>, and a list of attributes, each of which
|
|
has a name and a value. When a start or end tag token is created,
|
|
its <i>self-closing flag</i> must be unset (its other state is that
|
|
it be set), and its attributes list must be empty. Comment and
|
|
character tokens have data.</p>
|
|
|
|
<p>When a token is emitted, it must immediately be handled by the
|
|
<a href="#tree-construction">tree construction</a> stage. The tree construction stage
|
|
can affect the state of the tokenization stage, and can insert
|
|
additional characters into the stream. (For example, the
|
|
<code><a href="#the-script-element">script</a></code> element can result in scripts executing and
|
|
using the <a href="#dynamic-markup-insertion">dynamic markup insertion</a> APIs to insert
|
|
characters into the stream being tokenized.)</p>
|
|
|
|
<p>When a start tag token is emitted with its <i>self-closing
|
|
flag</i> set, if the flag is not <dfn id="acknowledge-self-closing-flag" title="acknowledge
|
|
self-closing flag">acknowledged</dfn> when it is processed by the
|
|
tree construction stage, that is a <a href="#parse-error">parse error</a>.</p>
|
|
|
|
<p>When an end tag token is emitted with attributes, that is a
|
|
<a href="#parse-error">parse error</a>.</p>
|
|
|
|
<p>When an end tag token is emitted with its <i>self-closing
|
|
flag</i> set, that is a <a href="#parse-error">parse error</a>.</p>
|
|
|
|
<p>An <dfn id="appropriate-end-tag-token">appropriate end tag token</dfn> is an end tag token whose
|
|
tag name matches the tag name of the last start tag to have been
|
|
emitted from this tokenizer, if any. If no start tag has been
|
|
emitted from this tokenizer, then no end tag token is
|
|
appropriate.</p>
|
|
|
|
<p>Before each step of the tokenizer, the user agent must first
|
|
check the <a href="#parser-pause-flag">parser pause flag</a>. If it is true, then the
|
|
tokenizer must abort the processing of any nested invocations of the
|
|
tokenizer, yielding control back to the caller.</p>
|
|
|
|
<p>The tokenizer state machine consists of the states defined in the
|
|
following subsections.</p>
|
|
|
|
|
|
|
|
|
|
<h5 id="data-state"><span class="secno">8.2.4.1 </span><dfn>Data state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0026 AMPERSAND (&)</dt>
|
|
<dd>Switch to the <a href="#character-reference-in-data-state">character reference in data
|
|
state</a>.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#tag-open-state">tag open state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Emit the <a href="#current-input-character">current input
|
|
character</a> as a character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd>Emit an end-of-file token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit the <a href="#current-input-character">current input character</a> as a character
|
|
token.</dd>
|
|
|
|
</dl><h5 id="character-reference-in-data-state"><span class="secno">8.2.4.2 </span><dfn>Character reference in data state</dfn></h5>
|
|
|
|
<p>Attempt to <a href="#consume-a-character-reference">consume a character reference</a>, with no
|
|
<a href="#additional-allowed-character">additional allowed character</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>
|
|
|
|
|
|
<h5 id="rcdata-state"><span class="secno">8.2.4.3 </span><dfn>RCDATA state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0026 AMPERSAND (&)</dt>
|
|
<dd>Switch to the <a href="#character-reference-in-rcdata-state">character reference in RCDATA
|
|
state</a>.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#rcdata-less-than-sign-state">RCDATA less-than sign state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Emit a U+FFFD REPLACEMENT CHARACTER
|
|
character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd>Emit an end-of-file token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit the <a href="#current-input-character">current input character</a> as a character
|
|
token.</dd>
|
|
|
|
</dl><h5 id="character-reference-in-rcdata-state"><span class="secno">8.2.4.4 </span><dfn>Character reference in RCDATA state</dfn></h5>
|
|
|
|
<p>Attempt to <a href="#consume-a-character-reference">consume a character reference</a>, with no
|
|
<a href="#additional-allowed-character">additional allowed character</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="#rcdata-state">RCDATA state</a>.</p>
|
|
|
|
|
|
<h5 id="rawtext-state"><span class="secno">8.2.4.5 </span><dfn>RAWTEXT state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#rawtext-less-than-sign-state">RAWTEXT less-than sign state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Emit a U+FFFD REPLACEMENT CHARACTER
|
|
character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd>Emit an end-of-file token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit the <a href="#current-input-character">current input character</a> as a character
|
|
token.</dd>
|
|
|
|
</dl><h5 id="script-data-state"><span class="secno">8.2.4.6 </span><dfn>Script data state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#script-data-less-than-sign-state">script data less-than sign state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Emit a U+FFFD REPLACEMENT CHARACTER
|
|
character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd>Emit an end-of-file token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit the <a href="#current-input-character">current input character</a> as a character
|
|
token.</dd>
|
|
|
|
</dl><h5 id="plaintext-state"><span class="secno">8.2.4.7 </span><dfn>PLAINTEXT state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Emit a U+FFFD REPLACEMENT CHARACTER
|
|
character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd>Emit an end-of-file token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit the <a href="#current-input-character">current input character</a> as a character
|
|
token.</dd>
|
|
|
|
</dl><h5 id="tag-open-state"><span class="secno">8.2.4.8 </span><dfn>Tag open state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0021 EXCLAMATION MARK (!)</dt>
|
|
<dd>Switch to the <a href="#markup-declaration-open-state">markup declaration open state</a>.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Switch to the <a href="#end-tag-open-state">end 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 <a href="#current-input-character">current input character</a> (add 0x0020 to the
|
|
character's code point), then switch to the <a href="#tag-name-state">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
|
|
<a href="#current-input-character">current input character</a>, then switch to the <a href="#tag-name-state">tag
|
|
name state</a>. (Don't emit the token yet; further details will
|
|
be filled in before it is emitted.)</dd>
|
|
|
|
<dt>U+003F QUESTION MARK (?)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#bogus-comment-state">bogus
|
|
comment state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Emit a U+003C LESS-THAN SIGN
|
|
character token and reconsume the <a href="#current-input-character">current input
|
|
character</a> in the <a href="#data-state">data state</a>.</dd>
|
|
|
|
</dl><h5 id="end-tag-open-state"><span class="secno">8.2.4.9 </span><dfn>End tag open state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">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 <a href="#current-input-character">current input character</a> (add 0x0020 to
|
|
the character's code point), then switch to the <a href="#tag-name-state">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
|
|
<a href="#current-input-character">current input character</a>, then switch to the <a href="#tag-name-state">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="#parse-error">Parse error</a>. Switch to the <a href="#data-state">data
|
|
state</a>.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">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="#parse-error">Parse error</a>. Switch to the <a href="#bogus-comment-state">bogus
|
|
comment state</a>.</dd>
|
|
|
|
</dl><h5 id="tag-name-state"><span class="secno">8.2.4.10 </span><dfn>Tag name state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#before-attribute-name-state">before attribute name state</a>.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Switch to the <a href="#self-closing-start-tag-state">self-closing start tag state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current tag
|
|
token.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
current tag token's tag name.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current tag token's tag name.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
tag token's tag name.</dd>
|
|
|
|
</dl><h5 id="rcdata-less-than-sign-state"><span class="secno">8.2.4.11 </span><dfn>RCDATA less-than sign state</dfn></h5>
|
|
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Set the <var><a href="#temporary-buffer">temporary buffer</a></var> to the empty string. Switch
|
|
to the <a href="#rcdata-end-tag-open-state">RCDATA end tag open state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token and reconsume the
|
|
<a href="#current-input-character">current input character</a> in the <a href="#rcdata-state">RCDATA
|
|
state</a>.</dd>
|
|
|
|
</dl><h5 id="rcdata-end-tag-open-state"><span class="secno">8.2.4.12 </span><dfn>RCDATA end tag open state</dfn></h5>
|
|
|
|
|
|
<p>Consume the <a href="#next-input-character">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, and set its tag name to the
|
|
lowercase version of the <a href="#current-input-character">current input character</a> (add
|
|
0x0020 to the character's code point). Append the <a href="#current-input-character">current
|
|
input character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>. Finally,
|
|
switch to the <a href="#rcdata-end-tag-name-state">RCDATA end 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, and set its tag name to the
|
|
<a href="#current-input-character">current input character</a>. Append the <a href="#current-input-character">current
|
|
input character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>. Finally,
|
|
switch to the <a href="#rcdata-end-tag-name-state">RCDATA end tag name state</a>. (Don't emit
|
|
the token yet; further details will be filled in before it is
|
|
emitted.)</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS
|
|
character token, and reconsume the <a href="#current-input-character">current input
|
|
character</a> in the <a href="#rcdata-state">RCDATA state</a>.</dd>
|
|
|
|
</dl><h5 id="rcdata-end-tag-name-state"><span class="secno">8.2.4.13 </span><dfn>RCDATA end tag name state</dfn></h5>
|
|
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then switch to the <a href="#before-attribute-name-state">before attribute name
|
|
state</a>. Otherwise, treat it as per the "anything else" entry
|
|
below.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then switch to the <a href="#self-closing-start-tag-state">self-closing start tag
|
|
state</a>. Otherwise, treat it as per the "anything else" entry
|
|
below.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then emit the current tag token and switch to the
|
|
<a href="#data-state">data state</a>. Otherwise, treat it as per the "anything
|
|
else" entry below.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
current tag token's tag name. Append the <a href="#current-input-character">current input
|
|
character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>.</dd>
|
|
|
|
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
tag token's tag name. Append the <a href="#current-input-character">current input
|
|
character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS
|
|
character token, a character token for each of the characters in
|
|
the <var><a href="#temporary-buffer">temporary buffer</a></var> (in the order they were added to
|
|
the buffer), and reconsume the <a href="#current-input-character">current input character</a>
|
|
in the <a href="#rcdata-state">RCDATA state</a>.</dd>
|
|
|
|
</dl><h5 id="rawtext-less-than-sign-state"><span class="secno">8.2.4.14 </span><dfn>RAWTEXT less-than sign state</dfn></h5>
|
|
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Set the <var><a href="#temporary-buffer">temporary buffer</a></var> to the empty string. Switch
|
|
to the <a href="#rawtext-end-tag-open-state">RAWTEXT end tag open state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token and reconsume the
|
|
<a href="#current-input-character">current input character</a> in the <a href="#rawtext-state">RAWTEXT
|
|
state</a>.</dd>
|
|
|
|
</dl><h5 id="rawtext-end-tag-open-state"><span class="secno">8.2.4.15 </span><dfn>RAWTEXT end tag open state</dfn></h5>
|
|
|
|
|
|
<p>Consume the <a href="#next-input-character">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, and set its tag name to the
|
|
lowercase version of the <a href="#current-input-character">current input character</a> (add
|
|
0x0020 to the character's code point). Append the <a href="#current-input-character">current
|
|
input character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>. Finally,
|
|
switch to the <a href="#rawtext-end-tag-name-state">RAWTEXT end 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, and set its tag name to the
|
|
<a href="#current-input-character">current input character</a>. Append the <a href="#current-input-character">current
|
|
input character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>. Finally,
|
|
switch to the <a href="#rawtext-end-tag-name-state">RAWTEXT end tag name state</a>. (Don't emit
|
|
the token yet; further details will be filled in before it is
|
|
emitted.)</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS
|
|
character token, and reconsume the <a href="#current-input-character">current input
|
|
character</a> in the <a href="#rawtext-state">RAWTEXT state</a>.</dd>
|
|
|
|
</dl><h5 id="rawtext-end-tag-name-state"><span class="secno">8.2.4.16 </span><dfn>RAWTEXT end tag name state</dfn></h5>
|
|
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then switch to the <a href="#before-attribute-name-state">before attribute name
|
|
state</a>. Otherwise, treat it as per the "anything else" entry
|
|
below.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then switch to the <a href="#self-closing-start-tag-state">self-closing start tag
|
|
state</a>. Otherwise, treat it as per the "anything else" entry
|
|
below.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then emit the current tag token and switch to the
|
|
<a href="#data-state">data state</a>. Otherwise, treat it as per the "anything
|
|
else" entry below.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
current tag token's tag name. Append the <a href="#current-input-character">current input
|
|
character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>.</dd>
|
|
|
|
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
tag token's tag name. Append the <a href="#current-input-character">current input
|
|
character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS
|
|
character token, a character token for each of the characters in
|
|
the <var><a href="#temporary-buffer">temporary buffer</a></var> (in the order they were added to
|
|
the buffer), and reconsume the <a href="#current-input-character">current input character</a>
|
|
in the <a href="#rawtext-state">RAWTEXT state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-less-than-sign-state"><span class="secno">8.2.4.17 </span><dfn>Script data less-than sign state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Set the <var><a href="#temporary-buffer">temporary buffer</a></var> to the empty string. Switch
|
|
to the <a href="#script-data-end-tag-open-state">script data end tag open state</a>.</dd>
|
|
|
|
<dt>U+0021 EXCLAMATION MARK (!)</dt>
|
|
<dd>Switch to the <a href="#script-data-escape-start-state">script data escape start state</a>. Emit
|
|
a U+003C LESS-THAN SIGN character token and a U+0021 EXCLAMATION
|
|
MARK character token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token and reconsume the
|
|
<a href="#current-input-character">current input character</a> in the <a href="#script-data-state">script data
|
|
state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-end-tag-open-state"><span class="secno">8.2.4.18 </span><dfn>Script data end tag open state</dfn></h5>
|
|
|
|
|
|
<p>Consume the <a href="#next-input-character">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, and set its tag name to the
|
|
lowercase version of the <a href="#current-input-character">current input character</a> (add
|
|
0x0020 to the character's code point). Append the <a href="#current-input-character">current
|
|
input character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>. Finally,
|
|
switch to the <a href="#script-data-end-tag-name-state">script data end 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, and set its tag name to the
|
|
<a href="#current-input-character">current input character</a>. Append the <a href="#current-input-character">current
|
|
input character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>. Finally,
|
|
switch to the <a href="#script-data-end-tag-name-state">script data end tag name state</a>. (Don't emit
|
|
the token yet; further details will be filled in before it is
|
|
emitted.)</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS
|
|
character token, and reconsume the <a href="#current-input-character">current input
|
|
character</a> in the <a href="#script-data-state">script data state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-end-tag-name-state"><span class="secno">8.2.4.19 </span><dfn>Script data end tag name state</dfn></h5>
|
|
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then switch to the <a href="#before-attribute-name-state">before attribute name
|
|
state</a>. Otherwise, treat it as per the "anything else" entry
|
|
below.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then switch to the <a href="#self-closing-start-tag-state">self-closing start tag
|
|
state</a>. Otherwise, treat it as per the "anything else" entry
|
|
below.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then emit the current tag token and switch to the
|
|
<a href="#data-state">data state</a>. Otherwise, treat it as per the "anything
|
|
else" entry below.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
current tag token's tag name. Append the <a href="#current-input-character">current input
|
|
character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>.</dd>
|
|
|
|
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
tag token's tag name. Append the <a href="#current-input-character">current input
|
|
character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS
|
|
character token, a character token for each of the characters in
|
|
the <var><a href="#temporary-buffer">temporary buffer</a></var> (in the order they were added to
|
|
the buffer), and reconsume the <a href="#current-input-character">current input character</a>
|
|
in the <a href="#script-data-state">script data state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-escape-start-state"><span class="secno">8.2.4.20 </span><dfn>Script data escape start state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#script-data-escape-start-dash-state">script data escape start dash
|
|
state</a>. Emit a U+002D HYPHEN-MINUS character token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Reconsume the <a href="#current-input-character">current input character</a> in the
|
|
<a href="#script-data-state">script data state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-escape-start-dash-state"><span class="secno">8.2.4.21 </span><dfn>Script data escape start dash state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#script-data-escaped-dash-dash-state">script data escaped dash dash
|
|
state</a>. Emit a U+002D HYPHEN-MINUS character token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Reconsume the <a href="#current-input-character">current input character</a> in the
|
|
<a href="#script-data-state">script data state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-escaped-state"><span class="secno">8.2.4.22 </span><dfn>Script data escaped state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#script-data-escaped-dash-state">script data escaped dash state</a>. Emit
|
|
a U+002D HYPHEN-MINUS character token.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#script-data-escaped-less-than-sign-state">script data escaped less-than sign
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Emit a U+FFFD REPLACEMENT CHARACTER
|
|
character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit the <a href="#current-input-character">current input character</a> as a character
|
|
token.</dd>
|
|
|
|
</dl><h5 id="script-data-escaped-dash-state"><span class="secno">8.2.4.23 </span><dfn>Script data escaped dash state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#script-data-escaped-dash-dash-state">script data escaped dash dash
|
|
state</a>. Emit a U+002D HYPHEN-MINUS character token.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#script-data-escaped-less-than-sign-state">script data escaped less-than sign
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#script-data-escaped-state">script data
|
|
escaped state</a>. Emit a U+FFFD REPLACEMENT CHARACTER character
|
|
token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Switch to the <a href="#script-data-escaped-state">script data escaped state</a>. Emit the
|
|
<a href="#current-input-character">current input character</a> as a character token.</dd>
|
|
|
|
</dl><h5 id="script-data-escaped-dash-dash-state"><span class="secno">8.2.4.24 </span><dfn>Script data escaped dash dash state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Emit a U+002D HYPHEN-MINUS character token.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#script-data-escaped-less-than-sign-state">script data escaped less-than sign
|
|
state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#script-data-state">script data state</a>. Emit a U+003E
|
|
GREATER-THAN SIGN character token.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#script-data-escaped-state">script data
|
|
escaped state</a>. Emit a U+FFFD REPLACEMENT CHARACTER character
|
|
token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Switch to the <a href="#script-data-escaped-state">script data escaped state</a>. Emit the
|
|
<a href="#current-input-character">current input character</a> as a character token.</dd>
|
|
|
|
</dl><h5 id="script-data-escaped-less-than-sign-state"><span class="secno">8.2.4.25 </span><dfn>Script data escaped less-than sign state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Set the <var><a href="#temporary-buffer">temporary buffer</a></var> to the empty string. Switch
|
|
to the <a href="#script-data-escaped-end-tag-open-state">script data escaped end tag open state</a>.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Set the <var><a href="#temporary-buffer">temporary buffer</a></var> to the empty string. Append
|
|
the lowercase version of the <a href="#current-input-character">current input character</a>
|
|
(add 0x0020 to the character's code point) to the <var><a href="#temporary-buffer">temporary
|
|
buffer</a></var>. Switch to the <a href="#script-data-double-escape-start-state">script data double escape start
|
|
state</a>. Emit a U+003C LESS-THAN SIGN character token and the
|
|
<a href="#current-input-character">current input character</a> as a character token.</dd>
|
|
|
|
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
|
|
<dd>Set the <var><a href="#temporary-buffer">temporary buffer</a></var> to the empty string. Append
|
|
the <a href="#current-input-character">current input character</a> to the <var><a href="#temporary-buffer">temporary
|
|
buffer</a></var>. Switch to the <a href="#script-data-double-escape-start-state">script data double escape start
|
|
state</a>. Emit a U+003C LESS-THAN SIGN character token and the
|
|
<a href="#current-input-character">current input character</a> as a character token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token and reconsume the
|
|
<a href="#current-input-character">current input character</a> in the <a href="#script-data-escaped-state">script data
|
|
escaped state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-escaped-end-tag-open-state"><span class="secno">8.2.4.26 </span><dfn>Script data escaped end tag open state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">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, and set its tag name to the
|
|
lowercase version of the <a href="#current-input-character">current input character</a> (add
|
|
0x0020 to the character's code point). Append the <a href="#current-input-character">current
|
|
input character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>. Finally,
|
|
switch to the <a href="#script-data-escaped-end-tag-name-state">script data escaped end 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, and set its tag name to the
|
|
<a href="#current-input-character">current input character</a>. Append the <a href="#current-input-character">current
|
|
input character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>. Finally,
|
|
switch to the <a href="#script-data-escaped-end-tag-name-state">script data escaped end tag name
|
|
state</a>. (Don't emit the token yet; further details will be
|
|
filled in before it is emitted.)</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS
|
|
character token, and reconsume the <a href="#current-input-character">current input
|
|
character</a> in the <a href="#script-data-escaped-state">script data escaped state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-escaped-end-tag-name-state"><span class="secno">8.2.4.27 </span><dfn>Script data escaped end tag name state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then switch to the <a href="#before-attribute-name-state">before attribute name
|
|
state</a>. Otherwise, treat it as per the "anything else" entry
|
|
below.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then switch to the <a href="#self-closing-start-tag-state">self-closing start tag
|
|
state</a>. Otherwise, treat it as per the "anything else" entry
|
|
below.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>If the current end tag token is an <a href="#appropriate-end-tag-token">appropriate end tag
|
|
token</a>, then emit the current tag token and switch to the
|
|
<a href="#data-state">data state</a>. Otherwise, treat it as per the "anything
|
|
else" entry below.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
current tag token's tag name. Append the <a href="#current-input-character">current input
|
|
character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>.</dd>
|
|
|
|
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
tag token's tag name. Append the <a href="#current-input-character">current input
|
|
character</a> to the <var><a href="#temporary-buffer">temporary buffer</a></var>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit a U+003C LESS-THAN SIGN character token, a U+002F SOLIDUS
|
|
character token, a character token for each of the characters in
|
|
the <var><a href="#temporary-buffer">temporary buffer</a></var> (in the order they were added to
|
|
the buffer), and reconsume the <a href="#current-input-character">current input character</a>
|
|
in the <a href="#script-data-escaped-state">script data escaped state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-double-escape-start-state"><span class="secno">8.2.4.28 </span><dfn>Script data double escape start state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>If the <var><a href="#temporary-buffer">temporary buffer</a></var> is the string "<code title="">script</code>", then switch to the <a href="#script-data-double-escaped-state">script data
|
|
double escaped state</a>. Otherwise, switch to the <a href="#script-data-escaped-state">script
|
|
data escaped state</a>. Emit the <a href="#current-input-character">current input
|
|
character</a> as a character token.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
<var><a href="#temporary-buffer">temporary buffer</a></var>. Emit the <a href="#current-input-character">current input
|
|
character</a> as a character token.</dd>
|
|
|
|
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the
|
|
<var><a href="#temporary-buffer">temporary buffer</a></var>. Emit the <a href="#current-input-character">current input
|
|
character</a> as a character token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Reconsume the <a href="#current-input-character">current input character</a> in the
|
|
<a href="#script-data-escaped-state">script data escaped state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-double-escaped-state"><span class="secno">8.2.4.29 </span><dfn>Script data double escaped state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#script-data-double-escaped-dash-state">script data double escaped dash
|
|
state</a>. Emit a U+002D HYPHEN-MINUS character token.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#script-data-double-escaped-less-than-sign-state">script data double escaped less-than
|
|
sign state</a>. Emit a U+003C LESS-THAN SIGN character
|
|
token.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Emit a U+FFFD REPLACEMENT CHARACTER
|
|
character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Emit the <a href="#current-input-character">current input character</a> as a character
|
|
token.</dd>
|
|
|
|
</dl><h5 id="script-data-double-escaped-dash-state"><span class="secno">8.2.4.30 </span><dfn>Script data double escaped dash state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#script-data-double-escaped-dash-dash-state">script data double escaped dash dash
|
|
state</a>. Emit a U+002D HYPHEN-MINUS character token.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#script-data-double-escaped-less-than-sign-state">script data double escaped less-than
|
|
sign state</a>. Emit a U+003C LESS-THAN SIGN character
|
|
token.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#script-data-double-escaped-state">script data
|
|
double escaped state</a>. Emit a U+FFFD REPLACEMENT CHARACTER
|
|
character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Switch to the <a href="#script-data-double-escaped-state">script data double escaped
|
|
state</a>. Emit the <a href="#current-input-character">current input character</a> as a
|
|
character token.</dd>
|
|
|
|
</dl><h5 id="script-data-double-escaped-dash-dash-state"><span class="secno">8.2.4.31 </span><dfn>Script data double escaped dash dash state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Emit a U+002D HYPHEN-MINUS character token.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd>Switch to the <a href="#script-data-double-escaped-less-than-sign-state">script data double escaped less-than
|
|
sign state</a>. Emit a U+003C LESS-THAN SIGN character
|
|
token.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#script-data-state">script data state</a>. Emit a U+003E
|
|
GREATER-THAN SIGN character token.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#script-data-double-escaped-state">script data
|
|
double escaped state</a>. Emit a U+FFFD REPLACEMENT CHARACTER
|
|
character token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Switch to the <a href="#script-data-double-escaped-state">script data double escaped
|
|
state</a>. Emit the <a href="#current-input-character">current input character</a> as a
|
|
character token.</dd>
|
|
|
|
</dl><h5 id="script-data-double-escaped-less-than-sign-state"><span class="secno">8.2.4.32 </span><dfn>Script data double escaped less-than sign state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Set the <var><a href="#temporary-buffer">temporary buffer</a></var> to the empty string. Switch
|
|
to the <a href="#script-data-double-escape-end-state">script data double escape end state</a>. Emit a
|
|
U+002F SOLIDUS character token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Reconsume the <a href="#current-input-character">current input character</a> in the
|
|
<a href="#script-data-double-escaped-state">script data double escaped state</a>.</dd>
|
|
|
|
</dl><h5 id="script-data-double-escape-end-state"><span class="secno">8.2.4.33 </span><dfn>Script data double escape end state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>If the <var><a href="#temporary-buffer">temporary buffer</a></var> is the string "<code title="">script</code>", then switch to the <a href="#script-data-escaped-state">script data
|
|
escaped state</a>. Otherwise, switch to the <a href="#script-data-double-escaped-state">script data
|
|
double escaped state</a>. Emit the <a href="#current-input-character">current input
|
|
character</a> as a character token.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
<var><a href="#temporary-buffer">temporary buffer</a></var>. Emit the <a href="#current-input-character">current input
|
|
character</a> as a character token.</dd>
|
|
|
|
<dt>U+0061 LATIN SMALL LETTER A through to U+007A LATIN SMALL LETTER Z</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the
|
|
<var><a href="#temporary-buffer">temporary buffer</a></var>. Emit the <a href="#current-input-character">current input
|
|
character</a> as a character token.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Reconsume the <a href="#current-input-character">current input character</a> in the
|
|
<a href="#script-data-double-escaped-state">script data double escaped state</a>.</dd>
|
|
|
|
</dl><h5 id="before-attribute-name-state"><span class="secno">8.2.4.34 </span><dfn>Before attribute name state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Switch to the <a href="#self-closing-start-tag-state">self-closing start tag state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current tag
|
|
token.</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 <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point), and its
|
|
value to the empty string. Switch to the <a href="#attribute-name-state">attribute name
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Start a new attribute in the current
|
|
tag token. Set that attribute's name to a U+FFFD REPLACEMENT
|
|
CHARACTER character, and its value to the empty string. Switch to
|
|
the <a href="#attribute-name-state">attribute name state</a>.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dt>U+003D EQUALS SIGN (=)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Treat it as per the "anything else"
|
|
entry below.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. 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 <a href="#current-input-character">current input character</a>, and
|
|
its value to the empty string. Switch to the <a href="#attribute-name-state">attribute name
|
|
state</a>.</dd>
|
|
|
|
</dl><h5 id="attribute-name-state"><span class="secno">8.2.4.35 </span><dfn>Attribute name state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#after-attribute-name-state">after attribute name state</a>.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Switch to the <a href="#self-closing-start-tag-state">self-closing start tag state</a>.</dd>
|
|
|
|
<dt>U+003D EQUALS SIGN (=)</dt>
|
|
<dd>Switch to the <a href="#before-attribute-value-state">before attribute value state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current tag
|
|
token.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
current attribute's name.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current attribute's name.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Treat it as per the "anything else"
|
|
entry below.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
attribute's name.</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="#parse-error">parse error</a> and the new
|
|
attribute must be dropped, along with the value that gets
|
|
associated with it (if any).</p>
|
|
|
|
|
|
<h5 id="after-attribute-name-state"><span class="secno">8.2.4.36 </span><dfn>After attribute name state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Switch to the <a href="#self-closing-start-tag-state">self-closing start tag state</a>.</dd>
|
|
|
|
<dt>U+003D EQUALS SIGN (=)</dt>
|
|
<dd>Switch to the <a href="#before-attribute-value-state">before attribute value state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current tag
|
|
token.</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 <a href="#current-input-character">current
|
|
input character</a> (add 0x0020 to the character's code point),
|
|
and its value to the empty string. Switch to the <a href="#attribute-name-state">attribute
|
|
name state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Start a new attribute in the current
|
|
tag token. Set that attribute's name to a U+FFFD REPLACEMENT
|
|
CHARACTER character, and its value to the empty string. Switch to
|
|
the <a href="#attribute-name-state">attribute name state</a>.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Treat it as per the "anything else"
|
|
entry below.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. 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 <a href="#current-input-character">current input character</a>, and
|
|
its value to the empty string. Switch to the <a href="#attribute-name-state">attribute name
|
|
state</a>.</dd>
|
|
|
|
</dl><h5 id="before-attribute-value-state"><span class="secno">8.2.4.37 </span><dfn>Before attribute value state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd>Switch to the <a href="#attribute-value-double-quoted-state">attribute value (double-quoted) state</a>.</dd>
|
|
|
|
<dt>U+0026 AMPERSAND (&)</dt>
|
|
<dd>Switch to the <a href="#attribute-value-unquoted-state">attribute value (unquoted) state</a>
|
|
and reconsume this <a href="#current-input-character">current input character</a>.</dd>
|
|
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd>Switch to the <a href="#attribute-value-single-quoted-state">attribute value (single-quoted) state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current attribute's value. Switch to the
|
|
<a href="#attribute-value-unquoted-state">attribute value (unquoted) state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit the current tag token.</dd>
|
|
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dt>U+003D EQUALS SIGN (=)</dt>
|
|
<dt>U+0060 GRAVE ACCENT (`)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Treat it as per the "anything else"
|
|
entry below.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
attribute's value. Switch to the <a href="#attribute-value-unquoted-state">attribute value (unquoted)
|
|
state</a>.</dd>
|
|
|
|
</dl><h5 id="attribute-value-double-quoted-state"><span class="secno">8.2.4.38 </span><dfn>Attribute value (double-quoted) state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd>Switch to the <a href="#after-attribute-value-quoted-state">after attribute value (quoted)
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0026 AMPERSAND (&)</dt>
|
|
<dd>Switch to the <a href="#character-reference-in-attribute-value-state">character reference in attribute value
|
|
state</a>, with the <a href="#additional-allowed-character">additional allowed character</a>
|
|
being U+0022 QUOTATION MARK (").</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current attribute's value.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
attribute's value.</dd>
|
|
|
|
</dl><h5 id="attribute-value-single-quoted-state"><span class="secno">8.2.4.39 </span><dfn>Attribute value (single-quoted) state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd>Switch to the <a href="#after-attribute-value-quoted-state">after attribute value (quoted)
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0026 AMPERSAND (&)</dt>
|
|
<dd>Switch to the <a href="#character-reference-in-attribute-value-state">character reference in attribute value
|
|
state</a>, with the <a href="#additional-allowed-character">additional allowed character</a>
|
|
being U+0027 APOSTROPHE (').</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current attribute's value.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
attribute's value.</dd>
|
|
|
|
</dl><h5 id="attribute-value-unquoted-state"><span class="secno">8.2.4.40 </span><dfn>Attribute value (unquoted) state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#before-attribute-name-state">before attribute name state</a>.</dd>
|
|
|
|
<dt>U+0026 AMPERSAND (&)</dt>
|
|
<dd>Switch to the <a href="#character-reference-in-attribute-value-state">character reference in attribute value
|
|
state</a>, with the <a href="#additional-allowed-character">additional allowed character</a>
|
|
being U+003E GREATER-THAN SIGN (>).</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current tag
|
|
token.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current attribute's value.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dt>U+003C LESS-THAN SIGN (<)</dt>
|
|
<dt>U+003D EQUALS SIGN (=)</dt>
|
|
<dt>U+0060 GRAVE ACCENT (`)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Treat it as per the "anything else"
|
|
entry below.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Append the <a href="#current-input-character">current input character</a> to the current
|
|
attribute's value.</dd>
|
|
|
|
</dl><h5 id="character-reference-in-attribute-value-state"><span class="secno">8.2.4.41 </span><dfn>Character reference in attribute value state</dfn></h5>
|
|
|
|
<p>Attempt to <a href="#consume-a-character-reference">consume a character reference</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 switched
|
|
into this state.</p>
|
|
|
|
|
|
<h5 id="after-attribute-value-quoted-state"><span class="secno">8.2.4.42 </span><dfn>After attribute value (quoted) state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#before-attribute-name-state">before attribute name state</a>.</dd>
|
|
|
|
<dt>U+002F SOLIDUS (/)</dt>
|
|
<dd>Switch to the <a href="#self-closing-start-tag-state">self-closing start tag state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current tag
|
|
token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the character in
|
|
the <a href="#before-attribute-name-state">before attribute name state</a>.</dd>
|
|
|
|
</dl><h5 id="self-closing-start-tag-state"><span class="secno">8.2.4.43 </span><dfn>Self-closing start tag state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Set the <i>self-closing flag</i> of the current tag
|
|
token. Switch to the <a href="#data-state">data state</a>. Emit the current tag
|
|
token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the character in
|
|
the <a href="#before-attribute-name-state">before attribute name state</a>.</dd>
|
|
|
|
</dl><h5 id="bogus-comment-state"><span class="secno">8.2.4.44 </span><dfn>Bogus comment state</dfn></h5>
|
|
|
|
<p>Consume every character up to and including 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 character immediately before
|
|
the last consumed character (i.e. up to the character just before
|
|
the U+003E or EOF character), but with any U+0000 NULL characters
|
|
replaced by U+FFFD REPLACEMENT CHARACTER characters. (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>
|
|
|
|
|
|
<h5 id="markup-declaration-open-state"><span class="secno">8.2.4.45 </span><dfn>Markup declaration open state</dfn></h5>
|
|
|
|
<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="#comment-start-state">comment
|
|
start state</a>.</p>
|
|
|
|
<p>Otherwise, if the next seven characters are an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the word "DOCTYPE", then consume
|
|
those characters and switch to the <a href="#doctype-state">DOCTYPE state</a>.</p>
|
|
|
|
<p>Otherwise, if the <a href="#current-node">current node</a> is not an element in
|
|
the <a href="#html-namespace-0">HTML namespace</a> and the next seven characters are an
|
|
<a href="#case-sensitive">case-sensitive</a> 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 <a href="#cdata-section-state">CDATA section state</a>.</p>
|
|
|
|
<p>Otherwise, this is a <a href="#parse-error">parse error</a>. Switch to the
|
|
<a href="#bogus-comment-state">bogus comment state</a>. The next character that is
|
|
consumed, if any, is the first character that will be in the
|
|
comment.</p>
|
|
|
|
|
|
<h5 id="comment-start-state"><span class="secno">8.2.4.46 </span><dfn>Comment start state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#comment-start-dash-state">comment start dash state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the comment token's data. Switch to the <a href="#comment-state">comment
|
|
state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit the comment token.</dd>
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">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 <a href="#current-input-character">current input character</a> to the comment
|
|
token's data. Switch to the <a href="#comment-state">comment state</a>.</dd>
|
|
|
|
</dl><h5 id="comment-start-dash-state"><span class="secno">8.2.4.47 </span><dfn>Comment start dash state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#comment-end-state">comment end state</a></dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+002D HYPHEN-MINUS
|
|
character (-) and a U+FFFD REPLACEMENT CHARACTER character to the
|
|
comment token's data. Switch to the <a href="#comment-state">comment
|
|
state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit the comment token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">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
|
|
<a href="#current-input-character">current input character</a> to the comment token's
|
|
data. Switch to the <a href="#comment-state">comment state</a>.</dd>
|
|
|
|
</dl><h5 id="comment-state"><span class="secno">8.2.4.48 </span><dfn id="comment">Comment state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#comment-end-dash-state">comment end dash state</a></dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the comment token's data.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">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 <a href="#current-input-character">current input character</a> to the comment
|
|
token's data.</dd>
|
|
|
|
</dl><h5 id="comment-end-dash-state"><span class="secno">8.2.4.49 </span><dfn>Comment end dash state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Switch to the <a href="#comment-end-state">comment end state</a></dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+002D HYPHEN-MINUS
|
|
character (-) and a U+FFFD REPLACEMENT CHARACTER character to the
|
|
comment token's data. Switch to the <a href="#comment-state">comment
|
|
state</a>.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">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
|
|
<a href="#current-input-character">current input character</a> to the comment token's
|
|
data. Switch to the <a href="#comment-state">comment state</a>.</dd>
|
|
|
|
</dl><h5 id="comment-end-state"><span class="secno">8.2.4.50 </span><dfn>Comment end state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the comment
|
|
token.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append two U+002D HYPHEN-MINUS
|
|
characters (-) and a U+FFFD REPLACEMENT CHARACTER character to the
|
|
comment token's data. Switch to the <a href="#comment-state">comment
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0021 EXCLAMATION MARK (!)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Switch to the <a href="#comment-end-bang-state">comment end bang
|
|
state</a>.</dd>
|
|
|
|
<dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+002D HYPHEN-MINUS
|
|
character (-) to the comment token's data.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">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="#parse-error">Parse error</a>. Append two U+002D HYPHEN-MINUS
|
|
characters (-) and the <a href="#current-input-character">current input character</a> to the
|
|
comment token's data. Switch to the <a href="#comment-state">comment
|
|
state</a>.</dd>
|
|
|
|
</dl><h5 id="comment-end-bang-state"><span class="secno">8.2.4.51 </span><dfn>Comment end bang state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+002D HYPHEN-MINUS (-)</dt>
|
|
<dd>Append two U+002D HYPHEN-MINUS characters (-) and a U+0021
|
|
EXCLAMATION MARK character (!) to the comment token's data. Switch
|
|
to the <a href="#comment-end-dash-state">comment end dash state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the comment
|
|
token.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append two U+002D HYPHEN-MINUS
|
|
characters (-), a U+0021 EXCLAMATION MARK character (!), and a
|
|
U+FFFD REPLACEMENT CHARACTER character to the comment token's data.
|
|
Switch to the <a href="#comment-state">comment state</a>.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">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 two U+002D HYPHEN-MINUS characters (-), a U+0021
|
|
EXCLAMATION MARK character (!), and the <a href="#current-input-character">current input
|
|
character</a> to the comment token's data. Switch to the
|
|
<a href="#comment-state">comment state</a>.</dd>
|
|
|
|
</dl><h5 id="doctype-state"><span class="secno">8.2.4.52 </span><dfn>DOCTYPE state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#before-doctype-name-state">before DOCTYPE name state</a>.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Create a new DOCTYPE token. Set its
|
|
<i>force-quirks flag</i> to <i>on</i>. Emit the token. Reconsume
|
|
the EOF character in the <a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Reconsume the character in the
|
|
<a href="#before-doctype-name-state">before DOCTYPE name state</a>.</dd>
|
|
|
|
</dl><h5 id="before-doctype-name-state"><span class="secno">8.2.4.53 </span><dfn>Before DOCTYPE name state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Create a new DOCTYPE token. Set the token's name to the
|
|
lowercase version of the <a href="#current-input-character">current input character</a> (add 0x0020 to the
|
|
character's code point). Switch to the <a href="#doctype-name-state">DOCTYPE name
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Create a new DOCTYPE token. Set the
|
|
token's name to a U+FFFD REPLACEMENT CHARACTER character. Switch to
|
|
the <a href="#doctype-name-state">DOCTYPE name state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Create a new DOCTYPE token. Set its
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit the token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Create a new DOCTYPE token. Set its
|
|
<i>force-quirks flag</i> to <i>on</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 to the
|
|
<a href="#current-input-character">current input character</a>. Switch to the <a href="#doctype-name-state">DOCTYPE name
|
|
state</a>.</dd>
|
|
|
|
</dl><h5 id="doctype-name-state"><span class="secno">8.2.4.54 </span><dfn>DOCTYPE name state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#after-doctype-name-state">after DOCTYPE name state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current DOCTYPE
|
|
token.</dd>
|
|
|
|
<dt>U+0041 LATIN CAPITAL LETTER A through to U+005A LATIN CAPITAL LETTER Z</dt>
|
|
<dd>Append the lowercase version of the <a href="#current-input-character">current input
|
|
character</a> (add 0x0020 to the character's code point) to the
|
|
current DOCTYPE token's name.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current DOCTYPE token's name.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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 <a href="#current-input-character">current input character</a> to the current
|
|
DOCTYPE token's name.</dd>
|
|
|
|
</dl><h5 id="after-doctype-name-state"><span class="secno">8.2.4.55 </span><dfn>After DOCTYPE name state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current DOCTYPE
|
|
token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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 six characters starting from the <a href="#current-input-character">current input
|
|
character</a> are an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match
|
|
for the word "PUBLIC", then consume those characters and switch to
|
|
the <a href="#after-doctype-public-keyword-state">after DOCTYPE public keyword state</a>.</p>
|
|
|
|
<p>Otherwise, if the six characters starting from the
|
|
<a href="#current-input-character">current input character</a> are an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the word "SYSTEM", then consume
|
|
those characters and switch to the <a href="#after-doctype-system-keyword-state">after DOCTYPE system
|
|
keyword state</a>.</p>
|
|
|
|
<p>Otherwise, this is the <a href="#parse-error">parse error</a>. Set the
|
|
DOCTYPE token's <i>force-quirks flag</i> to <i>on</i>. Switch to
|
|
the <a href="#bogus-doctype-state">bogus DOCTYPE state</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h5 id="after-doctype-public-keyword-state"><span class="secno">8.2.4.56 </span><dfn>After DOCTYPE public keyword state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#before-doctype-public-identifier-state">before DOCTYPE public identifier
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's public
|
|
identifier to the empty string (not missing), then switch to the
|
|
<a href="#doctype-public-identifier-double-quoted-state">DOCTYPE public identifier (double-quoted) state</a>.</dd>
|
|
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's public
|
|
identifier to the empty string (not missing), then switch to the
|
|
<a href="#doctype-public-identifier-single-quoted-state">DOCTYPE public identifier (single-quoted) state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit that DOCTYPE token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#bogus-doctype-state">bogus
|
|
DOCTYPE state</a>.</dd>
|
|
|
|
</dl><h5 id="before-doctype-public-identifier-state"><span class="secno">8.2.4.57 </span><dfn>Before DOCTYPE public identifier state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd>Set the DOCTYPE token's public identifier to the empty string
|
|
(not missing), then switch to the <a href="#doctype-public-identifier-double-quoted-state">DOCTYPE public identifier
|
|
(double-quoted) state</a>.</dd>
|
|
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd>Set the DOCTYPE token's public identifier to the empty string
|
|
(not missing), then switch to the <a href="#doctype-public-identifier-single-quoted-state">DOCTYPE public identifier
|
|
(single-quoted) state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit that DOCTYPE token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#bogus-doctype-state">bogus
|
|
DOCTYPE state</a>.</dd>
|
|
|
|
</dl><h5 id="doctype-public-identifier-double-quoted-state"><span class="secno">8.2.4.58 </span><dfn>DOCTYPE public identifier (double-quoted) state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd>Switch to the <a href="#after-doctype-public-identifier-state">after DOCTYPE public identifier state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current DOCTYPE token's public identifier.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit that DOCTYPE token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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 <a href="#current-input-character">current input character</a> to the current
|
|
DOCTYPE token's public identifier.</dd>
|
|
|
|
</dl><h5 id="doctype-public-identifier-single-quoted-state"><span class="secno">8.2.4.59 </span><dfn>DOCTYPE public identifier (single-quoted) state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd>Switch to the <a href="#after-doctype-public-identifier-state">after DOCTYPE public identifier state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current DOCTYPE token's public identifier.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit that DOCTYPE token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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 <a href="#current-input-character">current input character</a> to the current
|
|
DOCTYPE token's public identifier.</dd>
|
|
|
|
</dl><h5 id="after-doctype-public-identifier-state"><span class="secno">8.2.4.60 </span><dfn>After DOCTYPE public identifier state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#between-doctype-public-and-system-identifiers-state">between DOCTYPE public and system
|
|
identifiers state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current DOCTYPE
|
|
token.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's system
|
|
identifier to the empty string (not missing), then switch to the
|
|
<a href="#doctype-system-identifier-double-quoted-state">DOCTYPE system identifier (double-quoted) state</a>.</dd>
|
|
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's system
|
|
identifier to the empty string (not missing), then switch to the
|
|
<a href="#doctype-system-identifier-single-quoted-state">DOCTYPE system identifier (single-quoted) state</a>.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#bogus-doctype-state">bogus
|
|
DOCTYPE state</a>.</dd>
|
|
|
|
</dl><h5 id="between-doctype-public-and-system-identifiers-state"><span class="secno">8.2.4.61 </span><dfn>Between DOCTYPE public and system identifiers state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current DOCTYPE
|
|
token.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd>Set the DOCTYPE token's system identifier to the empty string
|
|
(not missing), then switch to the <a href="#doctype-system-identifier-double-quoted-state">DOCTYPE system identifier
|
|
(double-quoted) state</a>.</dd>
|
|
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd>Set the DOCTYPE token's system identifier to the empty string
|
|
(not missing), then switch to the <a href="#doctype-system-identifier-single-quoted-state">DOCTYPE system identifier
|
|
(single-quoted) state</a>.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#bogus-doctype-state">bogus
|
|
DOCTYPE state</a>.</dd>
|
|
|
|
</dl><h5 id="after-doctype-system-keyword-state"><span class="secno">8.2.4.62 </span><dfn>After DOCTYPE system keyword state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Switch to the <a href="#before-doctype-system-identifier-state">before DOCTYPE system identifier
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's system
|
|
identifier to the empty string (not missing), then switch to the
|
|
<a href="#doctype-system-identifier-double-quoted-state">DOCTYPE system identifier (double-quoted) state</a>.</dd>
|
|
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's system
|
|
identifier to the empty string (not missing), then switch to the
|
|
<a href="#doctype-system-identifier-single-quoted-state">DOCTYPE system identifier (single-quoted) state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit that DOCTYPE token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#bogus-doctype-state">bogus
|
|
DOCTYPE state</a>.</dd>
|
|
|
|
</dl><h5 id="before-doctype-system-identifier-state"><span class="secno">8.2.4.63 </span><dfn>Before DOCTYPE system identifier state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd>Set the DOCTYPE token's system identifier to the empty string
|
|
(not missing), then switch to the <a href="#doctype-system-identifier-double-quoted-state">DOCTYPE system identifier
|
|
(double-quoted) state</a>.</dd>
|
|
|
|
<dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd>Set the DOCTYPE token's system identifier to the empty string
|
|
(not missing), then switch to the <a href="#doctype-system-identifier-single-quoted-state">DOCTYPE system identifier
|
|
(single-quoted) state</a>.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit that DOCTYPE token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#bogus-doctype-state">bogus
|
|
DOCTYPE state</a>.</dd>
|
|
|
|
</dl><h5 id="doctype-system-identifier-double-quoted-state"><span class="secno">8.2.4.64 </span><dfn>DOCTYPE system identifier (double-quoted) state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0022 QUOTATION MARK (")</dt>
|
|
<dd>Switch to the <a href="#after-doctype-system-identifier-state">after DOCTYPE system identifier
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current DOCTYPE token's system identifier.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit that DOCTYPE token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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 <a href="#current-input-character">current input character</a> to the current
|
|
DOCTYPE token's system identifier.</dd>
|
|
|
|
</dl><h5 id="doctype-system-identifier-single-quoted-state"><span class="secno">8.2.4.65 </span><dfn>DOCTYPE system identifier (single-quoted) state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0027 APOSTROPHE (')</dt>
|
|
<dd>Switch to the <a href="#after-doctype-system-identifier-state">after DOCTYPE system identifier
|
|
state</a>.</dd>
|
|
|
|
<dt>U+0000 NULL</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Append a U+FFFD REPLACEMENT CHARACTER
|
|
character to the current DOCTYPE token's system identifier.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>. Switch to the <a href="#data-state">data
|
|
state</a>. Emit that DOCTYPE token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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 <a href="#current-input-character">current input character</a> to the current
|
|
DOCTYPE token's system identifier.</dd>
|
|
|
|
</dl><h5 id="after-doctype-system-identifier-state"><span class="secno">8.2.4.66 </span><dfn>After DOCTYPE system identifier state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+0009 CHARACTER TABULATION (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</dt>
|
|
<dt>U+000C FORM FEED (FF)</dt>
|
|
|
|
<dt>U+0020 SPACE</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
<dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the current DOCTYPE
|
|
token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd><a href="#parse-error">Parse error</a>. Set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</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="#parse-error">Parse error</a>. Switch to the <a href="#bogus-doctype-state">bogus DOCTYPE
|
|
state</a>. (This does <em>not</em> set the DOCTYPE token's
|
|
<i>force-quirks flag</i> to <i>on</i>.)</dd>
|
|
|
|
</dl><h5 id="bogus-doctype-state"><span class="secno">8.2.4.67 </span><dfn>Bogus DOCTYPE state</dfn></h5>
|
|
|
|
<p>Consume the <a href="#next-input-character">next input character</a>:</p>
|
|
|
|
<dl class="switch"><dt>U+003E GREATER-THAN SIGN (>)</dt>
|
|
<dd>Switch to the <a href="#data-state">data state</a>. Emit the DOCTYPE
|
|
token.</dd>
|
|
|
|
<dt>EOF</dt>
|
|
<dd>Emit the DOCTYPE token. Reconsume the EOF character in the
|
|
<a href="#data-state">data state</a>.</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>Ignore the character.</dd>
|
|
|
|
</dl><h5 id="cdata-section-state"><span class="secno">8.2.4.68 </span><dfn>CDATA section state</dfn></h5>
|
|
|
|
<p>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 (<code title="">]]></code>), or the
|
|
end of the file (EOF), whichever comes first. Emit a series of
|
|
character 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).</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>
|
|
|
|
|
|
|
|
<h5 id="tokenizing-character-references"><span class="secno">8.2.4.69 </span>Tokenizing character references</h5>
|
|
|
|
<p>This section defines how to <dfn id="consume-a-character-reference">consume a character
|
|
reference</dfn>. This definition is used when parsing character
|
|
references <a href="#character-reference-in-data-state" title="character reference in data state">in
|
|
text</a> and <a href="#character-reference-in-attribute-value-state" title="character reference in attribute value
|
|
state">in attributes</a>.</p>
|
|
|
|
<p>The behavior 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 (tab)</dt>
|
|
<dt>U+000A LINE FEED (LF)</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>The <dfn id="additional-allowed-character">additional allowed character</dfn>, if there is one</dt>
|
|
|
|
<dd>Not a character reference. 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 behavior 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 (0) to U+0039 DIGIT NINE (9), U+0061 LATIN
|
|
SMALL LETTER A to U+0066 LATIN SMALL LETTER F, and U+0041 LATIN
|
|
CAPITAL LETTER A 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 (0) to U+0039 DIGIT NINE (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="#parse-error">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="#parse-error">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="#parse-error">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 id="table-charref-overrides"><thead><tr><th>Number <th colspan="2">Unicode character
|
|
<tbody><tr><td>0x00 <td>U+FFFD <td>REPLACEMENT CHARACTER
|
|
<tr><td>0x0D <td>U+000D <td>CARRIAGE RETURN (CR)
|
|
<tr><td>0x80 <td>U+20AC <td>EURO SIGN (€)
|
|
<tr><td>0x81 <td>U+0081 <td><control>
|
|
<tr><td>0x82 <td>U+201A <td>SINGLE LOW-9 QUOTATION MARK (‚)
|
|
<tr><td>0x83 <td>U+0192 <td>LATIN SMALL LETTER F WITH HOOK (ƒ)
|
|
<tr><td>0x84 <td>U+201E <td>DOUBLE LOW-9 QUOTATION MARK („)
|
|
<tr><td>0x85 <td>U+2026 <td>HORIZONTAL ELLIPSIS (…)
|
|
<tr><td>0x86 <td>U+2020 <td>DAGGER (†)
|
|
<tr><td>0x87 <td>U+2021 <td>DOUBLE DAGGER (‡)
|
|
<tr><td>0x88 <td>U+02C6 <td>MODIFIER LETTER CIRCUMFLEX ACCENT (ˆ)
|
|
<tr><td>0x89 <td>U+2030 <td>PER MILLE SIGN (‰)
|
|
<tr><td>0x8A <td>U+0160 <td>LATIN CAPITAL LETTER S WITH CARON (Š)
|
|
<tr><td>0x8B <td>U+2039 <td>SINGLE LEFT-POINTING ANGLE QUOTATION MARK (‹)
|
|
<tr><td>0x8C <td>U+0152 <td>LATIN CAPITAL LIGATURE OE (Œ)
|
|
<tr><td>0x8D <td>U+008D <td><control>
|
|
<tr><td>0x8E <td>U+017D <td>LATIN CAPITAL LETTER Z WITH CARON (Ž)
|
|
<tr><td>0x8F <td>U+008F <td><control>
|
|
<tr><td>0x90 <td>U+0090 <td><control>
|
|
<tr><td>0x91 <td>U+2018 <td>LEFT SINGLE QUOTATION MARK (‘)
|
|
<tr><td>0x92 <td>U+2019 <td>RIGHT SINGLE QUOTATION MARK (’)
|
|
<tr><td>0x93 <td>U+201C <td>LEFT DOUBLE QUOTATION MARK (“)
|
|
<tr><td>0x94 <td>U+201D <td>RIGHT DOUBLE QUOTATION MARK (”)
|
|
<tr><td>0x95 <td>U+2022 <td>BULLET (•)
|
|
<tr><td>0x96 <td>U+2013 <td>EN DASH (–)
|
|
<tr><td>0x97 <td>U+2014 <td>EM DASH (—)
|
|
<tr><td>0x98 <td>U+02DC <td>SMALL TILDE (˜)
|
|
<tr><td>0x99 <td>U+2122 <td>TRADE MARK SIGN (™)
|
|
<tr><td>0x9A <td>U+0161 <td>LATIN SMALL LETTER S WITH CARON (š)
|
|
<tr><td>0x9B <td>U+203A <td>SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (›)
|
|
<tr><td>0x9C <td>U+0153 <td>LATIN SMALL LIGATURE OE (œ)
|
|
<tr><td>0x9D <td>U+009D <td><control>
|
|
<tr><td>0x9E <td>U+017E <td>LATIN SMALL LETTER Z WITH CARON (ž)
|
|
<tr><td>0x9F <td>U+0178 <td>LATIN CAPITAL LETTER Y WITH DIAERESIS (Ÿ)
|
|
</table><p>Otherwise, if the number is in the range 0xD800 to 0xDFFF or is greater than 0x10FFFF, then this is a
|
|
<a href="#parse-error">parse error</a>. Return a U+FFFD REPLACEMENT
|
|
CHARACTER.</p>
|
|
|
|
<p>Otherwise, return a character token for the Unicode character
|
|
whose code point is that number.
|
|
|
|
If the number is in the range 0x0001 to 0x0008, 0x000E to 0x001F, 0x007F to 0x009F, 0xFDD0 to
|
|
0xFDEF, or is one of 0x000B, 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, then this is a <a href="#parse-error">parse
|
|
error</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Anything else</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Consume the maximum number of characters possible, with the
|
|
consumed characters matching one of the identifiers in the first
|
|
column of the <a href="#named-character-references">named character references</a> table (in a
|
|
<a href="#case-sensitive">case-sensitive</a> manner).</p>
|
|
|
|
<p>If no match can be made, then no characters are consumed, and
|
|
nothing is returned. In this case, if the characters after the
|
|
U+0026 AMPERSAND character (&) consist of a sequence of one or
|
|
more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
|
|
NINE (9), U+0061 LATIN SMALL LETTER A to U+007A LATIN SMALL LETTER
|
|
Z, and U+0041 LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL
|
|
LETTER Z, followed by a U+003B SEMICOLON character (;), then this
|
|
is a <a href="#parse-error">parse error</a>.</p>
|
|
|
|
<p>If the character reference is being consumed <a href="#character-reference-in-attribute-value-state" title="character reference in attribute value state">as part of an
|
|
attribute</a>, and the last character matched is not a U+003B
|
|
SEMICOLON character (;), and the next character is either a U+003D
|
|
EQUALS SIGN character (=) or in the range U+0030 DIGIT ZERO (0) to
|
|
U+0039 DIGIT NINE (9), 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 character
|
|
(&) must be unconsumed, and nothing is returned.</p>
|
|
|
|
|
|
<p>Otherwise, a character reference is parsed. If the last
|
|
character matched is not a U+003B SEMICOLON character (;), there
|
|
is a <a href="#parse-error">parse error</a>.</p>
|
|
|
|
<p>Return one or two character tokens for the character(s)
|
|
corresponding to the character reference name (as given by the
|
|
second column of the <a href="#named-character-references">named character references</a>
|
|
table).</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>If the markup contains (not in an attribute) the string <code title="">I'm &notit; I tell you</code>, the character
|
|
reference is parsed as "not", as in, <code title="">I'm ¬it;
|
|
I tell you</code> (and this is a parse error). But if the markup
|
|
was <code title="">I'm &notin; I tell you</code>, the
|
|
character reference would be parsed as "notin;", resulting in
|
|
<code title="">I'm ∉ I tell you</code> (and no parse
|
|
error).</p>
|
|
|
|
</div>
|
|
|
|
</dd>
|
|
|
|
</dl></div><div class="impl">
|
|
|
|
|
|
<h4 id="tree-construction"><span class="secno">8.2.5 </span><dfn>Tree construction</dfn></h4>
|
|
|
|
<p>The input to the tree construction stage is a sequence of tokens
|
|
from the <a href="#tokenization">tokenization</a> stage. The tree construction
|
|
stage is associated with a DOM <code><a href="#document">Document</a></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>This specification does not define when an interactive user agent
|
|
has to render the <code><a href="#document">Document</a></code> so that it is available to
|
|
the user, or when it has to begin accepting user input.</p>
|
|
|
|
<hr><p>As each token is emitted from the tokenizer, the user agent must
|
|
follow the appropriate steps from the following list:</p>
|
|
|
|
<dl class="switch"><dt>If there is no <a href="#current-node">current node</a></dt>
|
|
<dt>If the <a href="#current-node">current node</a> is an element in the <a href="#html-namespace-0">HTML namespace</a></dt>
|
|
<dt>If the <a href="#current-node">current node</a> is a <a href="#mathml-text-integration-point">MathML text integration point</a> and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"</dt>
|
|
<dt>If the <a href="#current-node">current node</a> is an <code title="">annotation-xml</code> element in the <a href="#mathml-namespace">MathML namespace</a> and the token is a start tag whose tag name is "svg"</dt>
|
|
<dt>If the <a href="#current-node">current node</a> is an <a href="#html-integration-point">HTML integration point</a> and the token is a start tag</dt>
|
|
<dt>If the <a href="#current-node">current node</a> is an <a href="#html-integration-point">HTML integration point</a> and the token is a character token</dt>
|
|
<dt>If the token is an end-of-file token</dt>
|
|
|
|
<dd>Process the token according to the rules given in the section
|
|
corresponding to the current <a href="#insertion-mode">insertion mode</a> in HTML
|
|
content.</dd>
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>Process the token according to the rules given in the section
|
|
for parsing tokens <a href="#parsing-main-inforeign" title="insertion mode: in foreign
|
|
content">in foreign content</a>.</dd>
|
|
|
|
</dl><p>The <a href="#current-node">current node</a> is a <dfn id="mathml-text-integration-point">MathML text
|
|
integration point</dfn> if it is one of the following elements:</p>
|
|
|
|
<ul class="brief"><li>An <code title="">mi</code> element in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li>An <code title="">mo</code> element in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li>An <code title="">mn</code> element in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li>An <code title="">ms</code> element in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
<li>An <code title="">mtext</code> element in the <a href="#mathml-namespace">MathML namespace</a></li>
|
|
</ul><p>The <a href="#current-node">current node</a> is an <dfn id="html-integration-point">HTML
|
|
integration point</dfn> if it is one of the following elements:</p>
|
|
|
|
<ul class="brief"><li>An <code title="">annotation-xml</code> element in the <a href="#mathml-namespace">MathML namespace</a> whose start tag token had an attribute with the name "encoding" whose value was an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">text/html</code>"</li>
|
|
<li>An <code title="">annotation-xml</code> element in the <a href="#mathml-namespace">MathML namespace</a> whose start tag token had an attribute with the name "encoding" whose value was an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">application/xhtml+xml</code>"</li>
|
|
<li>A <code title="">foreignObject</code> element in the <a href="#svg-namespace">SVG namespace</a></li>
|
|
<li>A <code title="">desc</code> element in the <a href="#svg-namespace">SVG namespace</a></li>
|
|
<li>A <code title="">title</code> element in the <a href="#svg-namespace">SVG namespace</a></li>
|
|
</ul><hr><p>When the steps below require the UA to <dfn id="insert-a-character">insert a
|
|
character</dfn> into a node, if that node has a child immediately
|
|
before where the character is to be inserted, and that child is a
|
|
<code><a href="#text">Text</a></code> node, then the character must be appended to that
|
|
<code><a href="#text">Text</a></code> node; otherwise, a new <code><a href="#text">Text</a></code> node
|
|
whose data is just that character must be inserted in the
|
|
appropriate place.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>Here are some sample inputs to the parser and the corresponding
|
|
number of text nodes that they result in, assuming a user agent
|
|
that executes scripts.</p>
|
|
|
|
<table><thead><tr><th>Input <th>Number of text nodes
|
|
<tbody><tr><td><pre>A<script>
|
|
var script = document.getElementsByTagName('script')[0];
|
|
document.body.removeChild(script);
|
|
</script>B</pre>
|
|
<td>One text node in the document, containing "AB".
|
|
<tr><td><pre>A<script>
|
|
var text = document.createTextNode('B');
|
|
document.body.appendChild(text);
|
|
</script>C</pre>
|
|
<td>Three text nodes; "A" before the script, the script's contents, and "BC" after the script (the parser appends to the text node created by the script).
|
|
<tr><td><pre>A<script>
|
|
var text = document.getElementsByTagName('script')[0].firstChild;
|
|
text.data = 'B';
|
|
document.body.appendChild(text);
|
|
</script>C</pre>
|
|
<td>Two adjacent text nodes in the document, containing "A" and "BC".
|
|
<tr><td><pre>A<table>B<tr>C</tr>D</table></pre>
|
|
<td>One text node before the table, containing "ABCD". (This is caused by <a href="#foster-parent" title="foster parent">foster parenting</a>.)
|
|
<tr><td><pre>A<table><tr> B</tr> C</table></pre>
|
|
<td>One text node before the table, containing "A B C" (A-space-B-space-C). (This is caused by <a href="#foster-parent" title="foster parent">foster parenting</a>.)
|
|
<tr><td><pre>A<table><tr> B</tr> </em>C</table></pre>
|
|
<td>One text node before the table, containing "A BC" (A-space-B-C), and one text node inside the table (as a child of a <code><a href="#the-tbody-element">tbody</a></code>) with a single space character. (Space characters separated from non-space characters by non-character tokens are not affected by <a href="#foster-parent" title="foster parent">foster parenting</a>, even if those other tokens then get ignored.)
|
|
</table></div>
|
|
|
|
<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"><a href="#dom-document-write">document.write()</a></code> and <code title="dom-document-writeln"><a href="#dom-document-writeln">document.writeln()</a></code> calls. <a href="#refsDOMEVENTS">[DOMEVENTS]</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
|
|
implementors are encouraged to avoid arbitrary limits, it is
|
|
recognized that <a href="#hardwareLimitations">practical
|
|
concerns</a> will likely force user agents to impose nesting depth
|
|
constraints.</p>
|
|
|
|
|
|
<h5 id="creating-and-inserting-elements"><span class="secno">8.2.5.1 </span>Creating and inserting elements</h5>
|
|
|
|
<p>When the steps below require the UA to <dfn id="create-an-element-for-the-token" title="create an
|
|
element for the token">create an element for a token</dfn> 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 <code><a href="#the-a-element">a</a></code>
|
|
element in the <a href="#html-namespace-0">HTML namespace</a>, this specification
|
|
defines it to be the <code><a href="#htmlanchorelement">HTMLAnchorElement</a></code> 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.</p>
|
|
|
|
<p>The interface appropriate for an element in the <a href="#html-namespace-0">HTML
|
|
namespace</a> that is not defined in this specification (or
|
|
<a href="#other-applicable-specifications">other applicable specifications</a>) is
|
|
<code><a href="#htmlunknownelement">HTMLUnknownElement</a></code>. Element in other namespaces whose
|
|
interface is not defined by that namespace's specification must use
|
|
the interface <code><a href="#element">Element</a></code>.</p>
|
|
|
|
<p>When a <a href="#category-reset" title="category-reset">resettable element</a> is
|
|
created in this manner, its <a href="#concept-form-reset-control" title="concept-form-reset-control">reset algorithm</a> must be
|
|
invoked once the attributes are set. (This initializes the element's
|
|
<a href="#concept-fe-value" title="concept-fe-value">value</a> and <a href="#concept-fe-checked" title="concept-fe-checked">checkedness</a> based on the element's
|
|
attributes.)</p>
|
|
|
|
<hr><p>When the steps below require the UA to <dfn id="insert-an-html-element">insert an HTML
|
|
element</dfn> for a token, the UA must first <a href="#create-an-element-for-the-token">create an element
|
|
for the token</a> in the <a href="#html-namespace-0">HTML namespace</a>, and then
|
|
append this node to the <a href="#current-node">current node</a>, and push it onto
|
|
the <a href="#stack-of-open-elements">stack of open elements</a> so that it is the new
|
|
<a href="#current-node">current node</a>.</p>
|
|
|
|
<p>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 <a href="#current-node">current
|
|
node</a>. (This happens in particular during the parsing of
|
|
tables with invalid content.)</p>
|
|
|
|
<p>If an element created by the <a href="#insert-an-html-element">insert an HTML element</a>
|
|
algorithm is a <a href="#form-associated-element">form-associated element</a>, and the
|
|
<a href="#form-element-pointer"><code title="">form</code> element pointer</a> is not null,
|
|
and the newly created element doesn't have a <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute, the user agent must
|
|
<a href="#concept-form-association" title="concept-form-association">associate</a> the newly
|
|
created element with the <code><a href="#the-form-element">form</a></code> element pointed to by the
|
|
<a href="#form-element-pointer"><code title="">form</code> element pointer</a> when the
|
|
element is inserted, instead of running the <a href="#reset-the-form-owner">reset the form
|
|
owner</a> algorithm.</p>
|
|
|
|
<hr><p>When the steps below require the UA to <dfn id="insert-a-foreign-element">insert a foreign
|
|
element</dfn> for a token, the UA must first <a href="#create-an-element-for-the-token">create an element
|
|
for the token</a> in the given namespace, and then append this
|
|
node to the <a href="#current-node">current node</a>, and push it onto the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> so that it is the new
|
|
<a href="#current-node">current node</a>. If the newly created element has an <code title="">xmlns</code> attribute in the <a href="#xmlns-namespace">XMLNS namespace</a>
|
|
whose value is not exactly the same as the element's namespace, that
|
|
is a <a href="#parse-error">parse error</a>. Similarly, if the newly created
|
|
element has an <code title="">xmlns:xlink</code> attribute in the
|
|
<a href="#xmlns-namespace">XMLNS namespace</a> whose value is not the <a href="#xlink-namespace">XLink
|
|
Namespace</a>, that is a <a href="#parse-error">parse error</a>.</p>
|
|
|
|
<p>When the steps below require the user agent to <dfn id="adjust-mathml-attributes">adjust MathML
|
|
attributes</dfn> for a token, then, if the token has an attribute
|
|
named <code title="">definitionurl</code>, change its name to <code title="">definitionURL</code> (note the case difference).</p>
|
|
|
|
<p>When the steps below require the user agent to <dfn id="adjust-svg-attributes">adjust SVG
|
|
attributes</dfn> for a token, then, for each attribute on the token
|
|
whose attribute name is one of the ones in the first column of the
|
|
following table, change the attribute's name to the name given in
|
|
the corresponding cell in the second column. (This fixes the case of
|
|
SVG attributes that are not all lowercase.)</p>
|
|
|
|
<table><thead><tr><th> Attribute name on token <th> Attribute name on element
|
|
<tbody><tr><td> <code title="">attributename</code> <td> <code title="">attributeName</code>
|
|
<tr><td> <code title="">attributetype</code> <td> <code title="">attributeType</code>
|
|
<tr><td> <code title="">basefrequency</code> <td> <code title="">baseFrequency</code>
|
|
<tr><td> <code title="">baseprofile</code> <td> <code title="">baseProfile</code>
|
|
<tr><td> <code title="">calcmode</code> <td> <code title="">calcMode</code>
|
|
<tr><td> <code title="">clippathunits</code> <td> <code title="">clipPathUnits</code>
|
|
<tr><td> <code title="">contentscripttype</code> <td> <code title="">contentScriptType</code>
|
|
<tr><td> <code title="">contentstyletype</code> <td> <code title="">contentStyleType</code>
|
|
<tr><td> <code title="">diffuseconstant</code> <td> <code title="">diffuseConstant</code>
|
|
<tr><td> <code title="">edgemode</code> <td> <code title="">edgeMode</code>
|
|
<tr><td> <code title="">externalresourcesrequired</code> <td> <code title="">externalResourcesRequired</code>
|
|
<tr><td> <code title="">filterres</code> <td> <code title="">filterRes</code>
|
|
<tr><td> <code title="">filterunits</code> <td> <code title="">filterUnits</code>
|
|
<tr><td> <code title="">glyphref</code> <td> <code title="">glyphRef</code>
|
|
<tr><td> <code title="">gradienttransform</code> <td> <code title="">gradientTransform</code>
|
|
<tr><td> <code title="">gradientunits</code> <td> <code title="">gradientUnits</code>
|
|
<tr><td> <code title="">kernelmatrix</code> <td> <code title="">kernelMatrix</code>
|
|
<tr><td> <code title="">kernelunitlength</code> <td> <code title="">kernelUnitLength</code>
|
|
<tr><td> <code title="">keypoints</code> <td> <code title="">keyPoints</code>
|
|
<tr><td> <code title="">keysplines</code> <td> <code title="">keySplines</code>
|
|
<tr><td> <code title="">keytimes</code> <td> <code title="">keyTimes</code>
|
|
<tr><td> <code title="">lengthadjust</code> <td> <code title="">lengthAdjust</code>
|
|
<tr><td> <code title="">limitingconeangle</code> <td> <code title="">limitingConeAngle</code>
|
|
<tr><td> <code title="">markerheight</code> <td> <code title="">markerHeight</code>
|
|
<tr><td> <code title="">markerunits</code> <td> <code title="">markerUnits</code>
|
|
<tr><td> <code title="">markerwidth</code> <td> <code title="">markerWidth</code>
|
|
<tr><td> <code title="">maskcontentunits</code> <td> <code title="">maskContentUnits</code>
|
|
<tr><td> <code title="">maskunits</code> <td> <code title="">maskUnits</code>
|
|
<tr><td> <code title="">numoctaves</code> <td> <code title="">numOctaves</code>
|
|
<tr><td> <code title="">pathlength</code> <td> <code title="">pathLength</code>
|
|
<tr><td> <code title="">patterncontentunits</code> <td> <code title="">patternContentUnits</code>
|
|
<tr><td> <code title="">patterntransform</code> <td> <code title="">patternTransform</code>
|
|
<tr><td> <code title="">patternunits</code> <td> <code title="">patternUnits</code>
|
|
<tr><td> <code title="">pointsatx</code> <td> <code title="">pointsAtX</code>
|
|
<tr><td> <code title="">pointsaty</code> <td> <code title="">pointsAtY</code>
|
|
<tr><td> <code title="">pointsatz</code> <td> <code title="">pointsAtZ</code>
|
|
<tr><td> <code title="">preservealpha</code> <td> <code title="">preserveAlpha</code>
|
|
<tr><td> <code title="">preserveaspectratio</code> <td> <code title="">preserveAspectRatio</code>
|
|
<tr><td> <code title="">primitiveunits</code> <td> <code title="">primitiveUnits</code>
|
|
<tr><td> <code title="">refx</code> <td> <code title="">refX</code>
|
|
<tr><td> <code title="">refy</code> <td> <code title="">refY</code>
|
|
<tr><td> <code title="">repeatcount</code> <td> <code title="">repeatCount</code>
|
|
<tr><td> <code title="">repeatdur</code> <td> <code title="">repeatDur</code>
|
|
<tr><td> <code title="">requiredextensions</code> <td> <code title="">requiredExtensions</code>
|
|
<tr><td> <code title="">requiredfeatures</code> <td> <code title="">requiredFeatures</code>
|
|
<tr><td> <code title="">specularconstant</code> <td> <code title="">specularConstant</code>
|
|
<tr><td> <code title="">specularexponent</code> <td> <code title="">specularExponent</code>
|
|
<tr><td> <code title="">spreadmethod</code> <td> <code title="">spreadMethod</code>
|
|
<tr><td> <code title="">startoffset</code> <td> <code title="">startOffset</code>
|
|
<tr><td> <code title="">stddeviation</code> <td> <code title="">stdDeviation</code>
|
|
<tr><td> <code title="">stitchtiles</code> <td> <code title="">stitchTiles</code>
|
|
<tr><td> <code title="">surfacescale</code> <td> <code title="">surfaceScale</code>
|
|
<tr><td> <code title="">systemlanguage</code> <td> <code title="">systemLanguage</code>
|
|
<tr><td> <code title="">tablevalues</code> <td> <code title="">tableValues</code>
|
|
<tr><td> <code title="">targetx</code> <td> <code title="">targetX</code>
|
|
<tr><td> <code title="">targety</code> <td> <code title="">targetY</code>
|
|
<tr><td> <code title="">textlength</code> <td> <code title="">textLength</code>
|
|
<tr><td> <code title="">viewbox</code> <td> <code title="">viewBox</code>
|
|
<tr><td> <code title="">viewtarget</code> <td> <code title="">viewTarget</code>
|
|
<tr><td> <code title="">xchannelselector</code> <td> <code title="">xChannelSelector</code>
|
|
<tr><td> <code title="">ychannelselector</code> <td> <code title="">yChannelSelector</code>
|
|
<tr><td> <code title="">zoomandpan</code> <td> <code title="">zoomAndPan</code>
|
|
</table><p>When the steps below require the user agent to <dfn id="adjust-foreign-attributes">adjust
|
|
foreign attributes</dfn> 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
|
|
<a href="#attr-xml-lang" title="attr-xml-lang"><code title="">lang</code> attributes in
|
|
the <span>XML namespace</span></a>.)</p>
|
|
|
|
<table><thead><tr><th> Attribute name <th> Prefix <th> Local name <th> Namespace
|
|
<tbody><tr><td> <code title="">xlink:actuate</code> <td> <code title="">xlink</code> <td> <code title="">actuate</code> <td> <a href="#xlink-namespace">XLink namespace</a>
|
|
<tr><td> <code title="">xlink:arcrole</code> <td> <code title="">xlink</code> <td> <code title="">arcrole</code> <td> <a href="#xlink-namespace">XLink namespace</a>
|
|
<tr><td> <code title="">xlink:href</code> <td> <code title="">xlink</code> <td> <code title="">href</code> <td> <a href="#xlink-namespace">XLink namespace</a>
|
|
<tr><td> <code title="">xlink:role</code> <td> <code title="">xlink</code> <td> <code title="">role</code> <td> <a href="#xlink-namespace">XLink namespace</a>
|
|
<tr><td> <code title="">xlink:show</code> <td> <code title="">xlink</code> <td> <code title="">show</code> <td> <a href="#xlink-namespace">XLink namespace</a>
|
|
<tr><td> <code title="">xlink:title</code> <td> <code title="">xlink</code> <td> <code title="">title</code> <td> <a href="#xlink-namespace">XLink namespace</a>
|
|
<tr><td> <code title="">xlink:type</code> <td> <code title="">xlink</code> <td> <code title="">type</code> <td> <a href="#xlink-namespace">XLink namespace</a>
|
|
<tr><td> <code title="">xml:base</code> <td> <code title="">xml</code> <td> <code title="">base</code> <td> <a href="#xml-namespace">XML namespace</a>
|
|
<tr><td> <code title="">xml:lang</code> <td> <code title="">xml</code> <td> <code title="">lang</code> <td> <a href="#xml-namespace">XML namespace</a>
|
|
<tr><td> <code title="">xml:space</code> <td> <code title="">xml</code> <td> <code title="">space</code> <td> <a href="#xml-namespace">XML namespace</a>
|
|
<tr><td> <code title="">xmlns</code> <td> (none) <td> <code title="">xmlns</code> <td> <a href="#xmlns-namespace">XMLNS namespace</a>
|
|
<tr><td> <code title="">xmlns:xlink</code> <td> <code title="">xmlns</code> <td> <code title="">xlink</code> <td> <a href="#xmlns-namespace">XMLNS namespace</a>
|
|
</table><hr><p>The <dfn id="generic-raw-text-element-parsing-algorithm">generic raw text element parsing algorithm</dfn> and the
|
|
<dfn id="generic-rcdata-element-parsing-algorithm">generic RCDATA element parsing algorithm</dfn> consist of the
|
|
following steps. These algorithms are always invoked in response to
|
|
a start tag token.</p>
|
|
|
|
<ol><li><p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</li>
|
|
|
|
<li><p>If the algorithm that was invoked is the <a href="#generic-raw-text-element-parsing-algorithm">generic raw
|
|
text element parsing algorithm</a>, switch the tokenizer to the
|
|
<a href="#rawtext-state">RAWTEXT state</a>; otherwise the algorithm invoked
|
|
was the <a href="#generic-rcdata-element-parsing-algorithm">generic RCDATA element parsing algorithm</a>,
|
|
switch the tokenizer to the <a href="#rcdata-state">RCDATA state</a>.</li>
|
|
|
|
<li><p>Let the <a href="#original-insertion-mode">original insertion mode</a> be the current
|
|
<a href="#insertion-mode">insertion mode</a>.</p>
|
|
|
|
<li><p>Then, switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-incdata" title="insertion mode: text">text</a>".</li>
|
|
|
|
</ol><h5 id="closing-elements-that-have-implied-end-tags"><span class="secno">8.2.5.2 </span>Closing elements that have implied end tags</h5>
|
|
|
|
<p>When the steps below require the UA to <dfn id="generate-implied-end-tags">generate implied end
|
|
tags</dfn>, then, while the <a href="#current-node">current node</a> is a
|
|
<code><a href="#the-dd-element">dd</a></code> element, a <code><a href="#the-dt-element">dt</a></code> element, an
|
|
<code><a href="#the-li-element">li</a></code> element, an <code><a href="#the-option-element">option</a></code> element, an
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element, a <code><a href="#the-p-element">p</a></code> element, an
|
|
<code><a href="#the-rp-element">rp</a></code> element, or an <code><a href="#the-rt-element">rt</a></code> element, the UA must
|
|
pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p>If a step 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.</p>
|
|
|
|
|
|
<h5 id="foster-parenting"><span class="secno">8.2.5.3 </span>Foster parenting</h5>
|
|
|
|
<p>Foster parenting happens when content is misnested in tables.</p>
|
|
|
|
<p>When a node <var title="">node</var> is to be <dfn id="foster-parent" title="foster
|
|
parent">foster parented</dfn>, the node <var title="">node</var>
|
|
must be inserted into the <i><a href="#foster-parent-element">foster parent element</a></i>.</p>
|
|
|
|
<p>The <dfn id="foster-parent-element">foster parent element</dfn> is the parent element of the
|
|
last <code><a href="#the-table-element">table</a></code> element in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>, if there is a <code><a href="#the-table-element">table</a></code> element and it has
|
|
such a parent element.</p>
|
|
|
|
<p class="note">It might have no parent or some other kind parent if
|
|
a script manipulated the DOM after the element was inserted by the
|
|
parser.</p>
|
|
|
|
<p>If there is no <code><a href="#the-table-element">table</a></code> element in the <a href="#stack-of-open-elements">stack of
|
|
open elements</a> (<a href="#fragment-case">fragment case</a>), then the
|
|
<i><a href="#foster-parent-element">foster parent element</a></i> is the first element in the <a href="#stack-of-open-elements">stack
|
|
of open elements</a> (the <code><a href="#the-html-element">html</a></code> element). Otherwise,
|
|
if there is a <code><a href="#the-table-element">table</a></code> element in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>, but the last <code><a href="#the-table-element">table</a></code> element in the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> has no parent, or its parent
|
|
node is not an element, then the <i><a href="#foster-parent-element">foster parent element</a></i> is the
|
|
element before the last <code><a href="#the-table-element">table</a></code> element in the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</p>
|
|
|
|
<p>If the <i><a href="#foster-parent-element">foster parent element</a></i> is the parent element of the
|
|
last <code><a href="#the-table-element">table</a></code> element in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>, then <var title="">node</var> must be inserted into
|
|
the <i><a href="#foster-parent-element">foster parent element</a></i>, immediately <em>before</em> the
|
|
last <code><a href="#the-table-element">table</a></code> element in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>; otherwise, <var title="">node</var> must be
|
|
<em>appended</em> to the <i><a href="#foster-parent-element">foster parent element</a></i>.</p>
|
|
|
|
|
|
|
|
<h5 id="parsing-main-inhtml"><span class="secno">8.2.5.4 </span>The rules for parsing tokens in HTML content</h5>
|
|
|
|
|
|
<h6 id="the-initial-insertion-mode"><span class="secno">8.2.5.4.1 </span>The "<dfn title="insertion mode: initial">initial</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#the-initial-insertion-mode" title="insertion mode: initial">initial</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p>Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <code><a href="#document">Document</a></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 name is not a
|
|
<a href="#case-sensitive">case-sensitive</a> match for the string "<code title="">html</code>", or the token's public identifier is not
|
|
missing, or the token's system identifier is neither missing nor a
|
|
<a href="#case-sensitive">case-sensitive</a> match for the string
|
|
"<code><a href="#about:legacy-compat">about:legacy-compat</a></code>", and none of the sets of
|
|
conditions in the following list are matched, then there is a
|
|
<a href="#parse-error">parse error</a>.</p>
|
|
|
|
<ul><li>The DOCTYPE token's name is a <a href="#case-sensitive">case-sensitive</a>
|
|
match for the string "<code title="">html</code>", the token's
|
|
public identifier is the <a href="#case-sensitive">case-sensitive</a> string
|
|
"<code title="">-//W3C//DTD HTML 4.0//EN</code>", and
|
|
the token's system identifier is either missing or the
|
|
<a href="#case-sensitive">case-sensitive</a> string "<code title="">http://www.w3.org/TR/REC-html40/strict.dtd</code>".</li>
|
|
|
|
<li>The DOCTYPE token's name is a <a href="#case-sensitive">case-sensitive</a>
|
|
match for the string "<code title="">html</code>", the token's
|
|
public identifier is the <a href="#case-sensitive">case-sensitive</a> string
|
|
"<code title="">-//W3C//DTD HTML 4.01//EN</code>", and
|
|
the token's system identifier is either missing or the
|
|
<a href="#case-sensitive">case-sensitive</a> string "<code title="">http://www.w3.org/TR/html4/strict.dtd</code>".</li>
|
|
|
|
<li>The DOCTYPE token's name is a <a href="#case-sensitive">case-sensitive</a>
|
|
match for the string "<code title="">html</code>", the token's
|
|
public identifier is the <a href="#case-sensitive">case-sensitive</a> string
|
|
"<code title="">-//W3C//DTD XHTML 1.0 Strict//EN</code>",
|
|
and the token's system identifier is the
|
|
<a href="#case-sensitive">case-sensitive</a> string "<code title="">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</code>".</li>
|
|
|
|
<li>The DOCTYPE token's name is a <a href="#case-sensitive">case-sensitive</a>
|
|
match for the string "<code title="">html</code>", the token's
|
|
public identifier is the <a href="#case-sensitive">case-sensitive</a> string
|
|
"<code title="">-//W3C//DTD XHTML 1.1//EN</code>", and
|
|
the token's system identifier is the <a href="#case-sensitive">case-sensitive</a>
|
|
string "<code title="">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</code>".</li>
|
|
|
|
</ul><p>Conformance checkers may, based on the values (including
|
|
presence or lack thereof) of the DOCTYPE token's name, public
|
|
identifier, or system identifier, switch to a conformance checking
|
|
mode for another language (e.g. based on the DOCTYPE token a
|
|
conformance checker could recognize that the document is an
|
|
HTML4-era document, and defer to an HTML4 conformance
|
|
checker.)</p>
|
|
|
|
<p>Append a <code><a href="#documenttype">DocumentType</a></code> node to the
|
|
<code><a href="#document">Document</a></code> node, with the <code title="">name</code>
|
|
attribute set to the name given in the DOCTYPE token, or the empty
|
|
string if the name was missing; 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 missing; 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 missing; and the other attributes specific
|
|
to <code><a href="#documenttype">DocumentType</a></code> objects set to null and empty lists
|
|
as appropriate. Associate the <code><a href="#documenttype">DocumentType</a></code> node with
|
|
the <code><a href="#document">Document</a></code> object so that it is returned as the
|
|
value of the <code title="">doctype</code> attribute of the
|
|
<code><a href="#document">Document</a></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
|
|
<code><a href="#document">Document</a></code> to <a href="#quirks-mode">quirks mode</a>:</p>
|
|
|
|
<ul class="brief"><li> The <i>force-quirks flag</i> is set to <i>on</i>. </li>
|
|
<li> The name is set to anything other than "<code title="">html</code>" (compared <a href="#case-sensitive" title="case-sensitive">case-sensitively</a>). </li>
|
|
<li> The public identifier starts with: "<code title="">+//Silmaril//dtd html Pro v0r11 19970101//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//AdvaSoft Ltd//DTD HTML 3.0 asWedit + extensions//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//AS//DTD HTML 3.0 asWedit + extensions//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Level 1//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Level 2//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Strict Level 1//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Strict Level 2//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0 Strict//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.0//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 2.1E//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 3.0//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 3.2 Final//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 3.2//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML 3//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Level 0//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Level 1//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Level 2//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Level 3//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict Level 0//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict Level 1//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict Level 2//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict Level 3//</code>" </li>
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML Strict//</code>" </li>
|
|
|
|
|
|
<li> The public identifier starts with: "<code title="">-//IETF//DTD HTML//</code>" </li>
|
|
|
|
|
|
<li> The public identifier starts with: "<code title="">-//Metrius//DTD Metrius Presentational//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 HTML Strict//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 HTML//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 2.0 Tables//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 HTML Strict//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 HTML//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Microsoft//DTD Internet Explorer 3.0 Tables//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Netscape Comm. Corp.//DTD HTML//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Netscape Comm. Corp.//DTD Strict HTML//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//O'Reilly and Associates//DTD HTML 2.0//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//O'Reilly and Associates//DTD HTML Extended 1.0//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//O'Reilly and Associates//DTD HTML Extended Relaxed 1.0//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//SoftQuad Software//DTD HoTMetaL PRO 6.0::19990601::extensions to HTML 4.0//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//SoftQuad//DTD HoTMetaL PRO 4.0::19971010::extensions to HTML 4.0//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Spyglass//DTD HTML 2.0 Extended//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//SQ//DTD HTML 2.0 HoTMetaL + extensions//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Sun Microsystems Corp.//DTD HotJava HTML//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//Sun Microsystems Corp.//DTD HotJava Strict HTML//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3 1995-03-24//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3.2 Draft//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3.2 Final//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3.2//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 3.2S Draft//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 4.0 Frameset//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML 4.0 Transitional//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML Experimental 19960712//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD HTML Experimental 970421//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD W3 HTML//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3O//DTD W3 HTML 3.0//</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 starts with: "<code title="">-//WebTechs//DTD Mozilla HTML 2.0//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//WebTechs//DTD Mozilla HTML//</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 starts with: "<code title="">-//W3C//DTD HTML 4.01 Frameset//</code>" </li>
|
|
<li> The system identifier is missing and the public identifier starts with: "<code title="">-//W3C//DTD HTML 4.01 Transitional//</code>" </li>
|
|
</ul><p>Otherwise, if the DOCTYPE token matches one of the conditions
|
|
in the following list, then set the <code><a href="#document">Document</a></code> to
|
|
<a href="#limited-quirks-mode">limited-quirks mode</a>:</p>
|
|
|
|
<ul class="brief"><li> The public identifier starts with: "<code title="">-//W3C//DTD XHTML 1.0 Frameset//</code>" </li>
|
|
<li> The public identifier starts with: "<code title="">-//W3C//DTD XHTML 1.0 Transitional//</code>" </li>
|
|
<li> The system identifier is not missing and the public identifier starts with: "<code title="">-//W3C//DTD HTML 4.01 Frameset//</code>" </li>
|
|
<li> The system identifier is not missing and the public identifier starts with: "<code title="">-//W3C//DTD HTML 4.01 Transitional//</code>" </li>
|
|
</ul><p>The system identifier and public identifier strings must be
|
|
compared to the values given in the lists above in an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> manner. A system identifier whose value is
|
|
the empty string is not considered missing for the purposes of the
|
|
conditions above.</p>
|
|
|
|
<p>Then, switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#the-before-html-insertion-mode" title="insertion mode: before html">before html</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
|
|
<p>If the document is <em>not</em> <a href="#an-iframe-srcdoc-document">an <code>iframe</code>
|
|
<code title="attr-iframe-srcdoc">srcdoc</code> document</a>,
|
|
then this is a <a href="#parse-error">parse error</a>; set the
|
|
<code><a href="#document">Document</a></code> to <a href="#quirks-mode">quirks mode</a>.</p>
|
|
|
|
<p>In any case, switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#the-before-html-insertion-mode" title="insertion mode: before html">before html</a>", then
|
|
reprocess the current token.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h6 id="the-before-html-insertion-mode"><span class="secno">8.2.5.4.2 </span>The "<dfn title="insertion mode: before html">before html</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#the-before-html-insertion-mode" title="insertion mode: before html">before html</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A DOCTYPE token</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <code><a href="#document">Document</a></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 U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p>Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#create-an-element-for-the-token">Create an element for the token</a> in the <a href="#html-namespace-0">HTML
|
|
namespace</a>. Append it to the <code><a href="#document">Document</a></code>
|
|
object. Put this element in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p id="parser-appcache">If the <code><a href="#document">Document</a></code> is being
|
|
loaded as part of <a href="#navigate" title="navigate">navigation</a> of a
|
|
<a href="#browsing-context">browsing context</a>, then: if the newly created element
|
|
has a <code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code> attribute
|
|
whose value is not the empty string, then <a href="#resolve-a-url" title="resolve a
|
|
url">resolve</a> the value of that attribute to an
|
|
<a href="#absolute-url">absolute URL</a>, relative to the newly created element,
|
|
and if that is successful, run the <a href="#concept-appcache-init" title="concept-appcache-init">application cache selection
|
|
algorithm</a> with the resulting <a href="#absolute-url">absolute URL</a> with
|
|
any <a href="#url-fragment" title="url-fragment"><fragment></a> component
|
|
removed; otherwise, if there is no such attribute, or its value is
|
|
the empty string, or resolving its value fails, run the <a href="#concept-appcache-init" title="concept-appcache-init">application cache selection
|
|
algorithm</a> with no manifest. The algorithm must be passed
|
|
the <code><a href="#document">Document</a></code> object.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#the-before-head-insertion-mode" title="insertion mode: before head">before head</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is one of: "head", "body", "html", "br"</dt>
|
|
<dd>
|
|
<p>Act as described in the "anything else" entry below.</p>
|
|
</dd>
|
|
|
|
<dt>Any other end tag</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
|
|
<p>Create an <code><a href="#the-html-element">html</a></code> element. Append it to the
|
|
<code><a href="#document">Document</a></code> object. Put this element in the <a href="#stack-of-open-elements">stack
|
|
of open elements</a>.</p>
|
|
|
|
<p>If the <code><a href="#document">Document</a></code> is being loaded as part of <a href="#navigate" title="navigate">navigation</a> of a <a href="#browsing-context">browsing
|
|
context</a>, then: run the <a href="#concept-appcache-init" title="concept-appcache-init">application cache selection
|
|
algorithm</a> with no manifest, passing it the
|
|
<code><a href="#document">Document</a></code> object.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#the-before-head-insertion-mode" title="insertion mode: before head">before head</a>", then
|
|
reprocess the current token.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The root element can end up being removed from the
|
|
<code><a href="#document">Document</a></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.</p>
|
|
|
|
|
|
<h6 id="the-before-head-insertion-mode"><span class="secno">8.2.5.4.3 </span>The "<dfn title="insertion mode: before head">before head</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#the-before-head-insertion-mode" title="insertion mode: before head">before head</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p>Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "head"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Set the <a href="#head-element-pointer"><code title="">head</code> element pointer</a>
|
|
to the newly created <code><a href="#the-head-element">head</a></code> element.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is one of: "head", "body", "html", "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="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Anything else</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>
|
|
|
|
</dl><h6 id="parsing-main-inhead"><span class="secno">8.2.5.4.4 </span>The "<dfn title="insertion mode: in head">in head</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the character</a> into
|
|
the <a href="#current-node">current node</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "base", "basefont",
|
|
"bgsound", "command", "link"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. Immediately
|
|
pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "meta"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. Immediately
|
|
pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</p>
|
|
|
|
<p id="meta-charset-during-parse">If the element has a <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute, and its value
|
|
is either a supported <a href="#ascii-compatible-character-encoding">ASCII-compatible character
|
|
encoding</a> or a UTF-16 encoding, and the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> is currently
|
|
<i>tentative</i>, then <a href="#change-the-encoding">change the encoding</a> to the
|
|
encoding given by the value of the <code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code> attribute.</p>
|
|
|
|
<p>Otherwise, if the element has an <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code> attribute whose
|
|
value is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the
|
|
string "<code title="">Content-Type</code>", and the element has a
|
|
<code title="attr-meta-content"><a href="#attr-meta-content">content</a></code> attribute, and
|
|
applying the <a href="#algorithm-for-extracting-an-encoding-from-a-meta-element">algorithm for extracting an encoding from a
|
|
<code>meta</code> element</a> to that attribute's value returns
|
|
a supported <a href="#ascii-compatible-character-encoding">ASCII-compatible character encoding</a> or a
|
|
UTF-16 encoding, and the <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> is currently
|
|
<i>tentative</i>, then <a href="#change-the-encoding">change the encoding</a> to the
|
|
extracted encoding.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "title"</dt>
|
|
<dd>
|
|
<p>Follow the <a href="#generic-rcdata-element-parsing-algorithm">generic RCDATA element parsing algorithm</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "noscript", if the <a href="#scripting-flag">scripting flag</a> is enabled</dt>
|
|
<dt>A start tag whose tag name is one of: "noframes", "style"</dt>
|
|
<dd>
|
|
<p>Follow the <a href="#generic-raw-text-element-parsing-algorithm">generic raw text element parsing algorithm</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "noscript", if the <a href="#scripting-flag">scripting flag</a> is disabled</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inheadnoscript" 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>Run these steps:</p>
|
|
|
|
<ol><li><p><a href="#create-an-element-for-the-token">Create an element for the token</a> in the
|
|
<a href="#html-namespace-0">HTML namespace</a>.</li>
|
|
|
|
<li>
|
|
|
|
<p>Mark the element as being <a href="#parser-inserted">"parser-inserted"</a> and
|
|
unset the element's <a href="#force-async">"force-async"</a> flag.</p>
|
|
|
|
<p class="note">This ensures that, if the script is external,
|
|
any <code title="dom-document-write"><a href="#dom-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. It also
|
|
prevents the script from executing until the end tag is
|
|
seen.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the parser was originally created for the <a href="#html-fragment-parsing-algorithm">HTML
|
|
fragment parsing algorithm</a>, then mark the
|
|
<code><a href="#the-script-element">script</a></code> element as <a href="#already-started">"already
|
|
started"</a>. (<a href="#fragment-case">fragment case</a>)</li>
|
|
|
|
<li><p>Append the new element to the <a href="#current-node">current node</a>
|
|
and push it onto the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</li>
|
|
|
|
<li><p>Switch the tokenizer to the <a href="#script-data-state">script data
|
|
state</a>.</li>
|
|
|
|
<li><p>Let the <a href="#original-insertion-mode">original insertion mode</a> be the current
|
|
<a href="#insertion-mode">insertion mode</a>.</p>
|
|
|
|
<li><p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-incdata" title="insertion mode: text">text</a>".</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>An end tag whose tag name is "head"</dt>
|
|
<dd>
|
|
|
|
<p>Pop the <a href="#current-node">current node</a> (which will be the
|
|
<code><a href="#the-head-element">head</a></code> element) off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#the-after-head-insertion-mode" title="insertion mode: after head">after head</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is one of: "body", "html", "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="#parse-error">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>
|
|
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-inheadnoscript"><span class="secno">8.2.5.4.5 </span>The "<dfn title="insertion mode: in head noscript">in head noscript</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-inheadnoscript" title="insertion mode: in head noscript">in head noscript</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A DOCTYPE token</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "noscript"</dt>
|
|
<dd>
|
|
|
|
<p>Pop the <a href="#current-node">current node</a> (which will be a
|
|
<code><a href="#the-noscript-element">noscript</a></code> element) from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>; the new <a href="#current-node">current node</a> will be a
|
|
<code><a href="#the-head-element">head</a></code> element.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dt>A comment token</dt>
|
|
<dt>A start tag whose tag name is one of: "basefont", "bgsound",
|
|
"link", "meta", "noframes", "style"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "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="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
<p><a href="#parse-error">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><h6 id="the-after-head-insertion-mode"><span class="secno">8.2.5.4.6 </span>The "<dfn title="insertion mode: after head">after head</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#the-after-head-insertion-mode" title="insertion mode: after head">after head</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the character</a> into
|
|
the <a href="#current-node">current node</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "body"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "frameset"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inframeset" title="insertion mode: in frameset">in frameset</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag token whose tag name is one of: "base", "basefont",
|
|
"bgsound", "link", "meta", "noframes", "script", "style",
|
|
"title"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>Push the node pointed to by the <a href="#head-element-pointer"><code title="">head</code> element pointer</a> onto the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</p>
|
|
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
|
|
<p>Remove the node pointed to by the <a href="#head-element-pointer"><code title="">head</code> element pointer</a> from the <a href="#stack-of-open-elements">stack
|
|
of open elements</a>.</p>
|
|
|
|
<p class="note">The <a href="#head-element-pointer"><code title="">head</code> element
|
|
pointer</a> cannot be null at this point.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is one of: "body", "html", "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="#parse-error">Parse error</a>. Ignore the token.</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, then set the <a href="#frameset-ok-flag">frameset-ok
|
|
flag</a> back to "ok", and then reprocess the current
|
|
token.</p>
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-inbody"><span class="secno">8.2.5.4.7 </span>The "<dfn title="insertion mode: in body">in body</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is U+0000 NULL</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>A character token that is one of U+0009 CHARACTER TABULATION,
|
|
U+000A LINE FEED (LF), U+000C FORM FEED (FF), U+000D CARRIAGE
|
|
RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the token's
|
|
character</a> into the <a href="#current-node">current node</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Any other character token</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the token's
|
|
character</a> into the <a href="#current-node">current node</a>.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. For each attribute on the token,
|
|
check to see if the attribute is already present on the top
|
|
element of the <a href="#stack-of-open-elements">stack of open elements</a>. If it is not,
|
|
add the attribute and its corresponding value to that element.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag token whose tag name is one of: "base", "basefont",
|
|
"bgsound", "command", "link", "meta", "noframes", "script",
|
|
"style", "title"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "body"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>If the second element on the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> is not a <code><a href="#the-body-element">body</a></code> element, or, if the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> has only one node on it,
|
|
then ignore the token. (<a href="#fragment-case">fragment case</a>)</p>
|
|
|
|
<p>Otherwise, set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok";
|
|
then, for each attribute on the token, check to see if the
|
|
attribute is already present on the <code><a href="#the-body-element">body</a></code> element (the
|
|
second element) on the <a href="#stack-of-open-elements">stack of open elements</a>, and if
|
|
it is not, add the attribute and its corresponding value to that
|
|
element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "frameset"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>If the second element on the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> is not a <code><a href="#the-body-element">body</a></code> element, or, if the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> has only one node on it,
|
|
then ignore the token. (<a href="#fragment-case">fragment case</a>)</p>
|
|
|
|
<p>If the <a href="#frameset-ok-flag">frameset-ok flag</a> is set to "not ok", ignore
|
|
the token.</p>
|
|
|
|
<p>Otherwise, run the following steps:</p>
|
|
|
|
<ol><li><p>Remove the second element on the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> from its parent node, if it has one.</li>
|
|
|
|
<li><p>Pop all the nodes from the bottom of the <a href="#stack-of-open-elements">stack of
|
|
open elements</a>, from the <a href="#current-node">current node</a> up to,
|
|
but not including, the root <code><a href="#the-html-element">html</a></code> element.</p>
|
|
|
|
<li><p><a href="#insert-an-html-element">Insert an HTML element</a> for the
|
|
token.</li>
|
|
|
|
<li><p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inframeset" title="insertion mode: in frameset">in frameset</a>".</p>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
|
|
<p>If there is a node in the <a href="#stack-of-open-elements">stack of open elements</a>
|
|
that is not either a <code><a href="#the-dd-element">dd</a></code> element, a <code><a href="#the-dt-element">dt</a></code>
|
|
element, an <code><a href="#the-li-element">li</a></code> element, a <code><a href="#the-p-element">p</a></code> element, a
|
|
<code><a href="#the-tbody-element">tbody</a></code> element, a <code><a href="#the-td-element">td</a></code> element, a
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> element, a <code><a href="#the-th-element">th</a></code> element, a
|
|
<code><a href="#the-thead-element">thead</a></code> element, a <code><a href="#the-tr-element">tr</a></code> element, the
|
|
<code><a href="#the-body-element">body</a></code> element, or the <code><a href="#the-html-element">html</a></code> element, then
|
|
this is a <a href="#parse-error">parse error</a>.</p>
|
|
<p><a href="#stop-parsing">Stop parsing</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "body"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-scope" title="has an element in scope">have a <code>body</code> element
|
|
in scope</a>, this is a <a href="#parse-error">parse error</a>; ignore the
|
|
token.</p>
|
|
|
|
|
|
<p>Otherwise, if there is a node in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> that is not either a <code><a href="#the-dd-element">dd</a></code> element, a
|
|
<code><a href="#the-dt-element">dt</a></code> element, an <code><a href="#the-li-element">li</a></code> element, an
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element, an <code><a href="#the-option-element">option</a></code> element, a
|
|
<code><a href="#the-p-element">p</a></code> element, an <code><a href="#the-rp-element">rp</a></code> element, an
|
|
<code><a href="#the-rt-element">rt</a></code> element, a <code><a href="#the-tbody-element">tbody</a></code> element, a
|
|
<code><a href="#the-td-element">td</a></code> element, a <code><a href="#the-tfoot-element">tfoot</a></code> element, a
|
|
<code><a href="#the-th-element">th</a></code> element, a <code><a href="#the-thead-element">thead</a></code> element, a
|
|
<code><a href="#the-tr-element">tr</a></code> element, the <code><a href="#the-body-element">body</a></code> element, or the
|
|
<code><a href="#the-html-element">html</a></code> element, then this is a <a href="#parse-error">parse
|
|
error</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-afterbody" title="insertion mode: after body">after body</a>".</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>
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt>A start tag whose tag name is one of: "address", "article",
|
|
"aside", "blockquote", "center", "details", "dir", "div", "dl",
|
|
"fieldset", "figcaption", "figure", "footer", "header", "hgroup",
|
|
"menu", "nav", "ol", "p", "section", "summary", "ul"</dt>
|
|
<dd>
|
|
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has an
|
|
element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name "p" had
|
|
been seen.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>A start tag whose tag name is one of: "h1", "h2", "h3", "h4",
|
|
"h5", "h6"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has
|
|
an element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name
|
|
"p" had been seen.</p>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is an element whose tag name
|
|
is one of "h1", "h2", "h3", "h4", "h5", or "h6", then this is a
|
|
<a href="#parse-error">parse error</a>; pop the <a href="#current-node">current node</a> off
|
|
the <a href="#stack-of-open-elements">stack of open elements</a>.</p>
|
|
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>A start tag whose tag name is one of: "pre", "listing"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has
|
|
an element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name
|
|
"p" had been seen.</p>
|
|
|
|
<p><a href="#insert-an-html-element">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="#the-pre-element">pre</a></code> blocks are
|
|
ignored as an authoring convenience.)</p>
|
|
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>A start tag whose tag name is "form"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#form-element-pointer"><code title="form">form</code> element
|
|
pointer</a> is not null, then this is a <a href="#parse-error">parse
|
|
error</a>; ignore the token.</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has
|
|
an element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name
|
|
"p" had been seen.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token, and set the
|
|
<a href="#form-element-pointer"><code title="form">form</code> element pointer</a> to
|
|
point to the element created.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>A start tag whose tag name is "li"</dt>
|
|
<dd>
|
|
|
|
<p>Run these steps:</p>
|
|
|
|
<ol><li><p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</li>
|
|
|
|
<li><p>Initialize <var title="">node</var> to be the <a href="#current-node">current
|
|
node</a> (the bottommost node of the stack).</li>
|
|
|
|
<li><p><i>Loop</i>: If <var title="">node</var> is an
|
|
<code><a href="#the-li-element">li</a></code> element, then act as if an end tag with the tag
|
|
name "li" had been seen, then jump to the last step.</li>
|
|
|
|
<li><p>If <var title="">node</var> is in the <a href="#special">special</a>
|
|
category, but is not an <code><a href="#the-address-element">address</a></code>, <code><a href="#the-div-element">div</a></code>,
|
|
or <code><a href="#the-p-element">p</a></code> element, then jump to the last step.</li>
|
|
|
|
<li><p>Otherwise, set <var title="">node</var> to the previous
|
|
entry in the <a href="#stack-of-open-elements">stack of open elements</a> and return to
|
|
the step labeled <i>loop</i>.</li>
|
|
|
|
<li>
|
|
|
|
<p>This is the last step.</p>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has
|
|
an element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name
|
|
"p" had been seen.</p>
|
|
|
|
<p>Finally, <a href="#insert-an-html-element">insert an HTML element</a> for the
|
|
token.</p>
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>A start tag whose tag name is one of: "dd", "dt"</dt>
|
|
<dd>
|
|
|
|
<p>Run these steps:</p>
|
|
|
|
<ol><li><p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</li>
|
|
|
|
<li><p>Initialize <var title="">node</var> to be the <a href="#current-node">current
|
|
node</a> (the bottommost node of the stack).</li>
|
|
|
|
<li><p><i>Loop</i>: If <var title="">node</var> is a
|
|
<code><a href="#the-dd-element">dd</a></code> or <code><a href="#the-dt-element">dt</a></code> element, then act as if an end
|
|
tag with the same tag name as <var title="">node</var> had been
|
|
seen, then jump to the last step.</li>
|
|
|
|
<li><p>If <var title="">node</var> is in the <a href="#special">special</a>
|
|
category, but is not an <code><a href="#the-address-element">address</a></code>, <code><a href="#the-div-element">div</a></code>,
|
|
or <code><a href="#the-p-element">p</a></code> element, then jump to the last step.</li>
|
|
|
|
<li><p>Otherwise, set <var title="">node</var> to the previous
|
|
entry in the <a href="#stack-of-open-elements">stack of open elements</a> and return to
|
|
the step labeled <i>loop</i>.</li>
|
|
|
|
<li>
|
|
|
|
<p>This is the last step.</p>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has
|
|
an element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name
|
|
"p" had been seen.</p>
|
|
|
|
<p>Finally, <a href="#insert-an-html-element">insert an HTML element</a> for the
|
|
token.</p>
|
|
|
|
</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>A start tag whose tag name is "plaintext"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has
|
|
an element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name
|
|
"p" had been seen.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Switch the tokenizer to the <a href="#plaintext-state">PLAINTEXT state</a>.</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 out of the <a href="#plaintext-state">PLAINTEXT state</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>A start tag whose tag name is "button"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-scope" title="has
|
|
an element in scope">has a <code>button</code> element in
|
|
scope</a>, then this is a <a href="#parse-error">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-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
|
|
<dt>An end tag whose tag name is one of: "address", "article",
|
|
"aside", "blockquote", "button", "center", "details", "dir", "div",
|
|
"dl", "fieldset", "figcaption", "figure", "footer", "header",
|
|
"hgroup", "listing", "menu", "nav", "ol", "pre", "section",
|
|
"summary", "ul"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-scope" title="has an element in scope">have an element in scope</a>
|
|
with the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>; ignore the token.</p>
|
|
|
|
<p>Otherwise, run these steps:</p>
|
|
|
|
<ol><li><p><a href="#generate-implied-end-tags">Generate implied end tags</a>.</li>
|
|
|
|
<li><p>If the <a href="#current-node">current node</a> is not an element with
|
|
the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>.</li>
|
|
|
|
<li><p>Pop elements from the <a href="#stack-of-open-elements">stack of open elements</a>
|
|
until an element with the same tag name as the token has been
|
|
popped from the stack.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>An end tag whose tag name is "form"</dt>
|
|
<dd>
|
|
|
|
<p>Let <var title="">node</var> be the element that the
|
|
<a href="#form-element-pointer"><code title="">form</code> element pointer</a> is set
|
|
to.</p>
|
|
|
|
<p>Set the <a href="#form-element-pointer"><code title="">form</code> element pointer</a>
|
|
to null.</p>
|
|
|
|
<p>If <var title="">node</var> is null or the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> does not <a href="#has-an-element-in-scope" title="has an element in
|
|
scope">have <var title="">node</var> in scope</a>, then this is
|
|
a <a href="#parse-error">parse error</a>; ignore the token.</p>
|
|
|
|
<p>Otherwise, run these steps:</p>
|
|
|
|
<ol><li><p><a href="#generate-implied-end-tags">Generate implied end tags</a>.</li>
|
|
|
|
<li><p>If the <a href="#current-node">current node</a> is not <var title="">node</var>, then this is a <a href="#parse-error">parse
|
|
error</a>.</li>
|
|
|
|
<li><p>Remove <var title="">node</var> from the <a href="#stack-of-open-elements">stack of
|
|
open elements</a>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>An end tag whose tag name is "p"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-button-scope" title="has an element in button scope">have an element in button
|
|
scope</a> with the same tag name as that of the token, then this
|
|
is a <a href="#parse-error">parse error</a>; act as if a start tag with the tag
|
|
name "p" had been seen, then reprocess the current token.</p>
|
|
|
|
<p>Otherwise, run these steps:</p>
|
|
|
|
<ol><li><p><a href="#generate-implied-end-tags">Generate implied end tags</a>, except
|
|
for elements with the same tag name as the token.</li>
|
|
|
|
<li><p>If the <a href="#current-node">current node</a> is not an element with
|
|
the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>.</li>
|
|
|
|
<li><p>Pop elements from the <a href="#stack-of-open-elements">stack of open elements</a>
|
|
until an element with the same tag name as the token has been
|
|
popped from the stack.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>An end tag whose tag name is "li"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-list-item-scope" title="has an element in list item scope">have an element in list
|
|
item scope</a> with the same tag name as that of the token,
|
|
then this is a <a href="#parse-error">parse error</a>; ignore the token.</p>
|
|
|
|
<p>Otherwise, run these steps:</p>
|
|
|
|
<ol><li><p><a href="#generate-implied-end-tags">Generate implied end tags</a>, except
|
|
for elements with the same tag name as the token.</li>
|
|
|
|
<li><p>If the <a href="#current-node">current node</a> is not an element with
|
|
the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>.</li>
|
|
|
|
<li><p>Pop elements from the <a href="#stack-of-open-elements">stack of open elements</a>
|
|
until an element with the same tag name as the token has been
|
|
popped from the stack.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
<dt>An end tag whose tag name is one of: "dd", "dt"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-scope" title="has an element in scope">have an element in scope</a>
|
|
with the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>; ignore the token.</p>
|
|
|
|
<p>Otherwise, run these steps:</p>
|
|
|
|
<ol><li><p><a href="#generate-implied-end-tags">Generate implied end tags</a>, except
|
|
for elements with the same tag name as the token.</li>
|
|
|
|
<li><p>If the <a href="#current-node">current node</a> is not an element with
|
|
the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>.</li>
|
|
|
|
<li><p>Pop elements from the <a href="#stack-of-open-elements">stack of open elements</a>
|
|
until an element with the same tag name as the token has been
|
|
popped from the stack.</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-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-scope" title="has an element in scope">have an element in scope</a>
|
|
whose tag name is one of "h1", "h2", "h3", "h4", "h5", or "h6",
|
|
then this is a <a href="#parse-error">parse error</a>; ignore the token.</p>
|
|
|
|
<p>Otherwise, run these steps:</p>
|
|
|
|
<ol><li><p><a href="#generate-implied-end-tags">Generate implied end tags</a>.</li>
|
|
|
|
<li><p>If the <a href="#current-node">current node</a> is not an element with
|
|
the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>.</li>
|
|
|
|
<li><p>Pop elements from the <a href="#stack-of-open-elements">stack of open elements</a>
|
|
until an element whose tag name is one of "h1", "h2", "h3", "h4",
|
|
"h5", or "h6" has been popped from the stack.</li>
|
|
|
|
</ol></dd>
|
|
|
|
|
|
|
|
<dt>An end tag whose tag name is "sarcasm"</dt>
|
|
<dd>
|
|
<p>Take a deep breath, then act as described in the "any other end
|
|
tag" entry below.</p>
|
|
</dd>
|
|
|
|
|
|
<dt>A start tag whose tag name is "a"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#list-of-active-formatting-elements">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="#parse-error">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-of-active-formatting-elements">list of active formatting elements</a> and the
|
|
<a href="#stack-of-open-elements">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="#has-an-element-in-table-scope" 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="#the-a-element">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="#the-a-element">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="#the-a-element">a</a></code> element). The result is that the
|
|
two <code><a href="#the-a-element">a</a></code> elements are indirectly nested inside each
|
|
other — non-conforming markup will often result in
|
|
non-conforming DOMs when parsed.</p>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. <a href="#push-onto-the-list-of-active-formatting-elements">Push
|
|
onto the list of active formatting elements</a> that
|
|
element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "b", "big", "code", "em",
|
|
"font", "i", "s", "small", "strike", "strong", "tt", "u"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. <a href="#push-onto-the-list-of-active-formatting-elements">Push
|
|
onto the list of active formatting elements</a> that
|
|
element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "nobr"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-scope" title="has an
|
|
element in scope">has a <code>nobr</code> element in scope</a>,
|
|
then this is a <a href="#parse-error">parse error</a>; act as if an end tag with
|
|
the tag name "nobr" had been seen, then once again
|
|
<a href="#reconstruct-the-active-formatting-elements">reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. <a href="#push-onto-the-list-of-active-formatting-elements">Push
|
|
onto the list of active formatting elements</a> that
|
|
element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt id="adoptionAgency">An end tag whose tag name is one of: "a",
|
|
"b", "big", "code", "em", "font", "i", "nobr", "s", "small",
|
|
"strike", "strong", "tt", "u"</dt>
|
|
<dd>
|
|
|
|
<p>Run these steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">outer loop counter</var> be
|
|
zero.</li>
|
|
|
|
<li><p><i>Outer loop</i>: If <var title="">outer loop
|
|
counter</var> is greater than or equal to eight, then abort these
|
|
steps.</li>
|
|
|
|
<li><p>Increment <var title="">outer loop counter</var> by
|
|
one.</li>
|
|
|
|
<li>
|
|
|
|
<p>Let the <var title="">formatting element</var> be the last
|
|
element in the <a href="#list-of-active-formatting-elements">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, then abort these steps and instead
|
|
act as described in the "any other end tag" entry below.</p>
|
|
|
|
<p>Otherwise, if there is such a node, but that node is not
|
|
in the <a href="#stack-of-open-elements">stack of open elements</a>, then this is a
|
|
<a href="#parse-error">parse error</a>; remove the element from the list,
|
|
and abort these steps.</p>
|
|
|
|
<p>Otherwise, if there is such a node, and that node is also in
|
|
the <a href="#stack-of-open-elements">stack of open elements</a>, but the element is not
|
|
<a href="#has-an-element-in-scope" title="has an element in scope">in scope</a>, then this
|
|
is a <a href="#parse-error">parse error</a>; ignore the token, and abort these
|
|
steps.</p>
|
|
|
|
<p>Otherwise, there is a <var title="">formatting
|
|
element</var> and that element is in <a href="#stack-of-open-elements" title="stack of
|
|
open elements">the stack</a> and is <a href="#has-an-element-in-scope" title="has an
|
|
element in scope">in scope</a>. If the element is not the
|
|
<a href="#current-node">current node</a>, this is a <a href="#parse-error">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-of-open-elements">stack of open elements</a> that is lower in
|
|
the stack than the <var title="">formatting element</var>, and is
|
|
an element in the <a href="#special">special</a> category. There might not
|
|
be one.</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-of-open-elements">stack of open
|
|
elements</a>, from the <a href="#current-node">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-of-active-formatting-elements">list of active formatting elements</a>.</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-of-open-elements">stack of open elements</a>.</li>
|
|
|
|
<li><p>Let a bookmark note the position of the <var title="">formatting element</var> in the <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a> relative to the elements on either
|
|
side of it in the list.</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><p>Let <var title="">inner loop counter</var> be
|
|
zero.</li>
|
|
|
|
<li><p><i>Inner loop</i>: If <var title="">inner loop
|
|
counter</var> is greater than or equal to three, then abort these
|
|
steps.</li>
|
|
|
|
<li><p>Increment <var title="">inner loop counter</var> by
|
|
one.</li>
|
|
|
|
<li>Let <var title="">node</var> be the element immediately
|
|
above <var title="">node</var> in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>, or if <var title="">node</var> is no longer in
|
|
the <a href="#stack-of-open-elements">stack of open elements</a> (e.g. because it got
|
|
removed by the next step), the element that was immediately
|
|
above <var title="">node</var> in the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> before <var title="">node</var> was
|
|
removed.</li>
|
|
|
|
<li>If <var title="">node</var> is not in the <a href="#list-of-active-formatting-elements">list of
|
|
active formatting elements</a>, then remove <var title="">node</var> from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> and then go back to the step labeled <i>inner
|
|
loop</i>.</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><a href="#create-an-element-for-the-token">Create an element for the token</a> for which the
|
|
element <var title="">node</var> was created, replace the entry
|
|
for <var title="">node</var> in the <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a> with an entry for the new element,
|
|
replace the entry for <var title="">node</var> in the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> with an entry for the new
|
|
element, and let <var title="">node</var> be the new
|
|
element.</li>
|
|
|
|
<li>If <var title="">last node</var> is the <var title="">furthest block</var>, then move the aforementioned
|
|
bookmark to be immediately after the new <var title="">node</var> in the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a>.</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 the step labeled <i>inner loop</i>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>If the <var title="">common ancestor</var> node is a
|
|
<code><a href="#the-table-element">table</a></code>, <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>,
|
|
<code><a href="#the-thead-element">thead</a></code>, or <code><a href="#the-tr-element">tr</a></code> element, then,
|
|
<a href="#foster-parent">foster parent</a> whatever <var title="">last
|
|
node</var> ended up being in the previous step, first removing
|
|
it from its previous parent node if any.</p>
|
|
|
|
<p>Otherwise, append whatever <var title="">last node</var>
|
|
ended up being in the previous step to the <var title="">common
|
|
ancestor</var> node, first removing it from its previous parent
|
|
node if any.</p>
|
|
|
|
</li>
|
|
|
|
<li><p><a href="#create-an-element-for-the-token">Create an element for the token</a> for which the
|
|
<var title="">formatting element</var> was created.</li>
|
|
|
|
<li><p>Take all of the child nodes of the <var title="">furthest
|
|
block</var> and append them to the element created in the last
|
|
step.</li>
|
|
|
|
<li><p>Append that new element to the <var title="">furthest
|
|
block</var>.</li>
|
|
|
|
<li><p>Remove the <var title="">formatting element</var> from the
|
|
<a href="#list-of-active-formatting-elements">list of active formatting elements</a>, and insert the
|
|
new element into the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a> at the position of the aforementioned
|
|
bookmark.</li>
|
|
|
|
<li><p>Remove the <var title="">formatting element</var> from the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>, and insert the new element
|
|
into the <a href="#stack-of-open-elements">stack of open elements</a> immediately below
|
|
the position of the <var title="">furthest block</var> in that
|
|
stack.</li>
|
|
|
|
<li><p>Jump back to the step labeled <i>outer loop</i>.</li>
|
|
|
|
</ol><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 possible 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 token whose tag name is one of: "applet",
|
|
"marquee", "object"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Insert a marker at the end of the <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a>.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag token whose tag name is one of: "applet",
|
|
"marquee", "object"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-scope" title="has an element in scope">have an element in scope</a>
|
|
with the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>; ignore the token.</p>
|
|
|
|
<p>Otherwise, run these steps:</p>
|
|
|
|
<ol><li><p><a href="#generate-implied-end-tags">Generate implied end tags</a>.</li>
|
|
|
|
<li><p>If the <a href="#current-node">current node</a> is not an element with
|
|
the same tag name as that of the token, then this is a
|
|
<a href="#parse-error">parse error</a>.</li>
|
|
|
|
<li><p>Pop elements from the <a href="#stack-of-open-elements">stack of open elements</a>
|
|
until an element with the same tag name as the token has been
|
|
popped from the stack.</li>
|
|
|
|
<li><a href="#clear-the-list-of-active-formatting-elements-up-to-the-last-marker">Clear the list of active formatting elements up to the
|
|
last marker</a>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>A start tag whose tag name is "table"</dt>
|
|
<dd>
|
|
|
|
<p>If the <code><a href="#document">Document</a></code> is <em>not</em> set to
|
|
<a href="#quirks-mode">quirks mode</a>, and the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> <a href="#has-an-element-in-button-scope" title="has an element in button scope">has a
|
|
<code>p</code> element in button scope</a>, then act as if an
|
|
end tag with the tag name "p" had been seen.</p>
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intable" title="insertion mode: in table">in table</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "area", "br", "embed",
|
|
"img", "keygen", "wbr"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. Immediately
|
|
pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "input"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. Immediately
|
|
pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</p>
|
|
|
|
<p>If the token does not have an attribute with the name "type",
|
|
or if it does, but that attribute's value is not an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">hidden</code>", then: set the <a href="#frameset-ok-flag">frameset-ok
|
|
flag</a> to "not ok".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "param", "source", "track"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. Immediately
|
|
pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "hr"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has
|
|
an element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name
|
|
"p" had been seen.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. Immediately
|
|
pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "image"</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Change the token's tag name
|
|
to "img" and reprocess it. (Don't ask.)</p> </dd>
|
|
|
|
<dt id="isindex">A start tag whose tag name is "isindex"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>If the <a href="#form-element-pointer"><code title="">form</code> element
|
|
pointer</a> is not null, then ignore the token.</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</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-fs-action"><a href="#attr-fs-action">action</a></code> attribute on the
|
|
resulting <code><a href="#the-form-element">form</a></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 "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-fe-name"><a href="#attr-fe-name">name</a></code> attribute of the resulting
|
|
<code><a href="#the-input-element">input</a></code> element to the value "<code title="attr-fe-name-isindex"><a href="#attr-fe-name-isindex">isindex</a></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 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><a href="#the-input-element">input</a></code> element, express the
|
|
equivalent of "This is a searchable index. Enter search keywords:
|
|
(input field)" in the user's preferred language.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "textarea"</dt>
|
|
<dd>
|
|
|
|
<p>Run these steps:</p>
|
|
|
|
<ol><li><p><a href="#insert-an-html-element">Insert an HTML element</a> for the
|
|
token.</li>
|
|
|
|
<li><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="#the-textarea-element">textarea</a></code> elements are
|
|
ignored as an authoring convenience.)</li>
|
|
|
|
|
|
|
|
<li><p>Switch the tokenizer to the <a href="#rcdata-state">RCDATA
|
|
state</a>.</li>
|
|
|
|
<li><p>Let the <a href="#original-insertion-mode">original insertion mode</a> be the
|
|
current <a href="#insertion-mode">insertion mode</a>.</p>
|
|
|
|
<li><p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not
|
|
ok".</li>
|
|
|
|
<li><p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-incdata" title="insertion mode: text">text</a>".</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>A start tag whose tag name is "xmp"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-button-scope" title="has
|
|
an element in button scope">has a <code>p</code> element in button
|
|
scope</a>, then act as if an end tag with the tag name
|
|
"p" had been seen.</p>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
<p>Follow the <a href="#generic-raw-text-element-parsing-algorithm">generic raw text element parsing algorithm</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "iframe"</dt>
|
|
<dd>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
<p>Follow the <a href="#generic-raw-text-element-parsing-algorithm">generic raw text element parsing algorithm</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "noembed"</dt>
|
|
<dt>A start tag whose tag name is "noscript", if the <a href="#scripting-flag">scripting flag</a> is enabled</dt>
|
|
<dd>
|
|
|
|
<p>Follow the <a href="#generic-raw-text-element-parsing-algorithm">generic raw text element parsing algorithm</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "select"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
<p>If the <a href="#insertion-mode">insertion mode</a> is one of "<a href="#parsing-main-intable" title="insertion mode: in table">in table</a>", "<a href="#parsing-main-incaption" title="insertion mode: in caption">in caption</a>", "<a href="#parsing-main-intbody" title="insertion mode: in table body">in table body</a>",
|
|
"<a href="#parsing-main-intr" title="insertion mode: in row">in row</a>", or "<a href="#parsing-main-intd" title="insertion mode: in cell">in cell</a>", then switch the
|
|
<a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inselectintable" title="insertion mode: in
|
|
select in table">in select in table</a>". Otherwise, switch the
|
|
<a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-inselect" title="insertion mode: in
|
|
select">in select</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "optgroup", "option"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is an <code><a href="#the-option-element">option</a></code>
|
|
element, then act as if an end tag with the tag name "option" had
|
|
been seen.</p>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "rp", "rt"</dt>
|
|
<dd>
|
|
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-scope" title="has an
|
|
element in scope">has a <code>ruby</code> element in scope</a>,
|
|
then <a href="#generate-implied-end-tags">generate implied end tags</a>. If the <a href="#current-node">current
|
|
node</a> is not then a <code><a href="#the-ruby-element">ruby</a></code> element, this is a
|
|
<a href="#parse-error">parse error</a>; pop all the nodes from the <a href="#current-node">current
|
|
node</a> up to the node immediately before the bottommost
|
|
<code><a href="#the-ruby-element">ruby</a></code> element on the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "br"</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">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 tag whose tag name is "math"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#adjust-mathml-attributes">Adjust MathML attributes</a> for the token. (This
|
|
fixes the case of MathML attributes that are not all
|
|
lowercase.)</p>
|
|
|
|
<p><a href="#adjust-foreign-attributes">Adjust foreign attributes</a> for the token. (This
|
|
fixes the use of namespaced attributes, in particular XLink.)</p>
|
|
|
|
<p><a href="#insert-a-foreign-element">Insert a foreign element</a> for the token, in the
|
|
<a href="#mathml-namespace">MathML namespace</a>.</p>
|
|
|
|
|
|
<p>If the token has its <i>self-closing flag</i> set, pop the
|
|
<a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> and <a href="#acknowledge-self-closing-flag" title="acknowledge self-closing
|
|
flag">acknowledge the token's <i>self-closing flag</i></a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "svg"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#adjust-svg-attributes">Adjust SVG attributes</a> for the token. (This fixes
|
|
the case of SVG attributes that are not all lowercase.)</p>
|
|
|
|
<p><a href="#adjust-foreign-attributes">Adjust foreign attributes</a> for the token. (This
|
|
fixes the use of namespaced attributes, in particular XLink in
|
|
SVG.)</p>
|
|
|
|
<p><a href="#insert-a-foreign-element">Insert a foreign element</a> for the token, in the
|
|
<a href="#svg-namespace">SVG namespace</a>.</p>
|
|
|
|
|
|
<p>If the token has its <i>self-closing flag</i> set, pop the
|
|
<a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> and <a href="#acknowledge-self-closing-flag" title="acknowledge self-closing
|
|
flag">acknowledge the token's <i>self-closing flag</i></a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "caption",
|
|
"col", "colgroup", "frame", "head", "tbody", "td", "tfoot", "th",
|
|
"thead", "tr"</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>Any other start tag</dt>
|
|
<dd>
|
|
|
|
<p><a href="#reconstruct-the-active-formatting-elements">Reconstruct the active formatting elements</a>, if
|
|
any.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p class="note">This element will be an <a href="#ordinary">ordinary</a>
|
|
element.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Any other end tag</dt>
|
|
<dd>
|
|
|
|
<p>Run these steps:</p>
|
|
|
|
<ol><li><p>Initialize <var title="">node</var> to be the <a href="#current-node">current
|
|
node</a> (the bottommost node of the stack).</li>
|
|
|
|
<li><p><i>Loop</i>: If <var title="">node</var> has the same tag
|
|
name as the token, then:</p>
|
|
|
|
<ol><li><p><a href="#generate-implied-end-tags">Generate implied end tags</a>, except
|
|
for elements with the same tag name as the token.</li>
|
|
|
|
<li><p>If the tag name of the end tag token does not match
|
|
the tag name of the <a href="#current-node">current node</a>, this is a
|
|
<a href="#parse-error">parse error</a>.</li>
|
|
|
|
<li><p>Pop all the nodes from the <a href="#current-node">current node</a> up
|
|
to <var title="">node</var>, including <var title="">node</var>, then stop these steps.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Otherwise, if <var title="">node</var> is in the
|
|
<a href="#special">special</a> category, then this is a <a href="#parse-error">parse
|
|
error</a>; ignore the token, and abort these steps.</li>
|
|
|
|
<li><p>Set <var title="">node</var> to the previous entry in the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</li>
|
|
|
|
<li><p>Return to the step labeled <i>loop</i>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl><h6 id="parsing-main-incdata"><span class="secno">8.2.5.4.8 </span>The "<dfn title="insertion mode: text">text</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-incdata" title="insertion mode: text">text</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the token's
|
|
character</a> into the <a href="#current-node">current node</a>.</p>
|
|
|
|
<p class="note">This can never be a U+0000 NULL character; the
|
|
tokenizer converts those to U+FFFD REPLACEMENT CHARACTER
|
|
characters.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is a <code><a href="#the-script-element">script</a></code>
|
|
element, mark the <code><a href="#the-script-element">script</a></code> element as <a href="#already-started">"already
|
|
started"</a>.</p>
|
|
|
|
<p>Pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to the <a href="#original-insertion-mode">original
|
|
insertion mode</a> and reprocess the current token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt id="scriptEndTag">An end tag whose tag name is "script"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#provide-a-stable-state">Provide a stable state</a>.</p>
|
|
|
|
<p>Let <var title="">script</var> be the <a href="#current-node">current node</a>
|
|
(which will be a <code><a href="#the-script-element">script</a></code> element).</p>
|
|
|
|
<p>Pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to the <a href="#original-insertion-mode">original
|
|
insertion mode</a>.</p>
|
|
|
|
<p>Let the <var title="">old insertion point</var> have the
|
|
same value as the current <a href="#insertion-point">insertion point</a>. Let
|
|
the <a href="#insertion-point">insertion point</a> be just before the <a href="#next-input-character">next
|
|
input character</a>.</p>
|
|
|
|
<p>Increment the parser's <a href="#script-nesting-level">script nesting level</a> by
|
|
one.</p>
|
|
|
|
<p><a href="#prepare-a-script" title="prepare a script">Prepare</a> the <var title="">script</var>. This might cause some script to execute,
|
|
which might cause <a href="#dom-document-write" title="dom-document-write">new characters
|
|
to be inserted into the tokenizer</a>, and might cause the
|
|
tokenizer to output more tokens, resulting in a <a href="#nestedParsing">reentrant invocation of the parser</a>.</p>
|
|
|
|
<p>Decrement the parser's <a href="#script-nesting-level">script nesting level</a> by
|
|
one. If the parser's <a href="#script-nesting-level">script nesting level</a> is zero,
|
|
then set the <a href="#parser-pause-flag">parser pause flag</a> to false.</p>
|
|
|
|
<p>Let the <a href="#insertion-point">insertion point</a> have the value of the <var title="">old insertion point</var>. (In other words, restore the
|
|
<a href="#insertion-point">insertion point</a> to its previous value. This value
|
|
might be the "undefined" value.)</p>
|
|
|
|
<p id="scriptTagParserResumes">At this stage, if there is a
|
|
<a href="#pending-parsing-blocking-script">pending parsing-blocking script</a>, then:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#script-nesting-level">script nesting level</a> is not zero:</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Set the <a href="#parser-pause-flag">parser pause flag</a> to true, and abort the
|
|
processing of any nested invocations of the tokenizer, yielding
|
|
control back to the caller. (Tokenization will resume when the
|
|
caller returns to the "outer" tree construction stage.)</p>
|
|
|
|
<p class="note">The tree construction stage of this particular
|
|
parser is <a href="#nestedParsing">being called reentrantly</a>,
|
|
say from a call to <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Otherwise:</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Run these steps:</p>
|
|
|
|
<ol><li><p>Let <var title="">the script</var> be the <a href="#pending-parsing-blocking-script">pending
|
|
parsing-blocking script</a>. There is no longer a <a href="#pending-parsing-blocking-script">pending
|
|
parsing-blocking script</a>.</li>
|
|
|
|
<li><p>Block the <a href="#tokenization" title="tokenization">tokenizer</a>
|
|
for this instance of the <a href="#html-parser">HTML parser</a>, such that
|
|
the <a href="#event-loop">event loop</a> will not run <a href="#concept-task" title="concept-task">tasks</a> that invoke the <a href="#tokenization" title="tokenization">tokenizer</a>.</li>
|
|
|
|
<li><p>If the parser's <code><a href="#document">Document</a></code> <a href="#has-a-style-sheet-that-is-blocking-scripts">has a style
|
|
sheet that is blocking scripts</a> or <var title="">the
|
|
script</var>'s <a href="#ready-to-be-parser-executed">"ready to be parser-executed"</a> flag
|
|
is not set: <a href="#spin-the-event-loop">spin the event loop</a> until the parser's
|
|
<code><a href="#document">Document</a></code> <a href="#has-no-style-sheet-that-is-blocking-scripts">has no style sheet that is blocking
|
|
scripts</a> and <var title="">the script</var>'s
|
|
<a href="#ready-to-be-parser-executed">"ready to be parser-executed"</a> flag is
|
|
set.</li>
|
|
|
|
<li><p>Unblock the <a href="#tokenization" title="tokenization">tokenizer</a>
|
|
for this instance of the <a href="#html-parser">HTML parser</a>, such that
|
|
<a href="#concept-task" title="concept-task">tasks</a> that invoke the <a href="#tokenization" title="tokenization">tokenizer</a> can again be
|
|
run.</li>
|
|
|
|
<li><p>Let the <a href="#insertion-point">insertion point</a> be just before the
|
|
<a href="#next-input-character">next input character</a>.</li>
|
|
|
|
<li><p>Increment the parser's <a href="#script-nesting-level">script nesting level</a>
|
|
by one (it should be zero before this step, so this sets it to
|
|
one).</li>
|
|
|
|
<li><p><a href="#execute-the-script-block" title="execute the script block">Execute</a>
|
|
<var title="">the script</var>.</li>
|
|
|
|
<li><p>Decrement the parser's <a href="#script-nesting-level">script nesting level</a>
|
|
by one. If the parser's <a href="#script-nesting-level">script nesting level</a> is
|
|
zero (which it always should be at this point), then set the
|
|
<a href="#parser-pause-flag">parser pause flag</a> to false.</p>
|
|
|
|
<li><p>Let the <a href="#insertion-point">insertion point</a> be undefined
|
|
again.</li>
|
|
|
|
<li><p>If there is once again a <a href="#pending-parsing-blocking-script">pending parsing-blocking
|
|
script</a>, then repeat these steps from step 1.</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl></dd>
|
|
|
|
<dt>Any other end tag</dt>
|
|
<dd>
|
|
|
|
<p>Pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to the <a href="#original-insertion-mode">original
|
|
insertion mode</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-intable"><span class="secno">8.2.5.4.9 </span>The "<dfn title="insertion mode: in table">in table</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-intable" title="insertion mode: in table">in table</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token</dt>
|
|
<dd>
|
|
|
|
<p>Let the <dfn id="pending-table-character-tokens"><var>pending table character tokens</var></dfn>
|
|
be an empty list of tokens.</p>
|
|
|
|
<p>Let the <a href="#original-insertion-mode">original insertion mode</a> be the current
|
|
<a href="#insertion-mode">insertion mode</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intabletext" title="insertion mode: in table text">in table text</a>" and
|
|
reprocess the token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "caption"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#clear-the-stack-back-to-a-table-context">Clear the stack back to a table context</a>. (See
|
|
below.)</p>
|
|
|
|
<p>Insert a marker at the end of the <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a>.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token, then
|
|
switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-incaption" title="insertion mode: in caption">in caption</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "colgroup"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#clear-the-stack-back-to-a-table-context">Clear the stack back to a table context</a>. (See
|
|
below.)</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token, then
|
|
switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-incolgroup" 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="#clear-the-stack-back-to-a-table-context">Clear the stack back to a table context</a>. (See
|
|
below.)</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token, then
|
|
switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intbody" 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="#parse-error">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-case">fragment case</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "table"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-table-scope" 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="#parse-error">parse error</a>. Ignore the token. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p>Pop elements from this stack until a <code><a href="#the-table-element">table</a></code>
|
|
element has been popped from the stack.</p>
|
|
|
|
<p><a href="#reset-the-insertion-mode-appropriately">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="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "style", "script"</dt>
|
|
<dd>
|
|
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "input"</dt>
|
|
<dd>
|
|
|
|
<p>If the token does not have an attribute with the name "type",
|
|
or if it does, but that attribute's value is not an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">hidden</code>", then: act as described in the "anything
|
|
else" entry below.</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
|
|
<p>Pop that <code><a href="#the-input-element">input</a></code> element off the <a href="#stack-of-open-elements">stack of
|
|
open elements</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "form"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>If the <a href="#form-element-pointer"><code title="form">form</code> element
|
|
pointer</a> is not null, ignore the token.</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token, and set the
|
|
<a href="#form-element-pointer"><code title="form">form</code> element pointer</a> to
|
|
point to the element created.</p>
|
|
|
|
<p>Pop that <code><a href="#the-form-element">form</a></code> element off the <a href="#stack-of-open-elements">stack of
|
|
open elements</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is not the root
|
|
<code><a href="#the-html-element">html</a></code> element, then this is a <a href="#parse-error">parse
|
|
error</a>.</p>
|
|
|
|
<p class="note">It can only be the <a href="#current-node">current node</a> in
|
|
the <a href="#fragment-case">fragment case</a>.</p>
|
|
|
|
<p><a href="#stop-parsing">Stop parsing</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>. Process the token <a href="#using-the-rules-for">using the
|
|
rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in
|
|
body</a>" <a href="#insertion-mode">insertion mode</a>, except that if the
|
|
<a href="#current-node">current node</a> is a <code><a href="#the-table-element">table</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, <code><a href="#the-thead-element">thead</a></code>, or
|
|
<code><a href="#the-tr-element">tr</a></code> element, then, whenever a node would be inserted
|
|
into the <a href="#current-node">current node</a>, it must instead be <a href="#foster-parent" title="foster parent">foster parented</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>When the steps above require the UA to <dfn id="clear-the-stack-back-to-a-table-context">clear the stack
|
|
back to a table context</dfn>, it means that the UA must, while
|
|
the <a href="#current-node">current node</a> is not a <code><a href="#the-table-element">table</a></code>
|
|
element or an <code><a href="#the-html-element">html</a></code> element, pop elements from the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</p>
|
|
|
|
<p class="note">The <a href="#current-node">current node</a> being an
|
|
<code><a href="#the-html-element">html</a></code> element after this process is a <a href="#fragment-case">fragment
|
|
case</a>.</p>
|
|
|
|
|
|
|
|
<h6 id="parsing-main-intabletext"><span class="secno">8.2.5.4.10 </span>The "<dfn title="insertion mode: in table text">in table text</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-intabletext" title="insertion mode: in table text">in table text</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is U+0000 NULL</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Any other character token</dt>
|
|
<dd>
|
|
|
|
<p>Append the character token to the <var><a href="#pending-table-character-tokens">pending table character
|
|
tokens</a></var> list.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
|
|
<p>If any of the tokens in the <var><a href="#pending-table-character-tokens">pending table character
|
|
tokens</a></var> list are character tokens that are not one of U+0009
|
|
CHARACTER TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED
|
|
(FF), U+000D CARRIAGE RETURN (CR), or U+0020 SPACE, then reprocess
|
|
those character tokens using the rules given in the "anything
|
|
else" entry in the <a href="#parsing-main-intable" title="insertion mode: in table">in
|
|
table</a>" insertion mode.</p>
|
|
|
|
<p>Otherwise, <a href="#insert-a-character" title="insert a character">insert the
|
|
characters</a> given by the <var><a href="#pending-table-character-tokens">pending table character
|
|
tokens</a></var> list into the <a href="#current-node">current node</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to the <a href="#original-insertion-mode">original
|
|
insertion mode</a> and reprocess the token.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-incaption"><span class="secno">8.2.5.4.11 </span>The "<dfn title="insertion mode: in caption">in caption</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-incaption" title="insertion mode: in caption">in caption</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>An end tag whose tag name is "caption"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-table-scope" 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="#parse-error">parse error</a>. Ignore the token. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p><a href="#generate-implied-end-tags">Generate implied end tags</a>.</p>
|
|
|
|
<p>Now, if the <a href="#current-node">current node</a> is not a
|
|
<code><a href="#the-caption-element">caption</a></code> element, then this is a <a href="#parse-error">parse
|
|
error</a>.</p>
|
|
|
|
<p>Pop elements from this stack until a <code><a href="#the-caption-element">caption</a></code>
|
|
element has been popped from the stack.</p>
|
|
|
|
<p><a href="#clear-the-list-of-active-formatting-elements-up-to-the-last-marker">Clear the list of active formatting elements up to
|
|
the last marker</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intable" 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="#parse-error">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-case">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="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-incolgroup"><span class="secno">8.2.5.4.12 </span>The "<dfn title="insertion mode: in column group">in column group</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-incolgroup" title="insertion mode: in column group">in column group</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the character</a> into
|
|
the <a href="#current-node">current node</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "col"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token. Immediately
|
|
pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "colgroup"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is the root
|
|
<code><a href="#the-html-element">html</a></code> element, then this is a <a href="#parse-error">parse
|
|
error</a>; ignore the token. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise, pop the <a href="#current-node">current node</a> (which will be
|
|
a <code><a href="#the-colgroup-element">colgroup</a></code> element) from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>. Switch the <a href="#insertion-mode">insertion mode</a> to
|
|
"<a href="#parsing-main-intable" title="insertion mode: in table">in table</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "col"</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is the root <code><a href="#the-html-element">html</a></code>
|
|
element, then <a href="#stop-parsing">stop parsing</a>. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise, act as described in the "anything else" entry
|
|
below.</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-case">fragment case</a>.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-intbody"><span class="secno">8.2.5.4.13 </span>The "<dfn title="insertion mode: in table body">in table body</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-intbody" title="insertion mode: in table body">in table body</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A start tag whose tag name is "tr"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#clear-the-stack-back-to-a-table-body-context">Clear the stack back to a table body
|
|
context</a>. (See below.)</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token, then switch
|
|
the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intr" 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="#parse-error">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-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-table-scope" 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="#parse-error">parse error</a>. Ignore the token.</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p><a href="#clear-the-stack-back-to-a-table-body-context">Clear the stack back to a table body
|
|
context</a>. (See below.)</p>
|
|
|
|
<p>Pop the <a href="#current-node">current node</a> from the <a href="#stack-of-open-elements">stack of
|
|
open elements</a>. Switch the <a href="#insertion-mode">insertion mode</a>
|
|
to "<a href="#parsing-main-intable" 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-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-table-scope" 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="#parse-error">parse
|
|
error</a>. Ignore the token. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p><a href="#clear-the-stack-back-to-a-table-body-context">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="#current-node">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="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-intable" title="insertion mode: in table">in table</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
</dl><p>When the steps above require the UA to <dfn id="clear-the-stack-back-to-a-table-body-context">clear the stack
|
|
back to a table body context</dfn>, it means that the UA must,
|
|
while the <a href="#current-node">current node</a> is not a <code><a href="#the-tbody-element">tbody</a></code>,
|
|
<code><a href="#the-tfoot-element">tfoot</a></code>, <code><a href="#the-thead-element">thead</a></code>, or <code><a href="#the-html-element">html</a></code>
|
|
element, pop elements from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p class="note">The <a href="#current-node">current node</a> being an
|
|
<code><a href="#the-html-element">html</a></code> element after this process is a <a href="#fragment-case">fragment
|
|
case</a>.</p>
|
|
|
|
|
|
<h6 id="parsing-main-intr"><span class="secno">8.2.5.4.14 </span>The "<dfn title="insertion mode: in row">in row</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-intr" title="insertion mode: in row">in row</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A start tag whose tag name is one of: "th", "td"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#clear-the-stack-back-to-a-table-row-context">Clear the stack back to a table row
|
|
context</a>. (See below.)</p>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token, then switch
|
|
the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intd" title="insertion mode:
|
|
in cell">in cell</a>".</p>
|
|
|
|
<p>Insert a marker at the end of the <a href="#list-of-active-formatting-elements">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-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-table-scope" 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="#parse-error">parse error</a>. Ignore the token. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p><a href="#clear-the-stack-back-to-a-table-row-context">Clear the stack back to a table row
|
|
context</a>. (See below.)</p>
|
|
|
|
<p>Pop the <a href="#current-node">current node</a> (which will be a
|
|
<code><a href="#the-tr-element">tr</a></code> element) from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>. Switch the <a href="#insertion-mode">insertion mode</a> to
|
|
"<a href="#parsing-main-intbody" 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-case">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-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-table-scope" 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="#parse-error">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="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-intable" title="insertion mode: in table">in table</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
</dl><p>When the steps above require the UA to <dfn id="clear-the-stack-back-to-a-table-row-context">clear the stack
|
|
back to a table row context</dfn>, it means that the UA must,
|
|
while the <a href="#current-node">current node</a> is not a <code><a href="#the-tr-element">tr</a></code>
|
|
element or an <code><a href="#the-html-element">html</a></code> element, pop elements from the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</p>
|
|
|
|
<p class="note">The <a href="#current-node">current node</a> being an
|
|
<code><a href="#the-html-element">html</a></code> element after this process is a <a href="#fragment-case">fragment
|
|
case</a>.</p>
|
|
|
|
|
|
<h6 id="parsing-main-intd"><span class="secno">8.2.5.4.15 </span>The "<dfn title="insertion mode: in cell">in cell</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-intd" title="insertion mode: in cell">in cell</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>An end tag whose tag name is one of: "td", "th"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-table-scope" 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="#parse-error">parse error</a> and the token must be
|
|
ignored.</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p><a href="#generate-implied-end-tags">Generate implied end tags</a>.</p>
|
|
|
|
<p>Now, if the <a href="#current-node">current node</a> is not an element
|
|
with the same tag name as the token, then this is a
|
|
<a href="#parse-error">parse error</a>.</p>
|
|
|
|
<p>Pop elements from the <a href="#stack-of-open-elements">stack of open elements</a> stack
|
|
until an element with the same tag name as the token has been
|
|
popped from the stack.</p>
|
|
|
|
<p><a href="#clear-the-list-of-active-formatting-elements-up-to-the-last-marker">Clear the list of active formatting elements up to
|
|
the last marker</a>.</p>
|
|
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-intr" title="insertion mode: in row">in row</a>".</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-of-open-elements">stack of open elements</a> does
|
|
<em>not</em> <a href="#has-an-element-in-table-scope" 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="#parse-error">parse error</a>; ignore
|
|
the token. (<a href="#fragment-case">fragment case</a>)</p>
|
|
|
|
<p>Otherwise, <a href="#close-the-cell">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="#parse-error">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-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-table-scope" 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-case">fragment case</a>), then this is a <a href="#parse-error">parse
|
|
error</a> and the token must be ignored.</p>
|
|
|
|
<p>Otherwise, <a href="#close-the-cell">close the cell</a> (see below) and
|
|
reprocess the current token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
</dl><p>Where the steps above say to <dfn id="close-the-cell">close the cell</dfn>, they
|
|
mean to run the following algorithm:</p>
|
|
|
|
<ol><li><p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-table-scope" 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.</li>
|
|
|
|
<li><p>Otherwise, the <a href="#stack-of-open-elements">stack of open elements</a> will
|
|
<a href="#has-an-element-in-table-scope" 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.</li>
|
|
|
|
</ol><p class="note">The <a href="#stack-of-open-elements">stack of open elements</a> cannot have
|
|
both a <code><a href="#the-td-element">td</a></code> and a <code><a href="#the-th-element">th</a></code> element <a href="#has-an-element-in-table-scope" title="has an element in table scope">in table scope</a> at the
|
|
same time, nor can it have neither when the <a href="#close-the-cell">close the
|
|
cell</a> algorithm is invoked.</p>
|
|
|
|
|
|
<h6 id="parsing-main-inselect"><span class="secno">8.2.5.4.16 </span>The "<dfn title="insertion mode: in select">in select</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-inselect" title="insertion mode: in select">in select</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is U+0000 NULL</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>Any other character token</dt>
|
|
<dd>
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the token's
|
|
character</a> into the <a href="#current-node">current node</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "option"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is an <code><a href="#the-option-element">option</a></code>
|
|
element, act as if an end tag with the tag name "option" had
|
|
been seen.</p>
|
|
|
|
<p><a href="#insert-an-html-element">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="#current-node">current node</a> is an <code><a href="#the-option-element">option</a></code>
|
|
element, act as if an end tag with the tag name "option" had
|
|
been seen.</p>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is an
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element, act as if an end tag with the
|
|
tag name "optgroup" had been seen.</p>
|
|
|
|
<p><a href="#insert-an-html-element">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="#current-node">current node</a> is an
|
|
<code><a href="#the-option-element">option</a></code> element, and the node immediately before
|
|
it in the <a href="#stack-of-open-elements">stack of open elements</a> is an
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element, then act as if an end tag with
|
|
the tag name "option" had been seen.</p>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is an
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element, then pop that node from the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>. Otherwise, this is a
|
|
<a href="#parse-error">parse error</a>; ignore the token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "option"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is an <code><a href="#the-option-element">option</a></code>
|
|
element, then pop that node from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>. Otherwise, this is a <a href="#parse-error">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-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-select-scope" title="has an element in select scope">have an element in select
|
|
scope</a> with the same tag name as the token, this is a
|
|
<a href="#parse-error">parse error</a>. Ignore the token. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise:</p>
|
|
|
|
<p>Pop elements from the <a href="#stack-of-open-elements">stack of open elements</a>
|
|
until a <code><a href="#the-select-element">select</a></code> element has been popped from the
|
|
stack.</p>
|
|
|
|
<p><a href="#reset-the-insertion-mode-appropriately">Reset the insertion mode appropriately</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "select"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>. Act as if the token had been
|
|
an end tag with the tag name "select" instead.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "input", "keygen", "textarea"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> does not <a href="#has-an-element-in-select-scope" title="has an element in select scope">have a <code>select</code>
|
|
element in select scope</a>, ignore the token. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise, act as if an end tag with the tag name "select" had
|
|
been seen, and reprocess the token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag token whose tag name is "script"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is not the root
|
|
<code><a href="#the-html-element">html</a></code> element, then this is a <a href="#parse-error">parse
|
|
error</a>.</p>
|
|
|
|
<p class="note">It can only be the <a href="#current-node">current node</a> in
|
|
the <a href="#fragment-case">fragment case</a>.</p>
|
|
|
|
<p><a href="#stop-parsing">Stop parsing</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-inselectintable"><span class="secno">8.2.5.4.17 </span>The "<dfn title="insertion mode: in select in table">in select in table</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-inselectintable" title="insertion mode: in select in table">in select in table</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A start tag whose tag name is one of: "caption", "table",
|
|
"tbody", "tfoot", "thead", "tr", "td", "th"</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Act as if an end tag with the tag
|
|
name "select" had been seen, and reprocess the token.</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="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>If the <a href="#stack-of-open-elements">stack of open elements</a> <a href="#has-an-element-in-table-scope">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>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inselect" title="insertion mode: in select">in select</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-afterbody"><span class="secno">8.2.5.4.18 </span>The "<dfn title="insertion mode: after body">after body</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-afterbody" title="insertion mode: after body">after body</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the first element in
|
|
the <a href="#stack-of-open-elements">stack of open elements</a> (the <code><a href="#the-html-element">html</a></code>
|
|
element), 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</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-fragment-parsing-algorithm">HTML
|
|
fragment parsing algorithm</a>, this is a <a href="#parse-error">parse
|
|
error</a>; ignore the token. (<a href="#fragment-case">fragment case</a>)</p>
|
|
|
|
<p>Otherwise, switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#the-after-after-body-insertion-mode" title="insertion mode: after after body">after after
|
|
body</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
<p><a href="#stop-parsing">Stop parsing</a>.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>. Switch the <a href="#insertion-mode">insertion
|
|
mode</a> to "<a href="#parsing-main-inbody" title="insertion mode: in body">in
|
|
body</a>" and reprocess the token.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-inframeset"><span class="secno">8.2.5.4.19 </span>The "<dfn title="insertion mode: in frameset">in frameset</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-inframeset" title="insertion mode: in frameset">in frameset</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the character</a> into
|
|
the <a href="#current-node">current node</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "frameset"</dt>
|
|
<dd>
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.</p>
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "frameset"</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is the root
|
|
<code><a href="#the-html-element">html</a></code> element, then this is a <a href="#parse-error">parse
|
|
error</a>; ignore the token. (<a href="#fragment-case">fragment
|
|
case</a>)</p>
|
|
|
|
<p>Otherwise, pop the <a href="#current-node">current node</a> from the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</p>
|
|
|
|
<p>If the parser was <em>not</em> originally created as part
|
|
of the <a href="#html-fragment-parsing-algorithm">HTML fragment parsing algorithm</a>
|
|
(<a href="#fragment-case">fragment case</a>), and the <a href="#current-node">current
|
|
node</a> is no longer a <code><a href="#frameset">frameset</a></code> element, then
|
|
switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#parsing-main-afterframeset" title="insertion mode: after frameset">after
|
|
frameset</a>".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "frame"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-an-html-element">Insert an HTML element</a> for the token.
|
|
Immediately pop the <a href="#current-node">current node</a> off the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</p>
|
|
|
|
<p><a href="#acknowledge-self-closing-flag" title="acknowledge self-closing flag">Acknowledge the
|
|
token's <i>self-closing flag</i></a>, if it is set.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "noframes"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is not the root
|
|
<code><a href="#the-html-element">html</a></code> element, then this is a <a href="#parse-error">parse
|
|
error</a>.</p>
|
|
|
|
<p class="note">It can only be the <a href="#current-node">current node</a> in
|
|
the <a href="#fragment-case">fragment case</a>.</p>
|
|
|
|
<p><a href="#stop-parsing">Stop parsing</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
</dl><h6 id="parsing-main-afterframeset"><span class="secno">8.2.5.4.20 </span>The "<dfn title="insertion mode: after frameset">after frameset</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#parsing-main-afterframeset" title="insertion mode: after frameset">after frameset</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
|
|
<dl class="switch"><dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the character</a> into
|
|
the <a href="#current-node">current node</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>An end tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Switch the <a href="#insertion-mode">insertion mode</a> to "<a href="#the-after-after-frameset-insertion-mode" title="insertion mode: after after frameset">after after
|
|
frameset</a>".</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "noframes"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
<p><a href="#stop-parsing">Stop parsing</a>.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
</dl><h6 id="the-after-after-body-insertion-mode"><span class="secno">8.2.5.4.21 </span>The "<dfn title="insertion mode: after after body">after after body</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#the-after-after-body-insertion-mode" title="insertion mode: after after body">after after body</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <code><a href="#document">Document</a></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>
|
|
<dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
<p><a href="#stop-parsing">Stop parsing</a>.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Switch the <a href="#insertion-mode">insertion mode</a>
|
|
to "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" and
|
|
reprocess the token.</p>
|
|
</dd>
|
|
|
|
</dl><h6 id="the-after-after-frameset-insertion-mode"><span class="secno">8.2.5.4.22 </span>The "<dfn title="insertion mode: after after frameset">after after frameset</dfn>" insertion mode</h6>
|
|
|
|
<p>When the user agent is to apply the rules for the "<a href="#the-after-after-frameset-insertion-mode" title="insertion mode: after after frameset">after after frameset</a>" <a href="#insertion-mode">insertion mode</a>, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <code><a href="#document">Document</a></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>
|
|
<dt>A character token that is one of U+0009 CHARACTER
|
|
TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF),
|
|
U+000D CARRIAGE RETURN (CR), or U+0020 SPACE</dt>
|
|
<dt>A start tag whose tag name is "html"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>An end-of-file token</dt>
|
|
<dd>
|
|
<p><a href="#stop-parsing">Stop parsing</a>.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is "noframes"</dt>
|
|
<dd>
|
|
<p>Process the token <a href="#using-the-rules-for">using the rules for</a> the "<a href="#parsing-main-inhead" title="insertion mode: in head">in head</a>" <a href="#insertion-mode">insertion
|
|
mode</a>.</p>
|
|
</dd>
|
|
|
|
<dt>Anything else</dt>
|
|
<dd>
|
|
<p><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
</dl><h5 id="parsing-main-inforeign"><span class="secno">8.2.5.5 </span>The rules for parsing tokens <dfn title="insertion mode: in foreign content">in foreign content</dfn></h5>
|
|
|
|
<p>When the user agent is to apply the rules for parsing tokens in foreign content, the user agent must handle the token as follows:</p>
|
|
|
|
<dl class="switch"><dt>A character token that is U+0000 NULL</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>. <a href="#insert-a-character" title="insert a
|
|
character">Insert a U+FFFD REPLACEMENT CHARACTER character</a>
|
|
into the <a href="#current-node">current node</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A character token that is one of U+0009 CHARACTER TABULATION,
|
|
U+000A LINE FEED (LF), U+000C FORM FEED (FF), U+000D CARRIAGE
|
|
RETURN (CR), or U+0020 SPACE</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the token's
|
|
character</a> into the <a href="#current-node">current node</a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Any other character token</dt>
|
|
<dd>
|
|
|
|
<p><a href="#insert-a-character" title="insert a character">Insert the token's
|
|
character</a> into the <a href="#current-node">current node</a>.</p>
|
|
|
|
<p>Set the <a href="#frameset-ok-flag">frameset-ok flag</a> to "not ok".</p>
|
|
|
|
</dd>
|
|
|
|
<dt>A comment token</dt>
|
|
<dd>
|
|
<p>Append a <code><a href="#comment-0">Comment</a></code> node to the <a href="#current-node">current
|
|
node</a> 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><a href="#parse-error">Parse error</a>. Ignore the token.</p>
|
|
</dd>
|
|
|
|
<dt>A start tag whose tag name is one of: "b", "big",
|
|
"blockquote", "body", "br", "center", "code",
|
|
"dd", "div", "dl", "dt", "em", "embed", "h1", "h2",
|
|
"h3", "h4", "h5", "h6", "head", "hr", "i", "img",
|
|
"li", "listing", "menu", "meta", "nobr",
|
|
"ol", "p", "pre", "ruby", "s", "small",
|
|
"span", "strong", "strike", "sub", "sup",
|
|
"table", "tt", "u", "ul", "var"</dt> <dt>A start tag whose tag name is "font", if the token has any
|
|
attributes named "color", "face", or "size"</dt>
|
|
<dd>
|
|
|
|
<p><a href="#parse-error">Parse error</a>.</p>
|
|
|
|
<p>Pop an element from the <a href="#stack-of-open-elements">stack of open elements</a>,
|
|
and then keep popping more elements from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> until the <a href="#current-node">current node</a> is a
|
|
<a href="#mathml-text-integration-point">MathML text integration point</a>, an <a href="#html-integration-point">HTML
|
|
integration point</a>, or an element in the <a href="#html-namespace-0">HTML
|
|
namespace</a>.</p>
|
|
|
|
<p>Then, reprocess the token.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Any other start tag</dt>
|
|
<dd>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is an element in the
|
|
<a href="#mathml-namespace">MathML namespace</a>, <a href="#adjust-mathml-attributes">adjust MathML
|
|
attributes</a> for the token. (This fixes the case of MathML
|
|
attributes that are not all lowercase.)</p>
|
|
|
|
<p>If the <a href="#current-node">current node</a> is an element in the <a href="#svg-namespace">SVG
|
|
namespace</a>, and the token's tag name is one of the ones in
|
|
the first column of the following table, change the tag name to
|
|
the name given in the corresponding cell in the second
|
|
column. (This fixes the case of SVG elements that are not all
|
|
lowercase.)</p>
|
|
|
|
<table><thead><tr><th> Tag name <th> Element name
|
|
<tbody><tr><td> <code title="">altglyph</code> <td> <code title="">altGlyph</code>
|
|
<tr><td> <code title="">altglyphdef</code> <td> <code title="">altGlyphDef</code>
|
|
<tr><td> <code title="">altglyphitem</code> <td> <code title="">altGlyphItem</code>
|
|
<tr><td> <code title="">animatecolor</code> <td> <code title="">animateColor</code>
|
|
<tr><td> <code title="">animatemotion</code> <td> <code title="">animateMotion</code>
|
|
<tr><td> <code title="">animatetransform</code> <td> <code title="">animateTransform</code>
|
|
<tr><td> <code title="">clippath</code> <td> <code title="">clipPath</code>
|
|
<tr><td> <code title="">feblend</code> <td> <code title="">feBlend</code>
|
|
<tr><td> <code title="">fecolormatrix</code> <td> <code title="">feColorMatrix</code>
|
|
<tr><td> <code title="">fecomponenttransfer</code> <td> <code title="">feComponentTransfer</code>
|
|
<tr><td> <code title="">fecomposite</code> <td> <code title="">feComposite</code>
|
|
<tr><td> <code title="">feconvolvematrix</code> <td> <code title="">feConvolveMatrix</code>
|
|
<tr><td> <code title="">fediffuselighting</code> <td> <code title="">feDiffuseLighting</code>
|
|
<tr><td> <code title="">fedisplacementmap</code> <td> <code title="">feDisplacementMap</code>
|
|
<tr><td> <code title="">fedistantlight</code> <td> <code title="">feDistantLight</code>
|
|
<tr><td> <code title="">feflood</code> <td> <code title="">feFlood</code>
|
|
<tr><td> <code title="">fefunca</code> <td> <code title="">feFuncA</code>
|
|
<tr><td> <code title="">fefuncb</code> <td> <code title="">feFuncB</code>
|
|
<tr><td> <code title="">fefuncg</code> <td> <code title="">feFuncG</code>
|
|
<tr><td> <code title="">fefuncr</code> <td> <code title="">feFuncR</code>
|
|
<tr><td> <code title="">fegaussianblur</code> <td> <code title="">feGaussianBlur</code>
|
|
<tr><td> <code title="">feimage</code> <td> <code title="">feImage</code>
|
|
<tr><td> <code title="">femerge</code> <td> <code title="">feMerge</code>
|
|
<tr><td> <code title="">femergenode</code> <td> <code title="">feMergeNode</code>
|
|
<tr><td> <code title="">femorphology</code> <td> <code title="">feMorphology</code>
|
|
<tr><td> <code title="">feoffset</code> <td> <code title="">feOffset</code>
|
|
<tr><td> <code title="">fepointlight</code> <td> <code title="">fePointLight</code>
|
|
<tr><td> <code title="">fespecularlighting</code> <td> <code title="">feSpecularLighting</code>
|
|
<tr><td> <code title="">fespotlight</code> <td> <code title="">feSpotLight</code>
|
|
<tr><td> <code title="">fetile</code> <td> <code title="">feTile</code>
|
|
<tr><td> <code title="">feturbulence</code> <td> <code title="">feTurbulence</code>
|
|
<tr><td> <code title="">foreignobject</code> <td> <code title="">foreignObject</code>
|
|
<tr><td> <code title="">glyphref</code> <td> <code title="">glyphRef</code>
|
|
<tr><td> <code title="">lineargradient</code> <td> <code title="">linearGradient</code>
|
|
<tr><td> <code title="">radialgradient</code> <td> <code title="">radialGradient</code>
|
|
|
|
<tr><td> <code title="">textpath</code> <td> <code title="">textPath</code>
|
|
</table><p>If the <a href="#current-node">current node</a> is an element in the <a href="#svg-namespace">SVG
|
|
namespace</a>, <a href="#adjust-svg-attributes">adjust SVG attributes</a> for the
|
|
token. (This fixes the case of SVG attributes that are not all
|
|
lowercase.)</p>
|
|
|
|
<p><a href="#adjust-foreign-attributes">Adjust foreign attributes</a> for the token. (This
|
|
fixes the use of namespaced attributes, in particular XLink in
|
|
SVG.)</p>
|
|
|
|
<p><a href="#insert-a-foreign-element">Insert a foreign element</a> for the token, in the
|
|
same namespace as the <a href="#current-node">current node</a>.</p>
|
|
|
|
<p>If the token has its <i>self-closing flag</i> set, pop the
|
|
<a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> and <a href="#acknowledge-self-closing-flag" title="acknowledge self-closing
|
|
flag">acknowledge the token's <i>self-closing flag</i></a>.</p>
|
|
|
|
</dd>
|
|
|
|
<dt id="scriptForeignEndTag">An end tag whose tag name is "script", if the <a href="#current-node">current node</a> is a <code title="">script</code> element in the <a href="#svg-namespace">SVG namespace</a></dt>
|
|
<dd>
|
|
|
|
<p>Pop the <a href="#current-node">current node</a> off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</p>
|
|
|
|
<p>Let the <var title="">old insertion point</var> have the
|
|
same value as the current <a href="#insertion-point">insertion point</a>. Let
|
|
the <a href="#insertion-point">insertion point</a> be just before the <a href="#next-input-character">next
|
|
input character</a>.</p>
|
|
|
|
<p>Increment the parser's <a href="#script-nesting-level">script nesting level</a> by
|
|
one. Set the <a href="#parser-pause-flag">parser pause flag</a> to true.</p>
|
|
|
|
<p><a href="http://www.w3.org/TR/SVGMobile12/script.html#ScriptContentProcessing">Process
|
|
the <code title="">script</code> element</a> according to the SVG
|
|
rules, if the user agent supports SVG. <a href="#refsSVG">[SVG]</a></p>
|
|
|
|
<p class="note">Even if this causes <a href="#dom-document-write" title="dom-document-write">new characters to be inserted into the
|
|
tokenizer</a>, the parser will not be executed reentrantly,
|
|
since the <a href="#parser-pause-flag">parser pause flag</a> is true.</p>
|
|
|
|
<p>Decrement the parser's <a href="#script-nesting-level">script nesting level</a> by
|
|
one. If the parser's <a href="#script-nesting-level">script nesting level</a> is zero,
|
|
then set the <a href="#parser-pause-flag">parser pause flag</a> to false.</p>
|
|
|
|
<p>Let the <a href="#insertion-point">insertion point</a> have the value of the <var title="">old insertion point</var>. (In other words, restore the
|
|
<a href="#insertion-point">insertion point</a> to its previous value. This value
|
|
might be the "undefined" value.)</p>
|
|
|
|
</dd>
|
|
|
|
<dt>Any other end tag</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Run these steps:</p>
|
|
|
|
<ol><li><p>Initialize <var title="">node</var> to be the <a href="#current-node">current
|
|
node</a> (the bottommost node of the stack).</li>
|
|
|
|
<li><p>If <var title="">node</var> is not an element with the
|
|
same tag name as the token, then this is a <a href="#parse-error">parse
|
|
error</a>.</li>
|
|
|
|
<li><p><i>Loop</i>: If <var title="">node</var>'s tag name,
|
|
<a href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>, is the same as the tag
|
|
name of the token, pop elements from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> until <var title="">node</var> has been popped
|
|
from the stack, and then jump to the last step of this list of
|
|
steps.</li>
|
|
|
|
<li><p>Set <var title="">node</var> to the previous entry in the
|
|
<a href="#stack-of-open-elements">stack of open elements</a>.</li>
|
|
|
|
<li><p>If <var title="">node</var> is not an element in the
|
|
<a href="#html-namespace-0">HTML namespace</a>, return to the step labeled
|
|
<i>loop</i>.</li>
|
|
|
|
<li><p>Otherwise, process the token according to the rules given
|
|
in the section corresponding to the current <a href="#insertion-mode">insertion
|
|
mode</a> in HTML content.</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl></div><div class="impl">
|
|
|
|
<h4 id="the-end"><span class="secno">8.2.6 </span>The end</h4>
|
|
|
|
<p>Once the user agent <dfn id="stop-parsing" title="stop parsing">stops parsing</dfn>
|
|
the document, the user agent must run the following steps:</p>
|
|
|
|
<ol><li><p>Set the <a href="#current-document-readiness">current document readiness</a> to
|
|
"interactive" and
|
|
the <a href="#insertion-point">insertion point</a> to undefined.</li>
|
|
|
|
<li><p>Pop <em>all</em> the nodes off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</li>
|
|
|
|
<li><p>If the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts that will execute when the
|
|
document has finished parsing</a> is not empty, run these
|
|
substeps:</p>
|
|
|
|
<ol><li><p><a href="#spin-the-event-loop">Spin the event loop</a> until the first
|
|
<code><a href="#the-script-element">script</a></code> in the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts that will
|
|
execute when the document has finished parsing</a> has its
|
|
<a href="#ready-to-be-parser-executed">"ready to be parser-executed"</a> flag set <em>and</em>
|
|
the parser's <code><a href="#document">Document</a></code> <a href="#has-no-style-sheet-that-is-blocking-scripts">has no style sheet that
|
|
is blocking scripts</a>.</li>
|
|
|
|
<li><p><a href="#execute-the-script-block" title="execute the script block">Execute</a> the
|
|
first <code><a href="#the-script-element">script</a></code> in the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts that will
|
|
execute when the document has finished parsing</a>.</li>
|
|
|
|
<li><p>Remove the first <code><a href="#the-script-element">script</a></code> element from the
|
|
<a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts that will execute when the document has
|
|
finished parsing</a> (i.e. shift out the first entry in the
|
|
list).</li>
|
|
|
|
<li><p>If the <a href="#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing">list of scripts that will execute when the
|
|
document has finished parsing</a> is still not empty, repeat
|
|
these substeps again from substep 1.</p>
|
|
|
|
</ol></li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> that bubbles named <code title="event-DOMContentLoaded">DOMContentLoaded</code> at the
|
|
<code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li><p><a href="#spin-the-event-loop">Spin the event loop</a> until the <a href="#set-of-scripts-that-will-execute-as-soon-as-possible">set of
|
|
scripts that will execute as soon as possible</a> and the
|
|
<a href="#list-of-scripts-that-will-execute-in-order-as-soon-as-possible">list of scripts that will execute in order as soon as
|
|
possible</a> are empty.</li>
|
|
<li><p><a href="#spin-the-event-loop">Spin the event loop</a> until there is nothing that
|
|
<dfn id="delay-the-load-event" title="delay the load event">delays the load event</dfn> in
|
|
the <code><a href="#document">Document</a></code>.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to set the <a href="#current-document-readiness">current document
|
|
readiness</a> to "complete". </li>
|
|
|
|
<li><p>If the <code><a href="#document">Document</a></code> is in a <a href="#browsing-context">browsing
|
|
context</a>, then <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a
|
|
simple event</a> named <code title="event-load">load</code> at
|
|
the <code><a href="#document">Document</a></code>'s <code><a href="#window">Window</a></code> object, but with
|
|
its <code title="dom-event-target"><a href="#dom-event-target">target</a></code> set to the
|
|
<code><a href="#document">Document</a></code> object (and the <code title="dom-event-currentTarget">currentTarget</code> set to the
|
|
<code><a href="#window">Window</a></code> object).</li>
|
|
|
|
<li><p>If the <code><a href="#document">Document</a></code> is in a <a href="#browsing-context">browsing
|
|
context</a>, then <a href="#queue-a-task">queue a task</a> to fire a <code title="event-pageshow"><a href="#event-pageshow">pageshow</a></code> event at the
|
|
<code><a href="#window">Window</a></code> object of the <code><a href="#document">Document</a></code>, but with
|
|
its <code title="dom-event-target"><a href="#dom-event-target">target</a></code> set to the
|
|
<code><a href="#document">Document</a></code> object (and the <code title="dom-event-currentTarget">currentTarget</code> set to the
|
|
<code><a href="#window">Window</a></code> object), using the
|
|
<code><a href="#pagetransitionevent">PageTransitionEvent</a></code> interface, with the <code title="dom-PageTransitionEvent-persisted"><a href="#dom-pagetransitionevent-persisted">persisted</a></code>
|
|
attribute set to false. This event must not bubble, must not be
|
|
cancelable, and has no default action.</li>
|
|
|
|
<li><p>If the <code><a href="#document">Document</a></code> has any <a href="#pending-application-cache-download-process-tasks">pending
|
|
application cache download process tasks</a>, then <a href="#queue-a-task" title="queue a task">queue</a> each such <a href="#concept-task" title="concept-task">task</a> in the order they were added to
|
|
the list of <a href="#pending-application-cache-download-process-tasks">pending application cache download process
|
|
tasks</a>, and then empty the list of <a href="#pending-application-cache-download-process-tasks">pending application
|
|
cache download process tasks</a>. The <a href="#task-source">task source</a>
|
|
for these <a href="#concept-task" title="concept-task">tasks</a> is the
|
|
<a href="#networking-task-source">networking task source</a>.</li>
|
|
|
|
<li><p>The <code><a href="#document">Document</a></code> is now <dfn id="ready-for-post-load-tasks">ready for post-load
|
|
tasks</dfn>.</li>
|
|
|
|
<li><p><a href="#queue-a-task">Queue a task</a> to mark the <code><a href="#document">Document</a></code>
|
|
as <dfn id="completely-loaded">completely loaded</dfn>.</li>
|
|
|
|
</ol><p>When the user agent is to <dfn id="abort-a-parser">abort a parser</dfn>, it must run
|
|
the following steps:</p>
|
|
|
|
<ol><li><p>Throw away any pending content in the <a href="#the-input-stream">input
|
|
stream</a>, and discard any future content that would have been
|
|
added to it.</li>
|
|
|
|
<li><p>Pop <em>all</em> the nodes off the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>.</li>
|
|
|
|
|
|
</ol><p>Except where otherwise specified, the <a href="#task-source">task source</a>
|
|
for the <a href="#concept-task" title="concept-task">tasks</a> mentioned in this
|
|
section is the <a href="#dom-manipulation-task-source">DOM manipulation task source</a>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="coercing-an-html-dom-into-an-infoset"><span class="secno">8.2.7 </span>Coercing an HTML DOM into an infoset</h4>
|
|
|
|
<p>When an application uses an <a href="#html-parser">HTML parser</a> in
|
|
conjunction with an XML pipeline, it is possible that the
|
|
constructed DOM is not compatible with the XML tool chain in certain
|
|
subtle ways. For example, an XML toolchain might not be able to
|
|
represent attributes with the name <code title="">xmlns</code>,
|
|
since they conflict with the Namespaces in XML syntax. There is also
|
|
some data that the <a href="#html-parser">HTML parser</a> generates that isn't
|
|
included in the DOM itself. This section specifies some rules for
|
|
handling these issues.</p>
|
|
|
|
<p>If the XML API being used doesn't support DOCTYPEs, the tool may
|
|
drop DOCTYPEs altogether.</p>
|
|
|
|
<p>If the XML API doesn't support attributes in no namespace that
|
|
are named "<code title="">xmlns</code>", attributes whose names
|
|
start with "<code title="">xmlns:</code>", or attributes in the
|
|
<a href="#xmlns-namespace">XMLNS namespace</a>, then the tool may drop such
|
|
attributes.</p>
|
|
|
|
<p>The tool may annotate the output with any namespace declarations
|
|
required for proper operation.</p>
|
|
|
|
<p>If the XML API being used restricts the allowable characters in
|
|
the local names of elements and attributes, then the tool may map
|
|
all element and attribute local names that the API wouldn't support
|
|
to a set of names that <em>are</em> allowed, by replacing any
|
|
character that isn't supported with the uppercase letter U and the
|
|
six digits of the character's Unicode code point when expressed in
|
|
hexadecimal, using digits 0-9 and capital letters A-F as the
|
|
symbols, in increasing numeric order.</p>
|
|
|
|
<p class="example">For example, the element name <code title="">foo<bar</code>, which can be output by the <a href="#html-parser">HTML
|
|
parser</a>, though it is neither a legal HTML element name nor a
|
|
well-formed XML element name, would be converted into <code title="">fooU00003Cbar</code>, which <em>is</em> a well-formed XML
|
|
element name (though it's still not legal in HTML by any means).</p>
|
|
|
|
<p class="example">As another example, consider the attribute
|
|
<code>xlink:href</code>. Used on a MathML element, it becomes, after
|
|
being <a href="#adjust-foreign-attributes" title="adjust foreign attributes">adjusted</a>, an
|
|
attribute with a prefix "<code title="">xlink</code>" and a local
|
|
name "<code title="">href</code>". However, used on an HTML element,
|
|
it becomes an attribute with no prefix and the local name "<code title="">xlink:href</code>", which is not a valid NCName, and thus
|
|
might not be accepted by an XML API. It could thus get converted,
|
|
becoming "<code title="">xlinkU00003Ahref</code>".</p>
|
|
|
|
<p class="note">The resulting names from this conversion
|
|
conveniently can't clash with any attribute generated by the
|
|
<a href="#html-parser">HTML parser</a>, since those are all either lowercase or
|
|
those listed in the <a href="#adjust-foreign-attributes">adjust foreign attributes</a>
|
|
algorithm's table.</p>
|
|
|
|
<p>If the XML API restricts comments from having two consecutive
|
|
U+002D HYPHEN-MINUS characters (--), the tool may insert a single
|
|
U+0020 SPACE character between any such offending characters.</p>
|
|
|
|
<p>If the XML API restricts comments from ending in a
|
|
U+002D HYPHEN-MINUS character (-), the tool may insert a single
|
|
U+0020 SPACE character at the end of such comments.</p>
|
|
|
|
<p>If the XML API restricts allowed characters in character data,
|
|
attribute values, or comments, the tool may replace any U+000C FORM
|
|
FEED (FF) character with a U+0020 SPACE character, and any other
|
|
literal non-XML character with a U+FFFD REPLACEMENT CHARACTER.</p>
|
|
|
|
<p>If the tool has no way to convey out-of-band information, then
|
|
the tool may drop the following information:</p>
|
|
|
|
<ul><li>Whether the document is set to <i><a href="#no-quirks-mode">no-quirks mode</a></i>,
|
|
<i><a href="#limited-quirks-mode">limited-quirks mode</a></i>, or <i><a href="#quirks-mode">quirks mode</a></i></li>
|
|
|
|
<li>The association between form controls and forms that aren't
|
|
their nearest <code><a href="#the-form-element">form</a></code> element ancestor (use of the
|
|
<a href="#form-element-pointer"><code>form</code> element pointer</a> in the parser)</li>
|
|
|
|
</ul><p class="note">The mutations allowed by this section apply
|
|
<em>after</em> the <a href="#html-parser">HTML parser</a>'s rules have been
|
|
applied. For example, a <code title=""><a::></code> start tag
|
|
will be closed by a <code title=""></a::></code> end tag, and
|
|
never by a <code title=""></aU00003AU00003A></code> end tag, even
|
|
if the user agent is using the rules above to then generate an
|
|
actual element in the DOM with the name <code title="">aU00003AU00003A</code> for that start tag.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="an-introduction-to-error-handling-and-strange-cases-in-the-parser"><span class="secno">8.2.8 </span>An introduction to error handling and strange cases in the parser</h4>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>This section examines some erroneous markup and discusses how
|
|
the <a href="#html-parser">HTML parser</a> handles these cases.</p>
|
|
|
|
|
|
<h5 id="misnested-tags:-b-i-b-i"><span class="secno">8.2.8.1 </span>Misnested tags: <b><i></b></i></h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>The most-often discussed example of erroneous markup is as
|
|
follows:</p>
|
|
|
|
<pre><p>1<b>2<i>3</b>4</i>5</p></pre>
|
|
|
|
<p>The parsing of this markup is straightforward up to the "3". At
|
|
this point, the DOM looks like this:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t3"><code>#text</code>: <span title="">1</span><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">2</span><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t3"><code>#text</code>: <span title="">3</span></ul></ul></ul></ul></ul></ul><p>Here, the <a href="#stack-of-open-elements">stack of open elements</a> has five elements
|
|
on it: <code><a href="#the-html-element">html</a></code>, <code><a href="#the-body-element">body</a></code>, <code><a href="#the-p-element">p</a></code>,
|
|
<code><a href="#the-b-element">b</a></code>, and <code><a href="#the-i-element">i</a></code>. The <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a> just has two: <code><a href="#the-b-element">b</a></code> and
|
|
<code><a href="#the-i-element">i</a></code>. The <a href="#insertion-mode">insertion mode</a> is "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>".</p>
|
|
|
|
<p>Upon receiving the end tag token with the tag name "b", the "<a href="#adoptionAgency">adoption agency algorithm</a>" is
|
|
invoked. This is a simple case, in that the <var title="">formatting
|
|
element</var> is the <code><a href="#the-b-element">b</a></code> element, and there is no
|
|
<var title="">furthest block</var>. Thus, the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> ends up with just three elements: <code><a href="#the-html-element">html</a></code>,
|
|
<code><a href="#the-body-element">body</a></code>, and <code><a href="#the-p-element">p</a></code>, while the <a href="#list-of-active-formatting-elements">list of
|
|
active formatting elements</a> has just one: <code><a href="#the-i-element">i</a></code>. The
|
|
DOM tree is unmodified at this point.</p>
|
|
|
|
<p>The next token is a character ("4"), triggers the <a href="#reconstruct-the-active-formatting-elements" title="reconstruct the active formatting elements">reconstruction of
|
|
the active formatting elements</a>, in this case just the
|
|
<code><a href="#the-i-element">i</a></code> element. A new <code><a href="#the-i-element">i</a></code> element is thus created
|
|
for the "4" text node. After the end tag token for the "i" is also
|
|
received, and the "5" text node is inserted, the DOM looks as
|
|
follows:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t3"><code>#text</code>: <span title="">1</span><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">2</span><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t3"><code>#text</code>: <span title="">3</span></ul></ul><li class="t1"><code><a href="#the-i-element">i</a></code><ul><li class="t3"><code>#text</code>: <span title="">4</span></ul><li class="t3"><code>#text</code>: <span title="">5</span></ul></ul></ul></ul><h5 id="misnested-tags:-b-p-b-p"><span class="secno">8.2.8.2 </span>Misnested tags: <b><p></b></p></h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>A case similar to the previous one is the following:</p>
|
|
|
|
<pre><b>1<p>2</b>3</p></pre>
|
|
|
|
<p>Up to the "2" the parsing here is straightforward:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">1</span><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t3"><code>#text</code>: <span title="">2</span></ul></ul></ul></ul></ul><p>The interesting part is when the end tag token with the tag name
|
|
"b" is parsed.</p>
|
|
|
|
<p>Before that token is seen, the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> has four elements on it: <code><a href="#the-html-element">html</a></code>,
|
|
<code><a href="#the-body-element">body</a></code>, <code><a href="#the-b-element">b</a></code>, and <code><a href="#the-p-element">p</a></code>. The
|
|
<a href="#list-of-active-formatting-elements">list of active formatting elements</a> just has the one:
|
|
<code><a href="#the-b-element">b</a></code>. The <a href="#insertion-mode">insertion mode</a> is "<a href="#parsing-main-inbody" title="insertion mode: in body">in body</a>".</p>
|
|
|
|
<p>Upon receiving the end tag token with the tag name "b", the "<a href="#adoptionAgency">adoption agency algorithm</a>" is invoked, as
|
|
in the previous example. However, in this case, there <em>is</em> a
|
|
<var title="">furthest block</var>, namely the <code><a href="#the-p-element">p</a></code> element. Thus,
|
|
this time the adoption agency algorithm isn't skipped over.</p>
|
|
|
|
<p>The <var title="">common ancestor</var> is the <code><a href="#the-body-element">body</a></code>
|
|
element. A conceptual "bookmark" marks the position of the
|
|
<code><a href="#the-b-element">b</a></code> in the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a>, but since that list has only one element in it,
|
|
the bookmark won't have much effect.</p>
|
|
|
|
<p>As the algorithm progresses, <var title="">node</var> ends up set
|
|
to the formatting element (<code><a href="#the-b-element">b</a></code>), and <var title="">last
|
|
node</var> ends up set to the <var title="">furthest block</var>
|
|
(<code><a href="#the-p-element">p</a></code>).</p>
|
|
|
|
<p>The <var title="">last node</var> gets appended (moved) to the
|
|
<var title="">common ancestor</var>, so that the DOM looks like:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">1</span></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t3"><code>#text</code>: <span title="">2</span></ul></ul></ul></ul><p>A new <code><a href="#the-b-element">b</a></code> element is created, and the children of the
|
|
<code><a href="#the-p-element">p</a></code> element are moved to it:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">1</span></ul><li class="t1"><code><a href="#the-p-element">p</a></code></ul></ul></ul><ul class="domTree"><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">2</span></ul></ul><p>Finally, the new <code><a href="#the-b-element">b</a></code> element is appended to the
|
|
<code><a href="#the-p-element">p</a></code> element, so that the DOM looks like:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">1</span></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">2</span></ul></ul></ul></ul></ul><p>The <code><a href="#the-b-element">b</a></code> element is removed from the <a href="#list-of-active-formatting-elements">list of
|
|
active formatting elements</a> and the <a href="#stack-of-open-elements">stack of open
|
|
elements</a>, so that when the "3" is parsed, it is appended to
|
|
the <code><a href="#the-p-element">p</a></code> element:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">1</span></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">2</span></ul><li class="t3"><code>#text</code>: <span title="">3</span></ul></ul></ul></ul><h5 id="unexpected-markup-in-tables"><span class="secno">8.2.8.3 </span>Unexpected markup in tables</h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>Error handling in tables is, for historical reasons, especially
|
|
strange. For example, consider the following markup:</p>
|
|
|
|
<pre><table><strong><b></strong><tr><td>aaa</td></tr><strong>bbb</strong></table>ccc</pre>
|
|
|
|
<p>The highlighted <code><a href="#the-b-element">b</a></code> element start tag is not allowed
|
|
directly inside a table like that, and the parser handles this case
|
|
by placing the element <em>before</em> the table. (This is called <i title="foster parent"><a href="#foster-parent">foster parenting</a></i>.) This can be seen by
|
|
examining the DOM tree as it stands just after the
|
|
<code><a href="#the-table-element">table</a></code> element's start tag has been seen:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-table-element">table</a></code></ul></ul></ul><p>...and then immediately after the <code><a href="#the-b-element">b</a></code> element start
|
|
tag has been seen:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><li class="t1"><code><a href="#the-table-element">table</a></code></ul></ul></ul><p>At this point, the <a href="#stack-of-open-elements">stack of open elements</a> has on it
|
|
the elements <code><a href="#the-html-element">html</a></code>, <code><a href="#the-body-element">body</a></code>,
|
|
<code><a href="#the-table-element">table</a></code>, and <code><a href="#the-b-element">b</a></code> (in that order, despite the
|
|
resulting DOM tree); the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a> just has the <code><a href="#the-b-element">b</a></code> element in it; and the
|
|
<a href="#insertion-mode">insertion mode</a> is "<a href="#parsing-main-intable" title="insertion mode: in
|
|
table">in table</a>".</p>
|
|
|
|
<p>The <code><a href="#the-tr-element">tr</a></code> start tag causes the <code><a href="#the-b-element">b</a></code> element
|
|
to be popped off the stack and a <code><a href="#the-tbody-element">tbody</a></code> start tag to be
|
|
implied; the <code><a href="#the-tbody-element">tbody</a></code> and <code><a href="#the-tr-element">tr</a></code> elements are
|
|
then handled in a rather straight-forward manner, taking the parser
|
|
through the "<a href="#parsing-main-intbody" title="insertion mode: in table body">in table
|
|
body</a>" and "<a href="#parsing-main-intr" title="insertion mode: in row">in
|
|
row</a>" insertion modes, after which the DOM looks as
|
|
follows:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><li class="t1"><code><a href="#the-table-element">table</a></code><ul><li class="t1"><code><a href="#the-tbody-element">tbody</a></code><ul><li class="t1"><code><a href="#the-tr-element">tr</a></code></ul></ul></ul></ul></ul><p>Here, the <a href="#stack-of-open-elements">stack of open elements</a> has on it the
|
|
elements <code><a href="#the-html-element">html</a></code>, <code><a href="#the-body-element">body</a></code>, <code><a href="#the-table-element">table</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, and <code><a href="#the-tr-element">tr</a></code>; the <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a> still has the <code><a href="#the-b-element">b</a></code> element in
|
|
it; and the <a href="#insertion-mode">insertion mode</a> is "<a href="#parsing-main-intr" title="insertion
|
|
mode: in row">in row</a>".</p>
|
|
|
|
<p>The <code><a href="#the-td-element">td</a></code> element start tag token, after putting a
|
|
<code><a href="#the-td-element">td</a></code> element on the tree, puts a marker on the <a href="#list-of-active-formatting-elements">list
|
|
of active formatting elements</a> (it also switches to the "<a href="#parsing-main-intd" title="insertion mode: in cell">in cell</a>" <a href="#insertion-mode">insertion
|
|
mode</a>).</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><li class="t1"><code><a href="#the-table-element">table</a></code><ul><li class="t1"><code><a href="#the-tbody-element">tbody</a></code><ul><li class="t1"><code><a href="#the-tr-element">tr</a></code><ul><li class="t1"><code><a href="#the-td-element">td</a></code></ul></ul></ul></ul></ul></ul><p>The marker means that when the "aaa" character tokens are seen,
|
|
no <code><a href="#the-b-element">b</a></code> element is created to hold the resulting text
|
|
node:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><li class="t1"><code><a href="#the-table-element">table</a></code><ul><li class="t1"><code><a href="#the-tbody-element">tbody</a></code><ul><li class="t1"><code><a href="#the-tr-element">tr</a></code><ul><li class="t1"><code><a href="#the-td-element">td</a></code><ul><li class="t3"><code>#text</code>: <span title="">aaa</span></ul></ul></ul></ul></ul></ul></ul><p>The end tags are handled in a straight-forward manner; after
|
|
handling them, the <a href="#stack-of-open-elements">stack of open elements</a> has on it the
|
|
elements <code><a href="#the-html-element">html</a></code>, <code><a href="#the-body-element">body</a></code>, <code><a href="#the-table-element">table</a></code>,
|
|
and <code><a href="#the-tbody-element">tbody</a></code>; the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a> still has the <code><a href="#the-b-element">b</a></code> element in it (the
|
|
marker having been removed by the "td" end tag token); and the
|
|
<a href="#insertion-mode">insertion mode</a> is "<a href="#parsing-main-intbody" title="insertion mode: in
|
|
table body">in table body</a>".</p>
|
|
|
|
<p>Thus it is that the "bbb" character tokens are found. These
|
|
trigger the "<a href="#parsing-main-intabletext" title="insertion mode: in table text">in table
|
|
text</a>" insertion mode to be used (with the <a href="#original-insertion-mode">original
|
|
insertion mode</a> set to "<a href="#parsing-main-intbody" title="insertion mode: in table
|
|
body">in table body</a>"). The character tokens are collected,
|
|
and when the next token (the <code><a href="#the-table-element">table</a></code> element end tag) is
|
|
seen, they are processed as a group. Since they are not all spaces,
|
|
they are handled as per the "anything else" rules in the "<a href="#parsing-main-intable" title="insertion mode: in table">in table</a>" insertion mode,
|
|
which defer to the "<a href="#parsing-main-inbody" title="insertion mode: in body">in
|
|
body</a>" insertion mode but with <a href="#foster-parent" title="foster
|
|
parent">foster parenting</a>.</p>
|
|
|
|
<p>When <a href="#reconstruct-the-active-formatting-elements" title="reconstruct the active formatting elements">the
|
|
active formatting elements are reconstructed</a>, a
|
|
<code><a href="#the-b-element">b</a></code> element is created and <a href="#foster-parent" title="foster
|
|
parent">foster parented</a>, and then the "bbb" text node is
|
|
appended to it:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">bbb</span></ul><li class="t1"><code><a href="#the-table-element">table</a></code><ul><li class="t1"><code><a href="#the-tbody-element">tbody</a></code><ul><li class="t1"><code><a href="#the-tr-element">tr</a></code><ul><li class="t1"><code><a href="#the-td-element">td</a></code><ul><li class="t3"><code>#text</code>: <span title="">aaa</span></ul></ul></ul></ul></ul></ul></ul><p>The <a href="#stack-of-open-elements">stack of open elements</a> has on it the elements
|
|
<code><a href="#the-html-element">html</a></code>, <code><a href="#the-body-element">body</a></code>, <code><a href="#the-table-element">table</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, and the new <code><a href="#the-b-element">b</a></code> (again, note that
|
|
this doesn't match the resulting tree!); the <a href="#list-of-active-formatting-elements">list of active
|
|
formatting elements</a> has the new <code><a href="#the-b-element">b</a></code> element in it;
|
|
and the <a href="#insertion-mode">insertion mode</a> is still "<a href="#parsing-main-intbody" title="insertion
|
|
mode: in table body">in table body</a>".</p>
|
|
|
|
<p>Had the character tokens been only <a href="#space-character" title="space
|
|
character">space characters</a> instead of "bbb", then those
|
|
<a href="#space-character" title="space character">space characters</a> would just be
|
|
appended to the <code><a href="#the-tbody-element">tbody</a></code> element.</p>
|
|
|
|
<p>Finally, the <code><a href="#the-table-element">table</a></code> is closed by a "table" end
|
|
tag. This pops all the nodes from the <a href="#stack-of-open-elements">stack of open
|
|
elements</a> up to and including the <code><a href="#the-table-element">table</a></code> element,
|
|
but it doesn't affect the <a href="#list-of-active-formatting-elements">list of active formatting
|
|
elements</a>, so the "ccc" character tokens after the table
|
|
result in yet another <code><a href="#the-b-element">b</a></code> element being created, this
|
|
time after the table:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">bbb</span></ul><li class="t1"><code><a href="#the-table-element">table</a></code><ul><li class="t1"><code><a href="#the-tbody-element">tbody</a></code><ul><li class="t1"><code><a href="#the-tr-element">tr</a></code><ul><li class="t1"><code><a href="#the-td-element">td</a></code><ul><li class="t3"><code>#text</code>: <span title="">aaa</span></ul></ul></ul></ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">ccc</span></ul></ul></ul></ul><h5 id="scripts-that-modify-the-page-as-it-is-being-parsed"><span class="secno">8.2.8.4 </span>Scripts that modify the page as it is being parsed</h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>Consider the following markup, which for this example we will
|
|
assume is the document with <a href="#url">URL</a> <code title="">http://example.com/inner</code>, being rendered as the
|
|
content of an <code><a href="#the-iframe-element">iframe</a></code> in another document with the
|
|
<a href="#url">URL</a> <code title="">http://example.com/outer</code>:</p>
|
|
|
|
<pre><div id=a>
|
|
<script>
|
|
var div = document.getElementById('a');
|
|
parent.document.body.appendChild(div);
|
|
</script>
|
|
<script>
|
|
alert(document.URL);
|
|
</script>
|
|
</div>
|
|
<script>
|
|
alert(document.URL);
|
|
</script></pre>
|
|
|
|
<p>Up to the first "script" end tag, before the script is parsed,
|
|
the result is relatively straightforward:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-div-element">div</a></code> <span class="t2" title=""><code class="attribute name">id</code>="<code class="attribute value"><a href="#the-a-element">a</a></code>"</span><ul><li class="t3"><code>#text</code>: <span title="">
|
|
</span><li class="t1"><code><a href="#the-script-element">script</a></code><ul><li class="t3"><code>#text</code>: <span title="">var div = document.getElementById('a'); ⏎ parent.document.body.appendChild(div);</span></ul></ul></ul></ul></ul><p>After the script is parsed, though, the <code><a href="#the-div-element">div</a></code> element
|
|
and its child <code><a href="#the-script-element">script</a></code> element are gone:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code></ul></ul><p>They are, at this point, in the <code><a href="#document">Document</a></code> of the
|
|
aforementioned outer <a href="#browsing-context">browsing context</a>. However, the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> <em>still contains the
|
|
<code><a href="#the-div-element">div</a></code> element</em>.</p>
|
|
|
|
<p>Thus, when the second <code><a href="#the-script-element">script</a></code> element is parsed, it
|
|
is inserted <em>into the outer <code><a href="#document">Document</a></code>
|
|
object</em>.</p>
|
|
|
|
<p>This also means that the <a href="#script-s-global-object">script's global object</a> is
|
|
the outer <a href="#browsing-context">browsing context</a>'s <code><a href="#window">Window</a></code>
|
|
object, <em>not</em> the <code><a href="#window">Window</a></code> object inside the
|
|
<code><a href="#the-iframe-element">iframe</a></code>.</p>
|
|
|
|
<p class="note">This isn't a security problem since the script that
|
|
moves the <code><a href="#the-div-element">div</a></code> into the outer <code><a href="#document">Document</a></code> can
|
|
only do so because the two <code><a href="#document">Document</a></code> object have the
|
|
same <a href="#origin">origin</a>.</p>
|
|
|
|
<p>Thus, the first alert says "http://example.com/outer".</p>
|
|
|
|
<p>Once the <code><a href="#the-div-element">div</a></code> element's end tag is parsed, the
|
|
<code><a href="#the-div-element">div</a></code> element is popped off the stack, and so the next
|
|
<code><a href="#the-script-element">script</a></code> element is in the inner <code><a href="#document">Document</a></code>:</p>
|
|
|
|
<ul class="domTree"><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-script-element">script</a></code><ul><li class="t3"><code>#text</code>: <span title="">alert(document.URL);</span></ul></ul></ul></ul><p>This second alert will say "http://example.com/inner".</p>
|
|
|
|
|
|
<h5 id="the-execution-of-scripts-that-are-moving-across-multiple-documents"><span class="secno">8.2.8.5 </span>The execution of scripts that are moving across multiple documents</h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>Elaborating on the example in the previous section, consider a
|
|
case where a <code><a href="#the-script-element">script</a></code> element with a <code title="attr-script-src"><a href="#attr-script-src">src</a></code> attribute is parsed, but while
|
|
the external script is being downloaded, the element is moved to
|
|
another document.</p>
|
|
|
|
<p>In this case, the <a href="#script-s-global-object">script's global object</a> is that
|
|
second document's <a href="#browsing-context">browsing context</a>'s
|
|
<code><a href="#window">Window</a></code> object, not the <code><a href="#window">Window</a></code> object of
|
|
the document into which the element was parsed.</p>
|
|
|
|
|
|
|
|
<h5 id="unclosed-formatting-elements"><span class="secno">8.2.8.6 </span>Unclosed formatting elements</h5>
|
|
|
|
<p><i>This section is non-normative.</i></p>
|
|
|
|
<p>The following markup shows how nested formatting elements (such
|
|
as <code><a href="#the-b-element">b</a></code>) get collected and continue to be applied even as
|
|
the elements they are contained in are closed, but that excessive
|
|
duplicates are thrown away.</p>
|
|
|
|
<pre><!DOCTYPE html>
|
|
<p><b class=x><b class=x><b><b class=x><b class=x><b>X
|
|
<p>X
|
|
<p><b><b class=x><b>X
|
|
<p></b></b></b></b></b></b>X</pre>
|
|
|
|
<p>The resulting DOM tree is as follows:</p>
|
|
|
|
<ul class="domTree"><li class="t10">DOCTYPE: <code><a href="#the-html-element">html</a></code><li class="t1"><code><a href="#the-html-element">html</a></code><ul><li class="t1"><code><a href="#the-head-element">head</a></code><li class="t1"><code><a href="#the-body-element">body</a></code><ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">X⏎</span></ul></ul></ul></ul></ul></ul></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">X⏎</span></ul></ul></ul></ul></ul></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t1"><code><a href="#the-b-element">b</a></code> <span class="t2" title=""><code class="attribute name">class</code>="<code class="attribute value">x</code>"</span><ul><li class="t1"><code><a href="#the-b-element">b</a></code><ul><li class="t3"><code>#text</code>: <span title="">X⏎</span></ul></ul></ul></ul></ul></ul></ul></ul></ul><li class="t1"><code><a href="#the-p-element">p</a></code><ul><li class="t3"><code>#text</code>: <span title="">X⏎</span></ul></ul></ul></ul><p>Note how the second <code><a href="#the-p-element">p</a></code> element in the markup has no
|
|
explicit <code><a href="#the-b-element">b</a></code> elements, but in the resulting DOM, up to
|
|
three of each kind of formatting element (in this case three
|
|
<code><a href="#the-b-element">b</a></code> elements with the class attribute, and two unadorned
|
|
<code><a href="#the-b-element">b</a></code> elements) get reconstructed before the element's
|
|
"X".</p>
|
|
|
|
<p>Also note how this means that in the final paragraph only six
|
|
<code><a href="#the-b-element">b</a></code> end tags are needed to completely clear the list of
|
|
formatting elements, even though nine <code><a href="#the-b-element">b</a></code> start tags have
|
|
been seen up to this point.</p>
|
|
|
|
|
|
|
|
|
|
<h3 id="serializing-html-fragments"><span class="secno">8.3 </span>Serializing HTML fragments</h3>
|
|
|
|
<p>The following steps form the <dfn id="html-fragment-serialization-algorithm">HTML fragment serialization
|
|
algorithm</dfn>. The algorithm takes as input a DOM
|
|
<code><a href="#element">Element</a></code>, <code><a href="#document">Document</a></code>, or
|
|
<code><a href="#documentfragment">DocumentFragment</a></code> referred to as <var title="">the
|
|
node</var>, and either returns a string or raises an exception.</p>
|
|
|
|
<p class="note">This algorithm serializes the <em>children</em> of
|
|
the node being serialized, not the node itself.</p>
|
|
|
|
<ol><li><p>Let <var title="">s</var> be a string, and initialize it to
|
|
the empty string.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each child node of <var title="">the node</var>, in
|
|
<a href="#tree-order">tree order</a>, run the following steps:
|
|
|
|
<ol><li><p>Let <var title="">current node</var> be the child node
|
|
being processed.</li>
|
|
|
|
<li>
|
|
|
|
<p>Append the appropriate string from the following list to
|
|
<var title="">s</var>:</p>
|
|
|
|
<dl class="switch"><dt>If <var title="">current node</var> is an <code title="">Element</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>If <var title="">current node</var> is an element in the
|
|
<a href="#html-namespace-0">HTML namespace</a>, the <a href="#mathml-namespace">MathML
|
|
namespace</a>, or the <a href="#svg-namespace">SVG namespace</a>, then let
|
|
<var title="">tagname</var> be <var title="">current
|
|
node</var>'s local name. Otherwise, let <var title="">tagname</var> be <var title="">current node</var>'s
|
|
qualified name.</p>
|
|
|
|
<p>Append a U+003C LESS-THAN SIGN character (<), followed
|
|
by <var title="">tagname</var>.</p>
|
|
|
|
<p class="note">For <a href="#html-elements">HTML elements</a> created by the
|
|
<a href="#html-parser">HTML parser</a> or <code title="">Document.createElement()</code>, <var title="">tagname</var> will be lowercase.</p>
|
|
|
|
<p>For each attribute that the element has, append a U+0020
|
|
SPACE character, the <a href="#attribute-s-serialized-name" title="attribute's serialized
|
|
name">attribute's serialized name as described below</a>, a
|
|
U+003D EQUALS SIGN character (=), a U+0022 QUOTATION MARK
|
|
character ("), the attribute's value, <a href="#escapingString" title="escaping a string">escaped as described below</a> in
|
|
<i>attribute mode</i>, and a second U+0022 QUOTATION MARK
|
|
character (").</p>
|
|
|
|
<p>An <dfn id="attribute-s-serialized-name">attribute's serialized name</dfn> for the purposes
|
|
of the previous paragraph must be determined as follows:</p>
|
|
|
|
<dl class="switch"><dt>If the attribute has no namespace</dt>
|
|
|
|
<dd>
|
|
|
|
<p>The attribute's serialized name is the attribute's local
|
|
name.</p>
|
|
|
|
<p class="note">For attributes on <a href="#html-elements">HTML elements</a>
|
|
set by the <a href="#html-parser">HTML parser</a> or by <code title="">Element.setAttributeNode()</code> or <code title="">Element.setAttribute()</code>, the local name will
|
|
be lowercase.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If the attribute is in the <a href="#xml-namespace">XML namespace</a></dt>
|
|
|
|
<dd><p>The attribute's serialized name is the string "<code title="">xml:</code>" followed by the attribute's local
|
|
name.</dd>
|
|
|
|
|
|
<dt>If the attribute is in the <a href="#xmlns-namespace">XMLNS namespace</a> and the attribute's local name is <code title="">xmlns</code></dt>
|
|
|
|
<dd><p>The attribute's serialized name is the string "<code title="">xmlns</code>".</dd>
|
|
|
|
|
|
<dt>If the attribute is in the <a href="#xmlns-namespace">XMLNS namespace</a> and the attribute's local name is not <code title="">xmlns</code></dt>
|
|
|
|
<dd><p>The attribute's serialized name is the string "<code title="">xmlns:</code>" followed by the attribute's local
|
|
name.</dd>
|
|
|
|
|
|
<dt>If the attribute is in the <a href="#xlink-namespace">XLink namespace</a></dt>
|
|
|
|
<dd><p>The attribute's serialized name is the string "<code title="">xlink:</code>" followed by the attribute's local
|
|
name.</dd>
|
|
|
|
|
|
<dt>If the attribute is in some other namespace</dt>
|
|
|
|
<dd><p>The attribute's serialized name is the attribute's
|
|
qualified name.</dd>
|
|
|
|
</dl><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 serialize an
|
|
element's attributes in the same order.</p>
|
|
|
|
<p>Append a U+003E GREATER-THAN SIGN character (>).</p>
|
|
|
|
<p>If <var title="">current node</var> is an
|
|
<code><a href="#the-area-element">area</a></code>, <code><a href="#the-base-element">base</a></code>, <code><a href="#basefont">basefont</a></code>,
|
|
<code><a href="#bgsound">bgsound</a></code>, <code><a href="#the-br-element">br</a></code>, <code><a href="#the-col-element">col</a></code>,
|
|
<code><a href="#the-command-element">command</a></code>, <code><a href="#the-embed-element">embed</a></code>, <code><a href="#frame">frame</a></code>,
|
|
<code><a href="#the-hr-element">hr</a></code>, <code><a href="#the-img-element">img</a></code>, <code><a href="#the-input-element">input</a></code>,
|
|
<code><a href="#the-keygen-element">keygen</a></code>, <code><a href="#the-link-element">link</a></code>, <code><a href="#the-meta-element">meta</a></code>,
|
|
<code><a href="#the-param-element">param</a></code>, <code><a href="#the-source-element">source</a></code>, <code><a href="#the-track-element">track</a></code> or
|
|
<code><a href="#the-wbr-element">wbr</a></code> element, then continue on to the next child
|
|
node at this point.</p>
|
|
|
|
<p>If <var title="">current node</var> is a <code><a href="#the-pre-element">pre</a></code>,
|
|
<code><a href="#the-textarea-element">textarea</a></code>, or <code><a href="#listing">listing</a></code> element, append
|
|
a U+000A LINE FEED (LF) character.</p>
|
|
|
|
<p>Append the value of running the <a href="#html-fragment-serialization-algorithm">HTML fragment
|
|
serialization algorithm</a> on the <var title="">current
|
|
node</var> element (thus recursing into this algorithm for
|
|
that element), followed by a U+003C LESS-THAN SIGN character
|
|
(<), a U+002F SOLIDUS character (/), <var title="">tagname</var> again, and finally a U+003E
|
|
GREATER-THAN SIGN character (>).</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If <var title="">current node</var> is a <code title="">Text</code> or <code title="">CDATASection</code>
|
|
node</dt>
|
|
|
|
<dd>
|
|
|
|
<p>If the parent of <var title="">current node</var> is a
|
|
<code><a href="#the-style-element">style</a></code>, <code><a href="#the-script-element">script</a></code>, <code><a href="#xmp">xmp</a></code>,
|
|
<code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#noembed">noembed</a></code>,
|
|
<code><a href="#noframes">noframes</a></code>, or <code><a href="#plaintext">plaintext</a></code> element, or
|
|
if the parent of <var title="">current node</var> is
|
|
<code><a href="#the-noscript-element">noscript</a></code> element and <a href="#concept-n-script" title="concept-n-script">scripting is enabled</a> for the
|
|
node, then append the value of <var title="">current
|
|
node</var>'s <code title="">data</code> IDL attribute
|
|
literally.</p>
|
|
|
|
<p>Otherwise, append the value of <var title="">current
|
|
node</var>'s <code title="">data</code> IDL attribute, <a href="#escapingString" title="escaping a string">escaped as described
|
|
below</a>.</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If <var title="">current 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 <var title="">current node</var>'s <code title="">data</code> IDL
|
|
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="">current node</var> is a <code title="">ProcessingInstruction</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Append the literal string <code><?</code> (U+003C
|
|
LESS-THAN SIGN, U+003F QUESTION MARK), followed by the value
|
|
of <var title="">current node</var>'s <code title="">target</code> IDL attribute, followed by a single
|
|
U+0020 SPACE character, followed by the value of <var title="">current node</var>'s <code title="">data</code> IDL
|
|
attribute, followed by a single U+003E GREATER-THAN SIGN
|
|
character (>).</p>
|
|
|
|
</dd>
|
|
|
|
|
|
<dt>If <var title="">current node</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 <var title="">current node</var>'s <code title="">name</code> IDL attribute, followed by the literal
|
|
string <code>></code> (U+003E GREATER-THAN SIGN).</p>
|
|
|
|
</dd>
|
|
|
|
|
|
</dl><p>Other node types (e.g. <code title="">Attr</code>) cannot
|
|
occur as children of elements. If, despite this, they somehow do
|
|
occur, this algorithm must raise an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>The result of the algorithm is the string <var title="">s</var>.</li>
|
|
|
|
</ol><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="warning">It is possible that the output of this algorithm, if
|
|
parsed with an <a href="#html-parser">HTML parser</a>, will not return the
|
|
original tree structure.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For instance, if a <code><a href="#the-textarea-element">textarea</a></code> element to which a
|
|
<code title="">Comment</code> node has been appended is serialized
|
|
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 serializing 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="#the-script-element">script</a></code> element
|
|
contain a text node with the text string
|
|
"<code></script></code>", or having a <code><a href="#the-p-element">p</a></code> element
|
|
that contains a <code><a href="#the-ul-element">ul</a></code> element (as the <code><a href="#the-ul-element">ul</a></code>
|
|
element's <a href="#syntax-start-tag" title="syntax-start-tag">start tag</a> would
|
|
imply the end tag for the <code><a href="#the-p-element">p</a></code>).</p>
|
|
|
|
<p>This can enable cross-site scripting attacks. An example of this
|
|
would be a page that lets the user enter some font names that are
|
|
then inserted into a CSS <code><a href="#the-style-element">style</a></code> block via the DOM and
|
|
which then uses the <code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code>
|
|
IDL attribute to get the HTML serialization of that
|
|
<code><a href="#the-style-element">style</a></code> element: if the user enters
|
|
"<code></style><script>attack</script></code>" as a font
|
|
name, <code title="dom-innerHTML"><a href="#dom-innerhtml">innerHTML</a></code> will return
|
|
markup that, if parsed in a different context, would contain a
|
|
<code><a href="#the-script-element">script</a></code> node, even though no <code><a href="#the-script-element">script</a></code> node
|
|
existed in the original DOM.</p>
|
|
|
|
</div>
|
|
|
|
<p><dfn id="escapingString">Escaping a string</dfn> (for the
|
|
purposes of the algorithm above) consists of running the following
|
|
steps:</p>
|
|
|
|
<ol><li><p>Replace any occurrence of the "<code title="">&</code>"
|
|
character by the string "<code title="">&amp;</code>".</li>
|
|
|
|
<li><p>Replace any occurrences of the U+00A0 NO-BREAK SPACE
|
|
character by the string "<code title="">&nbsp;</code>".</li>
|
|
|
|
<li><p>If the algorithm was invoked in the <i>attribute mode</i>,
|
|
replace any occurrences of the "<code title="">"</code>"
|
|
character by the string "<code title="">&quot;</code>".</li>
|
|
|
|
<li><p>If the algorithm was <em>not</em> invoked in the
|
|
<i>attribute mode</i>, replace any occurrences of the "<code title=""><</code>" character by the string "<code title="">&lt;</code>", and any occurrences of the "<code title="">></code>" character by the string "<code title="">&gt;</code>".</li>
|
|
|
|
</ol><h3 id="parsing-html-fragments"><span class="secno">8.4 </span>Parsing HTML fragments</h3>
|
|
|
|
<p>The following steps form the <dfn id="html-fragment-parsing-algorithm">HTML fragment parsing
|
|
algorithm</dfn>. The algorithm optionally takes as input an
|
|
<code><a href="#element">Element</a></code> node, referred to as the <dfn id="concept-frag-parse-context" title="concept-frag-parse-context"><var>context</var></dfn> element,
|
|
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-case">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 (and with a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element). 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-case">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><a href="#document">Document</a></code> node, and mark it as being
|
|
an <a href="#html-documents" title="HTML documents">HTML document</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element, and the
|
|
<code><a href="#document">Document</a></code> of the <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element is in
|
|
<a href="#quirks-mode">quirks mode</a>, then let the <code><a href="#document">Document</a></code> be in
|
|
<a href="#quirks-mode">quirks mode</a>. Otherwise, if there is a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element, and the
|
|
<code><a href="#document">Document</a></code> of the <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element is in
|
|
<a href="#limited-quirks-mode">limited-quirks mode</a>, then let the
|
|
<code><a href="#document">Document</a></code> be in <a href="#limited-quirks-mode">limited-quirks mode</a>.
|
|
Otherwise, leave the <code><a href="#document">Document</a></code> in <a href="#no-quirks-mode">no-quirks
|
|
mode</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Create a new <a href="#html-parser">HTML parser</a>, and associate it with
|
|
the just created <code><a href="#document">Document</a></code> node.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element, run
|
|
these substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Set the state of the <a href="#html-parser">HTML parser</a>'s
|
|
<a href="#tokenization">tokenization</a> stage as follows:</p>
|
|
|
|
<dl class="switch"><dt>If it is a <code><a href="#the-title-element">title</a></code> or <code><a href="#the-textarea-element">textarea</a></code>
|
|
element</dt>
|
|
|
|
<dd>Switch the tokenizer to the <a href="#rcdata-state">RCDATA state</a>.</dd>
|
|
|
|
|
|
<dt>If it is a <code><a href="#the-style-element">style</a></code>, <code><a href="#xmp">xmp</a></code>,
|
|
<code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#noembed">noembed</a></code>, or
|
|
<code><a href="#noframes">noframes</a></code> element</dt>
|
|
|
|
<dd>Switch the tokenizer to the <a href="#rawtext-state">RAWTEXT state</a>.</dd>
|
|
|
|
|
|
<dt>If it is a <code><a href="#the-script-element">script</a></code> element</dt>
|
|
|
|
<dd>Switch the tokenizer to the <a href="#script-data-state">script data state</a>.</dd>
|
|
|
|
|
|
<dt>If it is a <code><a href="#the-noscript-element">noscript</a></code> element</dt>
|
|
|
|
<dd>If the <a href="#scripting-flag">scripting flag</a> is enabled, switch the
|
|
tokenizer to the <a href="#rawtext-state">RAWTEXT state</a>. Otherwise,
|
|
leave the tokenizer in the <a href="#data-state">data state</a>.</dd>
|
|
|
|
|
|
<dt>If it is a <code><a href="#plaintext">plaintext</a></code> element</dt>
|
|
|
|
<dd>Switch the tokenizer to the <a href="#plaintext-state">PLAINTEXT
|
|
state</a>.</dd>
|
|
|
|
|
|
<dt>Otherwise</dt>
|
|
|
|
<dd>Leave the tokenizer in the <a href="#data-state">data state</a>.</dd>
|
|
|
|
</dl><p class="note">For performance reasons, an implementation that
|
|
does not report errors and that uses the actual state machine
|
|
described in this specification directly could use the PLAINTEXT
|
|
state instead of the RAWTEXT and script data states where those
|
|
are mentioned in the list above. Except for rules regarding
|
|
parse errors, they are equivalent, since there is no
|
|
<a href="#appropriate-end-tag-token">appropriate end tag token</a> in the fragment case, yet
|
|
they involve far fewer state transitions.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">root</var> be a new <code><a href="#the-html-element">html</a></code> element
|
|
with no attributes.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Append the element <var title="">root</var> to the
|
|
<code><a href="#document">Document</a></code> node created above.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Set up the parser's <a href="#stack-of-open-elements">stack of open elements</a> so that
|
|
it contains just the single element <var title="">root</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#reset-the-insertion-mode-appropriately" 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="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element as part
|
|
of that algorithm.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Set the parser's <a href="#form-element-pointer"><code>form</code> element
|
|
pointer</a> to the nearest node to the <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element that is
|
|
a <code><a href="#the-form-element">form</a></code> element (going straight up the ancestor
|
|
chain, and including the element itself, if it is a
|
|
<code><a href="#the-form-element">form</a></code> element), or, if there is no such
|
|
<code><a href="#the-form-element">form</a></code> element, to null.</p>
|
|
|
|
</li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>Place into the <a href="#the-input-stream">input stream</a> for the <a href="#html-parser">HTML
|
|
parser</a> just created the <var title="">input</var>. The
|
|
encoding <a href="#concept-encoding-confidence" title="concept-encoding-confidence">confidence</a> is
|
|
<i>irrelevant</i>.</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>If there is a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element, return
|
|
the child nodes of <var title="">root</var>, in <a href="#tree-order">tree
|
|
order</a>.</p>
|
|
|
|
<p>Otherwise, return the children of the <code><a href="#document">Document</a></code>
|
|
object, in <a href="#tree-order">tree order</a>.</p>
|
|
|
|
</li>
|
|
|
|
</ol><p class="note">This algorithm is invoked without a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element in the case
|
|
of <code title="dom-Document-innerHTML">Document.innerHTML</code>.</p>
|
|
|
|
</div><h3 id="named-character-references"><span class="secno">8.5 </span><dfn>Named character references</dfn></h3><p>This table lists the character reference names that are supported
|
|
by HTML, and the code points to which they refer. It is referenced
|
|
by the previous sections.<div id="named-character-references-table">
|
|
<table><thead><tr><th> Name </th> <th> Character(s) </th> <th> Glyph </th> <tbody><tr id="entity-AElig"><td> <code title="">AElig;</code> </td> <td> U+000C6 </td> <td> <span class="glyph" title="">Æ</span> </td> <tr id="entity-AMP"><td> <code title="">AMP;</code> </td> <td> U+00026 </td> <td> <span class="glyph" title="">&</span> </td> <tr id="entity-Aacute"><td> <code title="">Aacute;</code> </td> <td> U+000C1 </td> <td> <span class="glyph" title="">Á</span> </td> <tr id="entity-Abreve"><td> <code title="">Abreve;</code> </td> <td> U+00102 </td> <td> <span class="glyph" title="">Ă</span> </td> <tr id="entity-Acirc"><td> <code title="">Acirc;</code> </td> <td> U+000C2 </td> <td> <span class="glyph" title="">Â</span> </td> <tr id="entity-Acy"><td> <code title="">Acy;</code> </td> <td> U+00410 </td> <td> <span class="glyph" title="">А</span> </td> <tr id="entity-Afr"><td> <code title="">Afr;</code> </td> <td> U+1D504 </td> <td> <span class="glyph" title="">𝔄</span> </td> <tr id="entity-Agrave"><td> <code title="">Agrave;</code> </td> <td> U+000C0 </td> <td> <span class="glyph" title="">À</span> </td> <tr id="entity-Alpha"><td> <code title="">Alpha;</code> </td> <td> U+00391 </td> <td> <span class="glyph" title="">Α</span> </td> <tr id="entity-Amacr"><td> <code title="">Amacr;</code> </td> <td> U+00100 </td> <td> <span class="glyph" title="">Ā</span> </td> <tr id="entity-And"><td> <code title="">And;</code> </td> <td> U+02A53 </td> <td> <span class="glyph" title="">⩓</span> </td> <tr id="entity-Aogon"><td> <code title="">Aogon;</code> </td> <td> U+00104 </td> <td> <span class="glyph" title="">Ą</span> </td> <tr id="entity-Aopf"><td> <code title="">Aopf;</code> </td> <td> U+1D538 </td> <td> <span class="glyph" title="">𝔸</span> </td> <tr id="entity-ApplyFunction"><td> <code title="">ApplyFunction;</code> </td> <td> U+02061 </td> <td> <span class="glyph" title="">⁡</span> </td> <tr id="entity-Aring"><td> <code title="">Aring;</code> </td> <td> U+000C5 </td> <td> <span class="glyph" title="">Å</span> </td> <tr id="entity-Ascr"><td> <code title="">Ascr;</code> </td> <td> U+1D49C </td> <td> <span class="glyph" title="">𝒜</span> </td> <tr id="entity-Assign"><td> <code title="">Assign;</code> </td> <td> U+02254 </td> <td> <span class="glyph" title="">≔</span> </td> <tr id="entity-Atilde"><td> <code title="">Atilde;</code> </td> <td> U+000C3 </td> <td> <span class="glyph" title="">Ã</span> </td> <tr id="entity-Auml"><td> <code title="">Auml;</code> </td> <td> U+000C4 </td> <td> <span class="glyph" title="">Ä</span> </td> <tr id="entity-Backslash"><td> <code title="">Backslash;</code> </td> <td> U+02216 </td> <td> <span class="glyph" title="">∖</span> </td> <tr id="entity-Barv"><td> <code title="">Barv;</code> </td> <td> U+02AE7 </td> <td> <span class="glyph" title="">⫧</span> </td> <tr id="entity-Barwed"><td> <code title="">Barwed;</code> </td> <td> U+02306 </td> <td> <span class="glyph" title="">⌆</span> </td> <tr id="entity-Bcy"><td> <code title="">Bcy;</code> </td> <td> U+00411 </td> <td> <span class="glyph" title="">Б</span> </td> <tr id="entity-Because"><td> <code title="">Because;</code> </td> <td> U+02235 </td> <td> <span class="glyph" title="">∵</span> </td> <tr id="entity-Bernoullis"><td> <code title="">Bernoullis;</code> </td> <td> U+0212C </td> <td> <span class="glyph" title="">ℬ</span> </td> <tr id="entity-Beta"><td> <code title="">Beta;</code> </td> <td> U+00392 </td> <td> <span class="glyph" title="">Β</span> </td> <tr id="entity-Bfr"><td> <code title="">Bfr;</code> </td> <td> U+1D505 </td> <td> <span class="glyph" title="">𝔅</span> </td> <tr id="entity-Bopf"><td> <code title="">Bopf;</code> </td> <td> U+1D539 </td> <td> <span class="glyph" title="">𝔹</span> </td> <tr id="entity-Breve"><td> <code title="">Breve;</code> </td> <td> U+002D8 </td> <td> <span class="glyph" title="">˘</span> </td> <tr id="entity-Bscr"><td> <code title="">Bscr;</code> </td> <td> U+0212C </td> <td> <span class="glyph" title="">ℬ</span> </td> <tr id="entity-Bumpeq"><td> <code title="">Bumpeq;</code> </td> <td> U+0224E </td> <td> <span class="glyph" title="">≎</span> </td> <tr id="entity-CHcy"><td> <code title="">CHcy;</code> </td> <td> U+00427 </td> <td> <span class="glyph" title="">Ч</span> </td> <tr id="entity-COPY"><td> <code title="">COPY;</code> </td> <td> U+000A9 </td> <td> <span class="glyph" title="">©</span> </td> <tr id="entity-Cacute"><td> <code title="">Cacute;</code> </td> <td> U+00106 </td> <td> <span class="glyph" title="">Ć</span> </td> <tr id="entity-Cap"><td> <code title="">Cap;</code> </td> <td> U+022D2 </td> <td> <span class="glyph" title="">⋒</span> </td> <tr id="entity-CapitalDifferentialD"><td> <code title="">CapitalDifferentialD;</code> </td> <td> U+02145 </td> <td> <span class="glyph" title="">ⅅ</span> </td> <tr id="entity-Cayleys"><td> <code title="">Cayleys;</code> </td> <td> U+0212D </td> <td> <span class="glyph" title="">ℭ</span> </td> <tr id="entity-Ccaron"><td> <code title="">Ccaron;</code> </td> <td> U+0010C </td> <td> <span class="glyph" title="">Č</span> </td> <tr id="entity-Ccedil"><td> <code title="">Ccedil;</code> </td> <td> U+000C7 </td> <td> <span class="glyph" title="">Ç</span> </td> <tr id="entity-Ccirc"><td> <code title="">Ccirc;</code> </td> <td> U+00108 </td> <td> <span class="glyph" title="">Ĉ</span> </td> <tr id="entity-Cconint"><td> <code title="">Cconint;</code> </td> <td> U+02230 </td> <td> <span class="glyph" title="">∰</span> </td> <tr id="entity-Cdot"><td> <code title="">Cdot;</code> </td> <td> U+0010A </td> <td> <span class="glyph" title="">Ċ</span> </td> <tr id="entity-Cedilla"><td> <code title="">Cedilla;</code> </td> <td> U+000B8 </td> <td> <span class="glyph" title="">¸</span> </td> <tr id="entity-CenterDot"><td> <code title="">CenterDot;</code> </td> <td> U+000B7 </td> <td> <span class="glyph" title="">·</span> </td> <tr id="entity-Cfr"><td> <code title="">Cfr;</code> </td> <td> U+0212D </td> <td> <span class="glyph" title="">ℭ</span> </td> <tr id="entity-Chi"><td> <code title="">Chi;</code> </td> <td> U+003A7 </td> <td> <span class="glyph" title="">Χ</span> </td> <tr id="entity-CircleDot"><td> <code title="">CircleDot;</code> </td> <td> U+02299 </td> <td> <span class="glyph" title="">⊙</span> </td> <tr id="entity-CircleMinus"><td> <code title="">CircleMinus;</code> </td> <td> U+02296 </td> <td> <span class="glyph" title="">⊖</span> </td> <tr id="entity-CirclePlus"><td> <code title="">CirclePlus;</code> </td> <td> U+02295 </td> <td> <span class="glyph" title="">⊕</span> </td> <tr id="entity-CircleTimes"><td> <code title="">CircleTimes;</code> </td> <td> U+02297 </td> <td> <span class="glyph" title="">⊗</span> </td> <tr id="entity-ClockwiseContourIntegral"><td> <code title="">ClockwiseContourIntegral;</code> </td> <td> U+02232 </td> <td> <span class="glyph" title="">∲</span> </td> <tr id="entity-CloseCurlyDoubleQuote"><td> <code title="">CloseCurlyDoubleQuote;</code> </td> <td> U+0201D </td> <td> <span class="glyph" title="">”</span> </td> <tr id="entity-CloseCurlyQuote"><td> <code title="">CloseCurlyQuote;</code> </td> <td> U+02019 </td> <td> <span class="glyph" title="">’</span> </td> <tr id="entity-Colon"><td> <code title="">Colon;</code> </td> <td> U+02237 </td> <td> <span class="glyph" title="">∷</span> </td> <tr id="entity-Colone"><td> <code title="">Colone;</code> </td> <td> U+02A74 </td> <td> <span class="glyph" title="">⩴</span> </td> <tr id="entity-Congruent"><td> <code title="">Congruent;</code> </td> <td> U+02261 </td> <td> <span class="glyph" title="">≡</span> </td> <tr id="entity-Conint"><td> <code title="">Conint;</code> </td> <td> U+0222F </td> <td> <span class="glyph" title="">∯</span> </td> <tr id="entity-ContourIntegral"><td> <code title="">ContourIntegral;</code> </td> <td> U+0222E </td> <td> <span class="glyph" title="">∮</span> </td> <tr id="entity-Copf"><td> <code title="">Copf;</code> </td> <td> U+02102 </td> <td> <span class="glyph" title="">ℂ</span> </td> <tr id="entity-Coproduct"><td> <code title="">Coproduct;</code> </td> <td> U+02210 </td> <td> <span class="glyph" title="">∐</span> </td> <tr id="entity-CounterClockwiseContourIntegral"><td> <code title="">CounterClockwiseContourIntegral;</code> </td> <td> U+02233 </td> <td> <span class="glyph" title="">∳</span> </td> <tr id="entity-Cross"><td> <code title="">Cross;</code> </td> <td> U+02A2F </td> <td> <span class="glyph" title="">⨯</span> </td> <tr id="entity-Cscr"><td> <code title="">Cscr;</code> </td> <td> U+1D49E </td> <td> <span class="glyph" title="">𝒞</span> </td> <tr id="entity-Cup"><td> <code title="">Cup;</code> </td> <td> U+022D3 </td> <td> <span class="glyph" title="">⋓</span> </td> <tr id="entity-CupCap"><td> <code title="">CupCap;</code> </td> <td> U+0224D </td> <td> <span class="glyph" title="">≍</span> </td> <tr id="entity-DD"><td> <code title="">DD;</code> </td> <td> U+02145 </td> <td> <span class="glyph" title="">ⅅ</span> </td> <tr id="entity-DDotrahd"><td> <code title="">DDotrahd;</code> </td> <td> U+02911 </td> <td> <span class="glyph" title="">⤑</span> </td> <tr id="entity-DJcy"><td> <code title="">DJcy;</code> </td> <td> U+00402 </td> <td> <span class="glyph" title="">Ђ</span> </td> <tr id="entity-DScy"><td> <code title="">DScy;</code> </td> <td> U+00405 </td> <td> <span class="glyph" title="">Ѕ</span> </td> <tr id="entity-DZcy"><td> <code title="">DZcy;</code> </td> <td> U+0040F </td> <td> <span class="glyph" title="">Џ</span> </td> <tr id="entity-Dagger"><td> <code title="">Dagger;</code> </td> <td> U+02021 </td> <td> <span class="glyph" title="">‡</span> </td> <tr id="entity-Darr"><td> <code title="">Darr;</code> </td> <td> U+021A1 </td> <td> <span class="glyph" title="">↡</span> </td> <tr id="entity-Dashv"><td> <code title="">Dashv;</code> </td> <td> U+02AE4 </td> <td> <span class="glyph" title="">⫤</span> </td> <tr id="entity-Dcaron"><td> <code title="">Dcaron;</code> </td> <td> U+0010E </td> <td> <span class="glyph" title="">Ď</span> </td> <tr id="entity-Dcy"><td> <code title="">Dcy;</code> </td> <td> U+00414 </td> <td> <span class="glyph" title="">Д</span> </td> <tr id="entity-Del"><td> <code title="">Del;</code> </td> <td> U+02207 </td> <td> <span class="glyph" title="">∇</span> </td> <tr id="entity-Delta"><td> <code title="">Delta;</code> </td> <td> U+00394 </td> <td> <span class="glyph" title="">Δ</span> </td> <tr id="entity-Dfr"><td> <code title="">Dfr;</code> </td> <td> U+1D507 </td> <td> <span class="glyph" title="">𝔇</span> </td> <tr id="entity-DiacriticalAcute"><td> <code title="">DiacriticalAcute;</code> </td> <td> U+000B4 </td> <td> <span class="glyph" title="">´</span> </td> <tr id="entity-DiacriticalDot"><td> <code title="">DiacriticalDot;</code> </td> <td> U+002D9 </td> <td> <span class="glyph" title="">˙</span> </td> <tr id="entity-DiacriticalDoubleAcute"><td> <code title="">DiacriticalDoubleAcute;</code> </td> <td> U+002DD </td> <td> <span class="glyph" title="">˝</span> </td> <tr id="entity-DiacriticalGrave"><td> <code title="">DiacriticalGrave;</code> </td> <td> U+00060 </td> <td> <span class="glyph" title="">`</span> </td> <tr id="entity-DiacriticalTilde"><td> <code title="">DiacriticalTilde;</code> </td> <td> U+002DC </td> <td> <span class="glyph" title="">˜</span> </td> <tr id="entity-Diamond"><td> <code title="">Diamond;</code> </td> <td> U+022C4 </td> <td> <span class="glyph" title="">⋄</span> </td> <tr id="entity-DifferentialD"><td> <code title="">DifferentialD;</code> </td> <td> U+02146 </td> <td> <span class="glyph" title="">ⅆ</span> </td> <tr id="entity-Dopf"><td> <code title="">Dopf;</code> </td> <td> U+1D53B </td> <td> <span class="glyph" title="">𝔻</span> </td> <tr id="entity-Dot"><td> <code title="">Dot;</code> </td> <td> U+000A8 </td> <td> <span class="glyph" title="">¨</span> </td> <tr id="entity-DotDot"><td> <code title="">DotDot;</code> </td> <td> U+020DC </td> <td> <span class="glyph composition" title="">◌⃜</span> </td> <tr id="entity-DotEqual"><td> <code title="">DotEqual;</code> </td> <td> U+02250 </td> <td> <span class="glyph" title="">≐</span> </td> <tr id="entity-DoubleContourIntegral"><td> <code title="">DoubleContourIntegral;</code> </td> <td> U+0222F </td> <td> <span class="glyph" title="">∯</span> </td> <tr id="entity-DoubleDot"><td> <code title="">DoubleDot;</code> </td> <td> U+000A8 </td> <td> <span class="glyph" title="">¨</span> </td> <tr id="entity-DoubleDownArrow"><td> <code title="">DoubleDownArrow;</code> </td> <td> U+021D3 </td> <td> <span class="glyph" title="">⇓</span> </td> <tr id="entity-DoubleLeftArrow"><td> <code title="">DoubleLeftArrow;</code> </td> <td> U+021D0 </td> <td> <span class="glyph" title="">⇐</span> </td> <tr id="entity-DoubleLeftRightArrow"><td> <code title="">DoubleLeftRightArrow;</code> </td> <td> U+021D4 </td> <td> <span class="glyph" title="">⇔</span> </td> <tr id="entity-DoubleLeftTee"><td> <code title="">DoubleLeftTee;</code> </td> <td> U+02AE4 </td> <td> <span class="glyph" title="">⫤</span> </td> <tr id="entity-DoubleLongLeftArrow"><td> <code title="">DoubleLongLeftArrow;</code> </td> <td> U+027F8 </td> <td> <span class="glyph" title="">⟸</span> </td> <tr id="entity-DoubleLongLeftRightArrow"><td> <code title="">DoubleLongLeftRightArrow;</code> </td> <td> U+027FA </td> <td> <span class="glyph" title="">⟺</span> </td> <tr id="entity-DoubleLongRightArrow"><td> <code title="">DoubleLongRightArrow;</code> </td> <td> U+027F9 </td> <td> <span class="glyph" title="">⟹</span> </td> <tr id="entity-DoubleRightArrow"><td> <code title="">DoubleRightArrow;</code> </td> <td> U+021D2 </td> <td> <span class="glyph" title="">⇒</span> </td> <tr id="entity-DoubleRightTee"><td> <code title="">DoubleRightTee;</code> </td> <td> U+022A8 </td> <td> <span class="glyph" title="">⊨</span> </td> <tr id="entity-DoubleUpArrow"><td> <code title="">DoubleUpArrow;</code> </td> <td> U+021D1 </td> <td> <span class="glyph" title="">⇑</span> </td> <tr id="entity-DoubleUpDownArrow"><td> <code title="">DoubleUpDownArrow;</code> </td> <td> U+021D5 </td> <td> <span class="glyph" title="">⇕</span> </td> <tr id="entity-DoubleVerticalBar"><td> <code title="">DoubleVerticalBar;</code> </td> <td> U+02225 </td> <td> <span class="glyph" title="">∥</span> </td> <tr id="entity-DownArrow"><td> <code title="">DownArrow;</code> </td> <td> U+02193 </td> <td> <span class="glyph" title="">↓</span> </td> <tr id="entity-DownArrowBar"><td> <code title="">DownArrowBar;</code> </td> <td> U+02913 </td> <td> <span class="glyph" title="">⤓</span> </td> <tr id="entity-DownArrowUpArrow"><td> <code title="">DownArrowUpArrow;</code> </td> <td> U+021F5 </td> <td> <span class="glyph" title="">⇵</span> </td> <tr id="entity-DownBreve"><td> <code title="">DownBreve;</code> </td> <td> U+00311 </td> <td> <span class="glyph composition" title="">◌̑</span> </td> <tr id="entity-DownLeftRightVector"><td> <code title="">DownLeftRightVector;</code> </td> <td> U+02950 </td> <td> <span class="glyph" title="">⥐</span> </td> <tr id="entity-DownLeftTeeVector"><td> <code title="">DownLeftTeeVector;</code> </td> <td> U+0295E </td> <td> <span class="glyph" title="">⥞</span> </td> <tr id="entity-DownLeftVector"><td> <code title="">DownLeftVector;</code> </td> <td> U+021BD </td> <td> <span class="glyph" title="">↽</span> </td> <tr id="entity-DownLeftVectorBar"><td> <code title="">DownLeftVectorBar;</code> </td> <td> U+02956 </td> <td> <span class="glyph" title="">⥖</span> </td> <tr id="entity-DownRightTeeVector"><td> <code title="">DownRightTeeVector;</code> </td> <td> U+0295F </td> <td> <span class="glyph" title="">⥟</span> </td> <tr id="entity-DownRightVector"><td> <code title="">DownRightVector;</code> </td> <td> U+021C1 </td> <td> <span class="glyph" title="">⇁</span> </td> <tr id="entity-DownRightVectorBar"><td> <code title="">DownRightVectorBar;</code> </td> <td> U+02957 </td> <td> <span class="glyph" title="">⥗</span> </td> <tr id="entity-DownTee"><td> <code title="">DownTee;</code> </td> <td> U+022A4 </td> <td> <span class="glyph" title="">⊤</span> </td> <tr id="entity-DownTeeArrow"><td> <code title="">DownTeeArrow;</code> </td> <td> U+021A7 </td> <td> <span class="glyph" title="">↧</span> </td> <tr id="entity-Downarrow"><td> <code title="">Downarrow;</code> </td> <td> U+021D3 </td> <td> <span class="glyph" title="">⇓</span> </td> <tr id="entity-Dscr"><td> <code title="">Dscr;</code> </td> <td> U+1D49F </td> <td> <span class="glyph" title="">𝒟</span> </td> <tr id="entity-Dstrok"><td> <code title="">Dstrok;</code> </td> <td> U+00110 </td> <td> <span class="glyph" title="">Đ</span> </td> <tr id="entity-ENG"><td> <code title="">ENG;</code> </td> <td> U+0014A </td> <td> <span class="glyph" title="">Ŋ</span> </td> <tr id="entity-ETH"><td> <code title="">ETH;</code> </td> <td> U+000D0 </td> <td> <span class="glyph" title="">Ð</span> </td> <tr id="entity-Eacute"><td> <code title="">Eacute;</code> </td> <td> U+000C9 </td> <td> <span class="glyph" title="">É</span> </td> <tr id="entity-Ecaron"><td> <code title="">Ecaron;</code> </td> <td> U+0011A </td> <td> <span class="glyph" title="">Ě</span> </td> <tr id="entity-Ecirc"><td> <code title="">Ecirc;</code> </td> <td> U+000CA </td> <td> <span class="glyph" title="">Ê</span> </td> <tr id="entity-Ecy"><td> <code title="">Ecy;</code> </td> <td> U+0042D </td> <td> <span class="glyph" title="">Э</span> </td> <tr id="entity-Edot"><td> <code title="">Edot;</code> </td> <td> U+00116 </td> <td> <span class="glyph" title="">Ė</span> </td> <tr id="entity-Efr"><td> <code title="">Efr;</code> </td> <td> U+1D508 </td> <td> <span class="glyph" title="">𝔈</span> </td> <tr id="entity-Egrave"><td> <code title="">Egrave;</code> </td> <td> U+000C8 </td> <td> <span class="glyph" title="">È</span> </td> <tr id="entity-Element"><td> <code title="">Element;</code> </td> <td> U+02208 </td> <td> <span class="glyph" title="">∈</span> </td> <tr id="entity-Emacr"><td> <code title="">Emacr;</code> </td> <td> U+00112 </td> <td> <span class="glyph" title="">Ē</span> </td> <tr id="entity-EmptySmallSquare"><td> <code title="">EmptySmallSquare;</code> </td> <td> U+025FB </td> <td> <span class="glyph" title="">◻</span> </td> <tr id="entity-EmptyVerySmallSquare"><td> <code title="">EmptyVerySmallSquare;</code> </td> <td> U+025AB </td> <td> <span class="glyph" title="">▫</span> </td> <tr id="entity-Eogon"><td> <code title="">Eogon;</code> </td> <td> U+00118 </td> <td> <span class="glyph" title="">Ę</span> </td> <tr id="entity-Eopf"><td> <code title="">Eopf;</code> </td> <td> U+1D53C </td> <td> <span class="glyph" title="">𝔼</span> </td> <tr id="entity-Epsilon"><td> <code title="">Epsilon;</code> </td> <td> U+00395 </td> <td> <span class="glyph" title="">Ε</span> </td> <tr id="entity-Equal"><td> <code title="">Equal;</code> </td> <td> U+02A75 </td> <td> <span class="glyph" title="">⩵</span> </td> <tr id="entity-EqualTilde"><td> <code title="">EqualTilde;</code> </td> <td> U+02242 </td> <td> <span class="glyph" title="">≂</span> </td> <tr id="entity-Equilibrium"><td> <code title="">Equilibrium;</code> </td> <td> U+021CC </td> <td> <span class="glyph" title="">⇌</span> </td> <tr id="entity-Escr"><td> <code title="">Escr;</code> </td> <td> U+02130 </td> <td> <span class="glyph" title="">ℰ</span> </td> <tr id="entity-Esim"><td> <code title="">Esim;</code> </td> <td> U+02A73 </td> <td> <span class="glyph" title="">⩳</span> </td> <tr id="entity-Eta"><td> <code title="">Eta;</code> </td> <td> U+00397 </td> <td> <span class="glyph" title="">Η</span> </td> <tr id="entity-Euml"><td> <code title="">Euml;</code> </td> <td> U+000CB </td> <td> <span class="glyph" title="">Ë</span> </td> <tr id="entity-Exists"><td> <code title="">Exists;</code> </td> <td> U+02203 </td> <td> <span class="glyph" title="">∃</span> </td> <tr id="entity-ExponentialE"><td> <code title="">ExponentialE;</code> </td> <td> U+02147 </td> <td> <span class="glyph" title="">ⅇ</span> </td> <tr id="entity-Fcy"><td> <code title="">Fcy;</code> </td> <td> U+00424 </td> <td> <span class="glyph" title="">Ф</span> </td> <tr id="entity-Ffr"><td> <code title="">Ffr;</code> </td> <td> U+1D509 </td> <td> <span class="glyph" title="">𝔉</span> </td> <tr id="entity-FilledSmallSquare"><td> <code title="">FilledSmallSquare;</code> </td> <td> U+025FC </td> <td> <span class="glyph" title="">◼</span> </td> <tr id="entity-FilledVerySmallSquare"><td> <code title="">FilledVerySmallSquare;</code> </td> <td> U+025AA </td> <td> <span class="glyph" title="">▪</span> </td> <tr id="entity-Fopf"><td> <code title="">Fopf;</code> </td> <td> U+1D53D </td> <td> <span class="glyph" title="">𝔽</span> </td> <tr id="entity-ForAll"><td> <code title="">ForAll;</code> </td> <td> U+02200 </td> <td> <span class="glyph" title="">∀</span> </td> <tr id="entity-Fouriertrf"><td> <code title="">Fouriertrf;</code> </td> <td> U+02131 </td> <td> <span class="glyph" title="">ℱ</span> </td> <tr id="entity-Fscr"><td> <code title="">Fscr;</code> </td> <td> U+02131 </td> <td> <span class="glyph" title="">ℱ</span> </td> <tr id="entity-GJcy"><td> <code title="">GJcy;</code> </td> <td> U+00403 </td> <td> <span class="glyph" title="">Ѓ</span> </td> <tr id="entity-GT"><td> <code title="">GT;</code> </td> <td> U+0003E </td> <td> <span class="glyph" title="">></span> </td> <tr id="entity-Gamma"><td> <code title="">Gamma;</code> </td> <td> U+00393 </td> <td> <span class="glyph" title="">Γ</span> </td> <tr id="entity-Gammad"><td> <code title="">Gammad;</code> </td> <td> U+003DC </td> <td> <span class="glyph" title="">Ϝ</span> </td> <tr id="entity-Gbreve"><td> <code title="">Gbreve;</code> </td> <td> U+0011E </td> <td> <span class="glyph" title="">Ğ</span> </td> <tr id="entity-Gcedil"><td> <code title="">Gcedil;</code> </td> <td> U+00122 </td> <td> <span class="glyph" title="">Ģ</span> </td> <tr id="entity-Gcirc"><td> <code title="">Gcirc;</code> </td> <td> U+0011C </td> <td> <span class="glyph" title="">Ĝ</span> </td> <tr id="entity-Gcy"><td> <code title="">Gcy;</code> </td> <td> U+00413 </td> <td> <span class="glyph" title="">Г</span> </td> <tr id="entity-Gdot"><td> <code title="">Gdot;</code> </td> <td> U+00120 </td> <td> <span class="glyph" title="">Ġ</span> </td> <tr id="entity-Gfr"><td> <code title="">Gfr;</code> </td> <td> U+1D50A </td> <td> <span class="glyph" title="">𝔊</span> </td> <tr id="entity-Gg"><td> <code title="">Gg;</code> </td> <td> U+022D9 </td> <td> <span class="glyph" title="">⋙</span> </td> <tr id="entity-Gopf"><td> <code title="">Gopf;</code> </td> <td> U+1D53E </td> <td> <span class="glyph" title="">𝔾</span> </td> <tr id="entity-GreaterEqual"><td> <code title="">GreaterEqual;</code> </td> <td> U+02265 </td> <td> <span class="glyph" title="">≥</span> </td> <tr id="entity-GreaterEqualLess"><td> <code title="">GreaterEqualLess;</code> </td> <td> U+022DB </td> <td> <span class="glyph" title="">⋛</span> </td> <tr id="entity-GreaterFullEqual"><td> <code title="">GreaterFullEqual;</code> </td> <td> U+02267 </td> <td> <span class="glyph" title="">≧</span> </td> <tr id="entity-GreaterGreater"><td> <code title="">GreaterGreater;</code> </td> <td> U+02AA2 </td> <td> <span class="glyph" title="">⪢</span> </td> <tr id="entity-GreaterLess"><td> <code title="">GreaterLess;</code> </td> <td> U+02277 </td> <td> <span class="glyph" title="">≷</span> </td> <tr id="entity-GreaterSlantEqual"><td> <code title="">GreaterSlantEqual;</code> </td> <td> U+02A7E </td> <td> <span class="glyph" title="">⩾</span> </td> <tr id="entity-GreaterTilde"><td> <code title="">GreaterTilde;</code> </td> <td> U+02273 </td> <td> <span class="glyph" title="">≳</span> </td> <tr id="entity-Gscr"><td> <code title="">Gscr;</code> </td> <td> U+1D4A2 </td> <td> <span class="glyph" title="">𝒢</span> </td> <tr id="entity-Gt"><td> <code title="">Gt;</code> </td> <td> U+0226B </td> <td> <span class="glyph" title="">≫</span> </td> <tr id="entity-HARDcy"><td> <code title="">HARDcy;</code> </td> <td> U+0042A </td> <td> <span class="glyph" title="">Ъ</span> </td> <tr id="entity-Hacek"><td> <code title="">Hacek;</code> </td> <td> U+002C7 </td> <td> <span class="glyph" title="">ˇ</span> </td> <tr id="entity-Hat"><td> <code title="">Hat;</code> </td> <td> U+0005E </td> <td> <span class="glyph" title="">^</span> </td> <tr id="entity-Hcirc"><td> <code title="">Hcirc;</code> </td> <td> U+00124 </td> <td> <span class="glyph" title="">Ĥ</span> </td> <tr id="entity-Hfr"><td> <code title="">Hfr;</code> </td> <td> U+0210C </td> <td> <span class="glyph" title="">ℌ</span> </td> <tr id="entity-HilbertSpace"><td> <code title="">HilbertSpace;</code> </td> <td> U+0210B </td> <td> <span class="glyph" title="">ℋ</span> </td> <tr id="entity-Hopf"><td> <code title="">Hopf;</code> </td> <td> U+0210D </td> <td> <span class="glyph" title="">ℍ</span> </td> <tr id="entity-HorizontalLine"><td> <code title="">HorizontalLine;</code> </td> <td> U+02500 </td> <td> <span class="glyph" title="">─</span> </td> <tr id="entity-Hscr"><td> <code title="">Hscr;</code> </td> <td> U+0210B </td> <td> <span class="glyph" title="">ℋ</span> </td> <tr id="entity-Hstrok"><td> <code title="">Hstrok;</code> </td> <td> U+00126 </td> <td> <span class="glyph" title="">Ħ</span> </td> <tr id="entity-HumpDownHump"><td> <code title="">HumpDownHump;</code> </td> <td> U+0224E </td> <td> <span class="glyph" title="">≎</span> </td> <tr id="entity-HumpEqual"><td> <code title="">HumpEqual;</code> </td> <td> U+0224F </td> <td> <span class="glyph" title="">≏</span> </td> <tr id="entity-IEcy"><td> <code title="">IEcy;</code> </td> <td> U+00415 </td> <td> <span class="glyph" title="">Е</span> </td> <tr id="entity-IJlig"><td> <code title="">IJlig;</code> </td> <td> U+00132 </td> <td> <span class="glyph" title="">IJ</span> </td> <tr id="entity-IOcy"><td> <code title="">IOcy;</code> </td> <td> U+00401 </td> <td> <span class="glyph" title="">Ё</span> </td> <tr id="entity-Iacute"><td> <code title="">Iacute;</code> </td> <td> U+000CD </td> <td> <span class="glyph" title="">Í</span> </td> <tr id="entity-Icirc"><td> <code title="">Icirc;</code> </td> <td> U+000CE </td> <td> <span class="glyph" title="">Î</span> </td> <tr id="entity-Icy"><td> <code title="">Icy;</code> </td> <td> U+00418 </td> <td> <span class="glyph" title="">И</span> </td> <tr id="entity-Idot"><td> <code title="">Idot;</code> </td> <td> U+00130 </td> <td> <span class="glyph" title="">İ</span> </td> <tr id="entity-Ifr"><td> <code title="">Ifr;</code> </td> <td> U+02111 </td> <td> <span class="glyph" title="">ℑ</span> </td> <tr id="entity-Igrave"><td> <code title="">Igrave;</code> </td> <td> U+000CC </td> <td> <span class="glyph" title="">Ì</span> </td> <tr id="entity-Im"><td> <code title="">Im;</code> </td> <td> U+02111 </td> <td> <span class="glyph" title="">ℑ</span> </td> <tr id="entity-Imacr"><td> <code title="">Imacr;</code> </td> <td> U+0012A </td> <td> <span class="glyph" title="">Ī</span> </td> <tr id="entity-ImaginaryI"><td> <code title="">ImaginaryI;</code> </td> <td> U+02148 </td> <td> <span class="glyph" title="">ⅈ</span> </td> <tr id="entity-Implies"><td> <code title="">Implies;</code> </td> <td> U+021D2 </td> <td> <span class="glyph" title="">⇒</span> </td> <tr id="entity-Int"><td> <code title="">Int;</code> </td> <td> U+0222C </td> <td> <span class="glyph" title="">∬</span> </td> <tr id="entity-Integral"><td> <code title="">Integral;</code> </td> <td> U+0222B </td> <td> <span class="glyph" title="">∫</span> </td> <tr id="entity-Intersection"><td> <code title="">Intersection;</code> </td> <td> U+022C2 </td> <td> <span class="glyph" title="">⋂</span> </td> <tr id="entity-InvisibleComma"><td> <code title="">InvisibleComma;</code> </td> <td> U+02063 </td> <td> <span class="glyph" title="">⁣</span> </td> <tr id="entity-InvisibleTimes"><td> <code title="">InvisibleTimes;</code> </td> <td> U+02062 </td> <td> <span class="glyph" title="">⁢</span> </td> <tr id="entity-Iogon"><td> <code title="">Iogon;</code> </td> <td> U+0012E </td> <td> <span class="glyph" title="">Į</span> </td> <tr id="entity-Iopf"><td> <code title="">Iopf;</code> </td> <td> U+1D540 </td> <td> <span class="glyph" title="">𝕀</span> </td> <tr id="entity-Iota"><td> <code title="">Iota;</code> </td> <td> U+00399 </td> <td> <span class="glyph" title="">Ι</span> </td> <tr id="entity-Iscr"><td> <code title="">Iscr;</code> </td> <td> U+02110 </td> <td> <span class="glyph" title="">ℐ</span> </td> <tr id="entity-Itilde"><td> <code title="">Itilde;</code> </td> <td> U+00128 </td> <td> <span class="glyph" title="">Ĩ</span> </td> <tr id="entity-Iukcy"><td> <code title="">Iukcy;</code> </td> <td> U+00406 </td> <td> <span class="glyph" title="">І</span> </td> <tr id="entity-Iuml"><td> <code title="">Iuml;</code> </td> <td> U+000CF </td> <td> <span class="glyph" title="">Ï</span> </td> <tr id="entity-Jcirc"><td> <code title="">Jcirc;</code> </td> <td> U+00134 </td> <td> <span class="glyph" title="">Ĵ</span> </td> <tr id="entity-Jcy"><td> <code title="">Jcy;</code> </td> <td> U+00419 </td> <td> <span class="glyph" title="">Й</span> </td> <tr id="entity-Jfr"><td> <code title="">Jfr;</code> </td> <td> U+1D50D </td> <td> <span class="glyph" title="">𝔍</span> </td> <tr id="entity-Jopf"><td> <code title="">Jopf;</code> </td> <td> U+1D541 </td> <td> <span class="glyph" title="">𝕁</span> </td> <tr id="entity-Jscr"><td> <code title="">Jscr;</code> </td> <td> U+1D4A5 </td> <td> <span class="glyph" title="">𝒥</span> </td> <tr id="entity-Jsercy"><td> <code title="">Jsercy;</code> </td> <td> U+00408 </td> <td> <span class="glyph" title="">Ј</span> </td> <tr id="entity-Jukcy"><td> <code title="">Jukcy;</code> </td> <td> U+00404 </td> <td> <span class="glyph" title="">Є</span> </td> <tr id="entity-KHcy"><td> <code title="">KHcy;</code> </td> <td> U+00425 </td> <td> <span class="glyph" title="">Х</span> </td> <tr id="entity-KJcy"><td> <code title="">KJcy;</code> </td> <td> U+0040C </td> <td> <span class="glyph" title="">Ќ</span> </td> <tr id="entity-Kappa"><td> <code title="">Kappa;</code> </td> <td> U+0039A </td> <td> <span class="glyph" title="">Κ</span> </td> <tr id="entity-Kcedil"><td> <code title="">Kcedil;</code> </td> <td> U+00136 </td> <td> <span class="glyph" title="">Ķ</span> </td> <tr id="entity-Kcy"><td> <code title="">Kcy;</code> </td> <td> U+0041A </td> <td> <span class="glyph" title="">К</span> </td> <tr id="entity-Kfr"><td> <code title="">Kfr;</code> </td> <td> U+1D50E </td> <td> <span class="glyph" title="">𝔎</span> </td> <tr id="entity-Kopf"><td> <code title="">Kopf;</code> </td> <td> U+1D542 </td> <td> <span class="glyph" title="">𝕂</span> </td> <tr id="entity-Kscr"><td> <code title="">Kscr;</code> </td> <td> U+1D4A6 </td> <td> <span class="glyph" title="">𝒦</span> </td> <tr id="entity-LJcy"><td> <code title="">LJcy;</code> </td> <td> U+00409 </td> <td> <span class="glyph" title="">Љ</span> </td> <tr id="entity-LT"><td> <code title="">LT;</code> </td> <td> U+0003C </td> <td> <span class="glyph" title=""><</span> </td> <tr id="entity-Lacute"><td> <code title="">Lacute;</code> </td> <td> U+00139 </td> <td> <span class="glyph" title="">Ĺ</span> </td> <tr id="entity-Lambda"><td> <code title="">Lambda;</code> </td> <td> U+0039B </td> <td> <span class="glyph" title="">Λ</span> </td> <tr id="entity-Lang"><td> <code title="">Lang;</code> </td> <td> U+027EA </td> <td> <span class="glyph" title="">⟪</span> </td> <tr id="entity-Laplacetrf"><td> <code title="">Laplacetrf;</code> </td> <td> U+02112 </td> <td> <span class="glyph" title="">ℒ</span> </td> <tr id="entity-Larr"><td> <code title="">Larr;</code> </td> <td> U+0219E </td> <td> <span class="glyph" title="">↞</span> </td> <tr id="entity-Lcaron"><td> <code title="">Lcaron;</code> </td> <td> U+0013D </td> <td> <span class="glyph" title="">Ľ</span> </td> <tr id="entity-Lcedil"><td> <code title="">Lcedil;</code> </td> <td> U+0013B </td> <td> <span class="glyph" title="">Ļ</span> </td> <tr id="entity-Lcy"><td> <code title="">Lcy;</code> </td> <td> U+0041B </td> <td> <span class="glyph" title="">Л</span> </td> <tr id="entity-LeftAngleBracket"><td> <code title="">LeftAngleBracket;</code> </td> <td> U+027E8 </td> <td> <span class="glyph" title="">⟨</span> </td> <tr id="entity-LeftArrow"><td> <code title="">LeftArrow;</code> </td> <td> U+02190 </td> <td> <span class="glyph" title="">←</span> </td> <tr id="entity-LeftArrowBar"><td> <code title="">LeftArrowBar;</code> </td> <td> U+021E4 </td> <td> <span class="glyph" title="">⇤</span> </td> <tr id="entity-LeftArrowRightArrow"><td> <code title="">LeftArrowRightArrow;</code> </td> <td> U+021C6 </td> <td> <span class="glyph" title="">⇆</span> </td> <tr id="entity-LeftCeiling"><td> <code title="">LeftCeiling;</code> </td> <td> U+02308 </td> <td> <span class="glyph" title="">⌈</span> </td> <tr id="entity-LeftDoubleBracket"><td> <code title="">LeftDoubleBracket;</code> </td> <td> U+027E6 </td> <td> <span class="glyph" title="">⟦</span> </td> <tr id="entity-LeftDownTeeVector"><td> <code title="">LeftDownTeeVector;</code> </td> <td> U+02961 </td> <td> <span class="glyph" title="">⥡</span> </td> <tr id="entity-LeftDownVector"><td> <code title="">LeftDownVector;</code> </td> <td> U+021C3 </td> <td> <span class="glyph" title="">⇃</span> </td> <tr id="entity-LeftDownVectorBar"><td> <code title="">LeftDownVectorBar;</code> </td> <td> U+02959 </td> <td> <span class="glyph" title="">⥙</span> </td> <tr id="entity-LeftFloor"><td> <code title="">LeftFloor;</code> </td> <td> U+0230A </td> <td> <span class="glyph" title="">⌊</span> </td> <tr id="entity-LeftRightArrow"><td> <code title="">LeftRightArrow;</code> </td> <td> U+02194 </td> <td> <span class="glyph" title="">↔</span> </td> <tr id="entity-LeftRightVector"><td> <code title="">LeftRightVector;</code> </td> <td> U+0294E </td> <td> <span class="glyph" title="">⥎</span> </td> <tr id="entity-LeftTee"><td> <code title="">LeftTee;</code> </td> <td> U+022A3 </td> <td> <span class="glyph" title="">⊣</span> </td> <tr id="entity-LeftTeeArrow"><td> <code title="">LeftTeeArrow;</code> </td> <td> U+021A4 </td> <td> <span class="glyph" title="">↤</span> </td> <tr id="entity-LeftTeeVector"><td> <code title="">LeftTeeVector;</code> </td> <td> U+0295A </td> <td> <span class="glyph" title="">⥚</span> </td> <tr id="entity-LeftTriangle"><td> <code title="">LeftTriangle;</code> </td> <td> U+022B2 </td> <td> <span class="glyph" title="">⊲</span> </td> <tr id="entity-LeftTriangleBar"><td> <code title="">LeftTriangleBar;</code> </td> <td> U+029CF </td> <td> <span class="glyph" title="">⧏</span> </td> <tr id="entity-LeftTriangleEqual"><td> <code title="">LeftTriangleEqual;</code> </td> <td> U+022B4 </td> <td> <span class="glyph" title="">⊴</span> </td> <tr id="entity-LeftUpDownVector"><td> <code title="">LeftUpDownVector;</code> </td> <td> U+02951 </td> <td> <span class="glyph" title="">⥑</span> </td> <tr id="entity-LeftUpTeeVector"><td> <code title="">LeftUpTeeVector;</code> </td> <td> U+02960 </td> <td> <span class="glyph" title="">⥠</span> </td> <tr id="entity-LeftUpVector"><td> <code title="">LeftUpVector;</code> </td> <td> U+021BF </td> <td> <span class="glyph" title="">↿</span> </td> <tr id="entity-LeftUpVectorBar"><td> <code title="">LeftUpVectorBar;</code> </td> <td> U+02958 </td> <td> <span class="glyph" title="">⥘</span> </td> <tr id="entity-LeftVector"><td> <code title="">LeftVector;</code> </td> <td> U+021BC </td> <td> <span class="glyph" title="">↼</span> </td> <tr id="entity-LeftVectorBar"><td> <code title="">LeftVectorBar;</code> </td> <td> U+02952 </td> <td> <span class="glyph" title="">⥒</span> </td> <tr id="entity-Leftarrow"><td> <code title="">Leftarrow;</code> </td> <td> U+021D0 </td> <td> <span class="glyph" title="">⇐</span> </td> <tr id="entity-Leftrightarrow"><td> <code title="">Leftrightarrow;</code> </td> <td> U+021D4 </td> <td> <span class="glyph" title="">⇔</span> </td> <tr id="entity-LessEqualGreater"><td> <code title="">LessEqualGreater;</code> </td> <td> U+022DA </td> <td> <span class="glyph" title="">⋚</span> </td> <tr id="entity-LessFullEqual"><td> <code title="">LessFullEqual;</code> </td> <td> U+02266 </td> <td> <span class="glyph" title="">≦</span> </td> <tr id="entity-LessGreater"><td> <code title="">LessGreater;</code> </td> <td> U+02276 </td> <td> <span class="glyph" title="">≶</span> </td> <tr id="entity-LessLess"><td> <code title="">LessLess;</code> </td> <td> U+02AA1 </td> <td> <span class="glyph" title="">⪡</span> </td> <tr id="entity-LessSlantEqual"><td> <code title="">LessSlantEqual;</code> </td> <td> U+02A7D </td> <td> <span class="glyph" title="">⩽</span> </td> <tr id="entity-LessTilde"><td> <code title="">LessTilde;</code> </td> <td> U+02272 </td> <td> <span class="glyph" title="">≲</span> </td> <tr id="entity-Lfr"><td> <code title="">Lfr;</code> </td> <td> U+1D50F </td> <td> <span class="glyph" title="">𝔏</span> </td> <tr id="entity-Ll"><td> <code title="">Ll;</code> </td> <td> U+022D8 </td> <td> <span class="glyph" title="">⋘</span> </td> <tr id="entity-Lleftarrow"><td> <code title="">Lleftarrow;</code> </td> <td> U+021DA </td> <td> <span class="glyph" title="">⇚</span> </td> <tr id="entity-Lmidot"><td> <code title="">Lmidot;</code> </td> <td> U+0013F </td> <td> <span class="glyph" title="">Ŀ</span> </td> <tr id="entity-LongLeftArrow"><td> <code title="">LongLeftArrow;</code> </td> <td> U+027F5 </td> <td> <span class="glyph" title="">⟵</span> </td> <tr id="entity-LongLeftRightArrow"><td> <code title="">LongLeftRightArrow;</code> </td> <td> U+027F7 </td> <td> <span class="glyph" title="">⟷</span> </td> <tr id="entity-LongRightArrow"><td> <code title="">LongRightArrow;</code> </td> <td> U+027F6 </td> <td> <span class="glyph" title="">⟶</span> </td> <tr id="entity-Longleftarrow"><td> <code title="">Longleftarrow;</code> </td> <td> U+027F8 </td> <td> <span class="glyph" title="">⟸</span> </td> <tr id="entity-Longleftrightarrow"><td> <code title="">Longleftrightarrow;</code> </td> <td> U+027FA </td> <td> <span class="glyph" title="">⟺</span> </td> <tr id="entity-Longrightarrow"><td> <code title="">Longrightarrow;</code> </td> <td> U+027F9 </td> <td> <span class="glyph" title="">⟹</span> </td> <tr id="entity-Lopf"><td> <code title="">Lopf;</code> </td> <td> U+1D543 </td> <td> <span class="glyph" title="">𝕃</span> </td> <tr id="entity-LowerLeftArrow"><td> <code title="">LowerLeftArrow;</code> </td> <td> U+02199 </td> <td> <span class="glyph" title="">↙</span> </td> <tr id="entity-LowerRightArrow"><td> <code title="">LowerRightArrow;</code> </td> <td> U+02198 </td> <td> <span class="glyph" title="">↘</span> </td> <tr id="entity-Lscr"><td> <code title="">Lscr;</code> </td> <td> U+02112 </td> <td> <span class="glyph" title="">ℒ</span> </td> <tr id="entity-Lsh"><td> <code title="">Lsh;</code> </td> <td> U+021B0 </td> <td> <span class="glyph" title="">↰</span> </td> <tr id="entity-Lstrok"><td> <code title="">Lstrok;</code> </td> <td> U+00141 </td> <td> <span class="glyph" title="">Ł</span> </td> <tr id="entity-Lt"><td> <code title="">Lt;</code> </td> <td> U+0226A </td> <td> <span class="glyph" title="">≪</span> </td> <tr id="entity-Map"><td> <code title="">Map;</code> </td> <td> U+02905 </td> <td> <span class="glyph" title="">⤅</span> </td> <tr id="entity-Mcy"><td> <code title="">Mcy;</code> </td> <td> U+0041C </td> <td> <span class="glyph" title="">М</span> </td> <tr id="entity-MediumSpace"><td> <code title="">MediumSpace;</code> </td> <td> U+0205F </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-Mellintrf"><td> <code title="">Mellintrf;</code> </td> <td> U+02133 </td> <td> <span class="glyph" title="">ℳ</span> </td> <tr id="entity-Mfr"><td> <code title="">Mfr;</code> </td> <td> U+1D510 </td> <td> <span class="glyph" title="">𝔐</span> </td> <tr id="entity-MinusPlus"><td> <code title="">MinusPlus;</code> </td> <td> U+02213 </td> <td> <span class="glyph" title="">∓</span> </td> <tr id="entity-Mopf"><td> <code title="">Mopf;</code> </td> <td> U+1D544 </td> <td> <span class="glyph" title="">𝕄</span> </td> <tr id="entity-Mscr"><td> <code title="">Mscr;</code> </td> <td> U+02133 </td> <td> <span class="glyph" title="">ℳ</span> </td> <tr id="entity-Mu"><td> <code title="">Mu;</code> </td> <td> U+0039C </td> <td> <span class="glyph" title="">Μ</span> </td> <tr id="entity-NJcy"><td> <code title="">NJcy;</code> </td> <td> U+0040A </td> <td> <span class="glyph" title="">Њ</span> </td> <tr id="entity-Nacute"><td> <code title="">Nacute;</code> </td> <td> U+00143 </td> <td> <span class="glyph" title="">Ń</span> </td> <tr id="entity-Ncaron"><td> <code title="">Ncaron;</code> </td> <td> U+00147 </td> <td> <span class="glyph" title="">Ň</span> </td> <tr id="entity-Ncedil"><td> <code title="">Ncedil;</code> </td> <td> U+00145 </td> <td> <span class="glyph" title="">Ņ</span> </td> <tr id="entity-Ncy"><td> <code title="">Ncy;</code> </td> <td> U+0041D </td> <td> <span class="glyph" title="">Н</span> </td> <tr id="entity-NegativeMediumSpace"><td> <code title="">NegativeMediumSpace;</code> </td> <td> U+0200B </td> <td> <span class="glyph" title="">​</span> </td> <tr id="entity-NegativeThickSpace"><td> <code title="">NegativeThickSpace;</code> </td> <td> U+0200B </td> <td> <span class="glyph" title="">​</span> </td> <tr id="entity-NegativeThinSpace"><td> <code title="">NegativeThinSpace;</code> </td> <td> U+0200B </td> <td> <span class="glyph" title="">​</span> </td> <tr id="entity-NegativeVeryThinSpace"><td> <code title="">NegativeVeryThinSpace;</code> </td> <td> U+0200B </td> <td> <span class="glyph" title="">​</span> </td> <tr id="entity-NestedGreaterGreater"><td> <code title="">NestedGreaterGreater;</code> </td> <td> U+0226B </td> <td> <span class="glyph" title="">≫</span> </td> <tr id="entity-NestedLessLess"><td> <code title="">NestedLessLess;</code> </td> <td> U+0226A </td> <td> <span class="glyph" title="">≪</span> </td> <tr id="entity-NewLine"><td> <code title="">NewLine;</code> </td> <td> U+0000A </td> <td> <span class="glyph control" title="">␊</span> </td> <tr id="entity-Nfr"><td> <code title="">Nfr;</code> </td> <td> U+1D511 </td> <td> <span class="glyph" title="">𝔑</span> </td> <tr id="entity-NoBreak"><td> <code title="">NoBreak;</code> </td> <td> U+02060 </td> <td> <span class="glyph" title="">⁠</span> </td> <tr id="entity-NonBreakingSpace"><td> <code title="">NonBreakingSpace;</code> </td> <td> U+000A0 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-Nopf"><td> <code title="">Nopf;</code> </td> <td> U+02115 </td> <td> <span class="glyph" title="">ℕ</span> </td> <tr id="entity-Not"><td> <code title="">Not;</code> </td> <td> U+02AEC </td> <td> <span class="glyph" title="">⫬</span> </td> <tr id="entity-NotCongruent"><td> <code title="">NotCongruent;</code> </td> <td> U+02262 </td> <td> <span class="glyph" title="">≢</span> </td> <tr id="entity-NotCupCap"><td> <code title="">NotCupCap;</code> </td> <td> U+0226D </td> <td> <span class="glyph" title="">≭</span> </td> <tr id="entity-NotDoubleVerticalBar"><td> <code title="">NotDoubleVerticalBar;</code> </td> <td> U+02226 </td> <td> <span class="glyph" title="">∦</span> </td> <tr id="entity-NotElement"><td> <code title="">NotElement;</code> </td> <td> U+02209 </td> <td> <span class="glyph" title="">∉</span> </td> <tr id="entity-NotEqual"><td> <code title="">NotEqual;</code> </td> <td> U+02260 </td> <td> <span class="glyph" title="">≠</span> </td> <tr id="entity-NotEqualTilde"><td> <code title="">NotEqualTilde;</code> </td> <td> U+02242 U+00338 </td> <td> <span class="glyph compound" title="">≂̸</span> </td> <tr id="entity-NotExists"><td> <code title="">NotExists;</code> </td> <td> U+02204 </td> <td> <span class="glyph" title="">∄</span> </td> <tr id="entity-NotGreater"><td> <code title="">NotGreater;</code> </td> <td> U+0226F </td> <td> <span class="glyph" title="">≯</span> </td> <tr id="entity-NotGreaterEqual"><td> <code title="">NotGreaterEqual;</code> </td> <td> U+02271 </td> <td> <span class="glyph" title="">≱</span> </td> <tr id="entity-NotGreaterFullEqual"><td> <code title="">NotGreaterFullEqual;</code> </td> <td> U+02267 U+00338 </td> <td> <span class="glyph compound" title="">≧̸</span> </td> <tr id="entity-NotGreaterGreater"><td> <code title="">NotGreaterGreater;</code> </td> <td> U+0226B U+00338 </td> <td> <span class="glyph compound" title="">≫̸</span> </td> <tr id="entity-NotGreaterLess"><td> <code title="">NotGreaterLess;</code> </td> <td> U+02279 </td> <td> <span class="glyph" title="">≹</span> </td> <tr id="entity-NotGreaterSlantEqual"><td> <code title="">NotGreaterSlantEqual;</code> </td> <td> U+02A7E U+00338 </td> <td> <span class="glyph compound" title="">⩾̸</span> </td> <tr id="entity-NotGreaterTilde"><td> <code title="">NotGreaterTilde;</code> </td> <td> U+02275 </td> <td> <span class="glyph" title="">≵</span> </td> <tr id="entity-NotHumpDownHump"><td> <code title="">NotHumpDownHump;</code> </td> <td> U+0224E U+00338 </td> <td> <span class="glyph compound" title="">≎̸</span> </td> <tr id="entity-NotHumpEqual"><td> <code title="">NotHumpEqual;</code> </td> <td> U+0224F U+00338 </td> <td> <span class="glyph compound" title="">≏̸</span> </td> <tr id="entity-NotLeftTriangle"><td> <code title="">NotLeftTriangle;</code> </td> <td> U+022EA </td> <td> <span class="glyph" title="">⋪</span> </td> <tr id="entity-NotLeftTriangleBar"><td> <code title="">NotLeftTriangleBar;</code> </td> <td> U+029CF U+00338 </td> <td> <span class="glyph compound" title="">⧏̸</span> </td> <tr id="entity-NotLeftTriangleEqual"><td> <code title="">NotLeftTriangleEqual;</code> </td> <td> U+022EC </td> <td> <span class="glyph" title="">⋬</span> </td> <tr id="entity-NotLess"><td> <code title="">NotLess;</code> </td> <td> U+0226E </td> <td> <span class="glyph" title="">≮</span> </td> <tr id="entity-NotLessEqual"><td> <code title="">NotLessEqual;</code> </td> <td> U+02270 </td> <td> <span class="glyph" title="">≰</span> </td> <tr id="entity-NotLessGreater"><td> <code title="">NotLessGreater;</code> </td> <td> U+02278 </td> <td> <span class="glyph" title="">≸</span> </td> <tr id="entity-NotLessLess"><td> <code title="">NotLessLess;</code> </td> <td> U+0226A U+00338 </td> <td> <span class="glyph compound" title="">≪̸</span> </td> <tr id="entity-NotLessSlantEqual"><td> <code title="">NotLessSlantEqual;</code> </td> <td> U+02A7D U+00338 </td> <td> <span class="glyph compound" title="">⩽̸</span> </td> <tr id="entity-NotLessTilde"><td> <code title="">NotLessTilde;</code> </td> <td> U+02274 </td> <td> <span class="glyph" title="">≴</span> </td> <tr id="entity-NotNestedGreaterGreater"><td> <code title="">NotNestedGreaterGreater;</code> </td> <td> U+02AA2 U+00338 </td> <td> <span class="glyph compound" title="">⪢̸</span> </td> <tr id="entity-NotNestedLessLess"><td> <code title="">NotNestedLessLess;</code> </td> <td> U+02AA1 U+00338 </td> <td> <span class="glyph compound" title="">⪡̸</span> </td> <tr id="entity-NotPrecedes"><td> <code title="">NotPrecedes;</code> </td> <td> U+02280 </td> <td> <span class="glyph" title="">⊀</span> </td> <tr id="entity-NotPrecedesEqual"><td> <code title="">NotPrecedesEqual;</code> </td> <td> U+02AAF U+00338 </td> <td> <span class="glyph compound" title="">⪯̸</span> </td> <tr id="entity-NotPrecedesSlantEqual"><td> <code title="">NotPrecedesSlantEqual;</code> </td> <td> U+022E0 </td> <td> <span class="glyph" title="">⋠</span> </td> <tr id="entity-NotReverseElement"><td> <code title="">NotReverseElement;</code> </td> <td> U+0220C </td> <td> <span class="glyph" title="">∌</span> </td> <tr id="entity-NotRightTriangle"><td> <code title="">NotRightTriangle;</code> </td> <td> U+022EB </td> <td> <span class="glyph" title="">⋫</span> </td> <tr id="entity-NotRightTriangleBar"><td> <code title="">NotRightTriangleBar;</code> </td> <td> U+029D0 U+00338 </td> <td> <span class="glyph compound" title="">⧐̸</span> </td> <tr id="entity-NotRightTriangleEqual"><td> <code title="">NotRightTriangleEqual;</code> </td> <td> U+022ED </td> <td> <span class="glyph" title="">⋭</span> </td> <tr id="entity-NotSquareSubset"><td> <code title="">NotSquareSubset;</code> </td> <td> U+0228F U+00338 </td> <td> <span class="glyph compound" title="">⊏̸</span> </td> <tr id="entity-NotSquareSubsetEqual"><td> <code title="">NotSquareSubsetEqual;</code> </td> <td> U+022E2 </td> <td> <span class="glyph" title="">⋢</span> </td> <tr id="entity-NotSquareSuperset"><td> <code title="">NotSquareSuperset;</code> </td> <td> U+02290 U+00338 </td> <td> <span class="glyph compound" title="">⊐̸</span> </td> <tr id="entity-NotSquareSupersetEqual"><td> <code title="">NotSquareSupersetEqual;</code> </td> <td> U+022E3 </td> <td> <span class="glyph" title="">⋣</span> </td> <tr id="entity-NotSubset"><td> <code title="">NotSubset;</code> </td> <td> U+02282 U+020D2 </td> <td> <span class="glyph compound" title="">⊂⃒</span> </td> <tr id="entity-NotSubsetEqual"><td> <code title="">NotSubsetEqual;</code> </td> <td> U+02288 </td> <td> <span class="glyph" title="">⊈</span> </td> <tr id="entity-NotSucceeds"><td> <code title="">NotSucceeds;</code> </td> <td> U+02281 </td> <td> <span class="glyph" title="">⊁</span> </td> <tr id="entity-NotSucceedsEqual"><td> <code title="">NotSucceedsEqual;</code> </td> <td> U+02AB0 U+00338 </td> <td> <span class="glyph compound" title="">⪰̸</span> </td> <tr id="entity-NotSucceedsSlantEqual"><td> <code title="">NotSucceedsSlantEqual;</code> </td> <td> U+022E1 </td> <td> <span class="glyph" title="">⋡</span> </td> <tr id="entity-NotSucceedsTilde"><td> <code title="">NotSucceedsTilde;</code> </td> <td> U+0227F U+00338 </td> <td> <span class="glyph compound" title="">≿̸</span> </td> <tr id="entity-NotSuperset"><td> <code title="">NotSuperset;</code> </td> <td> U+02283 U+020D2 </td> <td> <span class="glyph compound" title="">⊃⃒</span> </td> <tr id="entity-NotSupersetEqual"><td> <code title="">NotSupersetEqual;</code> </td> <td> U+02289 </td> <td> <span class="glyph" title="">⊉</span> </td> <tr id="entity-NotTilde"><td> <code title="">NotTilde;</code> </td> <td> U+02241 </td> <td> <span class="glyph" title="">≁</span> </td> <tr id="entity-NotTildeEqual"><td> <code title="">NotTildeEqual;</code> </td> <td> U+02244 </td> <td> <span class="glyph" title="">≄</span> </td> <tr id="entity-NotTildeFullEqual"><td> <code title="">NotTildeFullEqual;</code> </td> <td> U+02247 </td> <td> <span class="glyph" title="">≇</span> </td> <tr id="entity-NotTildeTilde"><td> <code title="">NotTildeTilde;</code> </td> <td> U+02249 </td> <td> <span class="glyph" title="">≉</span> </td> <tr id="entity-NotVerticalBar"><td> <code title="">NotVerticalBar;</code> </td> <td> U+02224 </td> <td> <span class="glyph" title="">∤</span> </td> <tr id="entity-Nscr"><td> <code title="">Nscr;</code> </td> <td> U+1D4A9 </td> <td> <span class="glyph" title="">𝒩</span> </td> <tr id="entity-Ntilde"><td> <code title="">Ntilde;</code> </td> <td> U+000D1 </td> <td> <span class="glyph" title="">Ñ</span> </td> <tr id="entity-Nu"><td> <code title="">Nu;</code> </td> <td> U+0039D </td> <td> <span class="glyph" title="">Ν</span> </td> <tr id="entity-OElig"><td> <code title="">OElig;</code> </td> <td> U+00152 </td> <td> <span class="glyph" title="">Œ</span> </td> <tr id="entity-Oacute"><td> <code title="">Oacute;</code> </td> <td> U+000D3 </td> <td> <span class="glyph" title="">Ó</span> </td> <tr id="entity-Ocirc"><td> <code title="">Ocirc;</code> </td> <td> U+000D4 </td> <td> <span class="glyph" title="">Ô</span> </td> <tr id="entity-Ocy"><td> <code title="">Ocy;</code> </td> <td> U+0041E </td> <td> <span class="glyph" title="">О</span> </td> <tr id="entity-Odblac"><td> <code title="">Odblac;</code> </td> <td> U+00150 </td> <td> <span class="glyph" title="">Ő</span> </td> <tr id="entity-Ofr"><td> <code title="">Ofr;</code> </td> <td> U+1D512 </td> <td> <span class="glyph" title="">𝔒</span> </td> <tr id="entity-Ograve"><td> <code title="">Ograve;</code> </td> <td> U+000D2 </td> <td> <span class="glyph" title="">Ò</span> </td> <tr id="entity-Omacr"><td> <code title="">Omacr;</code> </td> <td> U+0014C </td> <td> <span class="glyph" title="">Ō</span> </td> <tr id="entity-Omega"><td> <code title="">Omega;</code> </td> <td> U+003A9 </td> <td> <span class="glyph" title="">Ω</span> </td> <tr id="entity-Omicron"><td> <code title="">Omicron;</code> </td> <td> U+0039F </td> <td> <span class="glyph" title="">Ο</span> </td> <tr id="entity-Oopf"><td> <code title="">Oopf;</code> </td> <td> U+1D546 </td> <td> <span class="glyph" title="">𝕆</span> </td> <tr id="entity-OpenCurlyDoubleQuote"><td> <code title="">OpenCurlyDoubleQuote;</code> </td> <td> U+0201C </td> <td> <span class="glyph" title="">“</span> </td> <tr id="entity-OpenCurlyQuote"><td> <code title="">OpenCurlyQuote;</code> </td> <td> U+02018 </td> <td> <span class="glyph" title="">‘</span> </td> <tr id="entity-Or"><td> <code title="">Or;</code> </td> <td> U+02A54 </td> <td> <span class="glyph" title="">⩔</span> </td> <tr id="entity-Oscr"><td> <code title="">Oscr;</code> </td> <td> U+1D4AA </td> <td> <span class="glyph" title="">𝒪</span> </td> <tr id="entity-Oslash"><td> <code title="">Oslash;</code> </td> <td> U+000D8 </td> <td> <span class="glyph" title="">Ø</span> </td> <tr id="entity-Otilde"><td> <code title="">Otilde;</code> </td> <td> U+000D5 </td> <td> <span class="glyph" title="">Õ</span> </td> <tr id="entity-Otimes"><td> <code title="">Otimes;</code> </td> <td> U+02A37 </td> <td> <span class="glyph" title="">⨷</span> </td> <tr id="entity-Ouml"><td> <code title="">Ouml;</code> </td> <td> U+000D6 </td> <td> <span class="glyph" title="">Ö</span> </td> <tr id="entity-OverBar"><td> <code title="">OverBar;</code> </td> <td> U+0203E </td> <td> <span class="glyph" title="">‾</span> </td> <tr id="entity-OverBrace"><td> <code title="">OverBrace;</code> </td> <td> U+023DE </td> <td> <span class="glyph" title="">⏞</span> </td> <tr id="entity-OverBracket"><td> <code title="">OverBracket;</code> </td> <td> U+023B4 </td> <td> <span class="glyph" title="">⎴</span> </td> <tr id="entity-OverParenthesis"><td> <code title="">OverParenthesis;</code> </td> <td> U+023DC </td> <td> <span class="glyph" title="">⏜</span> </td> <tr id="entity-PartialD"><td> <code title="">PartialD;</code> </td> <td> U+02202 </td> <td> <span class="glyph" title="">∂</span> </td> <tr id="entity-Pcy"><td> <code title="">Pcy;</code> </td> <td> U+0041F </td> <td> <span class="glyph" title="">П</span> </td> <tr id="entity-Pfr"><td> <code title="">Pfr;</code> </td> <td> U+1D513 </td> <td> <span class="glyph" title="">𝔓</span> </td> <tr id="entity-Phi"><td> <code title="">Phi;</code> </td> <td> U+003A6 </td> <td> <span class="glyph" title="">Φ</span> </td> <tr id="entity-Pi"><td> <code title="">Pi;</code> </td> <td> U+003A0 </td> <td> <span class="glyph" title="">Π</span> </td> <tr id="entity-PlusMinus"><td> <code title="">PlusMinus;</code> </td> <td> U+000B1 </td> <td> <span class="glyph" title="">±</span> </td> <tr id="entity-Poincareplane"><td> <code title="">Poincareplane;</code> </td> <td> U+0210C </td> <td> <span class="glyph" title="">ℌ</span> </td> <tr id="entity-Popf"><td> <code title="">Popf;</code> </td> <td> U+02119 </td> <td> <span class="glyph" title="">ℙ</span> </td> <tr id="entity-Pr"><td> <code title="">Pr;</code> </td> <td> U+02ABB </td> <td> <span class="glyph" title="">⪻</span> </td> <tr id="entity-Precedes"><td> <code title="">Precedes;</code> </td> <td> U+0227A </td> <td> <span class="glyph" title="">≺</span> </td> <tr id="entity-PrecedesEqual"><td> <code title="">PrecedesEqual;</code> </td> <td> U+02AAF </td> <td> <span class="glyph" title="">⪯</span> </td> <tr id="entity-PrecedesSlantEqual"><td> <code title="">PrecedesSlantEqual;</code> </td> <td> U+0227C </td> <td> <span class="glyph" title="">≼</span> </td> <tr id="entity-PrecedesTilde"><td> <code title="">PrecedesTilde;</code> </td> <td> U+0227E </td> <td> <span class="glyph" title="">≾</span> </td> <tr id="entity-Prime"><td> <code title="">Prime;</code> </td> <td> U+02033 </td> <td> <span class="glyph" title="">″</span> </td> <tr id="entity-Product"><td> <code title="">Product;</code> </td> <td> U+0220F </td> <td> <span class="glyph" title="">∏</span> </td> <tr id="entity-Proportion"><td> <code title="">Proportion;</code> </td> <td> U+02237 </td> <td> <span class="glyph" title="">∷</span> </td> <tr id="entity-Proportional"><td> <code title="">Proportional;</code> </td> <td> U+0221D </td> <td> <span class="glyph" title="">∝</span> </td> <tr id="entity-Pscr"><td> <code title="">Pscr;</code> </td> <td> U+1D4AB </td> <td> <span class="glyph" title="">𝒫</span> </td> <tr id="entity-Psi"><td> <code title="">Psi;</code> </td> <td> U+003A8 </td> <td> <span class="glyph" title="">Ψ</span> </td> <tr id="entity-QUOT"><td> <code title="">QUOT;</code> </td> <td> U+00022 </td> <td> <span class="glyph" title="">"</span> </td> <tr id="entity-Qfr"><td> <code title="">Qfr;</code> </td> <td> U+1D514 </td> <td> <span class="glyph" title="">𝔔</span> </td> <tr id="entity-Qopf"><td> <code title="">Qopf;</code> </td> <td> U+0211A </td> <td> <span class="glyph" title="">ℚ</span> </td> <tr id="entity-Qscr"><td> <code title="">Qscr;</code> </td> <td> U+1D4AC </td> <td> <span class="glyph" title="">𝒬</span> </td> <tr id="entity-RBarr"><td> <code title="">RBarr;</code> </td> <td> U+02910 </td> <td> <span class="glyph" title="">⤐</span> </td> <tr id="entity-REG"><td> <code title="">REG;</code> </td> <td> U+000AE </td> <td> <span class="glyph" title="">®</span> </td> <tr id="entity-Racute"><td> <code title="">Racute;</code> </td> <td> U+00154 </td> <td> <span class="glyph" title="">Ŕ</span> </td> <tr id="entity-Rang"><td> <code title="">Rang;</code> </td> <td> U+027EB </td> <td> <span class="glyph" title="">⟫</span> </td> <tr id="entity-Rarr"><td> <code title="">Rarr;</code> </td> <td> U+021A0 </td> <td> <span class="glyph" title="">↠</span> </td> <tr id="entity-Rarrtl"><td> <code title="">Rarrtl;</code> </td> <td> U+02916 </td> <td> <span class="glyph" title="">⤖</span> </td> <tr id="entity-Rcaron"><td> <code title="">Rcaron;</code> </td> <td> U+00158 </td> <td> <span class="glyph" title="">Ř</span> </td> <tr id="entity-Rcedil"><td> <code title="">Rcedil;</code> </td> <td> U+00156 </td> <td> <span class="glyph" title="">Ŗ</span> </td> <tr id="entity-Rcy"><td> <code title="">Rcy;</code> </td> <td> U+00420 </td> <td> <span class="glyph" title="">Р</span> </td> <tr id="entity-Re"><td> <code title="">Re;</code> </td> <td> U+0211C </td> <td> <span class="glyph" title="">ℜ</span> </td> <tr id="entity-ReverseElement"><td> <code title="">ReverseElement;</code> </td> <td> U+0220B </td> <td> <span class="glyph" title="">∋</span> </td> <tr id="entity-ReverseEquilibrium"><td> <code title="">ReverseEquilibrium;</code> </td> <td> U+021CB </td> <td> <span class="glyph" title="">⇋</span> </td> <tr id="entity-ReverseUpEquilibrium"><td> <code title="">ReverseUpEquilibrium;</code> </td> <td> U+0296F </td> <td> <span class="glyph" title="">⥯</span> </td> <tr id="entity-Rfr"><td> <code title="">Rfr;</code> </td> <td> U+0211C </td> <td> <span class="glyph" title="">ℜ</span> </td> <tr id="entity-Rho"><td> <code title="">Rho;</code> </td> <td> U+003A1 </td> <td> <span class="glyph" title="">Ρ</span> </td> <tr id="entity-RightAngleBracket"><td> <code title="">RightAngleBracket;</code> </td> <td> U+027E9 </td> <td> <span class="glyph" title="">⟩</span> </td> <tr id="entity-RightArrow"><td> <code title="">RightArrow;</code> </td> <td> U+02192 </td> <td> <span class="glyph" title="">→</span> </td> <tr id="entity-RightArrowBar"><td> <code title="">RightArrowBar;</code> </td> <td> U+021E5 </td> <td> <span class="glyph" title="">⇥</span> </td> <tr id="entity-RightArrowLeftArrow"><td> <code title="">RightArrowLeftArrow;</code> </td> <td> U+021C4 </td> <td> <span class="glyph" title="">⇄</span> </td> <tr id="entity-RightCeiling"><td> <code title="">RightCeiling;</code> </td> <td> U+02309 </td> <td> <span class="glyph" title="">⌉</span> </td> <tr id="entity-RightDoubleBracket"><td> <code title="">RightDoubleBracket;</code> </td> <td> U+027E7 </td> <td> <span class="glyph" title="">⟧</span> </td> <tr id="entity-RightDownTeeVector"><td> <code title="">RightDownTeeVector;</code> </td> <td> U+0295D </td> <td> <span class="glyph" title="">⥝</span> </td> <tr id="entity-RightDownVector"><td> <code title="">RightDownVector;</code> </td> <td> U+021C2 </td> <td> <span class="glyph" title="">⇂</span> </td> <tr id="entity-RightDownVectorBar"><td> <code title="">RightDownVectorBar;</code> </td> <td> U+02955 </td> <td> <span class="glyph" title="">⥕</span> </td> <tr id="entity-RightFloor"><td> <code title="">RightFloor;</code> </td> <td> U+0230B </td> <td> <span class="glyph" title="">⌋</span> </td> <tr id="entity-RightTee"><td> <code title="">RightTee;</code> </td> <td> U+022A2 </td> <td> <span class="glyph" title="">⊢</span> </td> <tr id="entity-RightTeeArrow"><td> <code title="">RightTeeArrow;</code> </td> <td> U+021A6 </td> <td> <span class="glyph" title="">↦</span> </td> <tr id="entity-RightTeeVector"><td> <code title="">RightTeeVector;</code> </td> <td> U+0295B </td> <td> <span class="glyph" title="">⥛</span> </td> <tr id="entity-RightTriangle"><td> <code title="">RightTriangle;</code> </td> <td> U+022B3 </td> <td> <span class="glyph" title="">⊳</span> </td> <tr id="entity-RightTriangleBar"><td> <code title="">RightTriangleBar;</code> </td> <td> U+029D0 </td> <td> <span class="glyph" title="">⧐</span> </td> <tr id="entity-RightTriangleEqual"><td> <code title="">RightTriangleEqual;</code> </td> <td> U+022B5 </td> <td> <span class="glyph" title="">⊵</span> </td> <tr id="entity-RightUpDownVector"><td> <code title="">RightUpDownVector;</code> </td> <td> U+0294F </td> <td> <span class="glyph" title="">⥏</span> </td> <tr id="entity-RightUpTeeVector"><td> <code title="">RightUpTeeVector;</code> </td> <td> U+0295C </td> <td> <span class="glyph" title="">⥜</span> </td> <tr id="entity-RightUpVector"><td> <code title="">RightUpVector;</code> </td> <td> U+021BE </td> <td> <span class="glyph" title="">↾</span> </td> <tr id="entity-RightUpVectorBar"><td> <code title="">RightUpVectorBar;</code> </td> <td> U+02954 </td> <td> <span class="glyph" title="">⥔</span> </td> <tr id="entity-RightVector"><td> <code title="">RightVector;</code> </td> <td> U+021C0 </td> <td> <span class="glyph" title="">⇀</span> </td> <tr id="entity-RightVectorBar"><td> <code title="">RightVectorBar;</code> </td> <td> U+02953 </td> <td> <span class="glyph" title="">⥓</span> </td> <tr id="entity-Rightarrow"><td> <code title="">Rightarrow;</code> </td> <td> U+021D2 </td> <td> <span class="glyph" title="">⇒</span> </td> <tr id="entity-Ropf"><td> <code title="">Ropf;</code> </td> <td> U+0211D </td> <td> <span class="glyph" title="">ℝ</span> </td> <tr id="entity-RoundImplies"><td> <code title="">RoundImplies;</code> </td> <td> U+02970 </td> <td> <span class="glyph" title="">⥰</span> </td> <tr id="entity-Rrightarrow"><td> <code title="">Rrightarrow;</code> </td> <td> U+021DB </td> <td> <span class="glyph" title="">⇛</span> </td> <tr id="entity-Rscr"><td> <code title="">Rscr;</code> </td> <td> U+0211B </td> <td> <span class="glyph" title="">ℛ</span> </td> <tr id="entity-Rsh"><td> <code title="">Rsh;</code> </td> <td> U+021B1 </td> <td> <span class="glyph" title="">↱</span> </td> <tr id="entity-RuleDelayed"><td> <code title="">RuleDelayed;</code> </td> <td> U+029F4 </td> <td> <span class="glyph" title="">⧴</span> </td> <tr id="entity-SHCHcy"><td> <code title="">SHCHcy;</code> </td> <td> U+00429 </td> <td> <span class="glyph" title="">Щ</span> </td> <tr id="entity-SHcy"><td> <code title="">SHcy;</code> </td> <td> U+00428 </td> <td> <span class="glyph" title="">Ш</span> </td> <tr id="entity-SOFTcy"><td> <code title="">SOFTcy;</code> </td> <td> U+0042C </td> <td> <span class="glyph" title="">Ь</span> </td> <tr id="entity-Sacute"><td> <code title="">Sacute;</code> </td> <td> U+0015A </td> <td> <span class="glyph" title="">Ś</span> </td> <tr id="entity-Sc"><td> <code title="">Sc;</code> </td> <td> U+02ABC </td> <td> <span class="glyph" title="">⪼</span> </td> <tr id="entity-Scaron"><td> <code title="">Scaron;</code> </td> <td> U+00160 </td> <td> <span class="glyph" title="">Š</span> </td> <tr id="entity-Scedil"><td> <code title="">Scedil;</code> </td> <td> U+0015E </td> <td> <span class="glyph" title="">Ş</span> </td> <tr id="entity-Scirc"><td> <code title="">Scirc;</code> </td> <td> U+0015C </td> <td> <span class="glyph" title="">Ŝ</span> </td> <tr id="entity-Scy"><td> <code title="">Scy;</code> </td> <td> U+00421 </td> <td> <span class="glyph" title="">С</span> </td> <tr id="entity-Sfr"><td> <code title="">Sfr;</code> </td> <td> U+1D516 </td> <td> <span class="glyph" title="">𝔖</span> </td> <tr id="entity-ShortDownArrow"><td> <code title="">ShortDownArrow;</code> </td> <td> U+02193 </td> <td> <span class="glyph" title="">↓</span> </td> <tr id="entity-ShortLeftArrow"><td> <code title="">ShortLeftArrow;</code> </td> <td> U+02190 </td> <td> <span class="glyph" title="">←</span> </td> <tr id="entity-ShortRightArrow"><td> <code title="">ShortRightArrow;</code> </td> <td> U+02192 </td> <td> <span class="glyph" title="">→</span> </td> <tr id="entity-ShortUpArrow"><td> <code title="">ShortUpArrow;</code> </td> <td> U+02191 </td> <td> <span class="glyph" title="">↑</span> </td> <tr id="entity-Sigma"><td> <code title="">Sigma;</code> </td> <td> U+003A3 </td> <td> <span class="glyph" title="">Σ</span> </td> <tr id="entity-SmallCircle"><td> <code title="">SmallCircle;</code> </td> <td> U+02218 </td> <td> <span class="glyph" title="">∘</span> </td> <tr id="entity-Sopf"><td> <code title="">Sopf;</code> </td> <td> U+1D54A </td> <td> <span class="glyph" title="">𝕊</span> </td> <tr id="entity-Sqrt"><td> <code title="">Sqrt;</code> </td> <td> U+0221A </td> <td> <span class="glyph" title="">√</span> </td> <tr id="entity-Square"><td> <code title="">Square;</code> </td> <td> U+025A1 </td> <td> <span class="glyph" title="">□</span> </td> <tr id="entity-SquareIntersection"><td> <code title="">SquareIntersection;</code> </td> <td> U+02293 </td> <td> <span class="glyph" title="">⊓</span> </td> <tr id="entity-SquareSubset"><td> <code title="">SquareSubset;</code> </td> <td> U+0228F </td> <td> <span class="glyph" title="">⊏</span> </td> <tr id="entity-SquareSubsetEqual"><td> <code title="">SquareSubsetEqual;</code> </td> <td> U+02291 </td> <td> <span class="glyph" title="">⊑</span> </td> <tr id="entity-SquareSuperset"><td> <code title="">SquareSuperset;</code> </td> <td> U+02290 </td> <td> <span class="glyph" title="">⊐</span> </td> <tr id="entity-SquareSupersetEqual"><td> <code title="">SquareSupersetEqual;</code> </td> <td> U+02292 </td> <td> <span class="glyph" title="">⊒</span> </td> <tr id="entity-SquareUnion"><td> <code title="">SquareUnion;</code> </td> <td> U+02294 </td> <td> <span class="glyph" title="">⊔</span> </td> <tr id="entity-Sscr"><td> <code title="">Sscr;</code> </td> <td> U+1D4AE </td> <td> <span class="glyph" title="">𝒮</span> </td> <tr id="entity-Star"><td> <code title="">Star;</code> </td> <td> U+022C6 </td> <td> <span class="glyph" title="">⋆</span> </td> <tr id="entity-Sub"><td> <code title="">Sub;</code> </td> <td> U+022D0 </td> <td> <span class="glyph" title="">⋐</span> </td> <tr id="entity-Subset"><td> <code title="">Subset;</code> </td> <td> U+022D0 </td> <td> <span class="glyph" title="">⋐</span> </td> <tr id="entity-SubsetEqual"><td> <code title="">SubsetEqual;</code> </td> <td> U+02286 </td> <td> <span class="glyph" title="">⊆</span> </td> <tr id="entity-Succeeds"><td> <code title="">Succeeds;</code> </td> <td> U+0227B </td> <td> <span class="glyph" title="">≻</span> </td> <tr id="entity-SucceedsEqual"><td> <code title="">SucceedsEqual;</code> </td> <td> U+02AB0 </td> <td> <span class="glyph" title="">⪰</span> </td> <tr id="entity-SucceedsSlantEqual"><td> <code title="">SucceedsSlantEqual;</code> </td> <td> U+0227D </td> <td> <span class="glyph" title="">≽</span> </td> <tr id="entity-SucceedsTilde"><td> <code title="">SucceedsTilde;</code> </td> <td> U+0227F </td> <td> <span class="glyph" title="">≿</span> </td> <tr id="entity-SuchThat"><td> <code title="">SuchThat;</code> </td> <td> U+0220B </td> <td> <span class="glyph" title="">∋</span> </td> <tr id="entity-Sum"><td> <code title="">Sum;</code> </td> <td> U+02211 </td> <td> <span class="glyph" title="">∑</span> </td> <tr id="entity-Sup"><td> <code title="">Sup;</code> </td> <td> U+022D1 </td> <td> <span class="glyph" title="">⋑</span> </td> <tr id="entity-Superset"><td> <code title="">Superset;</code> </td> <td> U+02283 </td> <td> <span class="glyph" title="">⊃</span> </td> <tr id="entity-SupersetEqual"><td> <code title="">SupersetEqual;</code> </td> <td> U+02287 </td> <td> <span class="glyph" title="">⊇</span> </td> <tr id="entity-Supset"><td> <code title="">Supset;</code> </td> <td> U+022D1 </td> <td> <span class="glyph" title="">⋑</span> </td> <tr id="entity-THORN"><td> <code title="">THORN;</code> </td> <td> U+000DE </td> <td> <span class="glyph" title="">Þ</span> </td> <tr id="entity-TRADE"><td> <code title="">TRADE;</code> </td> <td> U+02122 </td> <td> <span class="glyph" title="">™</span> </td> <tr id="entity-TSHcy"><td> <code title="">TSHcy;</code> </td> <td> U+0040B </td> <td> <span class="glyph" title="">Ћ</span> </td> <tr id="entity-TScy"><td> <code title="">TScy;</code> </td> <td> U+00426 </td> <td> <span class="glyph" title="">Ц</span> </td> <tr id="entity-Tab"><td> <code title="">Tab;</code> </td> <td> U+00009 </td> <td> <span class="glyph control" title="">␉</span> </td> <tr id="entity-Tau"><td> <code title="">Tau;</code> </td> <td> U+003A4 </td> <td> <span class="glyph" title="">Τ</span> </td> <tr id="entity-Tcaron"><td> <code title="">Tcaron;</code> </td> <td> U+00164 </td> <td> <span class="glyph" title="">Ť</span> </td> <tr id="entity-Tcedil"><td> <code title="">Tcedil;</code> </td> <td> U+00162 </td> <td> <span class="glyph" title="">Ţ</span> </td> <tr id="entity-Tcy"><td> <code title="">Tcy;</code> </td> <td> U+00422 </td> <td> <span class="glyph" title="">Т</span> </td> <tr id="entity-Tfr"><td> <code title="">Tfr;</code> </td> <td> U+1D517 </td> <td> <span class="glyph" title="">𝔗</span> </td> <tr id="entity-Therefore"><td> <code title="">Therefore;</code> </td> <td> U+02234 </td> <td> <span class="glyph" title="">∴</span> </td> <tr id="entity-Theta"><td> <code title="">Theta;</code> </td> <td> U+00398 </td> <td> <span class="glyph" title="">Θ</span> </td> <tr id="entity-ThickSpace"><td> <code title="">ThickSpace;</code> </td> <td> U+0205F U+0200A </td> <td> <span class="glyph compound" title="">  </span> </td> <tr id="entity-ThinSpace"><td> <code title="">ThinSpace;</code> </td> <td> U+02009 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-Tilde"><td> <code title="">Tilde;</code> </td> <td> U+0223C </td> <td> <span class="glyph" title="">∼</span> </td> <tr id="entity-TildeEqual"><td> <code title="">TildeEqual;</code> </td> <td> U+02243 </td> <td> <span class="glyph" title="">≃</span> </td> <tr id="entity-TildeFullEqual"><td> <code title="">TildeFullEqual;</code> </td> <td> U+02245 </td> <td> <span class="glyph" title="">≅</span> </td> <tr id="entity-TildeTilde"><td> <code title="">TildeTilde;</code> </td> <td> U+02248 </td> <td> <span class="glyph" title="">≈</span> </td> <tr id="entity-Topf"><td> <code title="">Topf;</code> </td> <td> U+1D54B </td> <td> <span class="glyph" title="">𝕋</span> </td> <tr id="entity-TripleDot"><td> <code title="">TripleDot;</code> </td> <td> U+020DB </td> <td> <span class="glyph composition" title="">◌⃛</span> </td> <tr id="entity-Tscr"><td> <code title="">Tscr;</code> </td> <td> U+1D4AF </td> <td> <span class="glyph" title="">𝒯</span> </td> <tr id="entity-Tstrok"><td> <code title="">Tstrok;</code> </td> <td> U+00166 </td> <td> <span class="glyph" title="">Ŧ</span> </td> <tr id="entity-Uacute"><td> <code title="">Uacute;</code> </td> <td> U+000DA </td> <td> <span class="glyph" title="">Ú</span> </td> <tr id="entity-Uarr"><td> <code title="">Uarr;</code> </td> <td> U+0219F </td> <td> <span class="glyph" title="">↟</span> </td> <tr id="entity-Uarrocir"><td> <code title="">Uarrocir;</code> </td> <td> U+02949 </td> <td> <span class="glyph" title="">⥉</span> </td> <tr id="entity-Ubrcy"><td> <code title="">Ubrcy;</code> </td> <td> U+0040E </td> <td> <span class="glyph" title="">Ў</span> </td> <tr id="entity-Ubreve"><td> <code title="">Ubreve;</code> </td> <td> U+0016C </td> <td> <span class="glyph" title="">Ŭ</span> </td> <tr id="entity-Ucirc"><td> <code title="">Ucirc;</code> </td> <td> U+000DB </td> <td> <span class="glyph" title="">Û</span> </td> <tr id="entity-Ucy"><td> <code title="">Ucy;</code> </td> <td> U+00423 </td> <td> <span class="glyph" title="">У</span> </td> <tr id="entity-Udblac"><td> <code title="">Udblac;</code> </td> <td> U+00170 </td> <td> <span class="glyph" title="">Ű</span> </td> <tr id="entity-Ufr"><td> <code title="">Ufr;</code> </td> <td> U+1D518 </td> <td> <span class="glyph" title="">𝔘</span> </td> <tr id="entity-Ugrave"><td> <code title="">Ugrave;</code> </td> <td> U+000D9 </td> <td> <span class="glyph" title="">Ù</span> </td> <tr id="entity-Umacr"><td> <code title="">Umacr;</code> </td> <td> U+0016A </td> <td> <span class="glyph" title="">Ū</span> </td> <tr id="entity-UnderBar"><td> <code title="">UnderBar;</code> </td> <td> U+0005F </td> <td> <span class="glyph" title="">_</span> </td> <tr id="entity-UnderBrace"><td> <code title="">UnderBrace;</code> </td> <td> U+023DF </td> <td> <span class="glyph" title="">⏟</span> </td> <tr id="entity-UnderBracket"><td> <code title="">UnderBracket;</code> </td> <td> U+023B5 </td> <td> <span class="glyph" title="">⎵</span> </td> <tr id="entity-UnderParenthesis"><td> <code title="">UnderParenthesis;</code> </td> <td> U+023DD </td> <td> <span class="glyph" title="">⏝</span> </td> <tr id="entity-Union"><td> <code title="">Union;</code> </td> <td> U+022C3 </td> <td> <span class="glyph" title="">⋃</span> </td> <tr id="entity-UnionPlus"><td> <code title="">UnionPlus;</code> </td> <td> U+0228E </td> <td> <span class="glyph" title="">⊎</span> </td> <tr id="entity-Uogon"><td> <code title="">Uogon;</code> </td> <td> U+00172 </td> <td> <span class="glyph" title="">Ų</span> </td> <tr id="entity-Uopf"><td> <code title="">Uopf;</code> </td> <td> U+1D54C </td> <td> <span class="glyph" title="">𝕌</span> </td> <tr id="entity-UpArrow"><td> <code title="">UpArrow;</code> </td> <td> U+02191 </td> <td> <span class="glyph" title="">↑</span> </td> <tr id="entity-UpArrowBar"><td> <code title="">UpArrowBar;</code> </td> <td> U+02912 </td> <td> <span class="glyph" title="">⤒</span> </td> <tr id="entity-UpArrowDownArrow"><td> <code title="">UpArrowDownArrow;</code> </td> <td> U+021C5 </td> <td> <span class="glyph" title="">⇅</span> </td> <tr id="entity-UpDownArrow"><td> <code title="">UpDownArrow;</code> </td> <td> U+02195 </td> <td> <span class="glyph" title="">↕</span> </td> <tr id="entity-UpEquilibrium"><td> <code title="">UpEquilibrium;</code> </td> <td> U+0296E </td> <td> <span class="glyph" title="">⥮</span> </td> <tr id="entity-UpTee"><td> <code title="">UpTee;</code> </td> <td> U+022A5 </td> <td> <span class="glyph" title="">⊥</span> </td> <tr id="entity-UpTeeArrow"><td> <code title="">UpTeeArrow;</code> </td> <td> U+021A5 </td> <td> <span class="glyph" title="">↥</span> </td> <tr id="entity-Uparrow"><td> <code title="">Uparrow;</code> </td> <td> U+021D1 </td> <td> <span class="glyph" title="">⇑</span> </td> <tr id="entity-Updownarrow"><td> <code title="">Updownarrow;</code> </td> <td> U+021D5 </td> <td> <span class="glyph" title="">⇕</span> </td> <tr id="entity-UpperLeftArrow"><td> <code title="">UpperLeftArrow;</code> </td> <td> U+02196 </td> <td> <span class="glyph" title="">↖</span> </td> <tr id="entity-UpperRightArrow"><td> <code title="">UpperRightArrow;</code> </td> <td> U+02197 </td> <td> <span class="glyph" title="">↗</span> </td> <tr id="entity-Upsi"><td> <code title="">Upsi;</code> </td> <td> U+003D2 </td> <td> <span class="glyph" title="">ϒ</span> </td> <tr id="entity-Upsilon"><td> <code title="">Upsilon;</code> </td> <td> U+003A5 </td> <td> <span class="glyph" title="">Υ</span> </td> <tr id="entity-Uring"><td> <code title="">Uring;</code> </td> <td> U+0016E </td> <td> <span class="glyph" title="">Ů</span> </td> <tr id="entity-Uscr"><td> <code title="">Uscr;</code> </td> <td> U+1D4B0 </td> <td> <span class="glyph" title="">𝒰</span> </td> <tr id="entity-Utilde"><td> <code title="">Utilde;</code> </td> <td> U+00168 </td> <td> <span class="glyph" title="">Ũ</span> </td> <tr id="entity-Uuml"><td> <code title="">Uuml;</code> </td> <td> U+000DC </td> <td> <span class="glyph" title="">Ü</span> </td> <tr id="entity-VDash"><td> <code title="">VDash;</code> </td> <td> U+022AB </td> <td> <span class="glyph" title="">⊫</span> </td> <tr id="entity-Vbar"><td> <code title="">Vbar;</code> </td> <td> U+02AEB </td> <td> <span class="glyph" title="">⫫</span> </td> <tr id="entity-Vcy"><td> <code title="">Vcy;</code> </td> <td> U+00412 </td> <td> <span class="glyph" title="">В</span> </td> <tr id="entity-Vdash"><td> <code title="">Vdash;</code> </td> <td> U+022A9 </td> <td> <span class="glyph" title="">⊩</span> </td> <tr id="entity-Vdashl"><td> <code title="">Vdashl;</code> </td> <td> U+02AE6 </td> <td> <span class="glyph" title="">⫦</span> </td> <tr id="entity-Vee"><td> <code title="">Vee;</code> </td> <td> U+022C1 </td> <td> <span class="glyph" title="">⋁</span> </td> <tr id="entity-Verbar"><td> <code title="">Verbar;</code> </td> <td> U+02016 </td> <td> <span class="glyph" title="">‖</span> </td> <tr id="entity-Vert"><td> <code title="">Vert;</code> </td> <td> U+02016 </td> <td> <span class="glyph" title="">‖</span> </td> <tr id="entity-VerticalBar"><td> <code title="">VerticalBar;</code> </td> <td> U+02223 </td> <td> <span class="glyph" title="">∣</span> </td> <tr id="entity-VerticalLine"><td> <code title="">VerticalLine;</code> </td> <td> U+0007C </td> <td> <span class="glyph" title="">|</span> </td> <tr id="entity-VerticalSeparator"><td> <code title="">VerticalSeparator;</code> </td> <td> U+02758 </td> <td> <span class="glyph" title="">❘</span> </td> <tr id="entity-VerticalTilde"><td> <code title="">VerticalTilde;</code> </td> <td> U+02240 </td> <td> <span class="glyph" title="">≀</span> </td> <tr id="entity-VeryThinSpace"><td> <code title="">VeryThinSpace;</code> </td> <td> U+0200A </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-Vfr"><td> <code title="">Vfr;</code> </td> <td> U+1D519 </td> <td> <span class="glyph" title="">𝔙</span> </td> <tr id="entity-Vopf"><td> <code title="">Vopf;</code> </td> <td> U+1D54D </td> <td> <span class="glyph" title="">𝕍</span> </td> <tr id="entity-Vscr"><td> <code title="">Vscr;</code> </td> <td> U+1D4B1 </td> <td> <span class="glyph" title="">𝒱</span> </td> <tr id="entity-Vvdash"><td> <code title="">Vvdash;</code> </td> <td> U+022AA </td> <td> <span class="glyph" title="">⊪</span> </td> <tr id="entity-Wcirc"><td> <code title="">Wcirc;</code> </td> <td> U+00174 </td> <td> <span class="glyph" title="">Ŵ</span> </td> <tr id="entity-Wedge"><td> <code title="">Wedge;</code> </td> <td> U+022C0 </td> <td> <span class="glyph" title="">⋀</span> </td> <tr id="entity-Wfr"><td> <code title="">Wfr;</code> </td> <td> U+1D51A </td> <td> <span class="glyph" title="">𝔚</span> </td> <tr id="entity-Wopf"><td> <code title="">Wopf;</code> </td> <td> U+1D54E </td> <td> <span class="glyph" title="">𝕎</span> </td> <tr id="entity-Wscr"><td> <code title="">Wscr;</code> </td> <td> U+1D4B2 </td> <td> <span class="glyph" title="">𝒲</span> </td> <tr id="entity-Xfr"><td> <code title="">Xfr;</code> </td> <td> U+1D51B </td> <td> <span class="glyph" title="">𝔛</span> </td> <tr id="entity-Xi"><td> <code title="">Xi;</code> </td> <td> U+0039E </td> <td> <span class="glyph" title="">Ξ</span> </td> <tr id="entity-Xopf"><td> <code title="">Xopf;</code> </td> <td> U+1D54F </td> <td> <span class="glyph" title="">𝕏</span> </td> <tr id="entity-Xscr"><td> <code title="">Xscr;</code> </td> <td> U+1D4B3 </td> <td> <span class="glyph" title="">𝒳</span> </td> <tr id="entity-YAcy"><td> <code title="">YAcy;</code> </td> <td> U+0042F </td> <td> <span class="glyph" title="">Я</span> </td> <tr id="entity-YIcy"><td> <code title="">YIcy;</code> </td> <td> U+00407 </td> <td> <span class="glyph" title="">Ї</span> </td> <tr id="entity-YUcy"><td> <code title="">YUcy;</code> </td> <td> U+0042E </td> <td> <span class="glyph" title="">Ю</span> </td> <tr id="entity-Yacute"><td> <code title="">Yacute;</code> </td> <td> U+000DD </td> <td> <span class="glyph" title="">Ý</span> </td> <tr id="entity-Ycirc"><td> <code title="">Ycirc;</code> </td> <td> U+00176 </td> <td> <span class="glyph" title="">Ŷ</span> </td> <tr id="entity-Ycy"><td> <code title="">Ycy;</code> </td> <td> U+0042B </td> <td> <span class="glyph" title="">Ы</span> </td> <tr id="entity-Yfr"><td> <code title="">Yfr;</code> </td> <td> U+1D51C </td> <td> <span class="glyph" title="">𝔜</span> </td> <tr id="entity-Yopf"><td> <code title="">Yopf;</code> </td> <td> U+1D550 </td> <td> <span class="glyph" title="">𝕐</span> </td> <tr id="entity-Yscr"><td> <code title="">Yscr;</code> </td> <td> U+1D4B4 </td> <td> <span class="glyph" title="">𝒴</span> </td> <tr id="entity-Yuml"><td> <code title="">Yuml;</code> </td> <td> U+00178 </td> <td> <span class="glyph" title="">Ÿ</span> </td> <tr id="entity-ZHcy"><td> <code title="">ZHcy;</code> </td> <td> U+00416 </td> <td> <span class="glyph" title="">Ж</span> </td> <tr id="entity-Zacute"><td> <code title="">Zacute;</code> </td> <td> U+00179 </td> <td> <span class="glyph" title="">Ź</span> </td> <tr id="entity-Zcaron"><td> <code title="">Zcaron;</code> </td> <td> U+0017D </td> <td> <span class="glyph" title="">Ž</span> </td> <tr id="entity-Zcy"><td> <code title="">Zcy;</code> </td> <td> U+00417 </td> <td> <span class="glyph" title="">З</span> </td> <tr id="entity-Zdot"><td> <code title="">Zdot;</code> </td> <td> U+0017B </td> <td> <span class="glyph" title="">Ż</span> </td> <tr id="entity-ZeroWidthSpace"><td> <code title="">ZeroWidthSpace;</code> </td> <td> U+0200B </td> <td> <span class="glyph" title="">​</span> </td> <tr id="entity-Zeta"><td> <code title="">Zeta;</code> </td> <td> U+00396 </td> <td> <span class="glyph" title="">Ζ</span> </td> <tr id="entity-Zfr"><td> <code title="">Zfr;</code> </td> <td> U+02128 </td> <td> <span class="glyph" title="">ℨ</span> </td> <tr id="entity-Zopf"><td> <code title="">Zopf;</code> </td> <td> U+02124 </td> <td> <span class="glyph" title="">ℤ</span> </td> <tr id="entity-Zscr"><td> <code title="">Zscr;</code> </td> <td> U+1D4B5 </td> <td> <span class="glyph" title="">𝒵</span> </td> <tr id="entity-aacute"><td> <code title="">aacute;</code> </td> <td> U+000E1 </td> <td> <span class="glyph" title="">á</span> </td> <tr id="entity-abreve"><td> <code title="">abreve;</code> </td> <td> U+00103 </td> <td> <span class="glyph" title="">ă</span> </td> <tr id="entity-ac"><td> <code title="">ac;</code> </td> <td> U+0223E </td> <td> <span class="glyph" title="">∾</span> </td> <tr id="entity-acE"><td> <code title="">acE;</code> </td> <td> U+0223E U+00333 </td> <td> <span class="glyph compound" title="">∾̳</span> </td> <tr id="entity-acd"><td> <code title="">acd;</code> </td> <td> U+0223F </td> <td> <span class="glyph" title="">∿</span> </td> <tr id="entity-acirc"><td> <code title="">acirc;</code> </td> <td> U+000E2 </td> <td> <span class="glyph" title="">â</span> </td> <tr id="entity-acute"><td> <code title="">acute;</code> </td> <td> U+000B4 </td> <td> <span class="glyph" title="">´</span> </td> <tr id="entity-acy"><td> <code title="">acy;</code> </td> <td> U+00430 </td> <td> <span class="glyph" title="">а</span> </td> <tr id="entity-aelig"><td> <code title="">aelig;</code> </td> <td> U+000E6 </td> <td> <span class="glyph" title="">æ</span> </td> <tr id="entity-af"><td> <code title="">af;</code> </td> <td> U+02061 </td> <td> <span class="glyph" title="">⁡</span> </td> <tr id="entity-afr"><td> <code title="">afr;</code> </td> <td> U+1D51E </td> <td> <span class="glyph" title="">𝔞</span> </td> <tr id="entity-agrave"><td> <code title="">agrave;</code> </td> <td> U+000E0 </td> <td> <span class="glyph" title="">à</span> </td> <tr id="entity-alefsym"><td> <code title="">alefsym;</code> </td> <td> U+02135 </td> <td> <span class="glyph" title="">ℵ</span> </td> <tr id="entity-aleph"><td> <code title="">aleph;</code> </td> <td> U+02135 </td> <td> <span class="glyph" title="">ℵ</span> </td> <tr id="entity-alpha"><td> <code title="">alpha;</code> </td> <td> U+003B1 </td> <td> <span class="glyph" title="">α</span> </td> <tr id="entity-amacr"><td> <code title="">amacr;</code> </td> <td> U+00101 </td> <td> <span class="glyph" title="">ā</span> </td> <tr id="entity-amalg"><td> <code title="">amalg;</code> </td> <td> U+02A3F </td> <td> <span class="glyph" title="">⨿</span> </td> <tr id="entity-amp"><td> <code title="">amp;</code> </td> <td> U+00026 </td> <td> <span class="glyph" title="">&</span> </td> <tr id="entity-and"><td> <code title="">and;</code> </td> <td> U+02227 </td> <td> <span class="glyph" title="">∧</span> </td> <tr id="entity-andand"><td> <code title="">andand;</code> </td> <td> U+02A55 </td> <td> <span class="glyph" title="">⩕</span> </td> <tr id="entity-andd"><td> <code title="">andd;</code> </td> <td> U+02A5C </td> <td> <span class="glyph" title="">⩜</span> </td> <tr id="entity-andslope"><td> <code title="">andslope;</code> </td> <td> U+02A58 </td> <td> <span class="glyph" title="">⩘</span> </td> <tr id="entity-andv"><td> <code title="">andv;</code> </td> <td> U+02A5A </td> <td> <span class="glyph" title="">⩚</span> </td> <tr id="entity-ang"><td> <code title="">ang;</code> </td> <td> U+02220 </td> <td> <span class="glyph" title="">∠</span> </td> <tr id="entity-ange"><td> <code title="">ange;</code> </td> <td> U+029A4 </td> <td> <span class="glyph" title="">⦤</span> </td> <tr id="entity-angle"><td> <code title="">angle;</code> </td> <td> U+02220 </td> <td> <span class="glyph" title="">∠</span> </td> <tr id="entity-angmsd"><td> <code title="">angmsd;</code> </td> <td> U+02221 </td> <td> <span class="glyph" title="">∡</span> </td> <tr id="entity-angmsdaa"><td> <code title="">angmsdaa;</code> </td> <td> U+029A8 </td> <td> <span class="glyph" title="">⦨</span> </td> <tr id="entity-angmsdab"><td> <code title="">angmsdab;</code> </td> <td> U+029A9 </td> <td> <span class="glyph" title="">⦩</span> </td> <tr id="entity-angmsdac"><td> <code title="">angmsdac;</code> </td> <td> U+029AA </td> <td> <span class="glyph" title="">⦪</span> </td> <tr id="entity-angmsdad"><td> <code title="">angmsdad;</code> </td> <td> U+029AB </td> <td> <span class="glyph" title="">⦫</span> </td> <tr id="entity-angmsdae"><td> <code title="">angmsdae;</code> </td> <td> U+029AC </td> <td> <span class="glyph" title="">⦬</span> </td> <tr id="entity-angmsdaf"><td> <code title="">angmsdaf;</code> </td> <td> U+029AD </td> <td> <span class="glyph" title="">⦭</span> </td> <tr id="entity-angmsdag"><td> <code title="">angmsdag;</code> </td> <td> U+029AE </td> <td> <span class="glyph" title="">⦮</span> </td> <tr id="entity-angmsdah"><td> <code title="">angmsdah;</code> </td> <td> U+029AF </td> <td> <span class="glyph" title="">⦯</span> </td> <tr id="entity-angrt"><td> <code title="">angrt;</code> </td> <td> U+0221F </td> <td> <span class="glyph" title="">∟</span> </td> <tr id="entity-angrtvb"><td> <code title="">angrtvb;</code> </td> <td> U+022BE </td> <td> <span class="glyph" title="">⊾</span> </td> <tr id="entity-angrtvbd"><td> <code title="">angrtvbd;</code> </td> <td> U+0299D </td> <td> <span class="glyph" title="">⦝</span> </td> <tr id="entity-angsph"><td> <code title="">angsph;</code> </td> <td> U+02222 </td> <td> <span class="glyph" title="">∢</span> </td> <tr id="entity-angst"><td> <code title="">angst;</code> </td> <td> U+000C5 </td> <td> <span class="glyph" title="">Å</span> </td> <tr id="entity-angzarr"><td> <code title="">angzarr;</code> </td> <td> U+0237C </td> <td> <span class="glyph" title="">⍼</span> </td> <tr id="entity-aogon"><td> <code title="">aogon;</code> </td> <td> U+00105 </td> <td> <span class="glyph" title="">ą</span> </td> <tr id="entity-aopf"><td> <code title="">aopf;</code> </td> <td> U+1D552 </td> <td> <span class="glyph" title="">𝕒</span> </td> <tr id="entity-ap"><td> <code title="">ap;</code> </td> <td> U+02248 </td> <td> <span class="glyph" title="">≈</span> </td> <tr id="entity-apE"><td> <code title="">apE;</code> </td> <td> U+02A70 </td> <td> <span class="glyph" title="">⩰</span> </td> <tr id="entity-apacir"><td> <code title="">apacir;</code> </td> <td> U+02A6F </td> <td> <span class="glyph" title="">⩯</span> </td> <tr id="entity-ape"><td> <code title="">ape;</code> </td> <td> U+0224A </td> <td> <span class="glyph" title="">≊</span> </td> <tr id="entity-apid"><td> <code title="">apid;</code> </td> <td> U+0224B </td> <td> <span class="glyph" title="">≋</span> </td> <tr id="entity-apos"><td> <code title="">apos;</code> </td> <td> U+00027 </td> <td> <span class="glyph" title="">'</span> </td> <tr id="entity-approx"><td> <code title="">approx;</code> </td> <td> U+02248 </td> <td> <span class="glyph" title="">≈</span> </td> <tr id="entity-approxeq"><td> <code title="">approxeq;</code> </td> <td> U+0224A </td> <td> <span class="glyph" title="">≊</span> </td> <tr id="entity-aring"><td> <code title="">aring;</code> </td> <td> U+000E5 </td> <td> <span class="glyph" title="">å</span> </td> <tr id="entity-ascr"><td> <code title="">ascr;</code> </td> <td> U+1D4B6 </td> <td> <span class="glyph" title="">𝒶</span> </td> <tr id="entity-ast"><td> <code title="">ast;</code> </td> <td> U+0002A </td> <td> <span class="glyph" title="">*</span> </td> <tr id="entity-asymp"><td> <code title="">asymp;</code> </td> <td> U+02248 </td> <td> <span class="glyph" title="">≈</span> </td> <tr id="entity-asympeq"><td> <code title="">asympeq;</code> </td> <td> U+0224D </td> <td> <span class="glyph" title="">≍</span> </td> <tr id="entity-atilde"><td> <code title="">atilde;</code> </td> <td> U+000E3 </td> <td> <span class="glyph" title="">ã</span> </td> <tr id="entity-auml"><td> <code title="">auml;</code> </td> <td> U+000E4 </td> <td> <span class="glyph" title="">ä</span> </td> <tr id="entity-awconint"><td> <code title="">awconint;</code> </td> <td> U+02233 </td> <td> <span class="glyph" title="">∳</span> </td> <tr id="entity-awint"><td> <code title="">awint;</code> </td> <td> U+02A11 </td> <td> <span class="glyph" title="">⨑</span> </td> <tr id="entity-bNot"><td> <code title="">bNot;</code> </td> <td> U+02AED </td> <td> <span class="glyph" title="">⫭</span> </td> <tr id="entity-backcong"><td> <code title="">backcong;</code> </td> <td> U+0224C </td> <td> <span class="glyph" title="">≌</span> </td> <tr id="entity-backepsilon"><td> <code title="">backepsilon;</code> </td> <td> U+003F6 </td> <td> <span class="glyph" title="">϶</span> </td> <tr id="entity-backprime"><td> <code title="">backprime;</code> </td> <td> U+02035 </td> <td> <span class="glyph" title="">‵</span> </td> <tr id="entity-backsim"><td> <code title="">backsim;</code> </td> <td> U+0223D </td> <td> <span class="glyph" title="">∽</span> </td> <tr id="entity-backsimeq"><td> <code title="">backsimeq;</code> </td> <td> U+022CD </td> <td> <span class="glyph" title="">⋍</span> </td> <tr id="entity-barvee"><td> <code title="">barvee;</code> </td> <td> U+022BD </td> <td> <span class="glyph" title="">⊽</span> </td> <tr id="entity-barwed"><td> <code title="">barwed;</code> </td> <td> U+02305 </td> <td> <span class="glyph" title="">⌅</span> </td> <tr id="entity-barwedge"><td> <code title="">barwedge;</code> </td> <td> U+02305 </td> <td> <span class="glyph" title="">⌅</span> </td> <tr id="entity-bbrk"><td> <code title="">bbrk;</code> </td> <td> U+023B5 </td> <td> <span class="glyph" title="">⎵</span> </td> <tr id="entity-bbrktbrk"><td> <code title="">bbrktbrk;</code> </td> <td> U+023B6 </td> <td> <span class="glyph" title="">⎶</span> </td> <tr id="entity-bcong"><td> <code title="">bcong;</code> </td> <td> U+0224C </td> <td> <span class="glyph" title="">≌</span> </td> <tr id="entity-bcy"><td> <code title="">bcy;</code> </td> <td> U+00431 </td> <td> <span class="glyph" title="">б</span> </td> <tr id="entity-bdquo"><td> <code title="">bdquo;</code> </td> <td> U+0201E </td> <td> <span class="glyph" title="">„</span> </td> <tr id="entity-becaus"><td> <code title="">becaus;</code> </td> <td> U+02235 </td> <td> <span class="glyph" title="">∵</span> </td> <tr id="entity-because"><td> <code title="">because;</code> </td> <td> U+02235 </td> <td> <span class="glyph" title="">∵</span> </td> <tr id="entity-bemptyv"><td> <code title="">bemptyv;</code> </td> <td> U+029B0 </td> <td> <span class="glyph" title="">⦰</span> </td> <tr id="entity-bepsi"><td> <code title="">bepsi;</code> </td> <td> U+003F6 </td> <td> <span class="glyph" title="">϶</span> </td> <tr id="entity-bernou"><td> <code title="">bernou;</code> </td> <td> U+0212C </td> <td> <span class="glyph" title="">ℬ</span> </td> <tr id="entity-beta"><td> <code title="">beta;</code> </td> <td> U+003B2 </td> <td> <span class="glyph" title="">β</span> </td> <tr id="entity-beth"><td> <code title="">beth;</code> </td> <td> U+02136 </td> <td> <span class="glyph" title="">ℶ</span> </td> <tr id="entity-between"><td> <code title="">between;</code> </td> <td> U+0226C </td> <td> <span class="glyph" title="">≬</span> </td> <tr id="entity-bfr"><td> <code title="">bfr;</code> </td> <td> U+1D51F </td> <td> <span class="glyph" title="">𝔟</span> </td> <tr id="entity-bigcap"><td> <code title="">bigcap;</code> </td> <td> U+022C2 </td> <td> <span class="glyph" title="">⋂</span> </td> <tr id="entity-bigcirc"><td> <code title="">bigcirc;</code> </td> <td> U+025EF </td> <td> <span class="glyph" title="">◯</span> </td> <tr id="entity-bigcup"><td> <code title="">bigcup;</code> </td> <td> U+022C3 </td> <td> <span class="glyph" title="">⋃</span> </td> <tr id="entity-bigodot"><td> <code title="">bigodot;</code> </td> <td> U+02A00 </td> <td> <span class="glyph" title="">⨀</span> </td> <tr id="entity-bigoplus"><td> <code title="">bigoplus;</code> </td> <td> U+02A01 </td> <td> <span class="glyph" title="">⨁</span> </td> <tr id="entity-bigotimes"><td> <code title="">bigotimes;</code> </td> <td> U+02A02 </td> <td> <span class="glyph" title="">⨂</span> </td> <tr id="entity-bigsqcup"><td> <code title="">bigsqcup;</code> </td> <td> U+02A06 </td> <td> <span class="glyph" title="">⨆</span> </td> <tr id="entity-bigstar"><td> <code title="">bigstar;</code> </td> <td> U+02605 </td> <td> <span class="glyph" title="">★</span> </td> <tr id="entity-bigtriangledown"><td> <code title="">bigtriangledown;</code> </td> <td> U+025BD </td> <td> <span class="glyph" title="">▽</span> </td> <tr id="entity-bigtriangleup"><td> <code title="">bigtriangleup;</code> </td> <td> U+025B3 </td> <td> <span class="glyph" title="">△</span> </td> <tr id="entity-biguplus"><td> <code title="">biguplus;</code> </td> <td> U+02A04 </td> <td> <span class="glyph" title="">⨄</span> </td> <tr id="entity-bigvee"><td> <code title="">bigvee;</code> </td> <td> U+022C1 </td> <td> <span class="glyph" title="">⋁</span> </td> <tr id="entity-bigwedge"><td> <code title="">bigwedge;</code> </td> <td> U+022C0 </td> <td> <span class="glyph" title="">⋀</span> </td> <tr id="entity-bkarow"><td> <code title="">bkarow;</code> </td> <td> U+0290D </td> <td> <span class="glyph" title="">⤍</span> </td> <tr id="entity-blacklozenge"><td> <code title="">blacklozenge;</code> </td> <td> U+029EB </td> <td> <span class="glyph" title="">⧫</span> </td> <tr id="entity-blacksquare"><td> <code title="">blacksquare;</code> </td> <td> U+025AA </td> <td> <span class="glyph" title="">▪</span> </td> <tr id="entity-blacktriangle"><td> <code title="">blacktriangle;</code> </td> <td> U+025B4 </td> <td> <span class="glyph" title="">▴</span> </td> <tr id="entity-blacktriangledown"><td> <code title="">blacktriangledown;</code> </td> <td> U+025BE </td> <td> <span class="glyph" title="">▾</span> </td> <tr id="entity-blacktriangleleft"><td> <code title="">blacktriangleleft;</code> </td> <td> U+025C2 </td> <td> <span class="glyph" title="">◂</span> </td> <tr id="entity-blacktriangleright"><td> <code title="">blacktriangleright;</code> </td> <td> U+025B8 </td> <td> <span class="glyph" title="">▸</span> </td> <tr id="entity-blank"><td> <code title="">blank;</code> </td> <td> U+02423 </td> <td> <span class="glyph" title="">␣</span> </td> <tr id="entity-blk12"><td> <code title="">blk12;</code> </td> <td> U+02592 </td> <td> <span class="glyph" title="">▒</span> </td> <tr id="entity-blk14"><td> <code title="">blk14;</code> </td> <td> U+02591 </td> <td> <span class="glyph" title="">░</span> </td> <tr id="entity-blk34"><td> <code title="">blk34;</code> </td> <td> U+02593 </td> <td> <span class="glyph" title="">▓</span> </td> <tr id="entity-block"><td> <code title="">block;</code> </td> <td> U+02588 </td> <td> <span class="glyph" title="">█</span> </td> <tr id="entity-bne"><td> <code title="">bne;</code> </td> <td> U+0003D U+020E5 </td> <td> <span class="glyph compound" title="">=⃥</span> </td> <tr id="entity-bnequiv"><td> <code title="">bnequiv;</code> </td> <td> U+02261 U+020E5 </td> <td> <span class="glyph compound" title="">≡⃥</span> </td> <tr id="entity-bnot"><td> <code title="">bnot;</code> </td> <td> U+02310 </td> <td> <span class="glyph" title="">⌐</span> </td> <tr id="entity-bopf"><td> <code title="">bopf;</code> </td> <td> U+1D553 </td> <td> <span class="glyph" title="">𝕓</span> </td> <tr id="entity-bot"><td> <code title="">bot;</code> </td> <td> U+022A5 </td> <td> <span class="glyph" title="">⊥</span> </td> <tr id="entity-bottom"><td> <code title="">bottom;</code> </td> <td> U+022A5 </td> <td> <span class="glyph" title="">⊥</span> </td> <tr id="entity-bowtie"><td> <code title="">bowtie;</code> </td> <td> U+022C8 </td> <td> <span class="glyph" title="">⋈</span> </td> <tr id="entity-boxDL"><td> <code title="">boxDL;</code> </td> <td> U+02557 </td> <td> <span class="glyph" title="">╗</span> </td> <tr id="entity-boxDR"><td> <code title="">boxDR;</code> </td> <td> U+02554 </td> <td> <span class="glyph" title="">╔</span> </td> <tr id="entity-boxDl"><td> <code title="">boxDl;</code> </td> <td> U+02556 </td> <td> <span class="glyph" title="">╖</span> </td> <tr id="entity-boxDr"><td> <code title="">boxDr;</code> </td> <td> U+02553 </td> <td> <span class="glyph" title="">╓</span> </td> <tr id="entity-boxH"><td> <code title="">boxH;</code> </td> <td> U+02550 </td> <td> <span class="glyph" title="">═</span> </td> <tr id="entity-boxHD"><td> <code title="">boxHD;</code> </td> <td> U+02566 </td> <td> <span class="glyph" title="">╦</span> </td> <tr id="entity-boxHU"><td> <code title="">boxHU;</code> </td> <td> U+02569 </td> <td> <span class="glyph" title="">╩</span> </td> <tr id="entity-boxHd"><td> <code title="">boxHd;</code> </td> <td> U+02564 </td> <td> <span class="glyph" title="">╤</span> </td> <tr id="entity-boxHu"><td> <code title="">boxHu;</code> </td> <td> U+02567 </td> <td> <span class="glyph" title="">╧</span> </td> <tr id="entity-boxUL"><td> <code title="">boxUL;</code> </td> <td> U+0255D </td> <td> <span class="glyph" title="">╝</span> </td> <tr id="entity-boxUR"><td> <code title="">boxUR;</code> </td> <td> U+0255A </td> <td> <span class="glyph" title="">╚</span> </td> <tr id="entity-boxUl"><td> <code title="">boxUl;</code> </td> <td> U+0255C </td> <td> <span class="glyph" title="">╜</span> </td> <tr id="entity-boxUr"><td> <code title="">boxUr;</code> </td> <td> U+02559 </td> <td> <span class="glyph" title="">╙</span> </td> <tr id="entity-boxV"><td> <code title="">boxV;</code> </td> <td> U+02551 </td> <td> <span class="glyph" title="">║</span> </td> <tr id="entity-boxVH"><td> <code title="">boxVH;</code> </td> <td> U+0256C </td> <td> <span class="glyph" title="">╬</span> </td> <tr id="entity-boxVL"><td> <code title="">boxVL;</code> </td> <td> U+02563 </td> <td> <span class="glyph" title="">╣</span> </td> <tr id="entity-boxVR"><td> <code title="">boxVR;</code> </td> <td> U+02560 </td> <td> <span class="glyph" title="">╠</span> </td> <tr id="entity-boxVh"><td> <code title="">boxVh;</code> </td> <td> U+0256B </td> <td> <span class="glyph" title="">╫</span> </td> <tr id="entity-boxVl"><td> <code title="">boxVl;</code> </td> <td> U+02562 </td> <td> <span class="glyph" title="">╢</span> </td> <tr id="entity-boxVr"><td> <code title="">boxVr;</code> </td> <td> U+0255F </td> <td> <span class="glyph" title="">╟</span> </td> <tr id="entity-boxbox"><td> <code title="">boxbox;</code> </td> <td> U+029C9 </td> <td> <span class="glyph" title="">⧉</span> </td> <tr id="entity-boxdL"><td> <code title="">boxdL;</code> </td> <td> U+02555 </td> <td> <span class="glyph" title="">╕</span> </td> <tr id="entity-boxdR"><td> <code title="">boxdR;</code> </td> <td> U+02552 </td> <td> <span class="glyph" title="">╒</span> </td> <tr id="entity-boxdl"><td> <code title="">boxdl;</code> </td> <td> U+02510 </td> <td> <span class="glyph" title="">┐</span> </td> <tr id="entity-boxdr"><td> <code title="">boxdr;</code> </td> <td> U+0250C </td> <td> <span class="glyph" title="">┌</span> </td> <tr id="entity-boxh"><td> <code title="">boxh;</code> </td> <td> U+02500 </td> <td> <span class="glyph" title="">─</span> </td> <tr id="entity-boxhD"><td> <code title="">boxhD;</code> </td> <td> U+02565 </td> <td> <span class="glyph" title="">╥</span> </td> <tr id="entity-boxhU"><td> <code title="">boxhU;</code> </td> <td> U+02568 </td> <td> <span class="glyph" title="">╨</span> </td> <tr id="entity-boxhd"><td> <code title="">boxhd;</code> </td> <td> U+0252C </td> <td> <span class="glyph" title="">┬</span> </td> <tr id="entity-boxhu"><td> <code title="">boxhu;</code> </td> <td> U+02534 </td> <td> <span class="glyph" title="">┴</span> </td> <tr id="entity-boxminus"><td> <code title="">boxminus;</code> </td> <td> U+0229F </td> <td> <span class="glyph" title="">⊟</span> </td> <tr id="entity-boxplus"><td> <code title="">boxplus;</code> </td> <td> U+0229E </td> <td> <span class="glyph" title="">⊞</span> </td> <tr id="entity-boxtimes"><td> <code title="">boxtimes;</code> </td> <td> U+022A0 </td> <td> <span class="glyph" title="">⊠</span> </td> <tr id="entity-boxuL"><td> <code title="">boxuL;</code> </td> <td> U+0255B </td> <td> <span class="glyph" title="">╛</span> </td> <tr id="entity-boxuR"><td> <code title="">boxuR;</code> </td> <td> U+02558 </td> <td> <span class="glyph" title="">╘</span> </td> <tr id="entity-boxul"><td> <code title="">boxul;</code> </td> <td> U+02518 </td> <td> <span class="glyph" title="">┘</span> </td> <tr id="entity-boxur"><td> <code title="">boxur;</code> </td> <td> U+02514 </td> <td> <span class="glyph" title="">└</span> </td> <tr id="entity-boxv"><td> <code title="">boxv;</code> </td> <td> U+02502 </td> <td> <span class="glyph" title="">│</span> </td> <tr id="entity-boxvH"><td> <code title="">boxvH;</code> </td> <td> U+0256A </td> <td> <span class="glyph" title="">╪</span> </td> <tr id="entity-boxvL"><td> <code title="">boxvL;</code> </td> <td> U+02561 </td> <td> <span class="glyph" title="">╡</span> </td> <tr id="entity-boxvR"><td> <code title="">boxvR;</code> </td> <td> U+0255E </td> <td> <span class="glyph" title="">╞</span> </td> <tr id="entity-boxvh"><td> <code title="">boxvh;</code> </td> <td> U+0253C </td> <td> <span class="glyph" title="">┼</span> </td> <tr id="entity-boxvl"><td> <code title="">boxvl;</code> </td> <td> U+02524 </td> <td> <span class="glyph" title="">┤</span> </td> <tr id="entity-boxvr"><td> <code title="">boxvr;</code> </td> <td> U+0251C </td> <td> <span class="glyph" title="">├</span> </td> <tr id="entity-bprime"><td> <code title="">bprime;</code> </td> <td> U+02035 </td> <td> <span class="glyph" title="">‵</span> </td> <tr id="entity-breve"><td> <code title="">breve;</code> </td> <td> U+002D8 </td> <td> <span class="glyph" title="">˘</span> </td> <tr id="entity-brvbar"><td> <code title="">brvbar;</code> </td> <td> U+000A6 </td> <td> <span class="glyph" title="">¦</span> </td> <tr id="entity-bscr"><td> <code title="">bscr;</code> </td> <td> U+1D4B7 </td> <td> <span class="glyph" title="">𝒷</span> </td> <tr id="entity-bsemi"><td> <code title="">bsemi;</code> </td> <td> U+0204F </td> <td> <span class="glyph" title="">⁏</span> </td> <tr id="entity-bsim"><td> <code title="">bsim;</code> </td> <td> U+0223D </td> <td> <span class="glyph" title="">∽</span> </td> <tr id="entity-bsime"><td> <code title="">bsime;</code> </td> <td> U+022CD </td> <td> <span class="glyph" title="">⋍</span> </td> <tr id="entity-bsol"><td> <code title="">bsol;</code> </td> <td> U+0005C </td> <td> <span class="glyph" title="">\</span> </td> <tr id="entity-bsolb"><td> <code title="">bsolb;</code> </td> <td> U+029C5 </td> <td> <span class="glyph" title="">⧅</span> </td> <tr id="entity-bsolhsub"><td> <code title="">bsolhsub;</code> </td> <td> U+027C8 </td> <td> <span class="glyph" title="">⟈</span> </td> <tr id="entity-bull"><td> <code title="">bull;</code> </td> <td> U+02022 </td> <td> <span class="glyph" title="">•</span> </td> <tr id="entity-bullet"><td> <code title="">bullet;</code> </td> <td> U+02022 </td> <td> <span class="glyph" title="">•</span> </td> <tr id="entity-bump"><td> <code title="">bump;</code> </td> <td> U+0224E </td> <td> <span class="glyph" title="">≎</span> </td> <tr id="entity-bumpE"><td> <code title="">bumpE;</code> </td> <td> U+02AAE </td> <td> <span class="glyph" title="">⪮</span> </td> <tr id="entity-bumpe"><td> <code title="">bumpe;</code> </td> <td> U+0224F </td> <td> <span class="glyph" title="">≏</span> </td> <tr id="entity-bumpeq"><td> <code title="">bumpeq;</code> </td> <td> U+0224F </td> <td> <span class="glyph" title="">≏</span> </td> <tr id="entity-cacute"><td> <code title="">cacute;</code> </td> <td> U+00107 </td> <td> <span class="glyph" title="">ć</span> </td> <tr id="entity-cap"><td> <code title="">cap;</code> </td> <td> U+02229 </td> <td> <span class="glyph" title="">∩</span> </td> <tr id="entity-capand"><td> <code title="">capand;</code> </td> <td> U+02A44 </td> <td> <span class="glyph" title="">⩄</span> </td> <tr id="entity-capbrcup"><td> <code title="">capbrcup;</code> </td> <td> U+02A49 </td> <td> <span class="glyph" title="">⩉</span> </td> <tr id="entity-capcap"><td> <code title="">capcap;</code> </td> <td> U+02A4B </td> <td> <span class="glyph" title="">⩋</span> </td> <tr id="entity-capcup"><td> <code title="">capcup;</code> </td> <td> U+02A47 </td> <td> <span class="glyph" title="">⩇</span> </td> <tr id="entity-capdot"><td> <code title="">capdot;</code> </td> <td> U+02A40 </td> <td> <span class="glyph" title="">⩀</span> </td> <tr id="entity-caps"><td> <code title="">caps;</code> </td> <td> U+02229 U+0FE00 </td> <td> <span class="glyph compound" title="">∩︀</span> </td> <tr id="entity-caret"><td> <code title="">caret;</code> </td> <td> U+02041 </td> <td> <span class="glyph" title="">⁁</span> </td> <tr id="entity-caron"><td> <code title="">caron;</code> </td> <td> U+002C7 </td> <td> <span class="glyph" title="">ˇ</span> </td> <tr id="entity-ccaps"><td> <code title="">ccaps;</code> </td> <td> U+02A4D </td> <td> <span class="glyph" title="">⩍</span> </td> <tr id="entity-ccaron"><td> <code title="">ccaron;</code> </td> <td> U+0010D </td> <td> <span class="glyph" title="">č</span> </td> <tr id="entity-ccedil"><td> <code title="">ccedil;</code> </td> <td> U+000E7 </td> <td> <span class="glyph" title="">ç</span> </td> <tr id="entity-ccirc"><td> <code title="">ccirc;</code> </td> <td> U+00109 </td> <td> <span class="glyph" title="">ĉ</span> </td> <tr id="entity-ccups"><td> <code title="">ccups;</code> </td> <td> U+02A4C </td> <td> <span class="glyph" title="">⩌</span> </td> <tr id="entity-ccupssm"><td> <code title="">ccupssm;</code> </td> <td> U+02A50 </td> <td> <span class="glyph" title="">⩐</span> </td> <tr id="entity-cdot"><td> <code title="">cdot;</code> </td> <td> U+0010B </td> <td> <span class="glyph" title="">ċ</span> </td> <tr id="entity-cedil"><td> <code title="">cedil;</code> </td> <td> U+000B8 </td> <td> <span class="glyph" title="">¸</span> </td> <tr id="entity-cemptyv"><td> <code title="">cemptyv;</code> </td> <td> U+029B2 </td> <td> <span class="glyph" title="">⦲</span> </td> <tr id="entity-cent"><td> <code title="">cent;</code> </td> <td> U+000A2 </td> <td> <span class="glyph" title="">¢</span> </td> <tr id="entity-centerdot"><td> <code title="">centerdot;</code> </td> <td> U+000B7 </td> <td> <span class="glyph" title="">·</span> </td> <tr id="entity-cfr"><td> <code title="">cfr;</code> </td> <td> U+1D520 </td> <td> <span class="glyph" title="">𝔠</span> </td> <tr id="entity-chcy"><td> <code title="">chcy;</code> </td> <td> U+00447 </td> <td> <span class="glyph" title="">ч</span> </td> <tr id="entity-check"><td> <code title="">check;</code> </td> <td> U+02713 </td> <td> <span class="glyph" title="">✓</span> </td> <tr id="entity-checkmark"><td> <code title="">checkmark;</code> </td> <td> U+02713 </td> <td> <span class="glyph" title="">✓</span> </td> <tr id="entity-chi"><td> <code title="">chi;</code> </td> <td> U+003C7 </td> <td> <span class="glyph" title="">χ</span> </td> <tr id="entity-cir"><td> <code title="">cir;</code> </td> <td> U+025CB </td> <td> <span class="glyph" title="">○</span> </td> <tr id="entity-cirE"><td> <code title="">cirE;</code> </td> <td> U+029C3 </td> <td> <span class="glyph" title="">⧃</span> </td> <tr id="entity-circ"><td> <code title="">circ;</code> </td> <td> U+002C6 </td> <td> <span class="glyph" title="">ˆ</span> </td> <tr id="entity-circeq"><td> <code title="">circeq;</code> </td> <td> U+02257 </td> <td> <span class="glyph" title="">≗</span> </td> <tr id="entity-circlearrowleft"><td> <code title="">circlearrowleft;</code> </td> <td> U+021BA </td> <td> <span class="glyph" title="">↺</span> </td> <tr id="entity-circlearrowright"><td> <code title="">circlearrowright;</code> </td> <td> U+021BB </td> <td> <span class="glyph" title="">↻</span> </td> <tr id="entity-circledR"><td> <code title="">circledR;</code> </td> <td> U+000AE </td> <td> <span class="glyph" title="">®</span> </td> <tr id="entity-circledS"><td> <code title="">circledS;</code> </td> <td> U+024C8 </td> <td> <span class="glyph" title="">Ⓢ</span> </td> <tr id="entity-circledast"><td> <code title="">circledast;</code> </td> <td> U+0229B </td> <td> <span class="glyph" title="">⊛</span> </td> <tr id="entity-circledcirc"><td> <code title="">circledcirc;</code> </td> <td> U+0229A </td> <td> <span class="glyph" title="">⊚</span> </td> <tr id="entity-circleddash"><td> <code title="">circleddash;</code> </td> <td> U+0229D </td> <td> <span class="glyph" title="">⊝</span> </td> <tr id="entity-cire"><td> <code title="">cire;</code> </td> <td> U+02257 </td> <td> <span class="glyph" title="">≗</span> </td> <tr id="entity-cirfnint"><td> <code title="">cirfnint;</code> </td> <td> U+02A10 </td> <td> <span class="glyph" title="">⨐</span> </td> <tr id="entity-cirmid"><td> <code title="">cirmid;</code> </td> <td> U+02AEF </td> <td> <span class="glyph" title="">⫯</span> </td> <tr id="entity-cirscir"><td> <code title="">cirscir;</code> </td> <td> U+029C2 </td> <td> <span class="glyph" title="">⧂</span> </td> <tr id="entity-clubs"><td> <code title="">clubs;</code> </td> <td> U+02663 </td> <td> <span class="glyph" title="">♣</span> </td> <tr id="entity-clubsuit"><td> <code title="">clubsuit;</code> </td> <td> U+02663 </td> <td> <span class="glyph" title="">♣</span> </td> <tr id="entity-colon"><td> <code title="">colon;</code> </td> <td> U+0003A </td> <td> <span class="glyph" title="">:</span> </td> <tr id="entity-colone"><td> <code title="">colone;</code> </td> <td> U+02254 </td> <td> <span class="glyph" title="">≔</span> </td> <tr id="entity-coloneq"><td> <code title="">coloneq;</code> </td> <td> U+02254 </td> <td> <span class="glyph" title="">≔</span> </td> <tr id="entity-comma"><td> <code title="">comma;</code> </td> <td> U+0002C </td> <td> <span class="glyph" title="">,</span> </td> <tr id="entity-commat"><td> <code title="">commat;</code> </td> <td> U+00040 </td> <td> <span class="glyph" title="">@</span> </td> <tr id="entity-comp"><td> <code title="">comp;</code> </td> <td> U+02201 </td> <td> <span class="glyph" title="">∁</span> </td> <tr id="entity-compfn"><td> <code title="">compfn;</code> </td> <td> U+02218 </td> <td> <span class="glyph" title="">∘</span> </td> <tr id="entity-complement"><td> <code title="">complement;</code> </td> <td> U+02201 </td> <td> <span class="glyph" title="">∁</span> </td> <tr id="entity-complexes"><td> <code title="">complexes;</code> </td> <td> U+02102 </td> <td> <span class="glyph" title="">ℂ</span> </td> <tr id="entity-cong"><td> <code title="">cong;</code> </td> <td> U+02245 </td> <td> <span class="glyph" title="">≅</span> </td> <tr id="entity-congdot"><td> <code title="">congdot;</code> </td> <td> U+02A6D </td> <td> <span class="glyph" title="">⩭</span> </td> <tr id="entity-conint"><td> <code title="">conint;</code> </td> <td> U+0222E </td> <td> <span class="glyph" title="">∮</span> </td> <tr id="entity-copf"><td> <code title="">copf;</code> </td> <td> U+1D554 </td> <td> <span class="glyph" title="">𝕔</span> </td> <tr id="entity-coprod"><td> <code title="">coprod;</code> </td> <td> U+02210 </td> <td> <span class="glyph" title="">∐</span> </td> <tr id="entity-copy"><td> <code title="">copy;</code> </td> <td> U+000A9 </td> <td> <span class="glyph" title="">©</span> </td> <tr id="entity-copysr"><td> <code title="">copysr;</code> </td> <td> U+02117 </td> <td> <span class="glyph" title="">℗</span> </td> <tr id="entity-crarr"><td> <code title="">crarr;</code> </td> <td> U+021B5 </td> <td> <span class="glyph" title="">↵</span> </td> <tr id="entity-cross"><td> <code title="">cross;</code> </td> <td> U+02717 </td> <td> <span class="glyph" title="">✗</span> </td> <tr id="entity-cscr"><td> <code title="">cscr;</code> </td> <td> U+1D4B8 </td> <td> <span class="glyph" title="">𝒸</span> </td> <tr id="entity-csub"><td> <code title="">csub;</code> </td> <td> U+02ACF </td> <td> <span class="glyph" title="">⫏</span> </td> <tr id="entity-csube"><td> <code title="">csube;</code> </td> <td> U+02AD1 </td> <td> <span class="glyph" title="">⫑</span> </td> <tr id="entity-csup"><td> <code title="">csup;</code> </td> <td> U+02AD0 </td> <td> <span class="glyph" title="">⫐</span> </td> <tr id="entity-csupe"><td> <code title="">csupe;</code> </td> <td> U+02AD2 </td> <td> <span class="glyph" title="">⫒</span> </td> <tr id="entity-ctdot"><td> <code title="">ctdot;</code> </td> <td> U+022EF </td> <td> <span class="glyph" title="">⋯</span> </td> <tr id="entity-cudarrl"><td> <code title="">cudarrl;</code> </td> <td> U+02938 </td> <td> <span class="glyph" title="">⤸</span> </td> <tr id="entity-cudarrr"><td> <code title="">cudarrr;</code> </td> <td> U+02935 </td> <td> <span class="glyph" title="">⤵</span> </td> <tr id="entity-cuepr"><td> <code title="">cuepr;</code> </td> <td> U+022DE </td> <td> <span class="glyph" title="">⋞</span> </td> <tr id="entity-cuesc"><td> <code title="">cuesc;</code> </td> <td> U+022DF </td> <td> <span class="glyph" title="">⋟</span> </td> <tr id="entity-cularr"><td> <code title="">cularr;</code> </td> <td> U+021B6 </td> <td> <span class="glyph" title="">↶</span> </td> <tr id="entity-cularrp"><td> <code title="">cularrp;</code> </td> <td> U+0293D </td> <td> <span class="glyph" title="">⤽</span> </td> <tr id="entity-cup"><td> <code title="">cup;</code> </td> <td> U+0222A </td> <td> <span class="glyph" title="">∪</span> </td> <tr id="entity-cupbrcap"><td> <code title="">cupbrcap;</code> </td> <td> U+02A48 </td> <td> <span class="glyph" title="">⩈</span> </td> <tr id="entity-cupcap"><td> <code title="">cupcap;</code> </td> <td> U+02A46 </td> <td> <span class="glyph" title="">⩆</span> </td> <tr id="entity-cupcup"><td> <code title="">cupcup;</code> </td> <td> U+02A4A </td> <td> <span class="glyph" title="">⩊</span> </td> <tr id="entity-cupdot"><td> <code title="">cupdot;</code> </td> <td> U+0228D </td> <td> <span class="glyph" title="">⊍</span> </td> <tr id="entity-cupor"><td> <code title="">cupor;</code> </td> <td> U+02A45 </td> <td> <span class="glyph" title="">⩅</span> </td> <tr id="entity-cups"><td> <code title="">cups;</code> </td> <td> U+0222A U+0FE00 </td> <td> <span class="glyph compound" title="">∪︀</span> </td> <tr id="entity-curarr"><td> <code title="">curarr;</code> </td> <td> U+021B7 </td> <td> <span class="glyph" title="">↷</span> </td> <tr id="entity-curarrm"><td> <code title="">curarrm;</code> </td> <td> U+0293C </td> <td> <span class="glyph" title="">⤼</span> </td> <tr id="entity-curlyeqprec"><td> <code title="">curlyeqprec;</code> </td> <td> U+022DE </td> <td> <span class="glyph" title="">⋞</span> </td> <tr id="entity-curlyeqsucc"><td> <code title="">curlyeqsucc;</code> </td> <td> U+022DF </td> <td> <span class="glyph" title="">⋟</span> </td> <tr id="entity-curlyvee"><td> <code title="">curlyvee;</code> </td> <td> U+022CE </td> <td> <span class="glyph" title="">⋎</span> </td> <tr id="entity-curlywedge"><td> <code title="">curlywedge;</code> </td> <td> U+022CF </td> <td> <span class="glyph" title="">⋏</span> </td> <tr id="entity-curren"><td> <code title="">curren;</code> </td> <td> U+000A4 </td> <td> <span class="glyph" title="">¤</span> </td> <tr id="entity-curvearrowleft"><td> <code title="">curvearrowleft;</code> </td> <td> U+021B6 </td> <td> <span class="glyph" title="">↶</span> </td> <tr id="entity-curvearrowright"><td> <code title="">curvearrowright;</code> </td> <td> U+021B7 </td> <td> <span class="glyph" title="">↷</span> </td> <tr id="entity-cuvee"><td> <code title="">cuvee;</code> </td> <td> U+022CE </td> <td> <span class="glyph" title="">⋎</span> </td> <tr id="entity-cuwed"><td> <code title="">cuwed;</code> </td> <td> U+022CF </td> <td> <span class="glyph" title="">⋏</span> </td> <tr id="entity-cwconint"><td> <code title="">cwconint;</code> </td> <td> U+02232 </td> <td> <span class="glyph" title="">∲</span> </td> <tr id="entity-cwint"><td> <code title="">cwint;</code> </td> <td> U+02231 </td> <td> <span class="glyph" title="">∱</span> </td> <tr id="entity-cylcty"><td> <code title="">cylcty;</code> </td> <td> U+0232D </td> <td> <span class="glyph" title="">⌭</span> </td> <tr id="entity-dArr"><td> <code title="">dArr;</code> </td> <td> U+021D3 </td> <td> <span class="glyph" title="">⇓</span> </td> <tr id="entity-dHar"><td> <code title="">dHar;</code> </td> <td> U+02965 </td> <td> <span class="glyph" title="">⥥</span> </td> <tr id="entity-dagger"><td> <code title="">dagger;</code> </td> <td> U+02020 </td> <td> <span class="glyph" title="">†</span> </td> <tr id="entity-daleth"><td> <code title="">daleth;</code> </td> <td> U+02138 </td> <td> <span class="glyph" title="">ℸ</span> </td> <tr id="entity-darr"><td> <code title="">darr;</code> </td> <td> U+02193 </td> <td> <span class="glyph" title="">↓</span> </td> <tr id="entity-dash"><td> <code title="">dash;</code> </td> <td> U+02010 </td> <td> <span class="glyph" title="">‐</span> </td> <tr id="entity-dashv"><td> <code title="">dashv;</code> </td> <td> U+022A3 </td> <td> <span class="glyph" title="">⊣</span> </td> <tr id="entity-dbkarow"><td> <code title="">dbkarow;</code> </td> <td> U+0290F </td> <td> <span class="glyph" title="">⤏</span> </td> <tr id="entity-dblac"><td> <code title="">dblac;</code> </td> <td> U+002DD </td> <td> <span class="glyph" title="">˝</span> </td> <tr id="entity-dcaron"><td> <code title="">dcaron;</code> </td> <td> U+0010F </td> <td> <span class="glyph" title="">ď</span> </td> <tr id="entity-dcy"><td> <code title="">dcy;</code> </td> <td> U+00434 </td> <td> <span class="glyph" title="">д</span> </td> <tr id="entity-dd"><td> <code title="">dd;</code> </td> <td> U+02146 </td> <td> <span class="glyph" title="">ⅆ</span> </td> <tr id="entity-ddagger"><td> <code title="">ddagger;</code> </td> <td> U+02021 </td> <td> <span class="glyph" title="">‡</span> </td> <tr id="entity-ddarr"><td> <code title="">ddarr;</code> </td> <td> U+021CA </td> <td> <span class="glyph" title="">⇊</span> </td> <tr id="entity-ddotseq"><td> <code title="">ddotseq;</code> </td> <td> U+02A77 </td> <td> <span class="glyph" title="">⩷</span> </td> <tr id="entity-deg"><td> <code title="">deg;</code> </td> <td> U+000B0 </td> <td> <span class="glyph" title="">°</span> </td> <tr id="entity-delta"><td> <code title="">delta;</code> </td> <td> U+003B4 </td> <td> <span class="glyph" title="">δ</span> </td> <tr id="entity-demptyv"><td> <code title="">demptyv;</code> </td> <td> U+029B1 </td> <td> <span class="glyph" title="">⦱</span> </td> <tr id="entity-dfisht"><td> <code title="">dfisht;</code> </td> <td> U+0297F </td> <td> <span class="glyph" title="">⥿</span> </td> <tr id="entity-dfr"><td> <code title="">dfr;</code> </td> <td> U+1D521 </td> <td> <span class="glyph" title="">𝔡</span> </td> <tr id="entity-dharl"><td> <code title="">dharl;</code> </td> <td> U+021C3 </td> <td> <span class="glyph" title="">⇃</span> </td> <tr id="entity-dharr"><td> <code title="">dharr;</code> </td> <td> U+021C2 </td> <td> <span class="glyph" title="">⇂</span> </td> <tr id="entity-diam"><td> <code title="">diam;</code> </td> <td> U+022C4 </td> <td> <span class="glyph" title="">⋄</span> </td> <tr id="entity-diamond"><td> <code title="">diamond;</code> </td> <td> U+022C4 </td> <td> <span class="glyph" title="">⋄</span> </td> <tr id="entity-diamondsuit"><td> <code title="">diamondsuit;</code> </td> <td> U+02666 </td> <td> <span class="glyph" title="">♦</span> </td> <tr id="entity-diams"><td> <code title="">diams;</code> </td> <td> U+02666 </td> <td> <span class="glyph" title="">♦</span> </td> <tr id="entity-die"><td> <code title="">die;</code> </td> <td> U+000A8 </td> <td> <span class="glyph" title="">¨</span> </td> <tr id="entity-digamma"><td> <code title="">digamma;</code> </td> <td> U+003DD </td> <td> <span class="glyph" title="">ϝ</span> </td> <tr id="entity-disin"><td> <code title="">disin;</code> </td> <td> U+022F2 </td> <td> <span class="glyph" title="">⋲</span> </td> <tr id="entity-div"><td> <code title="">div;</code> </td> <td> U+000F7 </td> <td> <span class="glyph" title="">÷</span> </td> <tr id="entity-divide"><td> <code title="">divide;</code> </td> <td> U+000F7 </td> <td> <span class="glyph" title="">÷</span> </td> <tr id="entity-divideontimes"><td> <code title="">divideontimes;</code> </td> <td> U+022C7 </td> <td> <span class="glyph" title="">⋇</span> </td> <tr id="entity-divonx"><td> <code title="">divonx;</code> </td> <td> U+022C7 </td> <td> <span class="glyph" title="">⋇</span> </td> <tr id="entity-djcy"><td> <code title="">djcy;</code> </td> <td> U+00452 </td> <td> <span class="glyph" title="">ђ</span> </td> <tr id="entity-dlcorn"><td> <code title="">dlcorn;</code> </td> <td> U+0231E </td> <td> <span class="glyph" title="">⌞</span> </td> <tr id="entity-dlcrop"><td> <code title="">dlcrop;</code> </td> <td> U+0230D </td> <td> <span class="glyph" title="">⌍</span> </td> <tr id="entity-dollar"><td> <code title="">dollar;</code> </td> <td> U+00024 </td> <td> <span class="glyph" title="">$</span> </td> <tr id="entity-dopf"><td> <code title="">dopf;</code> </td> <td> U+1D555 </td> <td> <span class="glyph" title="">𝕕</span> </td> <tr id="entity-dot"><td> <code title="">dot;</code> </td> <td> U+002D9 </td> <td> <span class="glyph" title="">˙</span> </td> <tr id="entity-doteq"><td> <code title="">doteq;</code> </td> <td> U+02250 </td> <td> <span class="glyph" title="">≐</span> </td> <tr id="entity-doteqdot"><td> <code title="">doteqdot;</code> </td> <td> U+02251 </td> <td> <span class="glyph" title="">≑</span> </td> <tr id="entity-dotminus"><td> <code title="">dotminus;</code> </td> <td> U+02238 </td> <td> <span class="glyph" title="">∸</span> </td> <tr id="entity-dotplus"><td> <code title="">dotplus;</code> </td> <td> U+02214 </td> <td> <span class="glyph" title="">∔</span> </td> <tr id="entity-dotsquare"><td> <code title="">dotsquare;</code> </td> <td> U+022A1 </td> <td> <span class="glyph" title="">⊡</span> </td> <tr id="entity-doublebarwedge"><td> <code title="">doublebarwedge;</code> </td> <td> U+02306 </td> <td> <span class="glyph" title="">⌆</span> </td> <tr id="entity-downarrow"><td> <code title="">downarrow;</code> </td> <td> U+02193 </td> <td> <span class="glyph" title="">↓</span> </td> <tr id="entity-downdownarrows"><td> <code title="">downdownarrows;</code> </td> <td> U+021CA </td> <td> <span class="glyph" title="">⇊</span> </td> <tr id="entity-downharpoonleft"><td> <code title="">downharpoonleft;</code> </td> <td> U+021C3 </td> <td> <span class="glyph" title="">⇃</span> </td> <tr id="entity-downharpoonright"><td> <code title="">downharpoonright;</code> </td> <td> U+021C2 </td> <td> <span class="glyph" title="">⇂</span> </td> <tr id="entity-drbkarow"><td> <code title="">drbkarow;</code> </td> <td> U+02910 </td> <td> <span class="glyph" title="">⤐</span> </td> <tr id="entity-drcorn"><td> <code title="">drcorn;</code> </td> <td> U+0231F </td> <td> <span class="glyph" title="">⌟</span> </td> <tr id="entity-drcrop"><td> <code title="">drcrop;</code> </td> <td> U+0230C </td> <td> <span class="glyph" title="">⌌</span> </td> <tr id="entity-dscr"><td> <code title="">dscr;</code> </td> <td> U+1D4B9 </td> <td> <span class="glyph" title="">𝒹</span> </td> <tr id="entity-dscy"><td> <code title="">dscy;</code> </td> <td> U+00455 </td> <td> <span class="glyph" title="">ѕ</span> </td> <tr id="entity-dsol"><td> <code title="">dsol;</code> </td> <td> U+029F6 </td> <td> <span class="glyph" title="">⧶</span> </td> <tr id="entity-dstrok"><td> <code title="">dstrok;</code> </td> <td> U+00111 </td> <td> <span class="glyph" title="">đ</span> </td> <tr id="entity-dtdot"><td> <code title="">dtdot;</code> </td> <td> U+022F1 </td> <td> <span class="glyph" title="">⋱</span> </td> <tr id="entity-dtri"><td> <code title="">dtri;</code> </td> <td> U+025BF </td> <td> <span class="glyph" title="">▿</span> </td> <tr id="entity-dtrif"><td> <code title="">dtrif;</code> </td> <td> U+025BE </td> <td> <span class="glyph" title="">▾</span> </td> <tr id="entity-duarr"><td> <code title="">duarr;</code> </td> <td> U+021F5 </td> <td> <span class="glyph" title="">⇵</span> </td> <tr id="entity-duhar"><td> <code title="">duhar;</code> </td> <td> U+0296F </td> <td> <span class="glyph" title="">⥯</span> </td> <tr id="entity-dwangle"><td> <code title="">dwangle;</code> </td> <td> U+029A6 </td> <td> <span class="glyph" title="">⦦</span> </td> <tr id="entity-dzcy"><td> <code title="">dzcy;</code> </td> <td> U+0045F </td> <td> <span class="glyph" title="">џ</span> </td> <tr id="entity-dzigrarr"><td> <code title="">dzigrarr;</code> </td> <td> U+027FF </td> <td> <span class="glyph" title="">⟿</span> </td> <tr id="entity-eDDot"><td> <code title="">eDDot;</code> </td> <td> U+02A77 </td> <td> <span class="glyph" title="">⩷</span> </td> <tr id="entity-eDot"><td> <code title="">eDot;</code> </td> <td> U+02251 </td> <td> <span class="glyph" title="">≑</span> </td> <tr id="entity-eacute"><td> <code title="">eacute;</code> </td> <td> U+000E9 </td> <td> <span class="glyph" title="">é</span> </td> <tr id="entity-easter"><td> <code title="">easter;</code> </td> <td> U+02A6E </td> <td> <span class="glyph" title="">⩮</span> </td> <tr id="entity-ecaron"><td> <code title="">ecaron;</code> </td> <td> U+0011B </td> <td> <span class="glyph" title="">ě</span> </td> <tr id="entity-ecir"><td> <code title="">ecir;</code> </td> <td> U+02256 </td> <td> <span class="glyph" title="">≖</span> </td> <tr id="entity-ecirc"><td> <code title="">ecirc;</code> </td> <td> U+000EA </td> <td> <span class="glyph" title="">ê</span> </td> <tr id="entity-ecolon"><td> <code title="">ecolon;</code> </td> <td> U+02255 </td> <td> <span class="glyph" title="">≕</span> </td> <tr id="entity-ecy"><td> <code title="">ecy;</code> </td> <td> U+0044D </td> <td> <span class="glyph" title="">э</span> </td> <tr id="entity-edot"><td> <code title="">edot;</code> </td> <td> U+00117 </td> <td> <span class="glyph" title="">ė</span> </td> <tr id="entity-ee"><td> <code title="">ee;</code> </td> <td> U+02147 </td> <td> <span class="glyph" title="">ⅇ</span> </td> <tr id="entity-efDot"><td> <code title="">efDot;</code> </td> <td> U+02252 </td> <td> <span class="glyph" title="">≒</span> </td> <tr id="entity-efr"><td> <code title="">efr;</code> </td> <td> U+1D522 </td> <td> <span class="glyph" title="">𝔢</span> </td> <tr id="entity-eg"><td> <code title="">eg;</code> </td> <td> U+02A9A </td> <td> <span class="glyph" title="">⪚</span> </td> <tr id="entity-egrave"><td> <code title="">egrave;</code> </td> <td> U+000E8 </td> <td> <span class="glyph" title="">è</span> </td> <tr id="entity-egs"><td> <code title="">egs;</code> </td> <td> U+02A96 </td> <td> <span class="glyph" title="">⪖</span> </td> <tr id="entity-egsdot"><td> <code title="">egsdot;</code> </td> <td> U+02A98 </td> <td> <span class="glyph" title="">⪘</span> </td> <tr id="entity-el"><td> <code title="">el;</code> </td> <td> U+02A99 </td> <td> <span class="glyph" title="">⪙</span> </td> <tr id="entity-elinters"><td> <code title="">elinters;</code> </td> <td> U+023E7 </td> <td> <span class="glyph" title="">⏧</span> </td> <tr id="entity-ell"><td> <code title="">ell;</code> </td> <td> U+02113 </td> <td> <span class="glyph" title="">ℓ</span> </td> <tr id="entity-els"><td> <code title="">els;</code> </td> <td> U+02A95 </td> <td> <span class="glyph" title="">⪕</span> </td> <tr id="entity-elsdot"><td> <code title="">elsdot;</code> </td> <td> U+02A97 </td> <td> <span class="glyph" title="">⪗</span> </td> <tr id="entity-emacr"><td> <code title="">emacr;</code> </td> <td> U+00113 </td> <td> <span class="glyph" title="">ē</span> </td> <tr id="entity-empty"><td> <code title="">empty;</code> </td> <td> U+02205 </td> <td> <span class="glyph" title="">∅</span> </td> <tr id="entity-emptyset"><td> <code title="">emptyset;</code> </td> <td> U+02205 </td> <td> <span class="glyph" title="">∅</span> </td> <tr id="entity-emptyv"><td> <code title="">emptyv;</code> </td> <td> U+02205 </td> <td> <span class="glyph" title="">∅</span> </td> <tr id="entity-emsp"><td> <code title="">emsp;</code> </td> <td> U+02003 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-emsp13"><td> <code title="">emsp13;</code> </td> <td> U+02004 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-emsp14"><td> <code title="">emsp14;</code> </td> <td> U+02005 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-eng"><td> <code title="">eng;</code> </td> <td> U+0014B </td> <td> <span class="glyph" title="">ŋ</span> </td> <tr id="entity-ensp"><td> <code title="">ensp;</code> </td> <td> U+02002 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-eogon"><td> <code title="">eogon;</code> </td> <td> U+00119 </td> <td> <span class="glyph" title="">ę</span> </td> <tr id="entity-eopf"><td> <code title="">eopf;</code> </td> <td> U+1D556 </td> <td> <span class="glyph" title="">𝕖</span> </td> <tr id="entity-epar"><td> <code title="">epar;</code> </td> <td> U+022D5 </td> <td> <span class="glyph" title="">⋕</span> </td> <tr id="entity-eparsl"><td> <code title="">eparsl;</code> </td> <td> U+029E3 </td> <td> <span class="glyph" title="">⧣</span> </td> <tr id="entity-eplus"><td> <code title="">eplus;</code> </td> <td> U+02A71 </td> <td> <span class="glyph" title="">⩱</span> </td> <tr id="entity-epsi"><td> <code title="">epsi;</code> </td> <td> U+003B5 </td> <td> <span class="glyph" title="">ε</span> </td> <tr id="entity-epsilon"><td> <code title="">epsilon;</code> </td> <td> U+003B5 </td> <td> <span class="glyph" title="">ε</span> </td> <tr id="entity-epsiv"><td> <code title="">epsiv;</code> </td> <td> U+003F5 </td> <td> <span class="glyph" title="">ϵ</span> </td> <tr id="entity-eqcirc"><td> <code title="">eqcirc;</code> </td> <td> U+02256 </td> <td> <span class="glyph" title="">≖</span> </td> <tr id="entity-eqcolon"><td> <code title="">eqcolon;</code> </td> <td> U+02255 </td> <td> <span class="glyph" title="">≕</span> </td> <tr id="entity-eqsim"><td> <code title="">eqsim;</code> </td> <td> U+02242 </td> <td> <span class="glyph" title="">≂</span> </td> <tr id="entity-eqslantgtr"><td> <code title="">eqslantgtr;</code> </td> <td> U+02A96 </td> <td> <span class="glyph" title="">⪖</span> </td> <tr id="entity-eqslantless"><td> <code title="">eqslantless;</code> </td> <td> U+02A95 </td> <td> <span class="glyph" title="">⪕</span> </td> <tr id="entity-equals"><td> <code title="">equals;</code> </td> <td> U+0003D </td> <td> <span class="glyph" title="">=</span> </td> <tr id="entity-equest"><td> <code title="">equest;</code> </td> <td> U+0225F </td> <td> <span class="glyph" title="">≟</span> </td> <tr id="entity-equiv"><td> <code title="">equiv;</code> </td> <td> U+02261 </td> <td> <span class="glyph" title="">≡</span> </td> <tr id="entity-equivDD"><td> <code title="">equivDD;</code> </td> <td> U+02A78 </td> <td> <span class="glyph" title="">⩸</span> </td> <tr id="entity-eqvparsl"><td> <code title="">eqvparsl;</code> </td> <td> U+029E5 </td> <td> <span class="glyph" title="">⧥</span> </td> <tr id="entity-erDot"><td> <code title="">erDot;</code> </td> <td> U+02253 </td> <td> <span class="glyph" title="">≓</span> </td> <tr id="entity-erarr"><td> <code title="">erarr;</code> </td> <td> U+02971 </td> <td> <span class="glyph" title="">⥱</span> </td> <tr id="entity-escr"><td> <code title="">escr;</code> </td> <td> U+0212F </td> <td> <span class="glyph" title="">ℯ</span> </td> <tr id="entity-esdot"><td> <code title="">esdot;</code> </td> <td> U+02250 </td> <td> <span class="glyph" title="">≐</span> </td> <tr id="entity-esim"><td> <code title="">esim;</code> </td> <td> U+02242 </td> <td> <span class="glyph" title="">≂</span> </td> <tr id="entity-eta"><td> <code title="">eta;</code> </td> <td> U+003B7 </td> <td> <span class="glyph" title="">η</span> </td> <tr id="entity-eth"><td> <code title="">eth;</code> </td> <td> U+000F0 </td> <td> <span class="glyph" title="">ð</span> </td> <tr id="entity-euml"><td> <code title="">euml;</code> </td> <td> U+000EB </td> <td> <span class="glyph" title="">ë</span> </td> <tr id="entity-euro"><td> <code title="">euro;</code> </td> <td> U+020AC </td> <td> <span class="glyph" title="">€</span> </td> <tr id="entity-excl"><td> <code title="">excl;</code> </td> <td> U+00021 </td> <td> <span class="glyph" title="">!</span> </td> <tr id="entity-exist"><td> <code title="">exist;</code> </td> <td> U+02203 </td> <td> <span class="glyph" title="">∃</span> </td> <tr id="entity-expectation"><td> <code title="">expectation;</code> </td> <td> U+02130 </td> <td> <span class="glyph" title="">ℰ</span> </td> <tr id="entity-exponentiale"><td> <code title="">exponentiale;</code> </td> <td> U+02147 </td> <td> <span class="glyph" title="">ⅇ</span> </td> <tr id="entity-fallingdotseq"><td> <code title="">fallingdotseq;</code> </td> <td> U+02252 </td> <td> <span class="glyph" title="">≒</span> </td> <tr id="entity-fcy"><td> <code title="">fcy;</code> </td> <td> U+00444 </td> <td> <span class="glyph" title="">ф</span> </td> <tr id="entity-female"><td> <code title="">female;</code> </td> <td> U+02640 </td> <td> <span class="glyph" title="">♀</span> </td> <tr id="entity-ffilig"><td> <code title="">ffilig;</code> </td> <td> U+0FB03 </td> <td> <span class="glyph" title="">ffi</span> </td> <tr id="entity-fflig"><td> <code title="">fflig;</code> </td> <td> U+0FB00 </td> <td> <span class="glyph" title="">ff</span> </td> <tr id="entity-ffllig"><td> <code title="">ffllig;</code> </td> <td> U+0FB04 </td> <td> <span class="glyph" title="">ffl</span> </td> <tr id="entity-ffr"><td> <code title="">ffr;</code> </td> <td> U+1D523 </td> <td> <span class="glyph" title="">𝔣</span> </td> <tr id="entity-filig"><td> <code title="">filig;</code> </td> <td> U+0FB01 </td> <td> <span class="glyph" title="">fi</span> </td> <tr id="entity-fjlig"><td> <code title="">fjlig;</code> </td> <td> U+00066 U+0006A </td> <td> <span class="glyph compound" title="">fj</span> </td> <tr id="entity-flat"><td> <code title="">flat;</code> </td> <td> U+0266D </td> <td> <span class="glyph" title="">♭</span> </td> <tr id="entity-fllig"><td> <code title="">fllig;</code> </td> <td> U+0FB02 </td> <td> <span class="glyph" title="">fl</span> </td> <tr id="entity-fltns"><td> <code title="">fltns;</code> </td> <td> U+025B1 </td> <td> <span class="glyph" title="">▱</span> </td> <tr id="entity-fnof"><td> <code title="">fnof;</code> </td> <td> U+00192 </td> <td> <span class="glyph" title="">ƒ</span> </td> <tr id="entity-fopf"><td> <code title="">fopf;</code> </td> <td> U+1D557 </td> <td> <span class="glyph" title="">𝕗</span> </td> <tr id="entity-forall"><td> <code title="">forall;</code> </td> <td> U+02200 </td> <td> <span class="glyph" title="">∀</span> </td> <tr id="entity-fork"><td> <code title="">fork;</code> </td> <td> U+022D4 </td> <td> <span class="glyph" title="">⋔</span> </td> <tr id="entity-forkv"><td> <code title="">forkv;</code> </td> <td> U+02AD9 </td> <td> <span class="glyph" title="">⫙</span> </td> <tr id="entity-fpartint"><td> <code title="">fpartint;</code> </td> <td> U+02A0D </td> <td> <span class="glyph" title="">⨍</span> </td> <tr id="entity-frac12"><td> <code title="">frac12;</code> </td> <td> U+000BD </td> <td> <span class="glyph" title="">½</span> </td> <tr id="entity-frac13"><td> <code title="">frac13;</code> </td> <td> U+02153 </td> <td> <span class="glyph" title="">⅓</span> </td> <tr id="entity-frac14"><td> <code title="">frac14;</code> </td> <td> U+000BC </td> <td> <span class="glyph" title="">¼</span> </td> <tr id="entity-frac15"><td> <code title="">frac15;</code> </td> <td> U+02155 </td> <td> <span class="glyph" title="">⅕</span> </td> <tr id="entity-frac16"><td> <code title="">frac16;</code> </td> <td> U+02159 </td> <td> <span class="glyph" title="">⅙</span> </td> <tr id="entity-frac18"><td> <code title="">frac18;</code> </td> <td> U+0215B </td> <td> <span class="glyph" title="">⅛</span> </td> <tr id="entity-frac23"><td> <code title="">frac23;</code> </td> <td> U+02154 </td> <td> <span class="glyph" title="">⅔</span> </td> <tr id="entity-frac25"><td> <code title="">frac25;</code> </td> <td> U+02156 </td> <td> <span class="glyph" title="">⅖</span> </td> <tr id="entity-frac34"><td> <code title="">frac34;</code> </td> <td> U+000BE </td> <td> <span class="glyph" title="">¾</span> </td> <tr id="entity-frac35"><td> <code title="">frac35;</code> </td> <td> U+02157 </td> <td> <span class="glyph" title="">⅗</span> </td> <tr id="entity-frac38"><td> <code title="">frac38;</code> </td> <td> U+0215C </td> <td> <span class="glyph" title="">⅜</span> </td> <tr id="entity-frac45"><td> <code title="">frac45;</code> </td> <td> U+02158 </td> <td> <span class="glyph" title="">⅘</span> </td> <tr id="entity-frac56"><td> <code title="">frac56;</code> </td> <td> U+0215A </td> <td> <span class="glyph" title="">⅚</span> </td> <tr id="entity-frac58"><td> <code title="">frac58;</code> </td> <td> U+0215D </td> <td> <span class="glyph" title="">⅝</span> </td> <tr id="entity-frac78"><td> <code title="">frac78;</code> </td> <td> U+0215E </td> <td> <span class="glyph" title="">⅞</span> </td> <tr id="entity-frasl"><td> <code title="">frasl;</code> </td> <td> U+02044 </td> <td> <span class="glyph" title="">⁄</span> </td> <tr id="entity-frown"><td> <code title="">frown;</code> </td> <td> U+02322 </td> <td> <span class="glyph" title="">⌢</span> </td> <tr id="entity-fscr"><td> <code title="">fscr;</code> </td> <td> U+1D4BB </td> <td> <span class="glyph" title="">𝒻</span> </td> <tr id="entity-gE"><td> <code title="">gE;</code> </td> <td> U+02267 </td> <td> <span class="glyph" title="">≧</span> </td> <tr id="entity-gEl"><td> <code title="">gEl;</code> </td> <td> U+02A8C </td> <td> <span class="glyph" title="">⪌</span> </td> <tr id="entity-gacute"><td> <code title="">gacute;</code> </td> <td> U+001F5 </td> <td> <span class="glyph" title="">ǵ</span> </td> <tr id="entity-gamma"><td> <code title="">gamma;</code> </td> <td> U+003B3 </td> <td> <span class="glyph" title="">γ</span> </td> <tr id="entity-gammad"><td> <code title="">gammad;</code> </td> <td> U+003DD </td> <td> <span class="glyph" title="">ϝ</span> </td> <tr id="entity-gap"><td> <code title="">gap;</code> </td> <td> U+02A86 </td> <td> <span class="glyph" title="">⪆</span> </td> <tr id="entity-gbreve"><td> <code title="">gbreve;</code> </td> <td> U+0011F </td> <td> <span class="glyph" title="">ğ</span> </td> <tr id="entity-gcirc"><td> <code title="">gcirc;</code> </td> <td> U+0011D </td> <td> <span class="glyph" title="">ĝ</span> </td> <tr id="entity-gcy"><td> <code title="">gcy;</code> </td> <td> U+00433 </td> <td> <span class="glyph" title="">г</span> </td> <tr id="entity-gdot"><td> <code title="">gdot;</code> </td> <td> U+00121 </td> <td> <span class="glyph" title="">ġ</span> </td> <tr id="entity-ge"><td> <code title="">ge;</code> </td> <td> U+02265 </td> <td> <span class="glyph" title="">≥</span> </td> <tr id="entity-gel"><td> <code title="">gel;</code> </td> <td> U+022DB </td> <td> <span class="glyph" title="">⋛</span> </td> <tr id="entity-geq"><td> <code title="">geq;</code> </td> <td> U+02265 </td> <td> <span class="glyph" title="">≥</span> </td> <tr id="entity-geqq"><td> <code title="">geqq;</code> </td> <td> U+02267 </td> <td> <span class="glyph" title="">≧</span> </td> <tr id="entity-geqslant"><td> <code title="">geqslant;</code> </td> <td> U+02A7E </td> <td> <span class="glyph" title="">⩾</span> </td> <tr id="entity-ges"><td> <code title="">ges;</code> </td> <td> U+02A7E </td> <td> <span class="glyph" title="">⩾</span> </td> <tr id="entity-gescc"><td> <code title="">gescc;</code> </td> <td> U+02AA9 </td> <td> <span class="glyph" title="">⪩</span> </td> <tr id="entity-gesdot"><td> <code title="">gesdot;</code> </td> <td> U+02A80 </td> <td> <span class="glyph" title="">⪀</span> </td> <tr id="entity-gesdoto"><td> <code title="">gesdoto;</code> </td> <td> U+02A82 </td> <td> <span class="glyph" title="">⪂</span> </td> <tr id="entity-gesdotol"><td> <code title="">gesdotol;</code> </td> <td> U+02A84 </td> <td> <span class="glyph" title="">⪄</span> </td> <tr id="entity-gesl"><td> <code title="">gesl;</code> </td> <td> U+022DB U+0FE00 </td> <td> <span class="glyph compound" title="">⋛︀</span> </td> <tr id="entity-gesles"><td> <code title="">gesles;</code> </td> <td> U+02A94 </td> <td> <span class="glyph" title="">⪔</span> </td> <tr id="entity-gfr"><td> <code title="">gfr;</code> </td> <td> U+1D524 </td> <td> <span class="glyph" title="">𝔤</span> </td> <tr id="entity-gg"><td> <code title="">gg;</code> </td> <td> U+0226B </td> <td> <span class="glyph" title="">≫</span> </td> <tr id="entity-ggg"><td> <code title="">ggg;</code> </td> <td> U+022D9 </td> <td> <span class="glyph" title="">⋙</span> </td> <tr id="entity-gimel"><td> <code title="">gimel;</code> </td> <td> U+02137 </td> <td> <span class="glyph" title="">ℷ</span> </td> <tr id="entity-gjcy"><td> <code title="">gjcy;</code> </td> <td> U+00453 </td> <td> <span class="glyph" title="">ѓ</span> </td> <tr id="entity-gl"><td> <code title="">gl;</code> </td> <td> U+02277 </td> <td> <span class="glyph" title="">≷</span> </td> <tr id="entity-glE"><td> <code title="">glE;</code> </td> <td> U+02A92 </td> <td> <span class="glyph" title="">⪒</span> </td> <tr id="entity-gla"><td> <code title="">gla;</code> </td> <td> U+02AA5 </td> <td> <span class="glyph" title="">⪥</span> </td> <tr id="entity-glj"><td> <code title="">glj;</code> </td> <td> U+02AA4 </td> <td> <span class="glyph" title="">⪤</span> </td> <tr id="entity-gnE"><td> <code title="">gnE;</code> </td> <td> U+02269 </td> <td> <span class="glyph" title="">≩</span> </td> <tr id="entity-gnap"><td> <code title="">gnap;</code> </td> <td> U+02A8A </td> <td> <span class="glyph" title="">⪊</span> </td> <tr id="entity-gnapprox"><td> <code title="">gnapprox;</code> </td> <td> U+02A8A </td> <td> <span class="glyph" title="">⪊</span> </td> <tr id="entity-gne"><td> <code title="">gne;</code> </td> <td> U+02A88 </td> <td> <span class="glyph" title="">⪈</span> </td> <tr id="entity-gneq"><td> <code title="">gneq;</code> </td> <td> U+02A88 </td> <td> <span class="glyph" title="">⪈</span> </td> <tr id="entity-gneqq"><td> <code title="">gneqq;</code> </td> <td> U+02269 </td> <td> <span class="glyph" title="">≩</span> </td> <tr id="entity-gnsim"><td> <code title="">gnsim;</code> </td> <td> U+022E7 </td> <td> <span class="glyph" title="">⋧</span> </td> <tr id="entity-gopf"><td> <code title="">gopf;</code> </td> <td> U+1D558 </td> <td> <span class="glyph" title="">𝕘</span> </td> <tr id="entity-grave"><td> <code title="">grave;</code> </td> <td> U+00060 </td> <td> <span class="glyph" title="">`</span> </td> <tr id="entity-gscr"><td> <code title="">gscr;</code> </td> <td> U+0210A </td> <td> <span class="glyph" title="">ℊ</span> </td> <tr id="entity-gsim"><td> <code title="">gsim;</code> </td> <td> U+02273 </td> <td> <span class="glyph" title="">≳</span> </td> <tr id="entity-gsime"><td> <code title="">gsime;</code> </td> <td> U+02A8E </td> <td> <span class="glyph" title="">⪎</span> </td> <tr id="entity-gsiml"><td> <code title="">gsiml;</code> </td> <td> U+02A90 </td> <td> <span class="glyph" title="">⪐</span> </td> <tr id="entity-gt"><td> <code title="">gt;</code> </td> <td> U+0003E </td> <td> <span class="glyph" title="">></span> </td> <tr id="entity-gtcc"><td> <code title="">gtcc;</code> </td> <td> U+02AA7 </td> <td> <span class="glyph" title="">⪧</span> </td> <tr id="entity-gtcir"><td> <code title="">gtcir;</code> </td> <td> U+02A7A </td> <td> <span class="glyph" title="">⩺</span> </td> <tr id="entity-gtdot"><td> <code title="">gtdot;</code> </td> <td> U+022D7 </td> <td> <span class="glyph" title="">⋗</span> </td> <tr id="entity-gtlPar"><td> <code title="">gtlPar;</code> </td> <td> U+02995 </td> <td> <span class="glyph" title="">⦕</span> </td> <tr id="entity-gtquest"><td> <code title="">gtquest;</code> </td> <td> U+02A7C </td> <td> <span class="glyph" title="">⩼</span> </td> <tr id="entity-gtrapprox"><td> <code title="">gtrapprox;</code> </td> <td> U+02A86 </td> <td> <span class="glyph" title="">⪆</span> </td> <tr id="entity-gtrarr"><td> <code title="">gtrarr;</code> </td> <td> U+02978 </td> <td> <span class="glyph" title="">⥸</span> </td> <tr id="entity-gtrdot"><td> <code title="">gtrdot;</code> </td> <td> U+022D7 </td> <td> <span class="glyph" title="">⋗</span> </td> <tr id="entity-gtreqless"><td> <code title="">gtreqless;</code> </td> <td> U+022DB </td> <td> <span class="glyph" title="">⋛</span> </td> <tr id="entity-gtreqqless"><td> <code title="">gtreqqless;</code> </td> <td> U+02A8C </td> <td> <span class="glyph" title="">⪌</span> </td> <tr id="entity-gtrless"><td> <code title="">gtrless;</code> </td> <td> U+02277 </td> <td> <span class="glyph" title="">≷</span> </td> <tr id="entity-gtrsim"><td> <code title="">gtrsim;</code> </td> <td> U+02273 </td> <td> <span class="glyph" title="">≳</span> </td> <tr id="entity-gvertneqq"><td> <code title="">gvertneqq;</code> </td> <td> U+02269 U+0FE00 </td> <td> <span class="glyph compound" title="">≩︀</span> </td> <tr id="entity-gvnE"><td> <code title="">gvnE;</code> </td> <td> U+02269 U+0FE00 </td> <td> <span class="glyph compound" title="">≩︀</span> </td> <tr id="entity-hArr"><td> <code title="">hArr;</code> </td> <td> U+021D4 </td> <td> <span class="glyph" title="">⇔</span> </td> <tr id="entity-hairsp"><td> <code title="">hairsp;</code> </td> <td> U+0200A </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-half"><td> <code title="">half;</code> </td> <td> U+000BD </td> <td> <span class="glyph" title="">½</span> </td> <tr id="entity-hamilt"><td> <code title="">hamilt;</code> </td> <td> U+0210B </td> <td> <span class="glyph" title="">ℋ</span> </td> <tr id="entity-hardcy"><td> <code title="">hardcy;</code> </td> <td> U+0044A </td> <td> <span class="glyph" title="">ъ</span> </td> <tr id="entity-harr"><td> <code title="">harr;</code> </td> <td> U+02194 </td> <td> <span class="glyph" title="">↔</span> </td> <tr id="entity-harrcir"><td> <code title="">harrcir;</code> </td> <td> U+02948 </td> <td> <span class="glyph" title="">⥈</span> </td> <tr id="entity-harrw"><td> <code title="">harrw;</code> </td> <td> U+021AD </td> <td> <span class="glyph" title="">↭</span> </td> <tr id="entity-hbar"><td> <code title="">hbar;</code> </td> <td> U+0210F </td> <td> <span class="glyph" title="">ℏ</span> </td> <tr id="entity-hcirc"><td> <code title="">hcirc;</code> </td> <td> U+00125 </td> <td> <span class="glyph" title="">ĥ</span> </td> <tr id="entity-hearts"><td> <code title="">hearts;</code> </td> <td> U+02665 </td> <td> <span class="glyph" title="">♥</span> </td> <tr id="entity-heartsuit"><td> <code title="">heartsuit;</code> </td> <td> U+02665 </td> <td> <span class="glyph" title="">♥</span> </td> <tr id="entity-hellip"><td> <code title="">hellip;</code> </td> <td> U+02026 </td> <td> <span class="glyph" title="">…</span> </td> <tr id="entity-hercon"><td> <code title="">hercon;</code> </td> <td> U+022B9 </td> <td> <span class="glyph" title="">⊹</span> </td> <tr id="entity-hfr"><td> <code title="">hfr;</code> </td> <td> U+1D525 </td> <td> <span class="glyph" title="">𝔥</span> </td> <tr id="entity-hksearow"><td> <code title="">hksearow;</code> </td> <td> U+02925 </td> <td> <span class="glyph" title="">⤥</span> </td> <tr id="entity-hkswarow"><td> <code title="">hkswarow;</code> </td> <td> U+02926 </td> <td> <span class="glyph" title="">⤦</span> </td> <tr id="entity-hoarr"><td> <code title="">hoarr;</code> </td> <td> U+021FF </td> <td> <span class="glyph" title="">⇿</span> </td> <tr id="entity-homtht"><td> <code title="">homtht;</code> </td> <td> U+0223B </td> <td> <span class="glyph" title="">∻</span> </td> <tr id="entity-hookleftarrow"><td> <code title="">hookleftarrow;</code> </td> <td> U+021A9 </td> <td> <span class="glyph" title="">↩</span> </td> <tr id="entity-hookrightarrow"><td> <code title="">hookrightarrow;</code> </td> <td> U+021AA </td> <td> <span class="glyph" title="">↪</span> </td> <tr id="entity-hopf"><td> <code title="">hopf;</code> </td> <td> U+1D559 </td> <td> <span class="glyph" title="">𝕙</span> </td> <tr id="entity-horbar"><td> <code title="">horbar;</code> </td> <td> U+02015 </td> <td> <span class="glyph" title="">―</span> </td> <tr id="entity-hscr"><td> <code title="">hscr;</code> </td> <td> U+1D4BD </td> <td> <span class="glyph" title="">𝒽</span> </td> <tr id="entity-hslash"><td> <code title="">hslash;</code> </td> <td> U+0210F </td> <td> <span class="glyph" title="">ℏ</span> </td> <tr id="entity-hstrok"><td> <code title="">hstrok;</code> </td> <td> U+00127 </td> <td> <span class="glyph" title="">ħ</span> </td> <tr id="entity-hybull"><td> <code title="">hybull;</code> </td> <td> U+02043 </td> <td> <span class="glyph" title="">⁃</span> </td> <tr id="entity-hyphen"><td> <code title="">hyphen;</code> </td> <td> U+02010 </td> <td> <span class="glyph" title="">‐</span> </td> <tr id="entity-iacute"><td> <code title="">iacute;</code> </td> <td> U+000ED </td> <td> <span class="glyph" title="">í</span> </td> <tr id="entity-ic"><td> <code title="">ic;</code> </td> <td> U+02063 </td> <td> <span class="glyph" title="">⁣</span> </td> <tr id="entity-icirc"><td> <code title="">icirc;</code> </td> <td> U+000EE </td> <td> <span class="glyph" title="">î</span> </td> <tr id="entity-icy"><td> <code title="">icy;</code> </td> <td> U+00438 </td> <td> <span class="glyph" title="">и</span> </td> <tr id="entity-iecy"><td> <code title="">iecy;</code> </td> <td> U+00435 </td> <td> <span class="glyph" title="">е</span> </td> <tr id="entity-iexcl"><td> <code title="">iexcl;</code> </td> <td> U+000A1 </td> <td> <span class="glyph" title="">¡</span> </td> <tr id="entity-iff"><td> <code title="">iff;</code> </td> <td> U+021D4 </td> <td> <span class="glyph" title="">⇔</span> </td> <tr id="entity-ifr"><td> <code title="">ifr;</code> </td> <td> U+1D526 </td> <td> <span class="glyph" title="">𝔦</span> </td> <tr id="entity-igrave"><td> <code title="">igrave;</code> </td> <td> U+000EC </td> <td> <span class="glyph" title="">ì</span> </td> <tr id="entity-ii"><td> <code title="">ii;</code> </td> <td> U+02148 </td> <td> <span class="glyph" title="">ⅈ</span> </td> <tr id="entity-iiiint"><td> <code title="">iiiint;</code> </td> <td> U+02A0C </td> <td> <span class="glyph" title="">⨌</span> </td> <tr id="entity-iiint"><td> <code title="">iiint;</code> </td> <td> U+0222D </td> <td> <span class="glyph" title="">∭</span> </td> <tr id="entity-iinfin"><td> <code title="">iinfin;</code> </td> <td> U+029DC </td> <td> <span class="glyph" title="">⧜</span> </td> <tr id="entity-iiota"><td> <code title="">iiota;</code> </td> <td> U+02129 </td> <td> <span class="glyph" title="">℩</span> </td> <tr id="entity-ijlig"><td> <code title="">ijlig;</code> </td> <td> U+00133 </td> <td> <span class="glyph" title="">ij</span> </td> <tr id="entity-imacr"><td> <code title="">imacr;</code> </td> <td> U+0012B </td> <td> <span class="glyph" title="">ī</span> </td> <tr id="entity-image"><td> <code title="">image;</code> </td> <td> U+02111 </td> <td> <span class="glyph" title="">ℑ</span> </td> <tr id="entity-imagline"><td> <code title="">imagline;</code> </td> <td> U+02110 </td> <td> <span class="glyph" title="">ℐ</span> </td> <tr id="entity-imagpart"><td> <code title="">imagpart;</code> </td> <td> U+02111 </td> <td> <span class="glyph" title="">ℑ</span> </td> <tr id="entity-imath"><td> <code title="">imath;</code> </td> <td> U+00131 </td> <td> <span class="glyph" title="">ı</span> </td> <tr id="entity-imof"><td> <code title="">imof;</code> </td> <td> U+022B7 </td> <td> <span class="glyph" title="">⊷</span> </td> <tr id="entity-imped"><td> <code title="">imped;</code> </td> <td> U+001B5 </td> <td> <span class="glyph" title="">Ƶ</span> </td> <tr id="entity-in"><td> <code title="">in;</code> </td> <td> U+02208 </td> <td> <span class="glyph" title="">∈</span> </td> <tr id="entity-incare"><td> <code title="">incare;</code> </td> <td> U+02105 </td> <td> <span class="glyph" title="">℅</span> </td> <tr id="entity-infin"><td> <code title="">infin;</code> </td> <td> U+0221E </td> <td> <span class="glyph" title="">∞</span> </td> <tr id="entity-infintie"><td> <code title="">infintie;</code> </td> <td> U+029DD </td> <td> <span class="glyph" title="">⧝</span> </td> <tr id="entity-inodot"><td> <code title="">inodot;</code> </td> <td> U+00131 </td> <td> <span class="glyph" title="">ı</span> </td> <tr id="entity-int"><td> <code title="">int;</code> </td> <td> U+0222B </td> <td> <span class="glyph" title="">∫</span> </td> <tr id="entity-intcal"><td> <code title="">intcal;</code> </td> <td> U+022BA </td> <td> <span class="glyph" title="">⊺</span> </td> <tr id="entity-integers"><td> <code title="">integers;</code> </td> <td> U+02124 </td> <td> <span class="glyph" title="">ℤ</span> </td> <tr id="entity-intercal"><td> <code title="">intercal;</code> </td> <td> U+022BA </td> <td> <span class="glyph" title="">⊺</span> </td> <tr id="entity-intlarhk"><td> <code title="">intlarhk;</code> </td> <td> U+02A17 </td> <td> <span class="glyph" title="">⨗</span> </td> <tr id="entity-intprod"><td> <code title="">intprod;</code> </td> <td> U+02A3C </td> <td> <span class="glyph" title="">⨼</span> </td> <tr id="entity-iocy"><td> <code title="">iocy;</code> </td> <td> U+00451 </td> <td> <span class="glyph" title="">ё</span> </td> <tr id="entity-iogon"><td> <code title="">iogon;</code> </td> <td> U+0012F </td> <td> <span class="glyph" title="">į</span> </td> <tr id="entity-iopf"><td> <code title="">iopf;</code> </td> <td> U+1D55A </td> <td> <span class="glyph" title="">𝕚</span> </td> <tr id="entity-iota"><td> <code title="">iota;</code> </td> <td> U+003B9 </td> <td> <span class="glyph" title="">ι</span> </td> <tr id="entity-iprod"><td> <code title="">iprod;</code> </td> <td> U+02A3C </td> <td> <span class="glyph" title="">⨼</span> </td> <tr id="entity-iquest"><td> <code title="">iquest;</code> </td> <td> U+000BF </td> <td> <span class="glyph" title="">¿</span> </td> <tr id="entity-iscr"><td> <code title="">iscr;</code> </td> <td> U+1D4BE </td> <td> <span class="glyph" title="">𝒾</span> </td> <tr id="entity-isin"><td> <code title="">isin;</code> </td> <td> U+02208 </td> <td> <span class="glyph" title="">∈</span> </td> <tr id="entity-isinE"><td> <code title="">isinE;</code> </td> <td> U+022F9 </td> <td> <span class="glyph" title="">⋹</span> </td> <tr id="entity-isindot"><td> <code title="">isindot;</code> </td> <td> U+022F5 </td> <td> <span class="glyph" title="">⋵</span> </td> <tr id="entity-isins"><td> <code title="">isins;</code> </td> <td> U+022F4 </td> <td> <span class="glyph" title="">⋴</span> </td> <tr id="entity-isinsv"><td> <code title="">isinsv;</code> </td> <td> U+022F3 </td> <td> <span class="glyph" title="">⋳</span> </td> <tr id="entity-isinv"><td> <code title="">isinv;</code> </td> <td> U+02208 </td> <td> <span class="glyph" title="">∈</span> </td> <tr id="entity-it"><td> <code title="">it;</code> </td> <td> U+02062 </td> <td> <span class="glyph" title="">⁢</span> </td> <tr id="entity-itilde"><td> <code title="">itilde;</code> </td> <td> U+00129 </td> <td> <span class="glyph" title="">ĩ</span> </td> <tr id="entity-iukcy"><td> <code title="">iukcy;</code> </td> <td> U+00456 </td> <td> <span class="glyph" title="">і</span> </td> <tr id="entity-iuml"><td> <code title="">iuml;</code> </td> <td> U+000EF </td> <td> <span class="glyph" title="">ï</span> </td> <tr id="entity-jcirc"><td> <code title="">jcirc;</code> </td> <td> U+00135 </td> <td> <span class="glyph" title="">ĵ</span> </td> <tr id="entity-jcy"><td> <code title="">jcy;</code> </td> <td> U+00439 </td> <td> <span class="glyph" title="">й</span> </td> <tr id="entity-jfr"><td> <code title="">jfr;</code> </td> <td> U+1D527 </td> <td> <span class="glyph" title="">𝔧</span> </td> <tr id="entity-jmath"><td> <code title="">jmath;</code> </td> <td> U+00237 </td> <td> <span class="glyph" title="">ȷ</span> </td> <tr id="entity-jopf"><td> <code title="">jopf;</code> </td> <td> U+1D55B </td> <td> <span class="glyph" title="">𝕛</span> </td> <tr id="entity-jscr"><td> <code title="">jscr;</code> </td> <td> U+1D4BF </td> <td> <span class="glyph" title="">𝒿</span> </td> <tr id="entity-jsercy"><td> <code title="">jsercy;</code> </td> <td> U+00458 </td> <td> <span class="glyph" title="">ј</span> </td> <tr id="entity-jukcy"><td> <code title="">jukcy;</code> </td> <td> U+00454 </td> <td> <span class="glyph" title="">є</span> </td> <tr id="entity-kappa"><td> <code title="">kappa;</code> </td> <td> U+003BA </td> <td> <span class="glyph" title="">κ</span> </td> <tr id="entity-kappav"><td> <code title="">kappav;</code> </td> <td> U+003F0 </td> <td> <span class="glyph" title="">ϰ</span> </td> <tr id="entity-kcedil"><td> <code title="">kcedil;</code> </td> <td> U+00137 </td> <td> <span class="glyph" title="">ķ</span> </td> <tr id="entity-kcy"><td> <code title="">kcy;</code> </td> <td> U+0043A </td> <td> <span class="glyph" title="">к</span> </td> <tr id="entity-kfr"><td> <code title="">kfr;</code> </td> <td> U+1D528 </td> <td> <span class="glyph" title="">𝔨</span> </td> <tr id="entity-kgreen"><td> <code title="">kgreen;</code> </td> <td> U+00138 </td> <td> <span class="glyph" title="">ĸ</span> </td> <tr id="entity-khcy"><td> <code title="">khcy;</code> </td> <td> U+00445 </td> <td> <span class="glyph" title="">х</span> </td> <tr id="entity-kjcy"><td> <code title="">kjcy;</code> </td> <td> U+0045C </td> <td> <span class="glyph" title="">ќ</span> </td> <tr id="entity-kopf"><td> <code title="">kopf;</code> </td> <td> U+1D55C </td> <td> <span class="glyph" title="">𝕜</span> </td> <tr id="entity-kscr"><td> <code title="">kscr;</code> </td> <td> U+1D4C0 </td> <td> <span class="glyph" title="">𝓀</span> </td> <tr id="entity-lAarr"><td> <code title="">lAarr;</code> </td> <td> U+021DA </td> <td> <span class="glyph" title="">⇚</span> </td> <tr id="entity-lArr"><td> <code title="">lArr;</code> </td> <td> U+021D0 </td> <td> <span class="glyph" title="">⇐</span> </td> <tr id="entity-lAtail"><td> <code title="">lAtail;</code> </td> <td> U+0291B </td> <td> <span class="glyph" title="">⤛</span> </td> <tr id="entity-lBarr"><td> <code title="">lBarr;</code> </td> <td> U+0290E </td> <td> <span class="glyph" title="">⤎</span> </td> <tr id="entity-lE"><td> <code title="">lE;</code> </td> <td> U+02266 </td> <td> <span class="glyph" title="">≦</span> </td> <tr id="entity-lEg"><td> <code title="">lEg;</code> </td> <td> U+02A8B </td> <td> <span class="glyph" title="">⪋</span> </td> <tr id="entity-lHar"><td> <code title="">lHar;</code> </td> <td> U+02962 </td> <td> <span class="glyph" title="">⥢</span> </td> <tr id="entity-lacute"><td> <code title="">lacute;</code> </td> <td> U+0013A </td> <td> <span class="glyph" title="">ĺ</span> </td> <tr id="entity-laemptyv"><td> <code title="">laemptyv;</code> </td> <td> U+029B4 </td> <td> <span class="glyph" title="">⦴</span> </td> <tr id="entity-lagran"><td> <code title="">lagran;</code> </td> <td> U+02112 </td> <td> <span class="glyph" title="">ℒ</span> </td> <tr id="entity-lambda"><td> <code title="">lambda;</code> </td> <td> U+003BB </td> <td> <span class="glyph" title="">λ</span> </td> <tr id="entity-lang"><td> <code title="">lang;</code> </td> <td> U+027E8 </td> <td> <span class="glyph" title="">⟨</span> </td> <tr id="entity-langd"><td> <code title="">langd;</code> </td> <td> U+02991 </td> <td> <span class="glyph" title="">⦑</span> </td> <tr id="entity-langle"><td> <code title="">langle;</code> </td> <td> U+027E8 </td> <td> <span class="glyph" title="">⟨</span> </td> <tr id="entity-lap"><td> <code title="">lap;</code> </td> <td> U+02A85 </td> <td> <span class="glyph" title="">⪅</span> </td> <tr id="entity-laquo"><td> <code title="">laquo;</code> </td> <td> U+000AB </td> <td> <span class="glyph" title="">«</span> </td> <tr id="entity-larr"><td> <code title="">larr;</code> </td> <td> U+02190 </td> <td> <span class="glyph" title="">←</span> </td> <tr id="entity-larrb"><td> <code title="">larrb;</code> </td> <td> U+021E4 </td> <td> <span class="glyph" title="">⇤</span> </td> <tr id="entity-larrbfs"><td> <code title="">larrbfs;</code> </td> <td> U+0291F </td> <td> <span class="glyph" title="">⤟</span> </td> <tr id="entity-larrfs"><td> <code title="">larrfs;</code> </td> <td> U+0291D </td> <td> <span class="glyph" title="">⤝</span> </td> <tr id="entity-larrhk"><td> <code title="">larrhk;</code> </td> <td> U+021A9 </td> <td> <span class="glyph" title="">↩</span> </td> <tr id="entity-larrlp"><td> <code title="">larrlp;</code> </td> <td> U+021AB </td> <td> <span class="glyph" title="">↫</span> </td> <tr id="entity-larrpl"><td> <code title="">larrpl;</code> </td> <td> U+02939 </td> <td> <span class="glyph" title="">⤹</span> </td> <tr id="entity-larrsim"><td> <code title="">larrsim;</code> </td> <td> U+02973 </td> <td> <span class="glyph" title="">⥳</span> </td> <tr id="entity-larrtl"><td> <code title="">larrtl;</code> </td> <td> U+021A2 </td> <td> <span class="glyph" title="">↢</span> </td> <tr id="entity-lat"><td> <code title="">lat;</code> </td> <td> U+02AAB </td> <td> <span class="glyph" title="">⪫</span> </td> <tr id="entity-latail"><td> <code title="">latail;</code> </td> <td> U+02919 </td> <td> <span class="glyph" title="">⤙</span> </td> <tr id="entity-late"><td> <code title="">late;</code> </td> <td> U+02AAD </td> <td> <span class="glyph" title="">⪭</span> </td> <tr id="entity-lates"><td> <code title="">lates;</code> </td> <td> U+02AAD U+0FE00 </td> <td> <span class="glyph compound" title="">⪭︀</span> </td> <tr id="entity-lbarr"><td> <code title="">lbarr;</code> </td> <td> U+0290C </td> <td> <span class="glyph" title="">⤌</span> </td> <tr id="entity-lbbrk"><td> <code title="">lbbrk;</code> </td> <td> U+02772 </td> <td> <span class="glyph" title="">❲</span> </td> <tr id="entity-lbrace"><td> <code title="">lbrace;</code> </td> <td> U+0007B </td> <td> <span class="glyph" title="">{</span> </td> <tr id="entity-lbrack"><td> <code title="">lbrack;</code> </td> <td> U+0005B </td> <td> <span class="glyph" title="">[</span> </td> <tr id="entity-lbrke"><td> <code title="">lbrke;</code> </td> <td> U+0298B </td> <td> <span class="glyph" title="">⦋</span> </td> <tr id="entity-lbrksld"><td> <code title="">lbrksld;</code> </td> <td> U+0298F </td> <td> <span class="glyph" title="">⦏</span> </td> <tr id="entity-lbrkslu"><td> <code title="">lbrkslu;</code> </td> <td> U+0298D </td> <td> <span class="glyph" title="">⦍</span> </td> <tr id="entity-lcaron"><td> <code title="">lcaron;</code> </td> <td> U+0013E </td> <td> <span class="glyph" title="">ľ</span> </td> <tr id="entity-lcedil"><td> <code title="">lcedil;</code> </td> <td> U+0013C </td> <td> <span class="glyph" title="">ļ</span> </td> <tr id="entity-lceil"><td> <code title="">lceil;</code> </td> <td> U+02308 </td> <td> <span class="glyph" title="">⌈</span> </td> <tr id="entity-lcub"><td> <code title="">lcub;</code> </td> <td> U+0007B </td> <td> <span class="glyph" title="">{</span> </td> <tr id="entity-lcy"><td> <code title="">lcy;</code> </td> <td> U+0043B </td> <td> <span class="glyph" title="">л</span> </td> <tr id="entity-ldca"><td> <code title="">ldca;</code> </td> <td> U+02936 </td> <td> <span class="glyph" title="">⤶</span> </td> <tr id="entity-ldquo"><td> <code title="">ldquo;</code> </td> <td> U+0201C </td> <td> <span class="glyph" title="">“</span> </td> <tr id="entity-ldquor"><td> <code title="">ldquor;</code> </td> <td> U+0201E </td> <td> <span class="glyph" title="">„</span> </td> <tr id="entity-ldrdhar"><td> <code title="">ldrdhar;</code> </td> <td> U+02967 </td> <td> <span class="glyph" title="">⥧</span> </td> <tr id="entity-ldrushar"><td> <code title="">ldrushar;</code> </td> <td> U+0294B </td> <td> <span class="glyph" title="">⥋</span> </td> <tr id="entity-ldsh"><td> <code title="">ldsh;</code> </td> <td> U+021B2 </td> <td> <span class="glyph" title="">↲</span> </td> <tr id="entity-le"><td> <code title="">le;</code> </td> <td> U+02264 </td> <td> <span class="glyph" title="">≤</span> </td> <tr id="entity-leftarrow"><td> <code title="">leftarrow;</code> </td> <td> U+02190 </td> <td> <span class="glyph" title="">←</span> </td> <tr id="entity-leftarrowtail"><td> <code title="">leftarrowtail;</code> </td> <td> U+021A2 </td> <td> <span class="glyph" title="">↢</span> </td> <tr id="entity-leftharpoondown"><td> <code title="">leftharpoondown;</code> </td> <td> U+021BD </td> <td> <span class="glyph" title="">↽</span> </td> <tr id="entity-leftharpoonup"><td> <code title="">leftharpoonup;</code> </td> <td> U+021BC </td> <td> <span class="glyph" title="">↼</span> </td> <tr id="entity-leftleftarrows"><td> <code title="">leftleftarrows;</code> </td> <td> U+021C7 </td> <td> <span class="glyph" title="">⇇</span> </td> <tr id="entity-leftrightarrow"><td> <code title="">leftrightarrow;</code> </td> <td> U+02194 </td> <td> <span class="glyph" title="">↔</span> </td> <tr id="entity-leftrightarrows"><td> <code title="">leftrightarrows;</code> </td> <td> U+021C6 </td> <td> <span class="glyph" title="">⇆</span> </td> <tr id="entity-leftrightharpoons"><td> <code title="">leftrightharpoons;</code> </td> <td> U+021CB </td> <td> <span class="glyph" title="">⇋</span> </td> <tr id="entity-leftrightsquigarrow"><td> <code title="">leftrightsquigarrow;</code> </td> <td> U+021AD </td> <td> <span class="glyph" title="">↭</span> </td> <tr id="entity-leftthreetimes"><td> <code title="">leftthreetimes;</code> </td> <td> U+022CB </td> <td> <span class="glyph" title="">⋋</span> </td> <tr id="entity-leg"><td> <code title="">leg;</code> </td> <td> U+022DA </td> <td> <span class="glyph" title="">⋚</span> </td> <tr id="entity-leq"><td> <code title="">leq;</code> </td> <td> U+02264 </td> <td> <span class="glyph" title="">≤</span> </td> <tr id="entity-leqq"><td> <code title="">leqq;</code> </td> <td> U+02266 </td> <td> <span class="glyph" title="">≦</span> </td> <tr id="entity-leqslant"><td> <code title="">leqslant;</code> </td> <td> U+02A7D </td> <td> <span class="glyph" title="">⩽</span> </td> <tr id="entity-les"><td> <code title="">les;</code> </td> <td> U+02A7D </td> <td> <span class="glyph" title="">⩽</span> </td> <tr id="entity-lescc"><td> <code title="">lescc;</code> </td> <td> U+02AA8 </td> <td> <span class="glyph" title="">⪨</span> </td> <tr id="entity-lesdot"><td> <code title="">lesdot;</code> </td> <td> U+02A7F </td> <td> <span class="glyph" title="">⩿</span> </td> <tr id="entity-lesdoto"><td> <code title="">lesdoto;</code> </td> <td> U+02A81 </td> <td> <span class="glyph" title="">⪁</span> </td> <tr id="entity-lesdotor"><td> <code title="">lesdotor;</code> </td> <td> U+02A83 </td> <td> <span class="glyph" title="">⪃</span> </td> <tr id="entity-lesg"><td> <code title="">lesg;</code> </td> <td> U+022DA U+0FE00 </td> <td> <span class="glyph compound" title="">⋚︀</span> </td> <tr id="entity-lesges"><td> <code title="">lesges;</code> </td> <td> U+02A93 </td> <td> <span class="glyph" title="">⪓</span> </td> <tr id="entity-lessapprox"><td> <code title="">lessapprox;</code> </td> <td> U+02A85 </td> <td> <span class="glyph" title="">⪅</span> </td> <tr id="entity-lessdot"><td> <code title="">lessdot;</code> </td> <td> U+022D6 </td> <td> <span class="glyph" title="">⋖</span> </td> <tr id="entity-lesseqgtr"><td> <code title="">lesseqgtr;</code> </td> <td> U+022DA </td> <td> <span class="glyph" title="">⋚</span> </td> <tr id="entity-lesseqqgtr"><td> <code title="">lesseqqgtr;</code> </td> <td> U+02A8B </td> <td> <span class="glyph" title="">⪋</span> </td> <tr id="entity-lessgtr"><td> <code title="">lessgtr;</code> </td> <td> U+02276 </td> <td> <span class="glyph" title="">≶</span> </td> <tr id="entity-lesssim"><td> <code title="">lesssim;</code> </td> <td> U+02272 </td> <td> <span class="glyph" title="">≲</span> </td> <tr id="entity-lfisht"><td> <code title="">lfisht;</code> </td> <td> U+0297C </td> <td> <span class="glyph" title="">⥼</span> </td> <tr id="entity-lfloor"><td> <code title="">lfloor;</code> </td> <td> U+0230A </td> <td> <span class="glyph" title="">⌊</span> </td> <tr id="entity-lfr"><td> <code title="">lfr;</code> </td> <td> U+1D529 </td> <td> <span class="glyph" title="">𝔩</span> </td> <tr id="entity-lg"><td> <code title="">lg;</code> </td> <td> U+02276 </td> <td> <span class="glyph" title="">≶</span> </td> <tr id="entity-lgE"><td> <code title="">lgE;</code> </td> <td> U+02A91 </td> <td> <span class="glyph" title="">⪑</span> </td> <tr id="entity-lhard"><td> <code title="">lhard;</code> </td> <td> U+021BD </td> <td> <span class="glyph" title="">↽</span> </td> <tr id="entity-lharu"><td> <code title="">lharu;</code> </td> <td> U+021BC </td> <td> <span class="glyph" title="">↼</span> </td> <tr id="entity-lharul"><td> <code title="">lharul;</code> </td> <td> U+0296A </td> <td> <span class="glyph" title="">⥪</span> </td> <tr id="entity-lhblk"><td> <code title="">lhblk;</code> </td> <td> U+02584 </td> <td> <span class="glyph" title="">▄</span> </td> <tr id="entity-ljcy"><td> <code title="">ljcy;</code> </td> <td> U+00459 </td> <td> <span class="glyph" title="">љ</span> </td> <tr id="entity-ll"><td> <code title="">ll;</code> </td> <td> U+0226A </td> <td> <span class="glyph" title="">≪</span> </td> <tr id="entity-llarr"><td> <code title="">llarr;</code> </td> <td> U+021C7 </td> <td> <span class="glyph" title="">⇇</span> </td> <tr id="entity-llcorner"><td> <code title="">llcorner;</code> </td> <td> U+0231E </td> <td> <span class="glyph" title="">⌞</span> </td> <tr id="entity-llhard"><td> <code title="">llhard;</code> </td> <td> U+0296B </td> <td> <span class="glyph" title="">⥫</span> </td> <tr id="entity-lltri"><td> <code title="">lltri;</code> </td> <td> U+025FA </td> <td> <span class="glyph" title="">◺</span> </td> <tr id="entity-lmidot"><td> <code title="">lmidot;</code> </td> <td> U+00140 </td> <td> <span class="glyph" title="">ŀ</span> </td> <tr id="entity-lmoust"><td> <code title="">lmoust;</code> </td> <td> U+023B0 </td> <td> <span class="glyph" title="">⎰</span> </td> <tr id="entity-lmoustache"><td> <code title="">lmoustache;</code> </td> <td> U+023B0 </td> <td> <span class="glyph" title="">⎰</span> </td> <tr id="entity-lnE"><td> <code title="">lnE;</code> </td> <td> U+02268 </td> <td> <span class="glyph" title="">≨</span> </td> <tr id="entity-lnap"><td> <code title="">lnap;</code> </td> <td> U+02A89 </td> <td> <span class="glyph" title="">⪉</span> </td> <tr id="entity-lnapprox"><td> <code title="">lnapprox;</code> </td> <td> U+02A89 </td> <td> <span class="glyph" title="">⪉</span> </td> <tr id="entity-lne"><td> <code title="">lne;</code> </td> <td> U+02A87 </td> <td> <span class="glyph" title="">⪇</span> </td> <tr id="entity-lneq"><td> <code title="">lneq;</code> </td> <td> U+02A87 </td> <td> <span class="glyph" title="">⪇</span> </td> <tr id="entity-lneqq"><td> <code title="">lneqq;</code> </td> <td> U+02268 </td> <td> <span class="glyph" title="">≨</span> </td> <tr id="entity-lnsim"><td> <code title="">lnsim;</code> </td> <td> U+022E6 </td> <td> <span class="glyph" title="">⋦</span> </td> <tr id="entity-loang"><td> <code title="">loang;</code> </td> <td> U+027EC </td> <td> <span class="glyph" title="">⟬</span> </td> <tr id="entity-loarr"><td> <code title="">loarr;</code> </td> <td> U+021FD </td> <td> <span class="glyph" title="">⇽</span> </td> <tr id="entity-lobrk"><td> <code title="">lobrk;</code> </td> <td> U+027E6 </td> <td> <span class="glyph" title="">⟦</span> </td> <tr id="entity-longleftarrow"><td> <code title="">longleftarrow;</code> </td> <td> U+027F5 </td> <td> <span class="glyph" title="">⟵</span> </td> <tr id="entity-longleftrightarrow"><td> <code title="">longleftrightarrow;</code> </td> <td> U+027F7 </td> <td> <span class="glyph" title="">⟷</span> </td> <tr id="entity-longmapsto"><td> <code title="">longmapsto;</code> </td> <td> U+027FC </td> <td> <span class="glyph" title="">⟼</span> </td> <tr id="entity-longrightarrow"><td> <code title="">longrightarrow;</code> </td> <td> U+027F6 </td> <td> <span class="glyph" title="">⟶</span> </td> <tr id="entity-looparrowleft"><td> <code title="">looparrowleft;</code> </td> <td> U+021AB </td> <td> <span class="glyph" title="">↫</span> </td> <tr id="entity-looparrowright"><td> <code title="">looparrowright;</code> </td> <td> U+021AC </td> <td> <span class="glyph" title="">↬</span> </td> <tr id="entity-lopar"><td> <code title="">lopar;</code> </td> <td> U+02985 </td> <td> <span class="glyph" title="">⦅</span> </td> <tr id="entity-lopf"><td> <code title="">lopf;</code> </td> <td> U+1D55D </td> <td> <span class="glyph" title="">𝕝</span> </td> <tr id="entity-loplus"><td> <code title="">loplus;</code> </td> <td> U+02A2D </td> <td> <span class="glyph" title="">⨭</span> </td> <tr id="entity-lotimes"><td> <code title="">lotimes;</code> </td> <td> U+02A34 </td> <td> <span class="glyph" title="">⨴</span> </td> <tr id="entity-lowast"><td> <code title="">lowast;</code> </td> <td> U+02217 </td> <td> <span class="glyph" title="">∗</span> </td> <tr id="entity-lowbar"><td> <code title="">lowbar;</code> </td> <td> U+0005F </td> <td> <span class="glyph" title="">_</span> </td> <tr id="entity-loz"><td> <code title="">loz;</code> </td> <td> U+025CA </td> <td> <span class="glyph" title="">◊</span> </td> <tr id="entity-lozenge"><td> <code title="">lozenge;</code> </td> <td> U+025CA </td> <td> <span class="glyph" title="">◊</span> </td> <tr id="entity-lozf"><td> <code title="">lozf;</code> </td> <td> U+029EB </td> <td> <span class="glyph" title="">⧫</span> </td> <tr id="entity-lpar"><td> <code title="">lpar;</code> </td> <td> U+00028 </td> <td> <span class="glyph" title="">(</span> </td> <tr id="entity-lparlt"><td> <code title="">lparlt;</code> </td> <td> U+02993 </td> <td> <span class="glyph" title="">⦓</span> </td> <tr id="entity-lrarr"><td> <code title="">lrarr;</code> </td> <td> U+021C6 </td> <td> <span class="glyph" title="">⇆</span> </td> <tr id="entity-lrcorner"><td> <code title="">lrcorner;</code> </td> <td> U+0231F </td> <td> <span class="glyph" title="">⌟</span> </td> <tr id="entity-lrhar"><td> <code title="">lrhar;</code> </td> <td> U+021CB </td> <td> <span class="glyph" title="">⇋</span> </td> <tr id="entity-lrhard"><td> <code title="">lrhard;</code> </td> <td> U+0296D </td> <td> <span class="glyph" title="">⥭</span> </td> <tr id="entity-lrm"><td> <code title="">lrm;</code> </td> <td> U+0200E </td> <td> <span class="glyph" title="">‎</span> </td> <tr id="entity-lrtri"><td> <code title="">lrtri;</code> </td> <td> U+022BF </td> <td> <span class="glyph" title="">⊿</span> </td> <tr id="entity-lsaquo"><td> <code title="">lsaquo;</code> </td> <td> U+02039 </td> <td> <span class="glyph" title="">‹</span> </td> <tr id="entity-lscr"><td> <code title="">lscr;</code> </td> <td> U+1D4C1 </td> <td> <span class="glyph" title="">𝓁</span> </td> <tr id="entity-lsh"><td> <code title="">lsh;</code> </td> <td> U+021B0 </td> <td> <span class="glyph" title="">↰</span> </td> <tr id="entity-lsim"><td> <code title="">lsim;</code> </td> <td> U+02272 </td> <td> <span class="glyph" title="">≲</span> </td> <tr id="entity-lsime"><td> <code title="">lsime;</code> </td> <td> U+02A8D </td> <td> <span class="glyph" title="">⪍</span> </td> <tr id="entity-lsimg"><td> <code title="">lsimg;</code> </td> <td> U+02A8F </td> <td> <span class="glyph" title="">⪏</span> </td> <tr id="entity-lsqb"><td> <code title="">lsqb;</code> </td> <td> U+0005B </td> <td> <span class="glyph" title="">[</span> </td> <tr id="entity-lsquo"><td> <code title="">lsquo;</code> </td> <td> U+02018 </td> <td> <span class="glyph" title="">‘</span> </td> <tr id="entity-lsquor"><td> <code title="">lsquor;</code> </td> <td> U+0201A </td> <td> <span class="glyph" title="">‚</span> </td> <tr id="entity-lstrok"><td> <code title="">lstrok;</code> </td> <td> U+00142 </td> <td> <span class="glyph" title="">ł</span> </td> <tr id="entity-lt"><td> <code title="">lt;</code> </td> <td> U+0003C </td> <td> <span class="glyph" title=""><</span> </td> <tr id="entity-ltcc"><td> <code title="">ltcc;</code> </td> <td> U+02AA6 </td> <td> <span class="glyph" title="">⪦</span> </td> <tr id="entity-ltcir"><td> <code title="">ltcir;</code> </td> <td> U+02A79 </td> <td> <span class="glyph" title="">⩹</span> </td> <tr id="entity-ltdot"><td> <code title="">ltdot;</code> </td> <td> U+022D6 </td> <td> <span class="glyph" title="">⋖</span> </td> <tr id="entity-lthree"><td> <code title="">lthree;</code> </td> <td> U+022CB </td> <td> <span class="glyph" title="">⋋</span> </td> <tr id="entity-ltimes"><td> <code title="">ltimes;</code> </td> <td> U+022C9 </td> <td> <span class="glyph" title="">⋉</span> </td> <tr id="entity-ltlarr"><td> <code title="">ltlarr;</code> </td> <td> U+02976 </td> <td> <span class="glyph" title="">⥶</span> </td> <tr id="entity-ltquest"><td> <code title="">ltquest;</code> </td> <td> U+02A7B </td> <td> <span class="glyph" title="">⩻</span> </td> <tr id="entity-ltrPar"><td> <code title="">ltrPar;</code> </td> <td> U+02996 </td> <td> <span class="glyph" title="">⦖</span> </td> <tr id="entity-ltri"><td> <code title="">ltri;</code> </td> <td> U+025C3 </td> <td> <span class="glyph" title="">◃</span> </td> <tr id="entity-ltrie"><td> <code title="">ltrie;</code> </td> <td> U+022B4 </td> <td> <span class="glyph" title="">⊴</span> </td> <tr id="entity-ltrif"><td> <code title="">ltrif;</code> </td> <td> U+025C2 </td> <td> <span class="glyph" title="">◂</span> </td> <tr id="entity-lurdshar"><td> <code title="">lurdshar;</code> </td> <td> U+0294A </td> <td> <span class="glyph" title="">⥊</span> </td> <tr id="entity-luruhar"><td> <code title="">luruhar;</code> </td> <td> U+02966 </td> <td> <span class="glyph" title="">⥦</span> </td> <tr id="entity-lvertneqq"><td> <code title="">lvertneqq;</code> </td> <td> U+02268 U+0FE00 </td> <td> <span class="glyph compound" title="">≨︀</span> </td> <tr id="entity-lvnE"><td> <code title="">lvnE;</code> </td> <td> U+02268 U+0FE00 </td> <td> <span class="glyph compound" title="">≨︀</span> </td> <tr id="entity-mDDot"><td> <code title="">mDDot;</code> </td> <td> U+0223A </td> <td> <span class="glyph" title="">∺</span> </td> <tr id="entity-macr"><td> <code title="">macr;</code> </td> <td> U+000AF </td> <td> <span class="glyph" title="">¯</span> </td> <tr id="entity-male"><td> <code title="">male;</code> </td> <td> U+02642 </td> <td> <span class="glyph" title="">♂</span> </td> <tr id="entity-malt"><td> <code title="">malt;</code> </td> <td> U+02720 </td> <td> <span class="glyph" title="">✠</span> </td> <tr id="entity-maltese"><td> <code title="">maltese;</code> </td> <td> U+02720 </td> <td> <span class="glyph" title="">✠</span> </td> <tr id="entity-map"><td> <code title="">map;</code> </td> <td> U+021A6 </td> <td> <span class="glyph" title="">↦</span> </td> <tr id="entity-mapsto"><td> <code title="">mapsto;</code> </td> <td> U+021A6 </td> <td> <span class="glyph" title="">↦</span> </td> <tr id="entity-mapstodown"><td> <code title="">mapstodown;</code> </td> <td> U+021A7 </td> <td> <span class="glyph" title="">↧</span> </td> <tr id="entity-mapstoleft"><td> <code title="">mapstoleft;</code> </td> <td> U+021A4 </td> <td> <span class="glyph" title="">↤</span> </td> <tr id="entity-mapstoup"><td> <code title="">mapstoup;</code> </td> <td> U+021A5 </td> <td> <span class="glyph" title="">↥</span> </td> <tr id="entity-marker"><td> <code title="">marker;</code> </td> <td> U+025AE </td> <td> <span class="glyph" title="">▮</span> </td> <tr id="entity-mcomma"><td> <code title="">mcomma;</code> </td> <td> U+02A29 </td> <td> <span class="glyph" title="">⨩</span> </td> <tr id="entity-mcy"><td> <code title="">mcy;</code> </td> <td> U+0043C </td> <td> <span class="glyph" title="">м</span> </td> <tr id="entity-mdash"><td> <code title="">mdash;</code> </td> <td> U+02014 </td> <td> <span class="glyph" title="">—</span> </td> <tr id="entity-measuredangle"><td> <code title="">measuredangle;</code> </td> <td> U+02221 </td> <td> <span class="glyph" title="">∡</span> </td> <tr id="entity-mfr"><td> <code title="">mfr;</code> </td> <td> U+1D52A </td> <td> <span class="glyph" title="">𝔪</span> </td> <tr id="entity-mho"><td> <code title="">mho;</code> </td> <td> U+02127 </td> <td> <span class="glyph" title="">℧</span> </td> <tr id="entity-micro"><td> <code title="">micro;</code> </td> <td> U+000B5 </td> <td> <span class="glyph" title="">µ</span> </td> <tr id="entity-mid"><td> <code title="">mid;</code> </td> <td> U+02223 </td> <td> <span class="glyph" title="">∣</span> </td> <tr id="entity-midast"><td> <code title="">midast;</code> </td> <td> U+0002A </td> <td> <span class="glyph" title="">*</span> </td> <tr id="entity-midcir"><td> <code title="">midcir;</code> </td> <td> U+02AF0 </td> <td> <span class="glyph" title="">⫰</span> </td> <tr id="entity-middot"><td> <code title="">middot;</code> </td> <td> U+000B7 </td> <td> <span class="glyph" title="">·</span> </td> <tr id="entity-minus"><td> <code title="">minus;</code> </td> <td> U+02212 </td> <td> <span class="glyph" title="">−</span> </td> <tr id="entity-minusb"><td> <code title="">minusb;</code> </td> <td> U+0229F </td> <td> <span class="glyph" title="">⊟</span> </td> <tr id="entity-minusd"><td> <code title="">minusd;</code> </td> <td> U+02238 </td> <td> <span class="glyph" title="">∸</span> </td> <tr id="entity-minusdu"><td> <code title="">minusdu;</code> </td> <td> U+02A2A </td> <td> <span class="glyph" title="">⨪</span> </td> <tr id="entity-mlcp"><td> <code title="">mlcp;</code> </td> <td> U+02ADB </td> <td> <span class="glyph" title="">⫛</span> </td> <tr id="entity-mldr"><td> <code title="">mldr;</code> </td> <td> U+02026 </td> <td> <span class="glyph" title="">…</span> </td> <tr id="entity-mnplus"><td> <code title="">mnplus;</code> </td> <td> U+02213 </td> <td> <span class="glyph" title="">∓</span> </td> <tr id="entity-models"><td> <code title="">models;</code> </td> <td> U+022A7 </td> <td> <span class="glyph" title="">⊧</span> </td> <tr id="entity-mopf"><td> <code title="">mopf;</code> </td> <td> U+1D55E </td> <td> <span class="glyph" title="">𝕞</span> </td> <tr id="entity-mp"><td> <code title="">mp;</code> </td> <td> U+02213 </td> <td> <span class="glyph" title="">∓</span> </td> <tr id="entity-mscr"><td> <code title="">mscr;</code> </td> <td> U+1D4C2 </td> <td> <span class="glyph" title="">𝓂</span> </td> <tr id="entity-mstpos"><td> <code title="">mstpos;</code> </td> <td> U+0223E </td> <td> <span class="glyph" title="">∾</span> </td> <tr id="entity-mu"><td> <code title="">mu;</code> </td> <td> U+003BC </td> <td> <span class="glyph" title="">μ</span> </td> <tr id="entity-multimap"><td> <code title="">multimap;</code> </td> <td> U+022B8 </td> <td> <span class="glyph" title="">⊸</span> </td> <tr id="entity-mumap"><td> <code title="">mumap;</code> </td> <td> U+022B8 </td> <td> <span class="glyph" title="">⊸</span> </td> <tr id="entity-nGg"><td> <code title="">nGg;</code> </td> <td> U+022D9 U+00338 </td> <td> <span class="glyph compound" title="">⋙̸</span> </td> <tr id="entity-nGt"><td> <code title="">nGt;</code> </td> <td> U+0226B U+020D2 </td> <td> <span class="glyph compound" title="">≫⃒</span> </td> <tr id="entity-nGtv"><td> <code title="">nGtv;</code> </td> <td> U+0226B U+00338 </td> <td> <span class="glyph compound" title="">≫̸</span> </td> <tr id="entity-nLeftarrow"><td> <code title="">nLeftarrow;</code> </td> <td> U+021CD </td> <td> <span class="glyph" title="">⇍</span> </td> <tr id="entity-nLeftrightarrow"><td> <code title="">nLeftrightarrow;</code> </td> <td> U+021CE </td> <td> <span class="glyph" title="">⇎</span> </td> <tr id="entity-nLl"><td> <code title="">nLl;</code> </td> <td> U+022D8 U+00338 </td> <td> <span class="glyph compound" title="">⋘̸</span> </td> <tr id="entity-nLt"><td> <code title="">nLt;</code> </td> <td> U+0226A U+020D2 </td> <td> <span class="glyph compound" title="">≪⃒</span> </td> <tr id="entity-nLtv"><td> <code title="">nLtv;</code> </td> <td> U+0226A U+00338 </td> <td> <span class="glyph compound" title="">≪̸</span> </td> <tr id="entity-nRightarrow"><td> <code title="">nRightarrow;</code> </td> <td> U+021CF </td> <td> <span class="glyph" title="">⇏</span> </td> <tr id="entity-nVDash"><td> <code title="">nVDash;</code> </td> <td> U+022AF </td> <td> <span class="glyph" title="">⊯</span> </td> <tr id="entity-nVdash"><td> <code title="">nVdash;</code> </td> <td> U+022AE </td> <td> <span class="glyph" title="">⊮</span> </td> <tr id="entity-nabla"><td> <code title="">nabla;</code> </td> <td> U+02207 </td> <td> <span class="glyph" title="">∇</span> </td> <tr id="entity-nacute"><td> <code title="">nacute;</code> </td> <td> U+00144 </td> <td> <span class="glyph" title="">ń</span> </td> <tr id="entity-nang"><td> <code title="">nang;</code> </td> <td> U+02220 U+020D2 </td> <td> <span class="glyph compound" title="">∠⃒</span> </td> <tr id="entity-nap"><td> <code title="">nap;</code> </td> <td> U+02249 </td> <td> <span class="glyph" title="">≉</span> </td> <tr id="entity-napE"><td> <code title="">napE;</code> </td> <td> U+02A70 U+00338 </td> <td> <span class="glyph compound" title="">⩰̸</span> </td> <tr id="entity-napid"><td> <code title="">napid;</code> </td> <td> U+0224B U+00338 </td> <td> <span class="glyph compound" title="">≋̸</span> </td> <tr id="entity-napos"><td> <code title="">napos;</code> </td> <td> U+00149 </td> <td> <span class="glyph" title="">ʼn</span> </td> <tr id="entity-napprox"><td> <code title="">napprox;</code> </td> <td> U+02249 </td> <td> <span class="glyph" title="">≉</span> </td> <tr id="entity-natur"><td> <code title="">natur;</code> </td> <td> U+0266E </td> <td> <span class="glyph" title="">♮</span> </td> <tr id="entity-natural"><td> <code title="">natural;</code> </td> <td> U+0266E </td> <td> <span class="glyph" title="">♮</span> </td> <tr id="entity-naturals"><td> <code title="">naturals;</code> </td> <td> U+02115 </td> <td> <span class="glyph" title="">ℕ</span> </td> <tr id="entity-nbsp"><td> <code title="">nbsp;</code> </td> <td> U+000A0 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-nbump"><td> <code title="">nbump;</code> </td> <td> U+0224E U+00338 </td> <td> <span class="glyph compound" title="">≎̸</span> </td> <tr id="entity-nbumpe"><td> <code title="">nbumpe;</code> </td> <td> U+0224F U+00338 </td> <td> <span class="glyph compound" title="">≏̸</span> </td> <tr id="entity-ncap"><td> <code title="">ncap;</code> </td> <td> U+02A43 </td> <td> <span class="glyph" title="">⩃</span> </td> <tr id="entity-ncaron"><td> <code title="">ncaron;</code> </td> <td> U+00148 </td> <td> <span class="glyph" title="">ň</span> </td> <tr id="entity-ncedil"><td> <code title="">ncedil;</code> </td> <td> U+00146 </td> <td> <span class="glyph" title="">ņ</span> </td> <tr id="entity-ncong"><td> <code title="">ncong;</code> </td> <td> U+02247 </td> <td> <span class="glyph" title="">≇</span> </td> <tr id="entity-ncongdot"><td> <code title="">ncongdot;</code> </td> <td> U+02A6D U+00338 </td> <td> <span class="glyph compound" title="">⩭̸</span> </td> <tr id="entity-ncup"><td> <code title="">ncup;</code> </td> <td> U+02A42 </td> <td> <span class="glyph" title="">⩂</span> </td> <tr id="entity-ncy"><td> <code title="">ncy;</code> </td> <td> U+0043D </td> <td> <span class="glyph" title="">н</span> </td> <tr id="entity-ndash"><td> <code title="">ndash;</code> </td> <td> U+02013 </td> <td> <span class="glyph" title="">–</span> </td> <tr id="entity-ne"><td> <code title="">ne;</code> </td> <td> U+02260 </td> <td> <span class="glyph" title="">≠</span> </td> <tr id="entity-neArr"><td> <code title="">neArr;</code> </td> <td> U+021D7 </td> <td> <span class="glyph" title="">⇗</span> </td> <tr id="entity-nearhk"><td> <code title="">nearhk;</code> </td> <td> U+02924 </td> <td> <span class="glyph" title="">⤤</span> </td> <tr id="entity-nearr"><td> <code title="">nearr;</code> </td> <td> U+02197 </td> <td> <span class="glyph" title="">↗</span> </td> <tr id="entity-nearrow"><td> <code title="">nearrow;</code> </td> <td> U+02197 </td> <td> <span class="glyph" title="">↗</span> </td> <tr id="entity-nedot"><td> <code title="">nedot;</code> </td> <td> U+02250 U+00338 </td> <td> <span class="glyph compound" title="">≐̸</span> </td> <tr id="entity-nequiv"><td> <code title="">nequiv;</code> </td> <td> U+02262 </td> <td> <span class="glyph" title="">≢</span> </td> <tr id="entity-nesear"><td> <code title="">nesear;</code> </td> <td> U+02928 </td> <td> <span class="glyph" title="">⤨</span> </td> <tr id="entity-nesim"><td> <code title="">nesim;</code> </td> <td> U+02242 U+00338 </td> <td> <span class="glyph compound" title="">≂̸</span> </td> <tr id="entity-nexist"><td> <code title="">nexist;</code> </td> <td> U+02204 </td> <td> <span class="glyph" title="">∄</span> </td> <tr id="entity-nexists"><td> <code title="">nexists;</code> </td> <td> U+02204 </td> <td> <span class="glyph" title="">∄</span> </td> <tr id="entity-nfr"><td> <code title="">nfr;</code> </td> <td> U+1D52B </td> <td> <span class="glyph" title="">𝔫</span> </td> <tr id="entity-ngE"><td> <code title="">ngE;</code> </td> <td> U+02267 U+00338 </td> <td> <span class="glyph compound" title="">≧̸</span> </td> <tr id="entity-nge"><td> <code title="">nge;</code> </td> <td> U+02271 </td> <td> <span class="glyph" title="">≱</span> </td> <tr id="entity-ngeq"><td> <code title="">ngeq;</code> </td> <td> U+02271 </td> <td> <span class="glyph" title="">≱</span> </td> <tr id="entity-ngeqq"><td> <code title="">ngeqq;</code> </td> <td> U+02267 U+00338 </td> <td> <span class="glyph compound" title="">≧̸</span> </td> <tr id="entity-ngeqslant"><td> <code title="">ngeqslant;</code> </td> <td> U+02A7E U+00338 </td> <td> <span class="glyph compound" title="">⩾̸</span> </td> <tr id="entity-nges"><td> <code title="">nges;</code> </td> <td> U+02A7E U+00338 </td> <td> <span class="glyph compound" title="">⩾̸</span> </td> <tr id="entity-ngsim"><td> <code title="">ngsim;</code> </td> <td> U+02275 </td> <td> <span class="glyph" title="">≵</span> </td> <tr id="entity-ngt"><td> <code title="">ngt;</code> </td> <td> U+0226F </td> <td> <span class="glyph" title="">≯</span> </td> <tr id="entity-ngtr"><td> <code title="">ngtr;</code> </td> <td> U+0226F </td> <td> <span class="glyph" title="">≯</span> </td> <tr id="entity-nhArr"><td> <code title="">nhArr;</code> </td> <td> U+021CE </td> <td> <span class="glyph" title="">⇎</span> </td> <tr id="entity-nharr"><td> <code title="">nharr;</code> </td> <td> U+021AE </td> <td> <span class="glyph" title="">↮</span> </td> <tr id="entity-nhpar"><td> <code title="">nhpar;</code> </td> <td> U+02AF2 </td> <td> <span class="glyph" title="">⫲</span> </td> <tr id="entity-ni"><td> <code title="">ni;</code> </td> <td> U+0220B </td> <td> <span class="glyph" title="">∋</span> </td> <tr id="entity-nis"><td> <code title="">nis;</code> </td> <td> U+022FC </td> <td> <span class="glyph" title="">⋼</span> </td> <tr id="entity-nisd"><td> <code title="">nisd;</code> </td> <td> U+022FA </td> <td> <span class="glyph" title="">⋺</span> </td> <tr id="entity-niv"><td> <code title="">niv;</code> </td> <td> U+0220B </td> <td> <span class="glyph" title="">∋</span> </td> <tr id="entity-njcy"><td> <code title="">njcy;</code> </td> <td> U+0045A </td> <td> <span class="glyph" title="">њ</span> </td> <tr id="entity-nlArr"><td> <code title="">nlArr;</code> </td> <td> U+021CD </td> <td> <span class="glyph" title="">⇍</span> </td> <tr id="entity-nlE"><td> <code title="">nlE;</code> </td> <td> U+02266 U+00338 </td> <td> <span class="glyph compound" title="">≦̸</span> </td> <tr id="entity-nlarr"><td> <code title="">nlarr;</code> </td> <td> U+0219A </td> <td> <span class="glyph" title="">↚</span> </td> <tr id="entity-nldr"><td> <code title="">nldr;</code> </td> <td> U+02025 </td> <td> <span class="glyph" title="">‥</span> </td> <tr id="entity-nle"><td> <code title="">nle;</code> </td> <td> U+02270 </td> <td> <span class="glyph" title="">≰</span> </td> <tr id="entity-nleftarrow"><td> <code title="">nleftarrow;</code> </td> <td> U+0219A </td> <td> <span class="glyph" title="">↚</span> </td> <tr id="entity-nleftrightarrow"><td> <code title="">nleftrightarrow;</code> </td> <td> U+021AE </td> <td> <span class="glyph" title="">↮</span> </td> <tr id="entity-nleq"><td> <code title="">nleq;</code> </td> <td> U+02270 </td> <td> <span class="glyph" title="">≰</span> </td> <tr id="entity-nleqq"><td> <code title="">nleqq;</code> </td> <td> U+02266 U+00338 </td> <td> <span class="glyph compound" title="">≦̸</span> </td> <tr id="entity-nleqslant"><td> <code title="">nleqslant;</code> </td> <td> U+02A7D U+00338 </td> <td> <span class="glyph compound" title="">⩽̸</span> </td> <tr id="entity-nles"><td> <code title="">nles;</code> </td> <td> U+02A7D U+00338 </td> <td> <span class="glyph compound" title="">⩽̸</span> </td> <tr id="entity-nless"><td> <code title="">nless;</code> </td> <td> U+0226E </td> <td> <span class="glyph" title="">≮</span> </td> <tr id="entity-nlsim"><td> <code title="">nlsim;</code> </td> <td> U+02274 </td> <td> <span class="glyph" title="">≴</span> </td> <tr id="entity-nlt"><td> <code title="">nlt;</code> </td> <td> U+0226E </td> <td> <span class="glyph" title="">≮</span> </td> <tr id="entity-nltri"><td> <code title="">nltri;</code> </td> <td> U+022EA </td> <td> <span class="glyph" title="">⋪</span> </td> <tr id="entity-nltrie"><td> <code title="">nltrie;</code> </td> <td> U+022EC </td> <td> <span class="glyph" title="">⋬</span> </td> <tr id="entity-nmid"><td> <code title="">nmid;</code> </td> <td> U+02224 </td> <td> <span class="glyph" title="">∤</span> </td> <tr id="entity-nopf"><td> <code title="">nopf;</code> </td> <td> U+1D55F </td> <td> <span class="glyph" title="">𝕟</span> </td> <tr id="entity-not"><td> <code title="">not;</code> </td> <td> U+000AC </td> <td> <span class="glyph" title="">¬</span> </td> <tr id="entity-notin"><td> <code title="">notin;</code> </td> <td> U+02209 </td> <td> <span class="glyph" title="">∉</span> </td> <tr id="entity-notinE"><td> <code title="">notinE;</code> </td> <td> U+022F9 U+00338 </td> <td> <span class="glyph compound" title="">⋹̸</span> </td> <tr id="entity-notindot"><td> <code title="">notindot;</code> </td> <td> U+022F5 U+00338 </td> <td> <span class="glyph compound" title="">⋵̸</span> </td> <tr id="entity-notinva"><td> <code title="">notinva;</code> </td> <td> U+02209 </td> <td> <span class="glyph" title="">∉</span> </td> <tr id="entity-notinvb"><td> <code title="">notinvb;</code> </td> <td> U+022F7 </td> <td> <span class="glyph" title="">⋷</span> </td> <tr id="entity-notinvc"><td> <code title="">notinvc;</code> </td> <td> U+022F6 </td> <td> <span class="glyph" title="">⋶</span> </td> <tr id="entity-notni"><td> <code title="">notni;</code> </td> <td> U+0220C </td> <td> <span class="glyph" title="">∌</span> </td> <tr id="entity-notniva"><td> <code title="">notniva;</code> </td> <td> U+0220C </td> <td> <span class="glyph" title="">∌</span> </td> <tr id="entity-notnivb"><td> <code title="">notnivb;</code> </td> <td> U+022FE </td> <td> <span class="glyph" title="">⋾</span> </td> <tr id="entity-notnivc"><td> <code title="">notnivc;</code> </td> <td> U+022FD </td> <td> <span class="glyph" title="">⋽</span> </td> <tr id="entity-npar"><td> <code title="">npar;</code> </td> <td> U+02226 </td> <td> <span class="glyph" title="">∦</span> </td> <tr id="entity-nparallel"><td> <code title="">nparallel;</code> </td> <td> U+02226 </td> <td> <span class="glyph" title="">∦</span> </td> <tr id="entity-nparsl"><td> <code title="">nparsl;</code> </td> <td> U+02AFD U+020E5 </td> <td> <span class="glyph compound" title="">⫽⃥</span> </td> <tr id="entity-npart"><td> <code title="">npart;</code> </td> <td> U+02202 U+00338 </td> <td> <span class="glyph compound" title="">∂̸</span> </td> <tr id="entity-npolint"><td> <code title="">npolint;</code> </td> <td> U+02A14 </td> <td> <span class="glyph" title="">⨔</span> </td> <tr id="entity-npr"><td> <code title="">npr;</code> </td> <td> U+02280 </td> <td> <span class="glyph" title="">⊀</span> </td> <tr id="entity-nprcue"><td> <code title="">nprcue;</code> </td> <td> U+022E0 </td> <td> <span class="glyph" title="">⋠</span> </td> <tr id="entity-npre"><td> <code title="">npre;</code> </td> <td> U+02AAF U+00338 </td> <td> <span class="glyph compound" title="">⪯̸</span> </td> <tr id="entity-nprec"><td> <code title="">nprec;</code> </td> <td> U+02280 </td> <td> <span class="glyph" title="">⊀</span> </td> <tr id="entity-npreceq"><td> <code title="">npreceq;</code> </td> <td> U+02AAF U+00338 </td> <td> <span class="glyph compound" title="">⪯̸</span> </td> <tr id="entity-nrArr"><td> <code title="">nrArr;</code> </td> <td> U+021CF </td> <td> <span class="glyph" title="">⇏</span> </td> <tr id="entity-nrarr"><td> <code title="">nrarr;</code> </td> <td> U+0219B </td> <td> <span class="glyph" title="">↛</span> </td> <tr id="entity-nrarrc"><td> <code title="">nrarrc;</code> </td> <td> U+02933 U+00338 </td> <td> <span class="glyph compound" title="">⤳̸</span> </td> <tr id="entity-nrarrw"><td> <code title="">nrarrw;</code> </td> <td> U+0219D U+00338 </td> <td> <span class="glyph compound" title="">↝̸</span> </td> <tr id="entity-nrightarrow"><td> <code title="">nrightarrow;</code> </td> <td> U+0219B </td> <td> <span class="glyph" title="">↛</span> </td> <tr id="entity-nrtri"><td> <code title="">nrtri;</code> </td> <td> U+022EB </td> <td> <span class="glyph" title="">⋫</span> </td> <tr id="entity-nrtrie"><td> <code title="">nrtrie;</code> </td> <td> U+022ED </td> <td> <span class="glyph" title="">⋭</span> </td> <tr id="entity-nsc"><td> <code title="">nsc;</code> </td> <td> U+02281 </td> <td> <span class="glyph" title="">⊁</span> </td> <tr id="entity-nsccue"><td> <code title="">nsccue;</code> </td> <td> U+022E1 </td> <td> <span class="glyph" title="">⋡</span> </td> <tr id="entity-nsce"><td> <code title="">nsce;</code> </td> <td> U+02AB0 U+00338 </td> <td> <span class="glyph compound" title="">⪰̸</span> </td> <tr id="entity-nscr"><td> <code title="">nscr;</code> </td> <td> U+1D4C3 </td> <td> <span class="glyph" title="">𝓃</span> </td> <tr id="entity-nshortmid"><td> <code title="">nshortmid;</code> </td> <td> U+02224 </td> <td> <span class="glyph" title="">∤</span> </td> <tr id="entity-nshortparallel"><td> <code title="">nshortparallel;</code> </td> <td> U+02226 </td> <td> <span class="glyph" title="">∦</span> </td> <tr id="entity-nsim"><td> <code title="">nsim;</code> </td> <td> U+02241 </td> <td> <span class="glyph" title="">≁</span> </td> <tr id="entity-nsime"><td> <code title="">nsime;</code> </td> <td> U+02244 </td> <td> <span class="glyph" title="">≄</span> </td> <tr id="entity-nsimeq"><td> <code title="">nsimeq;</code> </td> <td> U+02244 </td> <td> <span class="glyph" title="">≄</span> </td> <tr id="entity-nsmid"><td> <code title="">nsmid;</code> </td> <td> U+02224 </td> <td> <span class="glyph" title="">∤</span> </td> <tr id="entity-nspar"><td> <code title="">nspar;</code> </td> <td> U+02226 </td> <td> <span class="glyph" title="">∦</span> </td> <tr id="entity-nsqsube"><td> <code title="">nsqsube;</code> </td> <td> U+022E2 </td> <td> <span class="glyph" title="">⋢</span> </td> <tr id="entity-nsqsupe"><td> <code title="">nsqsupe;</code> </td> <td> U+022E3 </td> <td> <span class="glyph" title="">⋣</span> </td> <tr id="entity-nsub"><td> <code title="">nsub;</code> </td> <td> U+02284 </td> <td> <span class="glyph" title="">⊄</span> </td> <tr id="entity-nsubE"><td> <code title="">nsubE;</code> </td> <td> U+02AC5 U+00338 </td> <td> <span class="glyph compound" title="">⫅̸</span> </td> <tr id="entity-nsube"><td> <code title="">nsube;</code> </td> <td> U+02288 </td> <td> <span class="glyph" title="">⊈</span> </td> <tr id="entity-nsubset"><td> <code title="">nsubset;</code> </td> <td> U+02282 U+020D2 </td> <td> <span class="glyph compound" title="">⊂⃒</span> </td> <tr id="entity-nsubseteq"><td> <code title="">nsubseteq;</code> </td> <td> U+02288 </td> <td> <span class="glyph" title="">⊈</span> </td> <tr id="entity-nsubseteqq"><td> <code title="">nsubseteqq;</code> </td> <td> U+02AC5 U+00338 </td> <td> <span class="glyph compound" title="">⫅̸</span> </td> <tr id="entity-nsucc"><td> <code title="">nsucc;</code> </td> <td> U+02281 </td> <td> <span class="glyph" title="">⊁</span> </td> <tr id="entity-nsucceq"><td> <code title="">nsucceq;</code> </td> <td> U+02AB0 U+00338 </td> <td> <span class="glyph compound" title="">⪰̸</span> </td> <tr id="entity-nsup"><td> <code title="">nsup;</code> </td> <td> U+02285 </td> <td> <span class="glyph" title="">⊅</span> </td> <tr id="entity-nsupE"><td> <code title="">nsupE;</code> </td> <td> U+02AC6 U+00338 </td> <td> <span class="glyph compound" title="">⫆̸</span> </td> <tr id="entity-nsupe"><td> <code title="">nsupe;</code> </td> <td> U+02289 </td> <td> <span class="glyph" title="">⊉</span> </td> <tr id="entity-nsupset"><td> <code title="">nsupset;</code> </td> <td> U+02283 U+020D2 </td> <td> <span class="glyph compound" title="">⊃⃒</span> </td> <tr id="entity-nsupseteq"><td> <code title="">nsupseteq;</code> </td> <td> U+02289 </td> <td> <span class="glyph" title="">⊉</span> </td> <tr id="entity-nsupseteqq"><td> <code title="">nsupseteqq;</code> </td> <td> U+02AC6 U+00338 </td> <td> <span class="glyph compound" title="">⫆̸</span> </td> <tr id="entity-ntgl"><td> <code title="">ntgl;</code> </td> <td> U+02279 </td> <td> <span class="glyph" title="">≹</span> </td> <tr id="entity-ntilde"><td> <code title="">ntilde;</code> </td> <td> U+000F1 </td> <td> <span class="glyph" title="">ñ</span> </td> <tr id="entity-ntlg"><td> <code title="">ntlg;</code> </td> <td> U+02278 </td> <td> <span class="glyph" title="">≸</span> </td> <tr id="entity-ntriangleleft"><td> <code title="">ntriangleleft;</code> </td> <td> U+022EA </td> <td> <span class="glyph" title="">⋪</span> </td> <tr id="entity-ntrianglelefteq"><td> <code title="">ntrianglelefteq;</code> </td> <td> U+022EC </td> <td> <span class="glyph" title="">⋬</span> </td> <tr id="entity-ntriangleright"><td> <code title="">ntriangleright;</code> </td> <td> U+022EB </td> <td> <span class="glyph" title="">⋫</span> </td> <tr id="entity-ntrianglerighteq"><td> <code title="">ntrianglerighteq;</code> </td> <td> U+022ED </td> <td> <span class="glyph" title="">⋭</span> </td> <tr id="entity-nu"><td> <code title="">nu;</code> </td> <td> U+003BD </td> <td> <span class="glyph" title="">ν</span> </td> <tr id="entity-num"><td> <code title="">num;</code> </td> <td> U+00023 </td> <td> <span class="glyph" title="">#</span> </td> <tr id="entity-numero"><td> <code title="">numero;</code> </td> <td> U+02116 </td> <td> <span class="glyph" title="">№</span> </td> <tr id="entity-numsp"><td> <code title="">numsp;</code> </td> <td> U+02007 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-nvDash"><td> <code title="">nvDash;</code> </td> <td> U+022AD </td> <td> <span class="glyph" title="">⊭</span> </td> <tr id="entity-nvHarr"><td> <code title="">nvHarr;</code> </td> <td> U+02904 </td> <td> <span class="glyph" title="">⤄</span> </td> <tr id="entity-nvap"><td> <code title="">nvap;</code> </td> <td> U+0224D U+020D2 </td> <td> <span class="glyph compound" title="">≍⃒</span> </td> <tr id="entity-nvdash"><td> <code title="">nvdash;</code> </td> <td> U+022AC </td> <td> <span class="glyph" title="">⊬</span> </td> <tr id="entity-nvge"><td> <code title="">nvge;</code> </td> <td> U+02265 U+020D2 </td> <td> <span class="glyph compound" title="">≥⃒</span> </td> <tr id="entity-nvgt"><td> <code title="">nvgt;</code> </td> <td> U+0003E U+020D2 </td> <td> <span class="glyph compound" title="">>⃒</span> </td> <tr id="entity-nvinfin"><td> <code title="">nvinfin;</code> </td> <td> U+029DE </td> <td> <span class="glyph" title="">⧞</span> </td> <tr id="entity-nvlArr"><td> <code title="">nvlArr;</code> </td> <td> U+02902 </td> <td> <span class="glyph" title="">⤂</span> </td> <tr id="entity-nvle"><td> <code title="">nvle;</code> </td> <td> U+02264 U+020D2 </td> <td> <span class="glyph compound" title="">≤⃒</span> </td> <tr id="entity-nvlt"><td> <code title="">nvlt;</code> </td> <td> U+0003C U+020D2 </td> <td> <span class="glyph compound" title=""><⃒</span> </td> <tr id="entity-nvltrie"><td> <code title="">nvltrie;</code> </td> <td> U+022B4 U+020D2 </td> <td> <span class="glyph compound" title="">⊴⃒</span> </td> <tr id="entity-nvrArr"><td> <code title="">nvrArr;</code> </td> <td> U+02903 </td> <td> <span class="glyph" title="">⤃</span> </td> <tr id="entity-nvrtrie"><td> <code title="">nvrtrie;</code> </td> <td> U+022B5 U+020D2 </td> <td> <span class="glyph compound" title="">⊵⃒</span> </td> <tr id="entity-nvsim"><td> <code title="">nvsim;</code> </td> <td> U+0223C U+020D2 </td> <td> <span class="glyph compound" title="">∼⃒</span> </td> <tr id="entity-nwArr"><td> <code title="">nwArr;</code> </td> <td> U+021D6 </td> <td> <span class="glyph" title="">⇖</span> </td> <tr id="entity-nwarhk"><td> <code title="">nwarhk;</code> </td> <td> U+02923 </td> <td> <span class="glyph" title="">⤣</span> </td> <tr id="entity-nwarr"><td> <code title="">nwarr;</code> </td> <td> U+02196 </td> <td> <span class="glyph" title="">↖</span> </td> <tr id="entity-nwarrow"><td> <code title="">nwarrow;</code> </td> <td> U+02196 </td> <td> <span class="glyph" title="">↖</span> </td> <tr id="entity-nwnear"><td> <code title="">nwnear;</code> </td> <td> U+02927 </td> <td> <span class="glyph" title="">⤧</span> </td> <tr id="entity-oS"><td> <code title="">oS;</code> </td> <td> U+024C8 </td> <td> <span class="glyph" title="">Ⓢ</span> </td> <tr id="entity-oacute"><td> <code title="">oacute;</code> </td> <td> U+000F3 </td> <td> <span class="glyph" title="">ó</span> </td> <tr id="entity-oast"><td> <code title="">oast;</code> </td> <td> U+0229B </td> <td> <span class="glyph" title="">⊛</span> </td> <tr id="entity-ocir"><td> <code title="">ocir;</code> </td> <td> U+0229A </td> <td> <span class="glyph" title="">⊚</span> </td> <tr id="entity-ocirc"><td> <code title="">ocirc;</code> </td> <td> U+000F4 </td> <td> <span class="glyph" title="">ô</span> </td> <tr id="entity-ocy"><td> <code title="">ocy;</code> </td> <td> U+0043E </td> <td> <span class="glyph" title="">о</span> </td> <tr id="entity-odash"><td> <code title="">odash;</code> </td> <td> U+0229D </td> <td> <span class="glyph" title="">⊝</span> </td> <tr id="entity-odblac"><td> <code title="">odblac;</code> </td> <td> U+00151 </td> <td> <span class="glyph" title="">ő</span> </td> <tr id="entity-odiv"><td> <code title="">odiv;</code> </td> <td> U+02A38 </td> <td> <span class="glyph" title="">⨸</span> </td> <tr id="entity-odot"><td> <code title="">odot;</code> </td> <td> U+02299 </td> <td> <span class="glyph" title="">⊙</span> </td> <tr id="entity-odsold"><td> <code title="">odsold;</code> </td> <td> U+029BC </td> <td> <span class="glyph" title="">⦼</span> </td> <tr id="entity-oelig"><td> <code title="">oelig;</code> </td> <td> U+00153 </td> <td> <span class="glyph" title="">œ</span> </td> <tr id="entity-ofcir"><td> <code title="">ofcir;</code> </td> <td> U+029BF </td> <td> <span class="glyph" title="">⦿</span> </td> <tr id="entity-ofr"><td> <code title="">ofr;</code> </td> <td> U+1D52C </td> <td> <span class="glyph" title="">𝔬</span> </td> <tr id="entity-ogon"><td> <code title="">ogon;</code> </td> <td> U+002DB </td> <td> <span class="glyph" title="">˛</span> </td> <tr id="entity-ograve"><td> <code title="">ograve;</code> </td> <td> U+000F2 </td> <td> <span class="glyph" title="">ò</span> </td> <tr id="entity-ogt"><td> <code title="">ogt;</code> </td> <td> U+029C1 </td> <td> <span class="glyph" title="">⧁</span> </td> <tr id="entity-ohbar"><td> <code title="">ohbar;</code> </td> <td> U+029B5 </td> <td> <span class="glyph" title="">⦵</span> </td> <tr id="entity-ohm"><td> <code title="">ohm;</code> </td> <td> U+003A9 </td> <td> <span class="glyph" title="">Ω</span> </td> <tr id="entity-oint"><td> <code title="">oint;</code> </td> <td> U+0222E </td> <td> <span class="glyph" title="">∮</span> </td> <tr id="entity-olarr"><td> <code title="">olarr;</code> </td> <td> U+021BA </td> <td> <span class="glyph" title="">↺</span> </td> <tr id="entity-olcir"><td> <code title="">olcir;</code> </td> <td> U+029BE </td> <td> <span class="glyph" title="">⦾</span> </td> <tr id="entity-olcross"><td> <code title="">olcross;</code> </td> <td> U+029BB </td> <td> <span class="glyph" title="">⦻</span> </td> <tr id="entity-oline"><td> <code title="">oline;</code> </td> <td> U+0203E </td> <td> <span class="glyph" title="">‾</span> </td> <tr id="entity-olt"><td> <code title="">olt;</code> </td> <td> U+029C0 </td> <td> <span class="glyph" title="">⧀</span> </td> <tr id="entity-omacr"><td> <code title="">omacr;</code> </td> <td> U+0014D </td> <td> <span class="glyph" title="">ō</span> </td> <tr id="entity-omega"><td> <code title="">omega;</code> </td> <td> U+003C9 </td> <td> <span class="glyph" title="">ω</span> </td> <tr id="entity-omicron"><td> <code title="">omicron;</code> </td> <td> U+003BF </td> <td> <span class="glyph" title="">ο</span> </td> <tr id="entity-omid"><td> <code title="">omid;</code> </td> <td> U+029B6 </td> <td> <span class="glyph" title="">⦶</span> </td> <tr id="entity-ominus"><td> <code title="">ominus;</code> </td> <td> U+02296 </td> <td> <span class="glyph" title="">⊖</span> </td> <tr id="entity-oopf"><td> <code title="">oopf;</code> </td> <td> U+1D560 </td> <td> <span class="glyph" title="">𝕠</span> </td> <tr id="entity-opar"><td> <code title="">opar;</code> </td> <td> U+029B7 </td> <td> <span class="glyph" title="">⦷</span> </td> <tr id="entity-operp"><td> <code title="">operp;</code> </td> <td> U+029B9 </td> <td> <span class="glyph" title="">⦹</span> </td> <tr id="entity-oplus"><td> <code title="">oplus;</code> </td> <td> U+02295 </td> <td> <span class="glyph" title="">⊕</span> </td> <tr id="entity-or"><td> <code title="">or;</code> </td> <td> U+02228 </td> <td> <span class="glyph" title="">∨</span> </td> <tr id="entity-orarr"><td> <code title="">orarr;</code> </td> <td> U+021BB </td> <td> <span class="glyph" title="">↻</span> </td> <tr id="entity-ord"><td> <code title="">ord;</code> </td> <td> U+02A5D </td> <td> <span class="glyph" title="">⩝</span> </td> <tr id="entity-order"><td> <code title="">order;</code> </td> <td> U+02134 </td> <td> <span class="glyph" title="">ℴ</span> </td> <tr id="entity-orderof"><td> <code title="">orderof;</code> </td> <td> U+02134 </td> <td> <span class="glyph" title="">ℴ</span> </td> <tr id="entity-ordf"><td> <code title="">ordf;</code> </td> <td> U+000AA </td> <td> <span class="glyph" title="">ª</span> </td> <tr id="entity-ordm"><td> <code title="">ordm;</code> </td> <td> U+000BA </td> <td> <span class="glyph" title="">º</span> </td> <tr id="entity-origof"><td> <code title="">origof;</code> </td> <td> U+022B6 </td> <td> <span class="glyph" title="">⊶</span> </td> <tr id="entity-oror"><td> <code title="">oror;</code> </td> <td> U+02A56 </td> <td> <span class="glyph" title="">⩖</span> </td> <tr id="entity-orslope"><td> <code title="">orslope;</code> </td> <td> U+02A57 </td> <td> <span class="glyph" title="">⩗</span> </td> <tr id="entity-orv"><td> <code title="">orv;</code> </td> <td> U+02A5B </td> <td> <span class="glyph" title="">⩛</span> </td> <tr id="entity-oscr"><td> <code title="">oscr;</code> </td> <td> U+02134 </td> <td> <span class="glyph" title="">ℴ</span> </td> <tr id="entity-oslash"><td> <code title="">oslash;</code> </td> <td> U+000F8 </td> <td> <span class="glyph" title="">ø</span> </td> <tr id="entity-osol"><td> <code title="">osol;</code> </td> <td> U+02298 </td> <td> <span class="glyph" title="">⊘</span> </td> <tr id="entity-otilde"><td> <code title="">otilde;</code> </td> <td> U+000F5 </td> <td> <span class="glyph" title="">õ</span> </td> <tr id="entity-otimes"><td> <code title="">otimes;</code> </td> <td> U+02297 </td> <td> <span class="glyph" title="">⊗</span> </td> <tr id="entity-otimesas"><td> <code title="">otimesas;</code> </td> <td> U+02A36 </td> <td> <span class="glyph" title="">⨶</span> </td> <tr id="entity-ouml"><td> <code title="">ouml;</code> </td> <td> U+000F6 </td> <td> <span class="glyph" title="">ö</span> </td> <tr id="entity-ovbar"><td> <code title="">ovbar;</code> </td> <td> U+0233D </td> <td> <span class="glyph" title="">⌽</span> </td> <tr id="entity-par"><td> <code title="">par;</code> </td> <td> U+02225 </td> <td> <span class="glyph" title="">∥</span> </td> <tr id="entity-para"><td> <code title="">para;</code> </td> <td> U+000B6 </td> <td> <span class="glyph" title="">¶</span> </td> <tr id="entity-parallel"><td> <code title="">parallel;</code> </td> <td> U+02225 </td> <td> <span class="glyph" title="">∥</span> </td> <tr id="entity-parsim"><td> <code title="">parsim;</code> </td> <td> U+02AF3 </td> <td> <span class="glyph" title="">⫳</span> </td> <tr id="entity-parsl"><td> <code title="">parsl;</code> </td> <td> U+02AFD </td> <td> <span class="glyph" title="">⫽</span> </td> <tr id="entity-part"><td> <code title="">part;</code> </td> <td> U+02202 </td> <td> <span class="glyph" title="">∂</span> </td> <tr id="entity-pcy"><td> <code title="">pcy;</code> </td> <td> U+0043F </td> <td> <span class="glyph" title="">п</span> </td> <tr id="entity-percnt"><td> <code title="">percnt;</code> </td> <td> U+00025 </td> <td> <span class="glyph" title="">%</span> </td> <tr id="entity-period"><td> <code title="">period;</code> </td> <td> U+0002E </td> <td> <span class="glyph" title="">.</span> </td> <tr id="entity-permil"><td> <code title="">permil;</code> </td> <td> U+02030 </td> <td> <span class="glyph" title="">‰</span> </td> <tr id="entity-perp"><td> <code title="">perp;</code> </td> <td> U+022A5 </td> <td> <span class="glyph" title="">⊥</span> </td> <tr id="entity-pertenk"><td> <code title="">pertenk;</code> </td> <td> U+02031 </td> <td> <span class="glyph" title="">‱</span> </td> <tr id="entity-pfr"><td> <code title="">pfr;</code> </td> <td> U+1D52D </td> <td> <span class="glyph" title="">𝔭</span> </td> <tr id="entity-phi"><td> <code title="">phi;</code> </td> <td> U+003C6 </td> <td> <span class="glyph" title="">φ</span> </td> <tr id="entity-phiv"><td> <code title="">phiv;</code> </td> <td> U+003D5 </td> <td> <span class="glyph" title="">ϕ</span> </td> <tr id="entity-phmmat"><td> <code title="">phmmat;</code> </td> <td> U+02133 </td> <td> <span class="glyph" title="">ℳ</span> </td> <tr id="entity-phone"><td> <code title="">phone;</code> </td> <td> U+0260E </td> <td> <span class="glyph" title="">☎</span> </td> <tr id="entity-pi"><td> <code title="">pi;</code> </td> <td> U+003C0 </td> <td> <span class="glyph" title="">π</span> </td> <tr id="entity-pitchfork"><td> <code title="">pitchfork;</code> </td> <td> U+022D4 </td> <td> <span class="glyph" title="">⋔</span> </td> <tr id="entity-piv"><td> <code title="">piv;</code> </td> <td> U+003D6 </td> <td> <span class="glyph" title="">ϖ</span> </td> <tr id="entity-planck"><td> <code title="">planck;</code> </td> <td> U+0210F </td> <td> <span class="glyph" title="">ℏ</span> </td> <tr id="entity-planckh"><td> <code title="">planckh;</code> </td> <td> U+0210E </td> <td> <span class="glyph" title="">ℎ</span> </td> <tr id="entity-plankv"><td> <code title="">plankv;</code> </td> <td> U+0210F </td> <td> <span class="glyph" title="">ℏ</span> </td> <tr id="entity-plus"><td> <code title="">plus;</code> </td> <td> U+0002B </td> <td> <span class="glyph" title="">+</span> </td> <tr id="entity-plusacir"><td> <code title="">plusacir;</code> </td> <td> U+02A23 </td> <td> <span class="glyph" title="">⨣</span> </td> <tr id="entity-plusb"><td> <code title="">plusb;</code> </td> <td> U+0229E </td> <td> <span class="glyph" title="">⊞</span> </td> <tr id="entity-pluscir"><td> <code title="">pluscir;</code> </td> <td> U+02A22 </td> <td> <span class="glyph" title="">⨢</span> </td> <tr id="entity-plusdo"><td> <code title="">plusdo;</code> </td> <td> U+02214 </td> <td> <span class="glyph" title="">∔</span> </td> <tr id="entity-plusdu"><td> <code title="">plusdu;</code> </td> <td> U+02A25 </td> <td> <span class="glyph" title="">⨥</span> </td> <tr id="entity-pluse"><td> <code title="">pluse;</code> </td> <td> U+02A72 </td> <td> <span class="glyph" title="">⩲</span> </td> <tr id="entity-plusmn"><td> <code title="">plusmn;</code> </td> <td> U+000B1 </td> <td> <span class="glyph" title="">±</span> </td> <tr id="entity-plussim"><td> <code title="">plussim;</code> </td> <td> U+02A26 </td> <td> <span class="glyph" title="">⨦</span> </td> <tr id="entity-plustwo"><td> <code title="">plustwo;</code> </td> <td> U+02A27 </td> <td> <span class="glyph" title="">⨧</span> </td> <tr id="entity-pm"><td> <code title="">pm;</code> </td> <td> U+000B1 </td> <td> <span class="glyph" title="">±</span> </td> <tr id="entity-pointint"><td> <code title="">pointint;</code> </td> <td> U+02A15 </td> <td> <span class="glyph" title="">⨕</span> </td> <tr id="entity-popf"><td> <code title="">popf;</code> </td> <td> U+1D561 </td> <td> <span class="glyph" title="">𝕡</span> </td> <tr id="entity-pound"><td> <code title="">pound;</code> </td> <td> U+000A3 </td> <td> <span class="glyph" title="">£</span> </td> <tr id="entity-pr"><td> <code title="">pr;</code> </td> <td> U+0227A </td> <td> <span class="glyph" title="">≺</span> </td> <tr id="entity-prE"><td> <code title="">prE;</code> </td> <td> U+02AB3 </td> <td> <span class="glyph" title="">⪳</span> </td> <tr id="entity-prap"><td> <code title="">prap;</code> </td> <td> U+02AB7 </td> <td> <span class="glyph" title="">⪷</span> </td> <tr id="entity-prcue"><td> <code title="">prcue;</code> </td> <td> U+0227C </td> <td> <span class="glyph" title="">≼</span> </td> <tr id="entity-pre"><td> <code title="">pre;</code> </td> <td> U+02AAF </td> <td> <span class="glyph" title="">⪯</span> </td> <tr id="entity-prec"><td> <code title="">prec;</code> </td> <td> U+0227A </td> <td> <span class="glyph" title="">≺</span> </td> <tr id="entity-precapprox"><td> <code title="">precapprox;</code> </td> <td> U+02AB7 </td> <td> <span class="glyph" title="">⪷</span> </td> <tr id="entity-preccurlyeq"><td> <code title="">preccurlyeq;</code> </td> <td> U+0227C </td> <td> <span class="glyph" title="">≼</span> </td> <tr id="entity-preceq"><td> <code title="">preceq;</code> </td> <td> U+02AAF </td> <td> <span class="glyph" title="">⪯</span> </td> <tr id="entity-precnapprox"><td> <code title="">precnapprox;</code> </td> <td> U+02AB9 </td> <td> <span class="glyph" title="">⪹</span> </td> <tr id="entity-precneqq"><td> <code title="">precneqq;</code> </td> <td> U+02AB5 </td> <td> <span class="glyph" title="">⪵</span> </td> <tr id="entity-precnsim"><td> <code title="">precnsim;</code> </td> <td> U+022E8 </td> <td> <span class="glyph" title="">⋨</span> </td> <tr id="entity-precsim"><td> <code title="">precsim;</code> </td> <td> U+0227E </td> <td> <span class="glyph" title="">≾</span> </td> <tr id="entity-prime"><td> <code title="">prime;</code> </td> <td> U+02032 </td> <td> <span class="glyph" title="">′</span> </td> <tr id="entity-primes"><td> <code title="">primes;</code> </td> <td> U+02119 </td> <td> <span class="glyph" title="">ℙ</span> </td> <tr id="entity-prnE"><td> <code title="">prnE;</code> </td> <td> U+02AB5 </td> <td> <span class="glyph" title="">⪵</span> </td> <tr id="entity-prnap"><td> <code title="">prnap;</code> </td> <td> U+02AB9 </td> <td> <span class="glyph" title="">⪹</span> </td> <tr id="entity-prnsim"><td> <code title="">prnsim;</code> </td> <td> U+022E8 </td> <td> <span class="glyph" title="">⋨</span> </td> <tr id="entity-prod"><td> <code title="">prod;</code> </td> <td> U+0220F </td> <td> <span class="glyph" title="">∏</span> </td> <tr id="entity-profalar"><td> <code title="">profalar;</code> </td> <td> U+0232E </td> <td> <span class="glyph" title="">⌮</span> </td> <tr id="entity-profline"><td> <code title="">profline;</code> </td> <td> U+02312 </td> <td> <span class="glyph" title="">⌒</span> </td> <tr id="entity-profsurf"><td> <code title="">profsurf;</code> </td> <td> U+02313 </td> <td> <span class="glyph" title="">⌓</span> </td> <tr id="entity-prop"><td> <code title="">prop;</code> </td> <td> U+0221D </td> <td> <span class="glyph" title="">∝</span> </td> <tr id="entity-propto"><td> <code title="">propto;</code> </td> <td> U+0221D </td> <td> <span class="glyph" title="">∝</span> </td> <tr id="entity-prsim"><td> <code title="">prsim;</code> </td> <td> U+0227E </td> <td> <span class="glyph" title="">≾</span> </td> <tr id="entity-prurel"><td> <code title="">prurel;</code> </td> <td> U+022B0 </td> <td> <span class="glyph" title="">⊰</span> </td> <tr id="entity-pscr"><td> <code title="">pscr;</code> </td> <td> U+1D4C5 </td> <td> <span class="glyph" title="">𝓅</span> </td> <tr id="entity-psi"><td> <code title="">psi;</code> </td> <td> U+003C8 </td> <td> <span class="glyph" title="">ψ</span> </td> <tr id="entity-puncsp"><td> <code title="">puncsp;</code> </td> <td> U+02008 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-qfr"><td> <code title="">qfr;</code> </td> <td> U+1D52E </td> <td> <span class="glyph" title="">𝔮</span> </td> <tr id="entity-qint"><td> <code title="">qint;</code> </td> <td> U+02A0C </td> <td> <span class="glyph" title="">⨌</span> </td> <tr id="entity-qopf"><td> <code title="">qopf;</code> </td> <td> U+1D562 </td> <td> <span class="glyph" title="">𝕢</span> </td> <tr id="entity-qprime"><td> <code title="">qprime;</code> </td> <td> U+02057 </td> <td> <span class="glyph" title="">⁗</span> </td> <tr id="entity-qscr"><td> <code title="">qscr;</code> </td> <td> U+1D4C6 </td> <td> <span class="glyph" title="">𝓆</span> </td> <tr id="entity-quaternions"><td> <code title="">quaternions;</code> </td> <td> U+0210D </td> <td> <span class="glyph" title="">ℍ</span> </td> <tr id="entity-quatint"><td> <code title="">quatint;</code> </td> <td> U+02A16 </td> <td> <span class="glyph" title="">⨖</span> </td> <tr id="entity-quest"><td> <code title="">quest;</code> </td> <td> U+0003F </td> <td> <span class="glyph" title="">?</span> </td> <tr id="entity-questeq"><td> <code title="">questeq;</code> </td> <td> U+0225F </td> <td> <span class="glyph" title="">≟</span> </td> <tr id="entity-quot"><td> <code title="">quot;</code> </td> <td> U+00022 </td> <td> <span class="glyph" title="">"</span> </td> <tr id="entity-rAarr"><td> <code title="">rAarr;</code> </td> <td> U+021DB </td> <td> <span class="glyph" title="">⇛</span> </td> <tr id="entity-rArr"><td> <code title="">rArr;</code> </td> <td> U+021D2 </td> <td> <span class="glyph" title="">⇒</span> </td> <tr id="entity-rAtail"><td> <code title="">rAtail;</code> </td> <td> U+0291C </td> <td> <span class="glyph" title="">⤜</span> </td> <tr id="entity-rBarr"><td> <code title="">rBarr;</code> </td> <td> U+0290F </td> <td> <span class="glyph" title="">⤏</span> </td> <tr id="entity-rHar"><td> <code title="">rHar;</code> </td> <td> U+02964 </td> <td> <span class="glyph" title="">⥤</span> </td> <tr id="entity-race"><td> <code title="">race;</code> </td> <td> U+0223D U+00331 </td> <td> <span class="glyph compound" title="">∽̱</span> </td> <tr id="entity-racute"><td> <code title="">racute;</code> </td> <td> U+00155 </td> <td> <span class="glyph" title="">ŕ</span> </td> <tr id="entity-radic"><td> <code title="">radic;</code> </td> <td> U+0221A </td> <td> <span class="glyph" title="">√</span> </td> <tr id="entity-raemptyv"><td> <code title="">raemptyv;</code> </td> <td> U+029B3 </td> <td> <span class="glyph" title="">⦳</span> </td> <tr id="entity-rang"><td> <code title="">rang;</code> </td> <td> U+027E9 </td> <td> <span class="glyph" title="">⟩</span> </td> <tr id="entity-rangd"><td> <code title="">rangd;</code> </td> <td> U+02992 </td> <td> <span class="glyph" title="">⦒</span> </td> <tr id="entity-range"><td> <code title="">range;</code> </td> <td> U+029A5 </td> <td> <span class="glyph" title="">⦥</span> </td> <tr id="entity-rangle"><td> <code title="">rangle;</code> </td> <td> U+027E9 </td> <td> <span class="glyph" title="">⟩</span> </td> <tr id="entity-raquo"><td> <code title="">raquo;</code> </td> <td> U+000BB </td> <td> <span class="glyph" title="">»</span> </td> <tr id="entity-rarr"><td> <code title="">rarr;</code> </td> <td> U+02192 </td> <td> <span class="glyph" title="">→</span> </td> <tr id="entity-rarrap"><td> <code title="">rarrap;</code> </td> <td> U+02975 </td> <td> <span class="glyph" title="">⥵</span> </td> <tr id="entity-rarrb"><td> <code title="">rarrb;</code> </td> <td> U+021E5 </td> <td> <span class="glyph" title="">⇥</span> </td> <tr id="entity-rarrbfs"><td> <code title="">rarrbfs;</code> </td> <td> U+02920 </td> <td> <span class="glyph" title="">⤠</span> </td> <tr id="entity-rarrc"><td> <code title="">rarrc;</code> </td> <td> U+02933 </td> <td> <span class="glyph" title="">⤳</span> </td> <tr id="entity-rarrfs"><td> <code title="">rarrfs;</code> </td> <td> U+0291E </td> <td> <span class="glyph" title="">⤞</span> </td> <tr id="entity-rarrhk"><td> <code title="">rarrhk;</code> </td> <td> U+021AA </td> <td> <span class="glyph" title="">↪</span> </td> <tr id="entity-rarrlp"><td> <code title="">rarrlp;</code> </td> <td> U+021AC </td> <td> <span class="glyph" title="">↬</span> </td> <tr id="entity-rarrpl"><td> <code title="">rarrpl;</code> </td> <td> U+02945 </td> <td> <span class="glyph" title="">⥅</span> </td> <tr id="entity-rarrsim"><td> <code title="">rarrsim;</code> </td> <td> U+02974 </td> <td> <span class="glyph" title="">⥴</span> </td> <tr id="entity-rarrtl"><td> <code title="">rarrtl;</code> </td> <td> U+021A3 </td> <td> <span class="glyph" title="">↣</span> </td> <tr id="entity-rarrw"><td> <code title="">rarrw;</code> </td> <td> U+0219D </td> <td> <span class="glyph" title="">↝</span> </td> <tr id="entity-ratail"><td> <code title="">ratail;</code> </td> <td> U+0291A </td> <td> <span class="glyph" title="">⤚</span> </td> <tr id="entity-ratio"><td> <code title="">ratio;</code> </td> <td> U+02236 </td> <td> <span class="glyph" title="">∶</span> </td> <tr id="entity-rationals"><td> <code title="">rationals;</code> </td> <td> U+0211A </td> <td> <span class="glyph" title="">ℚ</span> </td> <tr id="entity-rbarr"><td> <code title="">rbarr;</code> </td> <td> U+0290D </td> <td> <span class="glyph" title="">⤍</span> </td> <tr id="entity-rbbrk"><td> <code title="">rbbrk;</code> </td> <td> U+02773 </td> <td> <span class="glyph" title="">❳</span> </td> <tr id="entity-rbrace"><td> <code title="">rbrace;</code> </td> <td> U+0007D </td> <td> <span class="glyph" title="">}</span> </td> <tr id="entity-rbrack"><td> <code title="">rbrack;</code> </td> <td> U+0005D </td> <td> <span class="glyph" title="">]</span> </td> <tr id="entity-rbrke"><td> <code title="">rbrke;</code> </td> <td> U+0298C </td> <td> <span class="glyph" title="">⦌</span> </td> <tr id="entity-rbrksld"><td> <code title="">rbrksld;</code> </td> <td> U+0298E </td> <td> <span class="glyph" title="">⦎</span> </td> <tr id="entity-rbrkslu"><td> <code title="">rbrkslu;</code> </td> <td> U+02990 </td> <td> <span class="glyph" title="">⦐</span> </td> <tr id="entity-rcaron"><td> <code title="">rcaron;</code> </td> <td> U+00159 </td> <td> <span class="glyph" title="">ř</span> </td> <tr id="entity-rcedil"><td> <code title="">rcedil;</code> </td> <td> U+00157 </td> <td> <span class="glyph" title="">ŗ</span> </td> <tr id="entity-rceil"><td> <code title="">rceil;</code> </td> <td> U+02309 </td> <td> <span class="glyph" title="">⌉</span> </td> <tr id="entity-rcub"><td> <code title="">rcub;</code> </td> <td> U+0007D </td> <td> <span class="glyph" title="">}</span> </td> <tr id="entity-rcy"><td> <code title="">rcy;</code> </td> <td> U+00440 </td> <td> <span class="glyph" title="">р</span> </td> <tr id="entity-rdca"><td> <code title="">rdca;</code> </td> <td> U+02937 </td> <td> <span class="glyph" title="">⤷</span> </td> <tr id="entity-rdldhar"><td> <code title="">rdldhar;</code> </td> <td> U+02969 </td> <td> <span class="glyph" title="">⥩</span> </td> <tr id="entity-rdquo"><td> <code title="">rdquo;</code> </td> <td> U+0201D </td> <td> <span class="glyph" title="">”</span> </td> <tr id="entity-rdquor"><td> <code title="">rdquor;</code> </td> <td> U+0201D </td> <td> <span class="glyph" title="">”</span> </td> <tr id="entity-rdsh"><td> <code title="">rdsh;</code> </td> <td> U+021B3 </td> <td> <span class="glyph" title="">↳</span> </td> <tr id="entity-real"><td> <code title="">real;</code> </td> <td> U+0211C </td> <td> <span class="glyph" title="">ℜ</span> </td> <tr id="entity-realine"><td> <code title="">realine;</code> </td> <td> U+0211B </td> <td> <span class="glyph" title="">ℛ</span> </td> <tr id="entity-realpart"><td> <code title="">realpart;</code> </td> <td> U+0211C </td> <td> <span class="glyph" title="">ℜ</span> </td> <tr id="entity-reals"><td> <code title="">reals;</code> </td> <td> U+0211D </td> <td> <span class="glyph" title="">ℝ</span> </td> <tr id="entity-rect"><td> <code title="">rect;</code> </td> <td> U+025AD </td> <td> <span class="glyph" title="">▭</span> </td> <tr id="entity-reg"><td> <code title="">reg;</code> </td> <td> U+000AE </td> <td> <span class="glyph" title="">®</span> </td> <tr id="entity-rfisht"><td> <code title="">rfisht;</code> </td> <td> U+0297D </td> <td> <span class="glyph" title="">⥽</span> </td> <tr id="entity-rfloor"><td> <code title="">rfloor;</code> </td> <td> U+0230B </td> <td> <span class="glyph" title="">⌋</span> </td> <tr id="entity-rfr"><td> <code title="">rfr;</code> </td> <td> U+1D52F </td> <td> <span class="glyph" title="">𝔯</span> </td> <tr id="entity-rhard"><td> <code title="">rhard;</code> </td> <td> U+021C1 </td> <td> <span class="glyph" title="">⇁</span> </td> <tr id="entity-rharu"><td> <code title="">rharu;</code> </td> <td> U+021C0 </td> <td> <span class="glyph" title="">⇀</span> </td> <tr id="entity-rharul"><td> <code title="">rharul;</code> </td> <td> U+0296C </td> <td> <span class="glyph" title="">⥬</span> </td> <tr id="entity-rho"><td> <code title="">rho;</code> </td> <td> U+003C1 </td> <td> <span class="glyph" title="">ρ</span> </td> <tr id="entity-rhov"><td> <code title="">rhov;</code> </td> <td> U+003F1 </td> <td> <span class="glyph" title="">ϱ</span> </td> <tr id="entity-rightarrow"><td> <code title="">rightarrow;</code> </td> <td> U+02192 </td> <td> <span class="glyph" title="">→</span> </td> <tr id="entity-rightarrowtail"><td> <code title="">rightarrowtail;</code> </td> <td> U+021A3 </td> <td> <span class="glyph" title="">↣</span> </td> <tr id="entity-rightharpoondown"><td> <code title="">rightharpoondown;</code> </td> <td> U+021C1 </td> <td> <span class="glyph" title="">⇁</span> </td> <tr id="entity-rightharpoonup"><td> <code title="">rightharpoonup;</code> </td> <td> U+021C0 </td> <td> <span class="glyph" title="">⇀</span> </td> <tr id="entity-rightleftarrows"><td> <code title="">rightleftarrows;</code> </td> <td> U+021C4 </td> <td> <span class="glyph" title="">⇄</span> </td> <tr id="entity-rightleftharpoons"><td> <code title="">rightleftharpoons;</code> </td> <td> U+021CC </td> <td> <span class="glyph" title="">⇌</span> </td> <tr id="entity-rightrightarrows"><td> <code title="">rightrightarrows;</code> </td> <td> U+021C9 </td> <td> <span class="glyph" title="">⇉</span> </td> <tr id="entity-rightsquigarrow"><td> <code title="">rightsquigarrow;</code> </td> <td> U+0219D </td> <td> <span class="glyph" title="">↝</span> </td> <tr id="entity-rightthreetimes"><td> <code title="">rightthreetimes;</code> </td> <td> U+022CC </td> <td> <span class="glyph" title="">⋌</span> </td> <tr id="entity-ring"><td> <code title="">ring;</code> </td> <td> U+002DA </td> <td> <span class="glyph" title="">˚</span> </td> <tr id="entity-risingdotseq"><td> <code title="">risingdotseq;</code> </td> <td> U+02253 </td> <td> <span class="glyph" title="">≓</span> </td> <tr id="entity-rlarr"><td> <code title="">rlarr;</code> </td> <td> U+021C4 </td> <td> <span class="glyph" title="">⇄</span> </td> <tr id="entity-rlhar"><td> <code title="">rlhar;</code> </td> <td> U+021CC </td> <td> <span class="glyph" title="">⇌</span> </td> <tr id="entity-rlm"><td> <code title="">rlm;</code> </td> <td> U+0200F </td> <td> <span class="glyph" title="">‏</span> </td> <tr id="entity-rmoust"><td> <code title="">rmoust;</code> </td> <td> U+023B1 </td> <td> <span class="glyph" title="">⎱</span> </td> <tr id="entity-rmoustache"><td> <code title="">rmoustache;</code> </td> <td> U+023B1 </td> <td> <span class="glyph" title="">⎱</span> </td> <tr id="entity-rnmid"><td> <code title="">rnmid;</code> </td> <td> U+02AEE </td> <td> <span class="glyph" title="">⫮</span> </td> <tr id="entity-roang"><td> <code title="">roang;</code> </td> <td> U+027ED </td> <td> <span class="glyph" title="">⟭</span> </td> <tr id="entity-roarr"><td> <code title="">roarr;</code> </td> <td> U+021FE </td> <td> <span class="glyph" title="">⇾</span> </td> <tr id="entity-robrk"><td> <code title="">robrk;</code> </td> <td> U+027E7 </td> <td> <span class="glyph" title="">⟧</span> </td> <tr id="entity-ropar"><td> <code title="">ropar;</code> </td> <td> U+02986 </td> <td> <span class="glyph" title="">⦆</span> </td> <tr id="entity-ropf"><td> <code title="">ropf;</code> </td> <td> U+1D563 </td> <td> <span class="glyph" title="">𝕣</span> </td> <tr id="entity-roplus"><td> <code title="">roplus;</code> </td> <td> U+02A2E </td> <td> <span class="glyph" title="">⨮</span> </td> <tr id="entity-rotimes"><td> <code title="">rotimes;</code> </td> <td> U+02A35 </td> <td> <span class="glyph" title="">⨵</span> </td> <tr id="entity-rpar"><td> <code title="">rpar;</code> </td> <td> U+00029 </td> <td> <span class="glyph" title="">)</span> </td> <tr id="entity-rpargt"><td> <code title="">rpargt;</code> </td> <td> U+02994 </td> <td> <span class="glyph" title="">⦔</span> </td> <tr id="entity-rppolint"><td> <code title="">rppolint;</code> </td> <td> U+02A12 </td> <td> <span class="glyph" title="">⨒</span> </td> <tr id="entity-rrarr"><td> <code title="">rrarr;</code> </td> <td> U+021C9 </td> <td> <span class="glyph" title="">⇉</span> </td> <tr id="entity-rsaquo"><td> <code title="">rsaquo;</code> </td> <td> U+0203A </td> <td> <span class="glyph" title="">›</span> </td> <tr id="entity-rscr"><td> <code title="">rscr;</code> </td> <td> U+1D4C7 </td> <td> <span class="glyph" title="">𝓇</span> </td> <tr id="entity-rsh"><td> <code title="">rsh;</code> </td> <td> U+021B1 </td> <td> <span class="glyph" title="">↱</span> </td> <tr id="entity-rsqb"><td> <code title="">rsqb;</code> </td> <td> U+0005D </td> <td> <span class="glyph" title="">]</span> </td> <tr id="entity-rsquo"><td> <code title="">rsquo;</code> </td> <td> U+02019 </td> <td> <span class="glyph" title="">’</span> </td> <tr id="entity-rsquor"><td> <code title="">rsquor;</code> </td> <td> U+02019 </td> <td> <span class="glyph" title="">’</span> </td> <tr id="entity-rthree"><td> <code title="">rthree;</code> </td> <td> U+022CC </td> <td> <span class="glyph" title="">⋌</span> </td> <tr id="entity-rtimes"><td> <code title="">rtimes;</code> </td> <td> U+022CA </td> <td> <span class="glyph" title="">⋊</span> </td> <tr id="entity-rtri"><td> <code title="">rtri;</code> </td> <td> U+025B9 </td> <td> <span class="glyph" title="">▹</span> </td> <tr id="entity-rtrie"><td> <code title="">rtrie;</code> </td> <td> U+022B5 </td> <td> <span class="glyph" title="">⊵</span> </td> <tr id="entity-rtrif"><td> <code title="">rtrif;</code> </td> <td> U+025B8 </td> <td> <span class="glyph" title="">▸</span> </td> <tr id="entity-rtriltri"><td> <code title="">rtriltri;</code> </td> <td> U+029CE </td> <td> <span class="glyph" title="">⧎</span> </td> <tr id="entity-ruluhar"><td> <code title="">ruluhar;</code> </td> <td> U+02968 </td> <td> <span class="glyph" title="">⥨</span> </td> <tr id="entity-rx"><td> <code title="">rx;</code> </td> <td> U+0211E </td> <td> <span class="glyph" title="">℞</span> </td> <tr id="entity-sacute"><td> <code title="">sacute;</code> </td> <td> U+0015B </td> <td> <span class="glyph" title="">ś</span> </td> <tr id="entity-sbquo"><td> <code title="">sbquo;</code> </td> <td> U+0201A </td> <td> <span class="glyph" title="">‚</span> </td> <tr id="entity-sc"><td> <code title="">sc;</code> </td> <td> U+0227B </td> <td> <span class="glyph" title="">≻</span> </td> <tr id="entity-scE"><td> <code title="">scE;</code> </td> <td> U+02AB4 </td> <td> <span class="glyph" title="">⪴</span> </td> <tr id="entity-scap"><td> <code title="">scap;</code> </td> <td> U+02AB8 </td> <td> <span class="glyph" title="">⪸</span> </td> <tr id="entity-scaron"><td> <code title="">scaron;</code> </td> <td> U+00161 </td> <td> <span class="glyph" title="">š</span> </td> <tr id="entity-sccue"><td> <code title="">sccue;</code> </td> <td> U+0227D </td> <td> <span class="glyph" title="">≽</span> </td> <tr id="entity-sce"><td> <code title="">sce;</code> </td> <td> U+02AB0 </td> <td> <span class="glyph" title="">⪰</span> </td> <tr id="entity-scedil"><td> <code title="">scedil;</code> </td> <td> U+0015F </td> <td> <span class="glyph" title="">ş</span> </td> <tr id="entity-scirc"><td> <code title="">scirc;</code> </td> <td> U+0015D </td> <td> <span class="glyph" title="">ŝ</span> </td> <tr id="entity-scnE"><td> <code title="">scnE;</code> </td> <td> U+02AB6 </td> <td> <span class="glyph" title="">⪶</span> </td> <tr id="entity-scnap"><td> <code title="">scnap;</code> </td> <td> U+02ABA </td> <td> <span class="glyph" title="">⪺</span> </td> <tr id="entity-scnsim"><td> <code title="">scnsim;</code> </td> <td> U+022E9 </td> <td> <span class="glyph" title="">⋩</span> </td> <tr id="entity-scpolint"><td> <code title="">scpolint;</code> </td> <td> U+02A13 </td> <td> <span class="glyph" title="">⨓</span> </td> <tr id="entity-scsim"><td> <code title="">scsim;</code> </td> <td> U+0227F </td> <td> <span class="glyph" title="">≿</span> </td> <tr id="entity-scy"><td> <code title="">scy;</code> </td> <td> U+00441 </td> <td> <span class="glyph" title="">с</span> </td> <tr id="entity-sdot"><td> <code title="">sdot;</code> </td> <td> U+022C5 </td> <td> <span class="glyph" title="">⋅</span> </td> <tr id="entity-sdotb"><td> <code title="">sdotb;</code> </td> <td> U+022A1 </td> <td> <span class="glyph" title="">⊡</span> </td> <tr id="entity-sdote"><td> <code title="">sdote;</code> </td> <td> U+02A66 </td> <td> <span class="glyph" title="">⩦</span> </td> <tr id="entity-seArr"><td> <code title="">seArr;</code> </td> <td> U+021D8 </td> <td> <span class="glyph" title="">⇘</span> </td> <tr id="entity-searhk"><td> <code title="">searhk;</code> </td> <td> U+02925 </td> <td> <span class="glyph" title="">⤥</span> </td> <tr id="entity-searr"><td> <code title="">searr;</code> </td> <td> U+02198 </td> <td> <span class="glyph" title="">↘</span> </td> <tr id="entity-searrow"><td> <code title="">searrow;</code> </td> <td> U+02198 </td> <td> <span class="glyph" title="">↘</span> </td> <tr id="entity-sect"><td> <code title="">sect;</code> </td> <td> U+000A7 </td> <td> <span class="glyph" title="">§</span> </td> <tr id="entity-semi"><td> <code title="">semi;</code> </td> <td> U+0003B </td> <td> <span class="glyph" title="">;</span> </td> <tr id="entity-seswar"><td> <code title="">seswar;</code> </td> <td> U+02929 </td> <td> <span class="glyph" title="">⤩</span> </td> <tr id="entity-setminus"><td> <code title="">setminus;</code> </td> <td> U+02216 </td> <td> <span class="glyph" title="">∖</span> </td> <tr id="entity-setmn"><td> <code title="">setmn;</code> </td> <td> U+02216 </td> <td> <span class="glyph" title="">∖</span> </td> <tr id="entity-sext"><td> <code title="">sext;</code> </td> <td> U+02736 </td> <td> <span class="glyph" title="">✶</span> </td> <tr id="entity-sfr"><td> <code title="">sfr;</code> </td> <td> U+1D530 </td> <td> <span class="glyph" title="">𝔰</span> </td> <tr id="entity-sfrown"><td> <code title="">sfrown;</code> </td> <td> U+02322 </td> <td> <span class="glyph" title="">⌢</span> </td> <tr id="entity-sharp"><td> <code title="">sharp;</code> </td> <td> U+0266F </td> <td> <span class="glyph" title="">♯</span> </td> <tr id="entity-shchcy"><td> <code title="">shchcy;</code> </td> <td> U+00449 </td> <td> <span class="glyph" title="">щ</span> </td> <tr id="entity-shcy"><td> <code title="">shcy;</code> </td> <td> U+00448 </td> <td> <span class="glyph" title="">ш</span> </td> <tr id="entity-shortmid"><td> <code title="">shortmid;</code> </td> <td> U+02223 </td> <td> <span class="glyph" title="">∣</span> </td> <tr id="entity-shortparallel"><td> <code title="">shortparallel;</code> </td> <td> U+02225 </td> <td> <span class="glyph" title="">∥</span> </td> <tr id="entity-shy"><td> <code title="">shy;</code> </td> <td> U+000AD </td> <td> <span class="glyph" title="">­</span> </td> <tr id="entity-sigma"><td> <code title="">sigma;</code> </td> <td> U+003C3 </td> <td> <span class="glyph" title="">σ</span> </td> <tr id="entity-sigmaf"><td> <code title="">sigmaf;</code> </td> <td> U+003C2 </td> <td> <span class="glyph" title="">ς</span> </td> <tr id="entity-sigmav"><td> <code title="">sigmav;</code> </td> <td> U+003C2 </td> <td> <span class="glyph" title="">ς</span> </td> <tr id="entity-sim"><td> <code title="">sim;</code> </td> <td> U+0223C </td> <td> <span class="glyph" title="">∼</span> </td> <tr id="entity-simdot"><td> <code title="">simdot;</code> </td> <td> U+02A6A </td> <td> <span class="glyph" title="">⩪</span> </td> <tr id="entity-sime"><td> <code title="">sime;</code> </td> <td> U+02243 </td> <td> <span class="glyph" title="">≃</span> </td> <tr id="entity-simeq"><td> <code title="">simeq;</code> </td> <td> U+02243 </td> <td> <span class="glyph" title="">≃</span> </td> <tr id="entity-simg"><td> <code title="">simg;</code> </td> <td> U+02A9E </td> <td> <span class="glyph" title="">⪞</span> </td> <tr id="entity-simgE"><td> <code title="">simgE;</code> </td> <td> U+02AA0 </td> <td> <span class="glyph" title="">⪠</span> </td> <tr id="entity-siml"><td> <code title="">siml;</code> </td> <td> U+02A9D </td> <td> <span class="glyph" title="">⪝</span> </td> <tr id="entity-simlE"><td> <code title="">simlE;</code> </td> <td> U+02A9F </td> <td> <span class="glyph" title="">⪟</span> </td> <tr id="entity-simne"><td> <code title="">simne;</code> </td> <td> U+02246 </td> <td> <span class="glyph" title="">≆</span> </td> <tr id="entity-simplus"><td> <code title="">simplus;</code> </td> <td> U+02A24 </td> <td> <span class="glyph" title="">⨤</span> </td> <tr id="entity-simrarr"><td> <code title="">simrarr;</code> </td> <td> U+02972 </td> <td> <span class="glyph" title="">⥲</span> </td> <tr id="entity-slarr"><td> <code title="">slarr;</code> </td> <td> U+02190 </td> <td> <span class="glyph" title="">←</span> </td> <tr id="entity-smallsetminus"><td> <code title="">smallsetminus;</code> </td> <td> U+02216 </td> <td> <span class="glyph" title="">∖</span> </td> <tr id="entity-smashp"><td> <code title="">smashp;</code> </td> <td> U+02A33 </td> <td> <span class="glyph" title="">⨳</span> </td> <tr id="entity-smeparsl"><td> <code title="">smeparsl;</code> </td> <td> U+029E4 </td> <td> <span class="glyph" title="">⧤</span> </td> <tr id="entity-smid"><td> <code title="">smid;</code> </td> <td> U+02223 </td> <td> <span class="glyph" title="">∣</span> </td> <tr id="entity-smile"><td> <code title="">smile;</code> </td> <td> U+02323 </td> <td> <span class="glyph" title="">⌣</span> </td> <tr id="entity-smt"><td> <code title="">smt;</code> </td> <td> U+02AAA </td> <td> <span class="glyph" title="">⪪</span> </td> <tr id="entity-smte"><td> <code title="">smte;</code> </td> <td> U+02AAC </td> <td> <span class="glyph" title="">⪬</span> </td> <tr id="entity-smtes"><td> <code title="">smtes;</code> </td> <td> U+02AAC U+0FE00 </td> <td> <span class="glyph compound" title="">⪬︀</span> </td> <tr id="entity-softcy"><td> <code title="">softcy;</code> </td> <td> U+0044C </td> <td> <span class="glyph" title="">ь</span> </td> <tr id="entity-sol"><td> <code title="">sol;</code> </td> <td> U+0002F </td> <td> <span class="glyph" title="">/</span> </td> <tr id="entity-solb"><td> <code title="">solb;</code> </td> <td> U+029C4 </td> <td> <span class="glyph" title="">⧄</span> </td> <tr id="entity-solbar"><td> <code title="">solbar;</code> </td> <td> U+0233F </td> <td> <span class="glyph" title="">⌿</span> </td> <tr id="entity-sopf"><td> <code title="">sopf;</code> </td> <td> U+1D564 </td> <td> <span class="glyph" title="">𝕤</span> </td> <tr id="entity-spades"><td> <code title="">spades;</code> </td> <td> U+02660 </td> <td> <span class="glyph" title="">♠</span> </td> <tr id="entity-spadesuit"><td> <code title="">spadesuit;</code> </td> <td> U+02660 </td> <td> <span class="glyph" title="">♠</span> </td> <tr id="entity-spar"><td> <code title="">spar;</code> </td> <td> U+02225 </td> <td> <span class="glyph" title="">∥</span> </td> <tr id="entity-sqcap"><td> <code title="">sqcap;</code> </td> <td> U+02293 </td> <td> <span class="glyph" title="">⊓</span> </td> <tr id="entity-sqcaps"><td> <code title="">sqcaps;</code> </td> <td> U+02293 U+0FE00 </td> <td> <span class="glyph compound" title="">⊓︀</span> </td> <tr id="entity-sqcup"><td> <code title="">sqcup;</code> </td> <td> U+02294 </td> <td> <span class="glyph" title="">⊔</span> </td> <tr id="entity-sqcups"><td> <code title="">sqcups;</code> </td> <td> U+02294 U+0FE00 </td> <td> <span class="glyph compound" title="">⊔︀</span> </td> <tr id="entity-sqsub"><td> <code title="">sqsub;</code> </td> <td> U+0228F </td> <td> <span class="glyph" title="">⊏</span> </td> <tr id="entity-sqsube"><td> <code title="">sqsube;</code> </td> <td> U+02291 </td> <td> <span class="glyph" title="">⊑</span> </td> <tr id="entity-sqsubset"><td> <code title="">sqsubset;</code> </td> <td> U+0228F </td> <td> <span class="glyph" title="">⊏</span> </td> <tr id="entity-sqsubseteq"><td> <code title="">sqsubseteq;</code> </td> <td> U+02291 </td> <td> <span class="glyph" title="">⊑</span> </td> <tr id="entity-sqsup"><td> <code title="">sqsup;</code> </td> <td> U+02290 </td> <td> <span class="glyph" title="">⊐</span> </td> <tr id="entity-sqsupe"><td> <code title="">sqsupe;</code> </td> <td> U+02292 </td> <td> <span class="glyph" title="">⊒</span> </td> <tr id="entity-sqsupset"><td> <code title="">sqsupset;</code> </td> <td> U+02290 </td> <td> <span class="glyph" title="">⊐</span> </td> <tr id="entity-sqsupseteq"><td> <code title="">sqsupseteq;</code> </td> <td> U+02292 </td> <td> <span class="glyph" title="">⊒</span> </td> <tr id="entity-squ"><td> <code title="">squ;</code> </td> <td> U+025A1 </td> <td> <span class="glyph" title="">□</span> </td> <tr id="entity-square"><td> <code title="">square;</code> </td> <td> U+025A1 </td> <td> <span class="glyph" title="">□</span> </td> <tr id="entity-squarf"><td> <code title="">squarf;</code> </td> <td> U+025AA </td> <td> <span class="glyph" title="">▪</span> </td> <tr id="entity-squf"><td> <code title="">squf;</code> </td> <td> U+025AA </td> <td> <span class="glyph" title="">▪</span> </td> <tr id="entity-srarr"><td> <code title="">srarr;</code> </td> <td> U+02192 </td> <td> <span class="glyph" title="">→</span> </td> <tr id="entity-sscr"><td> <code title="">sscr;</code> </td> <td> U+1D4C8 </td> <td> <span class="glyph" title="">𝓈</span> </td> <tr id="entity-ssetmn"><td> <code title="">ssetmn;</code> </td> <td> U+02216 </td> <td> <span class="glyph" title="">∖</span> </td> <tr id="entity-ssmile"><td> <code title="">ssmile;</code> </td> <td> U+02323 </td> <td> <span class="glyph" title="">⌣</span> </td> <tr id="entity-sstarf"><td> <code title="">sstarf;</code> </td> <td> U+022C6 </td> <td> <span class="glyph" title="">⋆</span> </td> <tr id="entity-star"><td> <code title="">star;</code> </td> <td> U+02606 </td> <td> <span class="glyph" title="">☆</span> </td> <tr id="entity-starf"><td> <code title="">starf;</code> </td> <td> U+02605 </td> <td> <span class="glyph" title="">★</span> </td> <tr id="entity-straightepsilon"><td> <code title="">straightepsilon;</code> </td> <td> U+003F5 </td> <td> <span class="glyph" title="">ϵ</span> </td> <tr id="entity-straightphi"><td> <code title="">straightphi;</code> </td> <td> U+003D5 </td> <td> <span class="glyph" title="">ϕ</span> </td> <tr id="entity-strns"><td> <code title="">strns;</code> </td> <td> U+000AF </td> <td> <span class="glyph" title="">¯</span> </td> <tr id="entity-sub"><td> <code title="">sub;</code> </td> <td> U+02282 </td> <td> <span class="glyph" title="">⊂</span> </td> <tr id="entity-subE"><td> <code title="">subE;</code> </td> <td> U+02AC5 </td> <td> <span class="glyph" title="">⫅</span> </td> <tr id="entity-subdot"><td> <code title="">subdot;</code> </td> <td> U+02ABD </td> <td> <span class="glyph" title="">⪽</span> </td> <tr id="entity-sube"><td> <code title="">sube;</code> </td> <td> U+02286 </td> <td> <span class="glyph" title="">⊆</span> </td> <tr id="entity-subedot"><td> <code title="">subedot;</code> </td> <td> U+02AC3 </td> <td> <span class="glyph" title="">⫃</span> </td> <tr id="entity-submult"><td> <code title="">submult;</code> </td> <td> U+02AC1 </td> <td> <span class="glyph" title="">⫁</span> </td> <tr id="entity-subnE"><td> <code title="">subnE;</code> </td> <td> U+02ACB </td> <td> <span class="glyph" title="">⫋</span> </td> <tr id="entity-subne"><td> <code title="">subne;</code> </td> <td> U+0228A </td> <td> <span class="glyph" title="">⊊</span> </td> <tr id="entity-subplus"><td> <code title="">subplus;</code> </td> <td> U+02ABF </td> <td> <span class="glyph" title="">⪿</span> </td> <tr id="entity-subrarr"><td> <code title="">subrarr;</code> </td> <td> U+02979 </td> <td> <span class="glyph" title="">⥹</span> </td> <tr id="entity-subset"><td> <code title="">subset;</code> </td> <td> U+02282 </td> <td> <span class="glyph" title="">⊂</span> </td> <tr id="entity-subseteq"><td> <code title="">subseteq;</code> </td> <td> U+02286 </td> <td> <span class="glyph" title="">⊆</span> </td> <tr id="entity-subseteqq"><td> <code title="">subseteqq;</code> </td> <td> U+02AC5 </td> <td> <span class="glyph" title="">⫅</span> </td> <tr id="entity-subsetneq"><td> <code title="">subsetneq;</code> </td> <td> U+0228A </td> <td> <span class="glyph" title="">⊊</span> </td> <tr id="entity-subsetneqq"><td> <code title="">subsetneqq;</code> </td> <td> U+02ACB </td> <td> <span class="glyph" title="">⫋</span> </td> <tr id="entity-subsim"><td> <code title="">subsim;</code> </td> <td> U+02AC7 </td> <td> <span class="glyph" title="">⫇</span> </td> <tr id="entity-subsub"><td> <code title="">subsub;</code> </td> <td> U+02AD5 </td> <td> <span class="glyph" title="">⫕</span> </td> <tr id="entity-subsup"><td> <code title="">subsup;</code> </td> <td> U+02AD3 </td> <td> <span class="glyph" title="">⫓</span> </td> <tr id="entity-succ"><td> <code title="">succ;</code> </td> <td> U+0227B </td> <td> <span class="glyph" title="">≻</span> </td> <tr id="entity-succapprox"><td> <code title="">succapprox;</code> </td> <td> U+02AB8 </td> <td> <span class="glyph" title="">⪸</span> </td> <tr id="entity-succcurlyeq"><td> <code title="">succcurlyeq;</code> </td> <td> U+0227D </td> <td> <span class="glyph" title="">≽</span> </td> <tr id="entity-succeq"><td> <code title="">succeq;</code> </td> <td> U+02AB0 </td> <td> <span class="glyph" title="">⪰</span> </td> <tr id="entity-succnapprox"><td> <code title="">succnapprox;</code> </td> <td> U+02ABA </td> <td> <span class="glyph" title="">⪺</span> </td> <tr id="entity-succneqq"><td> <code title="">succneqq;</code> </td> <td> U+02AB6 </td> <td> <span class="glyph" title="">⪶</span> </td> <tr id="entity-succnsim"><td> <code title="">succnsim;</code> </td> <td> U+022E9 </td> <td> <span class="glyph" title="">⋩</span> </td> <tr id="entity-succsim"><td> <code title="">succsim;</code> </td> <td> U+0227F </td> <td> <span class="glyph" title="">≿</span> </td> <tr id="entity-sum"><td> <code title="">sum;</code> </td> <td> U+02211 </td> <td> <span class="glyph" title="">∑</span> </td> <tr id="entity-sung"><td> <code title="">sung;</code> </td> <td> U+0266A </td> <td> <span class="glyph" title="">♪</span> </td> <tr id="entity-sup"><td> <code title="">sup;</code> </td> <td> U+02283 </td> <td> <span class="glyph" title="">⊃</span> </td> <tr id="entity-sup1"><td> <code title="">sup1;</code> </td> <td> U+000B9 </td> <td> <span class="glyph" title="">¹</span> </td> <tr id="entity-sup2"><td> <code title="">sup2;</code> </td> <td> U+000B2 </td> <td> <span class="glyph" title="">²</span> </td> <tr id="entity-sup3"><td> <code title="">sup3;</code> </td> <td> U+000B3 </td> <td> <span class="glyph" title="">³</span> </td> <tr id="entity-supE"><td> <code title="">supE;</code> </td> <td> U+02AC6 </td> <td> <span class="glyph" title="">⫆</span> </td> <tr id="entity-supdot"><td> <code title="">supdot;</code> </td> <td> U+02ABE </td> <td> <span class="glyph" title="">⪾</span> </td> <tr id="entity-supdsub"><td> <code title="">supdsub;</code> </td> <td> U+02AD8 </td> <td> <span class="glyph" title="">⫘</span> </td> <tr id="entity-supe"><td> <code title="">supe;</code> </td> <td> U+02287 </td> <td> <span class="glyph" title="">⊇</span> </td> <tr id="entity-supedot"><td> <code title="">supedot;</code> </td> <td> U+02AC4 </td> <td> <span class="glyph" title="">⫄</span> </td> <tr id="entity-suphsol"><td> <code title="">suphsol;</code> </td> <td> U+027C9 </td> <td> <span class="glyph" title="">⟉</span> </td> <tr id="entity-suphsub"><td> <code title="">suphsub;</code> </td> <td> U+02AD7 </td> <td> <span class="glyph" title="">⫗</span> </td> <tr id="entity-suplarr"><td> <code title="">suplarr;</code> </td> <td> U+0297B </td> <td> <span class="glyph" title="">⥻</span> </td> <tr id="entity-supmult"><td> <code title="">supmult;</code> </td> <td> U+02AC2 </td> <td> <span class="glyph" title="">⫂</span> </td> <tr id="entity-supnE"><td> <code title="">supnE;</code> </td> <td> U+02ACC </td> <td> <span class="glyph" title="">⫌</span> </td> <tr id="entity-supne"><td> <code title="">supne;</code> </td> <td> U+0228B </td> <td> <span class="glyph" title="">⊋</span> </td> <tr id="entity-supplus"><td> <code title="">supplus;</code> </td> <td> U+02AC0 </td> <td> <span class="glyph" title="">⫀</span> </td> <tr id="entity-supset"><td> <code title="">supset;</code> </td> <td> U+02283 </td> <td> <span class="glyph" title="">⊃</span> </td> <tr id="entity-supseteq"><td> <code title="">supseteq;</code> </td> <td> U+02287 </td> <td> <span class="glyph" title="">⊇</span> </td> <tr id="entity-supseteqq"><td> <code title="">supseteqq;</code> </td> <td> U+02AC6 </td> <td> <span class="glyph" title="">⫆</span> </td> <tr id="entity-supsetneq"><td> <code title="">supsetneq;</code> </td> <td> U+0228B </td> <td> <span class="glyph" title="">⊋</span> </td> <tr id="entity-supsetneqq"><td> <code title="">supsetneqq;</code> </td> <td> U+02ACC </td> <td> <span class="glyph" title="">⫌</span> </td> <tr id="entity-supsim"><td> <code title="">supsim;</code> </td> <td> U+02AC8 </td> <td> <span class="glyph" title="">⫈</span> </td> <tr id="entity-supsub"><td> <code title="">supsub;</code> </td> <td> U+02AD4 </td> <td> <span class="glyph" title="">⫔</span> </td> <tr id="entity-supsup"><td> <code title="">supsup;</code> </td> <td> U+02AD6 </td> <td> <span class="glyph" title="">⫖</span> </td> <tr id="entity-swArr"><td> <code title="">swArr;</code> </td> <td> U+021D9 </td> <td> <span class="glyph" title="">⇙</span> </td> <tr id="entity-swarhk"><td> <code title="">swarhk;</code> </td> <td> U+02926 </td> <td> <span class="glyph" title="">⤦</span> </td> <tr id="entity-swarr"><td> <code title="">swarr;</code> </td> <td> U+02199 </td> <td> <span class="glyph" title="">↙</span> </td> <tr id="entity-swarrow"><td> <code title="">swarrow;</code> </td> <td> U+02199 </td> <td> <span class="glyph" title="">↙</span> </td> <tr id="entity-swnwar"><td> <code title="">swnwar;</code> </td> <td> U+0292A </td> <td> <span class="glyph" title="">⤪</span> </td> <tr id="entity-szlig"><td> <code title="">szlig;</code> </td> <td> U+000DF </td> <td> <span class="glyph" title="">ß</span> </td> <tr id="entity-target"><td> <code title="">target;</code> </td> <td> U+02316 </td> <td> <span class="glyph" title="">⌖</span> </td> <tr id="entity-tau"><td> <code title="">tau;</code> </td> <td> U+003C4 </td> <td> <span class="glyph" title="">τ</span> </td> <tr id="entity-tbrk"><td> <code title="">tbrk;</code> </td> <td> U+023B4 </td> <td> <span class="glyph" title="">⎴</span> </td> <tr id="entity-tcaron"><td> <code title="">tcaron;</code> </td> <td> U+00165 </td> <td> <span class="glyph" title="">ť</span> </td> <tr id="entity-tcedil"><td> <code title="">tcedil;</code> </td> <td> U+00163 </td> <td> <span class="glyph" title="">ţ</span> </td> <tr id="entity-tcy"><td> <code title="">tcy;</code> </td> <td> U+00442 </td> <td> <span class="glyph" title="">т</span> </td> <tr id="entity-tdot"><td> <code title="">tdot;</code> </td> <td> U+020DB </td> <td> <span class="glyph composition" title="">◌⃛</span> </td> <tr id="entity-telrec"><td> <code title="">telrec;</code> </td> <td> U+02315 </td> <td> <span class="glyph" title="">⌕</span> </td> <tr id="entity-tfr"><td> <code title="">tfr;</code> </td> <td> U+1D531 </td> <td> <span class="glyph" title="">𝔱</span> </td> <tr id="entity-there4"><td> <code title="">there4;</code> </td> <td> U+02234 </td> <td> <span class="glyph" title="">∴</span> </td> <tr id="entity-therefore"><td> <code title="">therefore;</code> </td> <td> U+02234 </td> <td> <span class="glyph" title="">∴</span> </td> <tr id="entity-theta"><td> <code title="">theta;</code> </td> <td> U+003B8 </td> <td> <span class="glyph" title="">θ</span> </td> <tr id="entity-thetasym"><td> <code title="">thetasym;</code> </td> <td> U+003D1 </td> <td> <span class="glyph" title="">ϑ</span> </td> <tr id="entity-thetav"><td> <code title="">thetav;</code> </td> <td> U+003D1 </td> <td> <span class="glyph" title="">ϑ</span> </td> <tr id="entity-thickapprox"><td> <code title="">thickapprox;</code> </td> <td> U+02248 </td> <td> <span class="glyph" title="">≈</span> </td> <tr id="entity-thicksim"><td> <code title="">thicksim;</code> </td> <td> U+0223C </td> <td> <span class="glyph" title="">∼</span> </td> <tr id="entity-thinsp"><td> <code title="">thinsp;</code> </td> <td> U+02009 </td> <td> <span class="glyph" title=""> </span> </td> <tr id="entity-thkap"><td> <code title="">thkap;</code> </td> <td> U+02248 </td> <td> <span class="glyph" title="">≈</span> </td> <tr id="entity-thksim"><td> <code title="">thksim;</code> </td> <td> U+0223C </td> <td> <span class="glyph" title="">∼</span> </td> <tr id="entity-thorn"><td> <code title="">thorn;</code> </td> <td> U+000FE </td> <td> <span class="glyph" title="">þ</span> </td> <tr id="entity-tilde"><td> <code title="">tilde;</code> </td> <td> U+002DC </td> <td> <span class="glyph" title="">˜</span> </td> <tr id="entity-times"><td> <code title="">times;</code> </td> <td> U+000D7 </td> <td> <span class="glyph" title="">×</span> </td> <tr id="entity-timesb"><td> <code title="">timesb;</code> </td> <td> U+022A0 </td> <td> <span class="glyph" title="">⊠</span> </td> <tr id="entity-timesbar"><td> <code title="">timesbar;</code> </td> <td> U+02A31 </td> <td> <span class="glyph" title="">⨱</span> </td> <tr id="entity-timesd"><td> <code title="">timesd;</code> </td> <td> U+02A30 </td> <td> <span class="glyph" title="">⨰</span> </td> <tr id="entity-tint"><td> <code title="">tint;</code> </td> <td> U+0222D </td> <td> <span class="glyph" title="">∭</span> </td> <tr id="entity-toea"><td> <code title="">toea;</code> </td> <td> U+02928 </td> <td> <span class="glyph" title="">⤨</span> </td> <tr id="entity-top"><td> <code title="">top;</code> </td> <td> U+022A4 </td> <td> <span class="glyph" title="">⊤</span> </td> <tr id="entity-topbot"><td> <code title="">topbot;</code> </td> <td> U+02336 </td> <td> <span class="glyph" title="">⌶</span> </td> <tr id="entity-topcir"><td> <code title="">topcir;</code> </td> <td> U+02AF1 </td> <td> <span class="glyph" title="">⫱</span> </td> <tr id="entity-topf"><td> <code title="">topf;</code> </td> <td> U+1D565 </td> <td> <span class="glyph" title="">𝕥</span> </td> <tr id="entity-topfork"><td> <code title="">topfork;</code> </td> <td> U+02ADA </td> <td> <span class="glyph" title="">⫚</span> </td> <tr id="entity-tosa"><td> <code title="">tosa;</code> </td> <td> U+02929 </td> <td> <span class="glyph" title="">⤩</span> </td> <tr id="entity-tprime"><td> <code title="">tprime;</code> </td> <td> U+02034 </td> <td> <span class="glyph" title="">‴</span> </td> <tr id="entity-trade"><td> <code title="">trade;</code> </td> <td> U+02122 </td> <td> <span class="glyph" title="">™</span> </td> <tr id="entity-triangle"><td> <code title="">triangle;</code> </td> <td> U+025B5 </td> <td> <span class="glyph" title="">▵</span> </td> <tr id="entity-triangledown"><td> <code title="">triangledown;</code> </td> <td> U+025BF </td> <td> <span class="glyph" title="">▿</span> </td> <tr id="entity-triangleleft"><td> <code title="">triangleleft;</code> </td> <td> U+025C3 </td> <td> <span class="glyph" title="">◃</span> </td> <tr id="entity-trianglelefteq"><td> <code title="">trianglelefteq;</code> </td> <td> U+022B4 </td> <td> <span class="glyph" title="">⊴</span> </td> <tr id="entity-triangleq"><td> <code title="">triangleq;</code> </td> <td> U+0225C </td> <td> <span class="glyph" title="">≜</span> </td> <tr id="entity-triangleright"><td> <code title="">triangleright;</code> </td> <td> U+025B9 </td> <td> <span class="glyph" title="">▹</span> </td> <tr id="entity-trianglerighteq"><td> <code title="">trianglerighteq;</code> </td> <td> U+022B5 </td> <td> <span class="glyph" title="">⊵</span> </td> <tr id="entity-tridot"><td> <code title="">tridot;</code> </td> <td> U+025EC </td> <td> <span class="glyph" title="">◬</span> </td> <tr id="entity-trie"><td> <code title="">trie;</code> </td> <td> U+0225C </td> <td> <span class="glyph" title="">≜</span> </td> <tr id="entity-triminus"><td> <code title="">triminus;</code> </td> <td> U+02A3A </td> <td> <span class="glyph" title="">⨺</span> </td> <tr id="entity-triplus"><td> <code title="">triplus;</code> </td> <td> U+02A39 </td> <td> <span class="glyph" title="">⨹</span> </td> <tr id="entity-trisb"><td> <code title="">trisb;</code> </td> <td> U+029CD </td> <td> <span class="glyph" title="">⧍</span> </td> <tr id="entity-tritime"><td> <code title="">tritime;</code> </td> <td> U+02A3B </td> <td> <span class="glyph" title="">⨻</span> </td> <tr id="entity-trpezium"><td> <code title="">trpezium;</code> </td> <td> U+023E2 </td> <td> <span class="glyph" title="">⏢</span> </td> <tr id="entity-tscr"><td> <code title="">tscr;</code> </td> <td> U+1D4C9 </td> <td> <span class="glyph" title="">𝓉</span> </td> <tr id="entity-tscy"><td> <code title="">tscy;</code> </td> <td> U+00446 </td> <td> <span class="glyph" title="">ц</span> </td> <tr id="entity-tshcy"><td> <code title="">tshcy;</code> </td> <td> U+0045B </td> <td> <span class="glyph" title="">ћ</span> </td> <tr id="entity-tstrok"><td> <code title="">tstrok;</code> </td> <td> U+00167 </td> <td> <span class="glyph" title="">ŧ</span> </td> <tr id="entity-twixt"><td> <code title="">twixt;</code> </td> <td> U+0226C </td> <td> <span class="glyph" title="">≬</span> </td> <tr id="entity-twoheadleftarrow"><td> <code title="">twoheadleftarrow;</code> </td> <td> U+0219E </td> <td> <span class="glyph" title="">↞</span> </td> <tr id="entity-twoheadrightarrow"><td> <code title="">twoheadrightarrow;</code> </td> <td> U+021A0 </td> <td> <span class="glyph" title="">↠</span> </td> <tr id="entity-uArr"><td> <code title="">uArr;</code> </td> <td> U+021D1 </td> <td> <span class="glyph" title="">⇑</span> </td> <tr id="entity-uHar"><td> <code title="">uHar;</code> </td> <td> U+02963 </td> <td> <span class="glyph" title="">⥣</span> </td> <tr id="entity-uacute"><td> <code title="">uacute;</code> </td> <td> U+000FA </td> <td> <span class="glyph" title="">ú</span> </td> <tr id="entity-uarr"><td> <code title="">uarr;</code> </td> <td> U+02191 </td> <td> <span class="glyph" title="">↑</span> </td> <tr id="entity-ubrcy"><td> <code title="">ubrcy;</code> </td> <td> U+0045E </td> <td> <span class="glyph" title="">ў</span> </td> <tr id="entity-ubreve"><td> <code title="">ubreve;</code> </td> <td> U+0016D </td> <td> <span class="glyph" title="">ŭ</span> </td> <tr id="entity-ucirc"><td> <code title="">ucirc;</code> </td> <td> U+000FB </td> <td> <span class="glyph" title="">û</span> </td> <tr id="entity-ucy"><td> <code title="">ucy;</code> </td> <td> U+00443 </td> <td> <span class="glyph" title="">у</span> </td> <tr id="entity-udarr"><td> <code title="">udarr;</code> </td> <td> U+021C5 </td> <td> <span class="glyph" title="">⇅</span> </td> <tr id="entity-udblac"><td> <code title="">udblac;</code> </td> <td> U+00171 </td> <td> <span class="glyph" title="">ű</span> </td> <tr id="entity-udhar"><td> <code title="">udhar;</code> </td> <td> U+0296E </td> <td> <span class="glyph" title="">⥮</span> </td> <tr id="entity-ufisht"><td> <code title="">ufisht;</code> </td> <td> U+0297E </td> <td> <span class="glyph" title="">⥾</span> </td> <tr id="entity-ufr"><td> <code title="">ufr;</code> </td> <td> U+1D532 </td> <td> <span class="glyph" title="">𝔲</span> </td> <tr id="entity-ugrave"><td> <code title="">ugrave;</code> </td> <td> U+000F9 </td> <td> <span class="glyph" title="">ù</span> </td> <tr id="entity-uharl"><td> <code title="">uharl;</code> </td> <td> U+021BF </td> <td> <span class="glyph" title="">↿</span> </td> <tr id="entity-uharr"><td> <code title="">uharr;</code> </td> <td> U+021BE </td> <td> <span class="glyph" title="">↾</span> </td> <tr id="entity-uhblk"><td> <code title="">uhblk;</code> </td> <td> U+02580 </td> <td> <span class="glyph" title="">▀</span> </td> <tr id="entity-ulcorn"><td> <code title="">ulcorn;</code> </td> <td> U+0231C </td> <td> <span class="glyph" title="">⌜</span> </td> <tr id="entity-ulcorner"><td> <code title="">ulcorner;</code> </td> <td> U+0231C </td> <td> <span class="glyph" title="">⌜</span> </td> <tr id="entity-ulcrop"><td> <code title="">ulcrop;</code> </td> <td> U+0230F </td> <td> <span class="glyph" title="">⌏</span> </td> <tr id="entity-ultri"><td> <code title="">ultri;</code> </td> <td> U+025F8 </td> <td> <span class="glyph" title="">◸</span> </td> <tr id="entity-umacr"><td> <code title="">umacr;</code> </td> <td> U+0016B </td> <td> <span class="glyph" title="">ū</span> </td> <tr id="entity-uml"><td> <code title="">uml;</code> </td> <td> U+000A8 </td> <td> <span class="glyph" title="">¨</span> </td> <tr id="entity-uogon"><td> <code title="">uogon;</code> </td> <td> U+00173 </td> <td> <span class="glyph" title="">ų</span> </td> <tr id="entity-uopf"><td> <code title="">uopf;</code> </td> <td> U+1D566 </td> <td> <span class="glyph" title="">𝕦</span> </td> <tr id="entity-uparrow"><td> <code title="">uparrow;</code> </td> <td> U+02191 </td> <td> <span class="glyph" title="">↑</span> </td> <tr id="entity-updownarrow"><td> <code title="">updownarrow;</code> </td> <td> U+02195 </td> <td> <span class="glyph" title="">↕</span> </td> <tr id="entity-upharpoonleft"><td> <code title="">upharpoonleft;</code> </td> <td> U+021BF </td> <td> <span class="glyph" title="">↿</span> </td> <tr id="entity-upharpoonright"><td> <code title="">upharpoonright;</code> </td> <td> U+021BE </td> <td> <span class="glyph" title="">↾</span> </td> <tr id="entity-uplus"><td> <code title="">uplus;</code> </td> <td> U+0228E </td> <td> <span class="glyph" title="">⊎</span> </td> <tr id="entity-upsi"><td> <code title="">upsi;</code> </td> <td> U+003C5 </td> <td> <span class="glyph" title="">υ</span> </td> <tr id="entity-upsih"><td> <code title="">upsih;</code> </td> <td> U+003D2 </td> <td> <span class="glyph" title="">ϒ</span> </td> <tr id="entity-upsilon"><td> <code title="">upsilon;</code> </td> <td> U+003C5 </td> <td> <span class="glyph" title="">υ</span> </td> <tr id="entity-upuparrows"><td> <code title="">upuparrows;</code> </td> <td> U+021C8 </td> <td> <span class="glyph" title="">⇈</span> </td> <tr id="entity-urcorn"><td> <code title="">urcorn;</code> </td> <td> U+0231D </td> <td> <span class="glyph" title="">⌝</span> </td> <tr id="entity-urcorner"><td> <code title="">urcorner;</code> </td> <td> U+0231D </td> <td> <span class="glyph" title="">⌝</span> </td> <tr id="entity-urcrop"><td> <code title="">urcrop;</code> </td> <td> U+0230E </td> <td> <span class="glyph" title="">⌎</span> </td> <tr id="entity-uring"><td> <code title="">uring;</code> </td> <td> U+0016F </td> <td> <span class="glyph" title="">ů</span> </td> <tr id="entity-urtri"><td> <code title="">urtri;</code> </td> <td> U+025F9 </td> <td> <span class="glyph" title="">◹</span> </td> <tr id="entity-uscr"><td> <code title="">uscr;</code> </td> <td> U+1D4CA </td> <td> <span class="glyph" title="">𝓊</span> </td> <tr id="entity-utdot"><td> <code title="">utdot;</code> </td> <td> U+022F0 </td> <td> <span class="glyph" title="">⋰</span> </td> <tr id="entity-utilde"><td> <code title="">utilde;</code> </td> <td> U+00169 </td> <td> <span class="glyph" title="">ũ</span> </td> <tr id="entity-utri"><td> <code title="">utri;</code> </td> <td> U+025B5 </td> <td> <span class="glyph" title="">▵</span> </td> <tr id="entity-utrif"><td> <code title="">utrif;</code> </td> <td> U+025B4 </td> <td> <span class="glyph" title="">▴</span> </td> <tr id="entity-uuarr"><td> <code title="">uuarr;</code> </td> <td> U+021C8 </td> <td> <span class="glyph" title="">⇈</span> </td> <tr id="entity-uuml"><td> <code title="">uuml;</code> </td> <td> U+000FC </td> <td> <span class="glyph" title="">ü</span> </td> <tr id="entity-uwangle"><td> <code title="">uwangle;</code> </td> <td> U+029A7 </td> <td> <span class="glyph" title="">⦧</span> </td> <tr id="entity-vArr"><td> <code title="">vArr;</code> </td> <td> U+021D5 </td> <td> <span class="glyph" title="">⇕</span> </td> <tr id="entity-vBar"><td> <code title="">vBar;</code> </td> <td> U+02AE8 </td> <td> <span class="glyph" title="">⫨</span> </td> <tr id="entity-vBarv"><td> <code title="">vBarv;</code> </td> <td> U+02AE9 </td> <td> <span class="glyph" title="">⫩</span> </td> <tr id="entity-vDash"><td> <code title="">vDash;</code> </td> <td> U+022A8 </td> <td> <span class="glyph" title="">⊨</span> </td> <tr id="entity-vangrt"><td> <code title="">vangrt;</code> </td> <td> U+0299C </td> <td> <span class="glyph" title="">⦜</span> </td> <tr id="entity-varepsilon"><td> <code title="">varepsilon;</code> </td> <td> U+003F5 </td> <td> <span class="glyph" title="">ϵ</span> </td> <tr id="entity-varkappa"><td> <code title="">varkappa;</code> </td> <td> U+003F0 </td> <td> <span class="glyph" title="">ϰ</span> </td> <tr id="entity-varnothing"><td> <code title="">varnothing;</code> </td> <td> U+02205 </td> <td> <span class="glyph" title="">∅</span> </td> <tr id="entity-varphi"><td> <code title="">varphi;</code> </td> <td> U+003D5 </td> <td> <span class="glyph" title="">ϕ</span> </td> <tr id="entity-varpi"><td> <code title="">varpi;</code> </td> <td> U+003D6 </td> <td> <span class="glyph" title="">ϖ</span> </td> <tr id="entity-varpropto"><td> <code title="">varpropto;</code> </td> <td> U+0221D </td> <td> <span class="glyph" title="">∝</span> </td> <tr id="entity-varr"><td> <code title="">varr;</code> </td> <td> U+02195 </td> <td> <span class="glyph" title="">↕</span> </td> <tr id="entity-varrho"><td> <code title="">varrho;</code> </td> <td> U+003F1 </td> <td> <span class="glyph" title="">ϱ</span> </td> <tr id="entity-varsigma"><td> <code title="">varsigma;</code> </td> <td> U+003C2 </td> <td> <span class="glyph" title="">ς</span> </td> <tr id="entity-varsubsetneq"><td> <code title="">varsubsetneq;</code> </td> <td> U+0228A U+0FE00 </td> <td> <span class="glyph compound" title="">⊊︀</span> </td> <tr id="entity-varsubsetneqq"><td> <code title="">varsubsetneqq;</code> </td> <td> U+02ACB U+0FE00 </td> <td> <span class="glyph compound" title="">⫋︀</span> </td> <tr id="entity-varsupsetneq"><td> <code title="">varsupsetneq;</code> </td> <td> U+0228B U+0FE00 </td> <td> <span class="glyph compound" title="">⊋︀</span> </td> <tr id="entity-varsupsetneqq"><td> <code title="">varsupsetneqq;</code> </td> <td> U+02ACC U+0FE00 </td> <td> <span class="glyph compound" title="">⫌︀</span> </td> <tr id="entity-vartheta"><td> <code title="">vartheta;</code> </td> <td> U+003D1 </td> <td> <span class="glyph" title="">ϑ</span> </td> <tr id="entity-vartriangleleft"><td> <code title="">vartriangleleft;</code> </td> <td> U+022B2 </td> <td> <span class="glyph" title="">⊲</span> </td> <tr id="entity-vartriangleright"><td> <code title="">vartriangleright;</code> </td> <td> U+022B3 </td> <td> <span class="glyph" title="">⊳</span> </td> <tr id="entity-vcy"><td> <code title="">vcy;</code> </td> <td> U+00432 </td> <td> <span class="glyph" title="">в</span> </td> <tr id="entity-vdash"><td> <code title="">vdash;</code> </td> <td> U+022A2 </td> <td> <span class="glyph" title="">⊢</span> </td> <tr id="entity-vee"><td> <code title="">vee;</code> </td> <td> U+02228 </td> <td> <span class="glyph" title="">∨</span> </td> <tr id="entity-veebar"><td> <code title="">veebar;</code> </td> <td> U+022BB </td> <td> <span class="glyph" title="">⊻</span> </td> <tr id="entity-veeeq"><td> <code title="">veeeq;</code> </td> <td> U+0225A </td> <td> <span class="glyph" title="">≚</span> </td> <tr id="entity-vellip"><td> <code title="">vellip;</code> </td> <td> U+022EE </td> <td> <span class="glyph" title="">⋮</span> </td> <tr id="entity-verbar"><td> <code title="">verbar;</code> </td> <td> U+0007C </td> <td> <span class="glyph" title="">|</span> </td> <tr id="entity-vert"><td> <code title="">vert;</code> </td> <td> U+0007C </td> <td> <span class="glyph" title="">|</span> </td> <tr id="entity-vfr"><td> <code title="">vfr;</code> </td> <td> U+1D533 </td> <td> <span class="glyph" title="">𝔳</span> </td> <tr id="entity-vltri"><td> <code title="">vltri;</code> </td> <td> U+022B2 </td> <td> <span class="glyph" title="">⊲</span> </td> <tr id="entity-vnsub"><td> <code title="">vnsub;</code> </td> <td> U+02282 U+020D2 </td> <td> <span class="glyph compound" title="">⊂⃒</span> </td> <tr id="entity-vnsup"><td> <code title="">vnsup;</code> </td> <td> U+02283 U+020D2 </td> <td> <span class="glyph compound" title="">⊃⃒</span> </td> <tr id="entity-vopf"><td> <code title="">vopf;</code> </td> <td> U+1D567 </td> <td> <span class="glyph" title="">𝕧</span> </td> <tr id="entity-vprop"><td> <code title="">vprop;</code> </td> <td> U+0221D </td> <td> <span class="glyph" title="">∝</span> </td> <tr id="entity-vrtri"><td> <code title="">vrtri;</code> </td> <td> U+022B3 </td> <td> <span class="glyph" title="">⊳</span> </td> <tr id="entity-vscr"><td> <code title="">vscr;</code> </td> <td> U+1D4CB </td> <td> <span class="glyph" title="">𝓋</span> </td> <tr id="entity-vsubnE"><td> <code title="">vsubnE;</code> </td> <td> U+02ACB U+0FE00 </td> <td> <span class="glyph compound" title="">⫋︀</span> </td> <tr id="entity-vsubne"><td> <code title="">vsubne;</code> </td> <td> U+0228A U+0FE00 </td> <td> <span class="glyph compound" title="">⊊︀</span> </td> <tr id="entity-vsupnE"><td> <code title="">vsupnE;</code> </td> <td> U+02ACC U+0FE00 </td> <td> <span class="glyph compound" title="">⫌︀</span> </td> <tr id="entity-vsupne"><td> <code title="">vsupne;</code> </td> <td> U+0228B U+0FE00 </td> <td> <span class="glyph compound" title="">⊋︀</span> </td> <tr id="entity-vzigzag"><td> <code title="">vzigzag;</code> </td> <td> U+0299A </td> <td> <span class="glyph" title="">⦚</span> </td> <tr id="entity-wcirc"><td> <code title="">wcirc;</code> </td> <td> U+00175 </td> <td> <span class="glyph" title="">ŵ</span> </td> <tr id="entity-wedbar"><td> <code title="">wedbar;</code> </td> <td> U+02A5F </td> <td> <span class="glyph" title="">⩟</span> </td> <tr id="entity-wedge"><td> <code title="">wedge;</code> </td> <td> U+02227 </td> <td> <span class="glyph" title="">∧</span> </td> <tr id="entity-wedgeq"><td> <code title="">wedgeq;</code> </td> <td> U+02259 </td> <td> <span class="glyph" title="">≙</span> </td> <tr id="entity-weierp"><td> <code title="">weierp;</code> </td> <td> U+02118 </td> <td> <span class="glyph" title="">℘</span> </td> <tr id="entity-wfr"><td> <code title="">wfr;</code> </td> <td> U+1D534 </td> <td> <span class="glyph" title="">𝔴</span> </td> <tr id="entity-wopf"><td> <code title="">wopf;</code> </td> <td> U+1D568 </td> <td> <span class="glyph" title="">𝕨</span> </td> <tr id="entity-wp"><td> <code title="">wp;</code> </td> <td> U+02118 </td> <td> <span class="glyph" title="">℘</span> </td> <tr id="entity-wr"><td> <code title="">wr;</code> </td> <td> U+02240 </td> <td> <span class="glyph" title="">≀</span> </td> <tr id="entity-wreath"><td> <code title="">wreath;</code> </td> <td> U+02240 </td> <td> <span class="glyph" title="">≀</span> </td> <tr id="entity-wscr"><td> <code title="">wscr;</code> </td> <td> U+1D4CC </td> <td> <span class="glyph" title="">𝓌</span> </td> <tr id="entity-xcap"><td> <code title="">xcap;</code> </td> <td> U+022C2 </td> <td> <span class="glyph" title="">⋂</span> </td> <tr id="entity-xcirc"><td> <code title="">xcirc;</code> </td> <td> U+025EF </td> <td> <span class="glyph" title="">◯</span> </td> <tr id="entity-xcup"><td> <code title="">xcup;</code> </td> <td> U+022C3 </td> <td> <span class="glyph" title="">⋃</span> </td> <tr id="entity-xdtri"><td> <code title="">xdtri;</code> </td> <td> U+025BD </td> <td> <span class="glyph" title="">▽</span> </td> <tr id="entity-xfr"><td> <code title="">xfr;</code> </td> <td> U+1D535 </td> <td> <span class="glyph" title="">𝔵</span> </td> <tr id="entity-xhArr"><td> <code title="">xhArr;</code> </td> <td> U+027FA </td> <td> <span class="glyph" title="">⟺</span> </td> <tr id="entity-xharr"><td> <code title="">xharr;</code> </td> <td> U+027F7 </td> <td> <span class="glyph" title="">⟷</span> </td> <tr id="entity-xi"><td> <code title="">xi;</code> </td> <td> U+003BE </td> <td> <span class="glyph" title="">ξ</span> </td> <tr id="entity-xlArr"><td> <code title="">xlArr;</code> </td> <td> U+027F8 </td> <td> <span class="glyph" title="">⟸</span> </td> <tr id="entity-xlarr"><td> <code title="">xlarr;</code> </td> <td> U+027F5 </td> <td> <span class="glyph" title="">⟵</span> </td> <tr id="entity-xmap"><td> <code title="">xmap;</code> </td> <td> U+027FC </td> <td> <span class="glyph" title="">⟼</span> </td> <tr id="entity-xnis"><td> <code title="">xnis;</code> </td> <td> U+022FB </td> <td> <span class="glyph" title="">⋻</span> </td> <tr id="entity-xodot"><td> <code title="">xodot;</code> </td> <td> U+02A00 </td> <td> <span class="glyph" title="">⨀</span> </td> <tr id="entity-xopf"><td> <code title="">xopf;</code> </td> <td> U+1D569 </td> <td> <span class="glyph" title="">𝕩</span> </td> <tr id="entity-xoplus"><td> <code title="">xoplus;</code> </td> <td> U+02A01 </td> <td> <span class="glyph" title="">⨁</span> </td> <tr id="entity-xotime"><td> <code title="">xotime;</code> </td> <td> U+02A02 </td> <td> <span class="glyph" title="">⨂</span> </td> <tr id="entity-xrArr"><td> <code title="">xrArr;</code> </td> <td> U+027F9 </td> <td> <span class="glyph" title="">⟹</span> </td> <tr id="entity-xrarr"><td> <code title="">xrarr;</code> </td> <td> U+027F6 </td> <td> <span class="glyph" title="">⟶</span> </td> <tr id="entity-xscr"><td> <code title="">xscr;</code> </td> <td> U+1D4CD </td> <td> <span class="glyph" title="">𝓍</span> </td> <tr id="entity-xsqcup"><td> <code title="">xsqcup;</code> </td> <td> U+02A06 </td> <td> <span class="glyph" title="">⨆</span> </td> <tr id="entity-xuplus"><td> <code title="">xuplus;</code> </td> <td> U+02A04 </td> <td> <span class="glyph" title="">⨄</span> </td> <tr id="entity-xutri"><td> <code title="">xutri;</code> </td> <td> U+025B3 </td> <td> <span class="glyph" title="">△</span> </td> <tr id="entity-xvee"><td> <code title="">xvee;</code> </td> <td> U+022C1 </td> <td> <span class="glyph" title="">⋁</span> </td> <tr id="entity-xwedge"><td> <code title="">xwedge;</code> </td> <td> U+022C0 </td> <td> <span class="glyph" title="">⋀</span> </td> <tr id="entity-yacute"><td> <code title="">yacute;</code> </td> <td> U+000FD </td> <td> <span class="glyph" title="">ý</span> </td> <tr id="entity-yacy"><td> <code title="">yacy;</code> </td> <td> U+0044F </td> <td> <span class="glyph" title="">я</span> </td> <tr id="entity-ycirc"><td> <code title="">ycirc;</code> </td> <td> U+00177 </td> <td> <span class="glyph" title="">ŷ</span> </td> <tr id="entity-ycy"><td> <code title="">ycy;</code> </td> <td> U+0044B </td> <td> <span class="glyph" title="">ы</span> </td> <tr id="entity-yen"><td> <code title="">yen;</code> </td> <td> U+000A5 </td> <td> <span class="glyph" title="">¥</span> </td> <tr id="entity-yfr"><td> <code title="">yfr;</code> </td> <td> U+1D536 </td> <td> <span class="glyph" title="">𝔶</span> </td> <tr id="entity-yicy"><td> <code title="">yicy;</code> </td> <td> U+00457 </td> <td> <span class="glyph" title="">ї</span> </td> <tr id="entity-yopf"><td> <code title="">yopf;</code> </td> <td> U+1D56A </td> <td> <span class="glyph" title="">𝕪</span> </td> <tr id="entity-yscr"><td> <code title="">yscr;</code> </td> <td> U+1D4CE </td> <td> <span class="glyph" title="">𝓎</span> </td> <tr id="entity-yucy"><td> <code title="">yucy;</code> </td> <td> U+0044E </td> <td> <span class="glyph" title="">ю</span> </td> <tr id="entity-yuml"><td> <code title="">yuml;</code> </td> <td> U+000FF </td> <td> <span class="glyph" title="">ÿ</span> </td> <tr id="entity-zacute"><td> <code title="">zacute;</code> </td> <td> U+0017A </td> <td> <span class="glyph" title="">ź</span> </td> <tr id="entity-zcaron"><td> <code title="">zcaron;</code> </td> <td> U+0017E </td> <td> <span class="glyph" title="">ž</span> </td> <tr id="entity-zcy"><td> <code title="">zcy;</code> </td> <td> U+00437 </td> <td> <span class="glyph" title="">з</span> </td> <tr id="entity-zdot"><td> <code title="">zdot;</code> </td> <td> U+0017C </td> <td> <span class="glyph" title="">ż</span> </td> <tr id="entity-zeetrf"><td> <code title="">zeetrf;</code> </td> <td> U+02128 </td> <td> <span class="glyph" title="">ℨ</span> </td> <tr id="entity-zeta"><td> <code title="">zeta;</code> </td> <td> U+003B6 </td> <td> <span class="glyph" title="">ζ</span> </td> <tr id="entity-zfr"><td> <code title="">zfr;</code> </td> <td> U+1D537 </td> <td> <span class="glyph" title="">𝔷</span> </td> <tr id="entity-zhcy"><td> <code title="">zhcy;</code> </td> <td> U+00436 </td> <td> <span class="glyph" title="">ж</span> </td> <tr id="entity-zigrarr"><td> <code title="">zigrarr;</code> </td> <td> U+021DD </td> <td> <span class="glyph" title="">⇝</span> </td> <tr id="entity-zopf"><td> <code title="">zopf;</code> </td> <td> U+1D56B </td> <td> <span class="glyph" title="">𝕫</span> </td> <tr id="entity-zscr"><td> <code title="">zscr;</code> </td> <td> U+1D4CF </td> <td> <span class="glyph" title="">𝓏</span> </td> <tr id="entity-zwj"><td> <code title="">zwj;</code> </td> <td> U+0200D </td> <td> <span class="glyph" title="">‍</span> </td> <tr id="entity-zwnj"><td> <code title="">zwnj;</code> </td> <td> U+0200C </td> <td> <span class="glyph" title="">‌</span> </td> <tr class="impl"><td> <code title="">AElig</code> </td> <td> U+000C6 </td> <td> <span title="">Æ</span> </td> </tr><tr class="impl"><td> <code title="">AMP</code> </td> <td> U+00026 </td> <td> <span title="">&</span> </td> </tr><tr class="impl"><td> <code title="">Aacute</code> </td> <td> U+000C1 </td> <td> <span title="">Á</span> </td> </tr><tr class="impl"><td> <code title="">Acirc</code> </td> <td> U+000C2 </td> <td> <span title="">Â</span> </td> </tr><tr class="impl"><td> <code title="">Agrave</code> </td> <td> U+000C0 </td> <td> <span title="">À</span> </td> </tr><tr class="impl"><td> <code title="">Aring</code> </td> <td> U+000C5 </td> <td> <span title="">Å</span> </td> </tr><tr class="impl"><td> <code title="">Atilde</code> </td> <td> U+000C3 </td> <td> <span title="">Ã</span> </td> </tr><tr class="impl"><td> <code title="">Auml</code> </td> <td> U+000C4 </td> <td> <span title="">Ä</span> </td> </tr><tr class="impl"><td> <code title="">COPY</code> </td> <td> U+000A9 </td> <td> <span title="">©</span> </td> </tr><tr class="impl"><td> <code title="">Ccedil</code> </td> <td> U+000C7 </td> <td> <span title="">Ç</span> </td> </tr><tr class="impl"><td> <code title="">ETH</code> </td> <td> U+000D0 </td> <td> <span title="">Ð</span> </td> </tr><tr class="impl"><td> <code title="">Eacute</code> </td> <td> U+000C9 </td> <td> <span title="">É</span> </td> </tr><tr class="impl"><td> <code title="">Ecirc</code> </td> <td> U+000CA </td> <td> <span title="">Ê</span> </td> </tr><tr class="impl"><td> <code title="">Egrave</code> </td> <td> U+000C8 </td> <td> <span title="">È</span> </td> </tr><tr class="impl"><td> <code title="">Euml</code> </td> <td> U+000CB </td> <td> <span title="">Ë</span> </td> </tr><tr class="impl"><td> <code title="">GT</code> </td> <td> U+0003E </td> <td> <span title="">></span> </td> </tr><tr class="impl"><td> <code title="">Iacute</code> </td> <td> U+000CD </td> <td> <span title="">Í</span> </td> </tr><tr class="impl"><td> <code title="">Icirc</code> </td> <td> U+000CE </td> <td> <span title="">Î</span> </td> </tr><tr class="impl"><td> <code title="">Igrave</code> </td> <td> U+000CC </td> <td> <span title="">Ì</span> </td> </tr><tr class="impl"><td> <code title="">Iuml</code> </td> <td> U+000CF </td> <td> <span title="">Ï</span> </td> </tr><tr class="impl"><td> <code title="">LT</code> </td> <td> U+0003C </td> <td> <span title=""><</span> </td> </tr><tr class="impl"><td> <code title="">Ntilde</code> </td> <td> U+000D1 </td> <td> <span title="">Ñ</span> </td> </tr><tr class="impl"><td> <code title="">Oacute</code> </td> <td> U+000D3 </td> <td> <span title="">Ó</span> </td> </tr><tr class="impl"><td> <code title="">Ocirc</code> </td> <td> U+000D4 </td> <td> <span title="">Ô</span> </td> </tr><tr class="impl"><td> <code title="">Ograve</code> </td> <td> U+000D2 </td> <td> <span title="">Ò</span> </td> </tr><tr class="impl"><td> <code title="">Oslash</code> </td> <td> U+000D8 </td> <td> <span title="">Ø</span> </td> </tr><tr class="impl"><td> <code title="">Otilde</code> </td> <td> U+000D5 </td> <td> <span title="">Õ</span> </td> </tr><tr class="impl"><td> <code title="">Ouml</code> </td> <td> U+000D6 </td> <td> <span title="">Ö</span> </td> </tr><tr class="impl"><td> <code title="">QUOT</code> </td> <td> U+00022 </td> <td> <span title="">"</span> </td> </tr><tr class="impl"><td> <code title="">REG</code> </td> <td> U+000AE </td> <td> <span title="">®</span> </td> </tr><tr class="impl"><td> <code title="">THORN</code> </td> <td> U+000DE </td> <td> <span title="">Þ</span> </td> </tr><tr class="impl"><td> <code title="">Uacute</code> </td> <td> U+000DA </td> <td> <span title="">Ú</span> </td> </tr><tr class="impl"><td> <code title="">Ucirc</code> </td> <td> U+000DB </td> <td> <span title="">Û</span> </td> </tr><tr class="impl"><td> <code title="">Ugrave</code> </td> <td> U+000D9 </td> <td> <span title="">Ù</span> </td> </tr><tr class="impl"><td> <code title="">Uuml</code> </td> <td> U+000DC </td> <td> <span title="">Ü</span> </td> </tr><tr class="impl"><td> <code title="">Yacute</code> </td> <td> U+000DD </td> <td> <span title="">Ý</span> </td> </tr><tr class="impl"><td> <code title="">aacute</code> </td> <td> U+000E1 </td> <td> <span title="">á</span> </td> </tr><tr class="impl"><td> <code title="">acirc</code> </td> <td> U+000E2 </td> <td> <span title="">â</span> </td> </tr><tr class="impl"><td> <code title="">acute</code> </td> <td> U+000B4 </td> <td> <span title="">´</span> </td> </tr><tr class="impl"><td> <code title="">aelig</code> </td> <td> U+000E6 </td> <td> <span title="">æ</span> </td> </tr><tr class="impl"><td> <code title="">agrave</code> </td> <td> U+000E0 </td> <td> <span title="">à</span> </td> </tr><tr class="impl"><td> <code title="">amp</code> </td> <td> U+00026 </td> <td> <span title="">&</span> </td> </tr><tr class="impl"><td> <code title="">aring</code> </td> <td> U+000E5 </td> <td> <span title="">å</span> </td> </tr><tr class="impl"><td> <code title="">atilde</code> </td> <td> U+000E3 </td> <td> <span title="">ã</span> </td> </tr><tr class="impl"><td> <code title="">auml</code> </td> <td> U+000E4 </td> <td> <span title="">ä</span> </td> </tr><tr class="impl"><td> <code title="">brvbar</code> </td> <td> U+000A6 </td> <td> <span title="">¦</span> </td> </tr><tr class="impl"><td> <code title="">ccedil</code> </td> <td> U+000E7 </td> <td> <span title="">ç</span> </td> </tr><tr class="impl"><td> <code title="">cedil</code> </td> <td> U+000B8 </td> <td> <span title="">¸</span> </td> </tr><tr class="impl"><td> <code title="">cent</code> </td> <td> U+000A2 </td> <td> <span title="">¢</span> </td> </tr><tr class="impl"><td> <code title="">copy</code> </td> <td> U+000A9 </td> <td> <span title="">©</span> </td> </tr><tr class="impl"><td> <code title="">curren</code> </td> <td> U+000A4 </td> <td> <span title="">¤</span> </td> </tr><tr class="impl"><td> <code title="">deg</code> </td> <td> U+000B0 </td> <td> <span title="">°</span> </td> </tr><tr class="impl"><td> <code title="">divide</code> </td> <td> U+000F7 </td> <td> <span title="">÷</span> </td> </tr><tr class="impl"><td> <code title="">eacute</code> </td> <td> U+000E9 </td> <td> <span title="">é</span> </td> </tr><tr class="impl"><td> <code title="">ecirc</code> </td> <td> U+000EA </td> <td> <span title="">ê</span> </td> </tr><tr class="impl"><td> <code title="">egrave</code> </td> <td> U+000E8 </td> <td> <span title="">è</span> </td> </tr><tr class="impl"><td> <code title="">eth</code> </td> <td> U+000F0 </td> <td> <span title="">ð</span> </td> </tr><tr class="impl"><td> <code title="">euml</code> </td> <td> U+000EB </td> <td> <span title="">ë</span> </td> </tr><tr class="impl"><td> <code title="">frac12</code> </td> <td> U+000BD </td> <td> <span title="">½</span> </td> </tr><tr class="impl"><td> <code title="">frac14</code> </td> <td> U+000BC </td> <td> <span title="">¼</span> </td> </tr><tr class="impl"><td> <code title="">frac34</code> </td> <td> U+000BE </td> <td> <span title="">¾</span> </td> </tr><tr class="impl"><td> <code title="">gt</code> </td> <td> U+0003E </td> <td> <span title="">></span> </td> </tr><tr class="impl"><td> <code title="">iacute</code> </td> <td> U+000ED </td> <td> <span title="">í</span> </td> </tr><tr class="impl"><td> <code title="">icirc</code> </td> <td> U+000EE </td> <td> <span title="">î</span> </td> </tr><tr class="impl"><td> <code title="">iexcl</code> </td> <td> U+000A1 </td> <td> <span title="">¡</span> </td> </tr><tr class="impl"><td> <code title="">igrave</code> </td> <td> U+000EC </td> <td> <span title="">ì</span> </td> </tr><tr class="impl"><td> <code title="">iquest</code> </td> <td> U+000BF </td> <td> <span title="">¿</span> </td> </tr><tr class="impl"><td> <code title="">iuml</code> </td> <td> U+000EF </td> <td> <span title="">ï</span> </td> </tr><tr class="impl"><td> <code title="">laquo</code> </td> <td> U+000AB </td> <td> <span title="">«</span> </td> </tr><tr class="impl"><td> <code title="">lt</code> </td> <td> U+0003C </td> <td> <span title=""><</span> </td> </tr><tr class="impl"><td> <code title="">macr</code> </td> <td> U+000AF </td> <td> <span title="">¯</span> </td> </tr><tr class="impl"><td> <code title="">micro</code> </td> <td> U+000B5 </td> <td> <span title="">µ</span> </td> </tr><tr class="impl"><td> <code title="">middot</code> </td> <td> U+000B7 </td> <td> <span title="">·</span> </td> </tr><tr class="impl"><td> <code title="">nbsp</code> </td> <td> U+000A0 </td> <td> <span title=""> </span> </td> </tr><tr class="impl"><td> <code title="">not</code> </td> <td> U+000AC </td> <td> <span title="">¬</span> </td> </tr><tr class="impl"><td> <code title="">ntilde</code> </td> <td> U+000F1 </td> <td> <span title="">ñ</span> </td> </tr><tr class="impl"><td> <code title="">oacute</code> </td> <td> U+000F3 </td> <td> <span title="">ó</span> </td> </tr><tr class="impl"><td> <code title="">ocirc</code> </td> <td> U+000F4 </td> <td> <span title="">ô</span> </td> </tr><tr class="impl"><td> <code title="">ograve</code> </td> <td> U+000F2 </td> <td> <span title="">ò</span> </td> </tr><tr class="impl"><td> <code title="">ordf</code> </td> <td> U+000AA </td> <td> <span title="">ª</span> </td> </tr><tr class="impl"><td> <code title="">ordm</code> </td> <td> U+000BA </td> <td> <span title="">º</span> </td> </tr><tr class="impl"><td> <code title="">oslash</code> </td> <td> U+000F8 </td> <td> <span title="">ø</span> </td> </tr><tr class="impl"><td> <code title="">otilde</code> </td> <td> U+000F5 </td> <td> <span title="">õ</span> </td> </tr><tr class="impl"><td> <code title="">ouml</code> </td> <td> U+000F6 </td> <td> <span title="">ö</span> </td> </tr><tr class="impl"><td> <code title="">para</code> </td> <td> U+000B6 </td> <td> <span title="">¶</span> </td> </tr><tr class="impl"><td> <code title="">plusmn</code> </td> <td> U+000B1 </td> <td> <span title="">±</span> </td> </tr><tr class="impl"><td> <code title="">pound</code> </td> <td> U+000A3 </td> <td> <span title="">£</span> </td> </tr><tr class="impl"><td> <code title="">quot</code> </td> <td> U+00022 </td> <td> <span title="">"</span> </td> </tr><tr class="impl"><td> <code title="">raquo</code> </td> <td> U+000BB </td> <td> <span title="">»</span> </td> </tr><tr class="impl"><td> <code title="">reg</code> </td> <td> U+000AE </td> <td> <span title="">®</span> </td> </tr><tr class="impl"><td> <code title="">sect</code> </td> <td> U+000A7 </td> <td> <span title="">§</span> </td> </tr><tr class="impl"><td> <code title="">shy</code> </td> <td> U+000AD </td> <td> <span title="">­</span> </td> </tr><tr class="impl"><td> <code title="">sup1</code> </td> <td> U+000B9 </td> <td> <span title="">¹</span> </td> </tr><tr class="impl"><td> <code title="">sup2</code> </td> <td> U+000B2 </td> <td> <span title="">²</span> </td> </tr><tr class="impl"><td> <code title="">sup3</code> </td> <td> U+000B3 </td> <td> <span title="">³</span> </td> </tr><tr class="impl"><td> <code title="">szlig</code> </td> <td> U+000DF </td> <td> <span title="">ß</span> </td> </tr><tr class="impl"><td> <code title="">thorn</code> </td> <td> U+000FE </td> <td> <span title="">þ</span> </td> </tr><tr class="impl"><td> <code title="">times</code> </td> <td> U+000D7 </td> <td> <span title="">×</span> </td> </tr><tr class="impl"><td> <code title="">uacute</code> </td> <td> U+000FA </td> <td> <span title="">ú</span> </td> </tr><tr class="impl"><td> <code title="">ucirc</code> </td> <td> U+000FB </td> <td> <span title="">û</span> </td> </tr><tr class="impl"><td> <code title="">ugrave</code> </td> <td> U+000F9 </td> <td> <span title="">ù</span> </td> </tr><tr class="impl"><td> <code title="">uml</code> </td> <td> U+000A8 </td> <td> <span title="">¨</span> </td> </tr><tr class="impl"><td> <code title="">uuml</code> </td> <td> U+000FC </td> <td> <span title="">ü</span> </td> </tr><tr class="impl"><td> <code title="">yacute</code> </td> <td> U+000FD </td> <td> <span title="">ý</span> </td> </tr><tr class="impl"><td> <code title="">yen</code> </td> <td> U+000A5 </td> <td> <span title="">¥</span> </td> </tr><tr class="impl"><td> <code title="">yuml</code> </td> <td> U+000FF </td> <td> <span title="">ÿ</span> </td> </tr></table></div><p><i>The glyphs displayed above are non-normative. Refer to the
|
|
Unicode specifications for formal definitions of the characters
|
|
listed above.</i><h2 id="the-xhtml-syntax"><span class="secno">9 </span><dfn id="xhtml">The XHTML syntax</dfn></h2><p class="note">This section only describes the rules for XML
|
|
resources. Rules for <code><a href="#text-html">text/html</a></code> resources are discussed
|
|
in the section above entitled "<a href="#syntax">The HTML syntax</a>".<div class="impl">
|
|
|
|
<h3 id="writing-xhtml-documents"><span class="secno">9.1 </span>Writing XHTML documents</h3>
|
|
|
|
</div><p>The syntax for using HTML with XML, whether in XHTML documents or
|
|
embedded in other XML documents, is defined in the XML and
|
|
Namespaces in XML specifications. <a href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a><p>This specification does not define any syntax-level requirements
|
|
beyond those defined for XML proper.<p>XML documents may contain a <code>DOCTYPE</code> if desired, but
|
|
this is not required to conform to this specification. This
|
|
specification does not define a public or system identifier, nor
|
|
provide a format DTD.<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 entity references
|
|
for characters in XHTML documents is unsafe if they are defined in
|
|
an external file (except for <code title="">&lt;</code>, <code title="">&gt;</code>, <code title="">&amp;</code>, <code title="">&quot;</code> and <code title="">&apos;</code>).<div class="impl">
|
|
|
|
<h3 id="parsing-xhtml-documents"><span class="secno">9.2 </span>Parsing XHTML documents</h3>
|
|
|
|
<p>This section describes the relationship between XML and the DOM,
|
|
with a particular emphasis on how this interacts with HTML.</p>
|
|
|
|
<p>An <dfn id="xml-parser">XML parser</dfn>, for the purposes of this specification,
|
|
is a construct that follows the rules given in the XML specification
|
|
to map a string of bytes or characters into a <code><a href="#document">Document</a></code>
|
|
object.</p>
|
|
|
|
<p>An <a href="#xml-parser">XML parser</a> is either associated with a
|
|
<code><a href="#document">Document</a></code> object when it is created, or creates one
|
|
implicitly.</p>
|
|
|
|
<p>This <code><a href="#document">Document</a></code> must then be populated with DOM nodes
|
|
that represent the tree structure of the input passed to the parser,
|
|
as defined by the XML specification, the Namespaces in XML
|
|
specification, and the DOM Core specification. DOM mutation events
|
|
must not fire for the operations that the <a href="#xml-parser">XML parser</a>
|
|
performs on the <code><a href="#document">Document</a></code>'s tree, but the user agent
|
|
must act as if elements and attributes were individually appended
|
|
and set respectively so as to trigger rules in this specification
|
|
regarding what happens when an element is inserted into a document
|
|
or has its attributes set. <a href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a> <a href="#refsDOMCORE">[DOMCORE]</a>
|
|
<a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
|
|
|
|
<p>Between the time an element's start tag is parsed and the time
|
|
either the element's end tag is parsed or the parser detects a
|
|
well-formedness error, the user agent must act as if the element was
|
|
in a <a href="#stack-of-open-elements">stack of open elements</a>.</p>
|
|
|
|
<p class="note">This is used by the <code><a href="#the-object-element">object</a></code> element to
|
|
avoid instantiating plugins before the <code><a href="#the-param-element">param</a></code> element
|
|
children have been parsed.</p>
|
|
|
|
<p>This specification provides the following additional information
|
|
that user agents should use when retrieving an external entity: the
|
|
public identifiers given in the following list all correspond to <a href="data:application/xml-dtd;base64,PCFFTlRJVFkgVGFiICImI3g5OyI%2BPCFFTlRJVFkgTmV3TGluZSAiJiN4QTsiPjwhRU5USVRZIGV4Y2wgIiYjeDIxOyI%2BPCFFTlRJVFkgcXVvdCAiJiN4MjI7Ij48IUVOVElUWSBRVU9UICImI3gyMjsiPjwhRU5USVRZIG51bSAiJiN4MjM7Ij48IUVOVElUWSBkb2xsYXIgIiYjeDI0OyI%2BPCFFTlRJVFkgcGVyY250ICImI3gyNTsiPjwhRU5USVRZIGFtcCAiJiN4MjY7Ij48IUVOVElUWSBBTVAgIiYjeDI2OyI%2BPCFFTlRJVFkgYXBvcyAiJiN4Mjc7Ij48IUVOVElUWSBscGFyICImI3gyODsiPjwhRU5USVRZIHJwYXIgIiYjeDI5OyI%2BPCFFTlRJVFkgYXN0ICImI3gyQTsiPjwhRU5USVRZIG1pZGFzdCAiJiN4MkE7Ij48IUVOVElUWSBwbHVzICImI3gyQjsiPjwhRU5USVRZIGNvbW1hICImI3gyQzsiPjwhRU5USVRZIHBlcmlvZCAiJiN4MkU7Ij48IUVOVElUWSBzb2wgIiYjeDJGOyI%2BPCFFTlRJVFkgY29sb24gIiYjeDNBOyI%2BPCFFTlRJVFkgc2VtaSAiJiN4M0I7Ij48IUVOVElUWSBsdCAiJiN4M0M7Ij48IUVOVElUWSBMVCAiJiN4M0M7Ij48IUVOVElUWSBudmx0ICImI3gzQzsmI3gyMEQyOyI%2BPCFFTlRJVFkgZXF1YWxzICImI3gzRDsiPjwhRU5USVRZIGJuZSAiJiN4M0Q7JiN4MjBFNTsiPjwhRU5USVRZIGd0ICImI3gzRTsiPjwhRU5USVRZIEdUICImI3gzRTsiPjwhRU5USVRZIG52Z3QgIiYjeDNFOyYjeDIwRDI7Ij48IUVOVElUWSBxdWVzdCAiJiN4M0Y7Ij48IUVOVElUWSBjb21tYXQgIiYjeDQwOyI%2BPCFFTlRJVFkgbHNxYiAiJiN4NUI7Ij48IUVOVElUWSBsYnJhY2sgIiYjeDVCOyI%2BPCFFTlRJVFkgYnNvbCAiJiN4NUM7Ij48IUVOVElUWSByc3FiICImI3g1RDsiPjwhRU5USVRZIHJicmFjayAiJiN4NUQ7Ij48IUVOVElUWSBIYXQgIiYjeDVFOyI%2BPCFFTlRJVFkgbG93YmFyICImI3g1RjsiPjwhRU5USVRZIFVuZGVyQmFyICImI3g1RjsiPjwhRU5USVRZIGdyYXZlICImI3g2MDsiPjwhRU5USVRZIERpYWNyaXRpY2FsR3JhdmUgIiYjeDYwOyI%2BPCFFTlRJVFkgZmpsaWcgIiYjeDY2OyYjeDZBOyI%2BPCFFTlRJVFkgbGN1YiAiJiN4N0I7Ij48IUVOVElUWSBsYnJhY2UgIiYjeDdCOyI%2BPCFFTlRJVFkgdmVyYmFyICImI3g3QzsiPjwhRU5USVRZIHZlcnQgIiYjeDdDOyI%2BPCFFTlRJVFkgVmVydGljYWxMaW5lICImI3g3QzsiPjwhRU5USVRZIHJjdWIgIiYjeDdEOyI%2BPCFFTlRJVFkgcmJyYWNlICImI3g3RDsiPjwhRU5USVRZIG5ic3AgIiYjeEEwOyI%2BPCFFTlRJVFkgTm9uQnJlYWtpbmdTcGFjZSAiJiN4QTA7Ij48IUVOVElUWSBpZXhjbCAiJiN4QTE7Ij48IUVOVElUWSBjZW50ICImI3hBMjsiPjwhRU5USVRZIHBvdW5kICImI3hBMzsiPjwhRU5USVRZIGN1cnJlbiAiJiN4QTQ7Ij48IUVOVElUWSB5ZW4gIiYjeEE1OyI%2BPCFFTlRJVFkgYnJ2YmFyICImI3hBNjsiPjwhRU5USVRZIHNlY3QgIiYjeEE3OyI%2BPCFFTlRJVFkgRG90ICImI3hBODsiPjwhRU5USVRZIGRpZSAiJiN4QTg7Ij48IUVOVElUWSBEb3VibGVEb3QgIiYjeEE4OyI%2BPCFFTlRJVFkgdW1sICImI3hBODsiPjwhRU5USVRZIGNvcHkgIiYjeEE5OyI%2BPCFFTlRJVFkgQ09QWSAiJiN4QTk7Ij48IUVOVElUWSBvcmRmICImI3hBQTsiPjwhRU5USVRZIGxhcXVvICImI3hBQjsiPjwhRU5USVRZIG5vdCAiJiN4QUM7Ij48IUVOVElUWSBzaHkgIiYjeEFEOyI%2BPCFFTlRJVFkgcmVnICImI3hBRTsiPjwhRU5USVRZIGNpcmNsZWRSICImI3hBRTsiPjwhRU5USVRZIFJFRyAiJiN4QUU7Ij48IUVOVElUWSBtYWNyICImI3hBRjsiPjwhRU5USVRZIHN0cm5zICImI3hBRjsiPjwhRU5USVRZIGRlZyAiJiN4QjA7Ij48IUVOVElUWSBwbHVzbW4gIiYjeEIxOyI%2BPCFFTlRJVFkgcG0gIiYjeEIxOyI%2BPCFFTlRJVFkgUGx1c01pbnVzICImI3hCMTsiPjwhRU5USVRZIHN1cDIgIiYjeEIyOyI%2BPCFFTlRJVFkgc3VwMyAiJiN4QjM7Ij48IUVOVElUWSBhY3V0ZSAiJiN4QjQ7Ij48IUVOVElUWSBEaWFjcml0aWNhbEFjdXRlICImI3hCNDsiPjwhRU5USVRZIG1pY3JvICImI3hCNTsiPjwhRU5USVRZIHBhcmEgIiYjeEI2OyI%2BPCFFTlRJVFkgbWlkZG90ICImI3hCNzsiPjwhRU5USVRZIGNlbnRlcmRvdCAiJiN4Qjc7Ij48IUVOVElUWSBDZW50ZXJEb3QgIiYjeEI3OyI%2BPCFFTlRJVFkgY2VkaWwgIiYjeEI4OyI%2BPCFFTlRJVFkgQ2VkaWxsYSAiJiN4Qjg7Ij48IUVOVElUWSBzdXAxICImI3hCOTsiPjwhRU5USVRZIG9yZG0gIiYjeEJBOyI%2BPCFFTlRJVFkgcmFxdW8gIiYjeEJCOyI%2BPCFFTlRJVFkgZnJhYzE0ICImI3hCQzsiPjwhRU5USVRZIGZyYWMxMiAiJiN4QkQ7Ij48IUVOVElUWSBoYWxmICImI3hCRDsiPjwhRU5USVRZIGZyYWMzNCAiJiN4QkU7Ij48IUVOVElUWSBpcXVlc3QgIiYjeEJGOyI%2BPCFFTlRJVFkgQWdyYXZlICImI3hDMDsiPjwhRU5USVRZIEFhY3V0ZSAiJiN4QzE7Ij48IUVOVElUWSBBY2lyYyAiJiN4QzI7Ij48IUVOVElUWSBBdGlsZGUgIiYjeEMzOyI%2BPCFFTlRJVFkgQXVtbCAiJiN4QzQ7Ij48IUVOVElUWSBBcmluZyAiJiN4QzU7Ij48IUVOVElUWSBhbmdzdCAiJiN4QzU7Ij48IUVOVElUWSBBRWxpZyAiJiN4QzY7Ij48IUVOVElUWSBDY2VkaWwgIiYjeEM3OyI%2BPCFFTlRJVFkgRWdyYXZlICImI3hDODsiPjwhRU5USVRZIEVhY3V0ZSAiJiN4Qzk7Ij48IUVOVElUWSBFY2lyYyAiJiN4Q0E7Ij48IUVOVElUWSBFdW1sICImI3hDQjsiPjwhRU5USVRZIElncmF2ZSAiJiN4Q0M7Ij48IUVOVElUWSBJYWN1dGUgIiYjeENEOyI%2BPCFFTlRJVFkgSWNpcmMgIiYjeENFOyI%2BPCFFTlRJVFkgSXVtbCAiJiN4Q0Y7Ij48IUVOVElUWSBFVEggIiYjeEQwOyI%2BPCFFTlRJVFkgTnRpbGRlICImI3hEMTsiPjwhRU5USVRZIE9ncmF2ZSAiJiN4RDI7Ij48IUVOVElUWSBPYWN1dGUgIiYjeEQzOyI%2BPCFFTlRJVFkgT2NpcmMgIiYjeEQ0OyI%2BPCFFTlRJVFkgT3RpbGRlICImI3hENTsiPjwhRU5USVRZIE91bWwgIiYjeEQ2OyI%2BPCFFTlRJVFkgdGltZXMgIiYjeEQ3OyI%2BPCFFTlRJVFkgT3NsYXNoICImI3hEODsiPjwhRU5USVRZIFVncmF2ZSAiJiN4RDk7Ij48IUVOVElUWSBVYWN1dGUgIiYjeERBOyI%2BPCFFTlRJVFkgVWNpcmMgIiYjeERCOyI%2BPCFFTlRJVFkgVXVtbCAiJiN4REM7Ij48IUVOVElUWSBZYWN1dGUgIiYjeEREOyI%2BPCFFTlRJVFkgVEhPUk4gIiYjeERFOyI%2BPCFFTlRJVFkgc3psaWcgIiYjeERGOyI%2BPCFFTlRJVFkgYWdyYXZlICImI3hFMDsiPjwhRU5USVRZIGFhY3V0ZSAiJiN4RTE7Ij48IUVOVElUWSBhY2lyYyAiJiN4RTI7Ij48IUVOVElUWSBhdGlsZGUgIiYjeEUzOyI%2BPCFFTlRJVFkgYXVtbCAiJiN4RTQ7Ij48IUVOVElUWSBhcmluZyAiJiN4RTU7Ij48IUVOVElUWSBhZWxpZyAiJiN4RTY7Ij48IUVOVElUWSBjY2VkaWwgIiYjeEU3OyI%2BPCFFTlRJVFkgZWdyYXZlICImI3hFODsiPjwhRU5USVRZIGVhY3V0ZSAiJiN4RTk7Ij48IUVOVElUWSBlY2lyYyAiJiN4RUE7Ij48IUVOVElUWSBldW1sICImI3hFQjsiPjwhRU5USVRZIGlncmF2ZSAiJiN4RUM7Ij48IUVOVElUWSBpYWN1dGUgIiYjeEVEOyI%2BPCFFTlRJVFkgaWNpcmMgIiYjeEVFOyI%2BPCFFTlRJVFkgaXVtbCAiJiN4RUY7Ij48IUVOVElUWSBldGggIiYjeEYwOyI%2BPCFFTlRJVFkgbnRpbGRlICImI3hGMTsiPjwhRU5USVRZIG9ncmF2ZSAiJiN4RjI7Ij48IUVOVElUWSBvYWN1dGUgIiYjeEYzOyI%2BPCFFTlRJVFkgb2NpcmMgIiYjeEY0OyI%2BPCFFTlRJVFkgb3RpbGRlICImI3hGNTsiPjwhRU5USVRZIG91bWwgIiYjeEY2OyI%2BPCFFTlRJVFkgZGl2aWRlICImI3hGNzsiPjwhRU5USVRZIGRpdiAiJiN4Rjc7Ij48IUVOVElUWSBvc2xhc2ggIiYjeEY4OyI%2BPCFFTlRJVFkgdWdyYXZlICImI3hGOTsiPjwhRU5USVRZIHVhY3V0ZSAiJiN4RkE7Ij48IUVOVElUWSB1Y2lyYyAiJiN4RkI7Ij48IUVOVElUWSB1dW1sICImI3hGQzsiPjwhRU5USVRZIHlhY3V0ZSAiJiN4RkQ7Ij48IUVOVElUWSB0aG9ybiAiJiN4RkU7Ij48IUVOVElUWSB5dW1sICImI3hGRjsiPjwhRU5USVRZIEFtYWNyICImI3gxMDA7Ij48IUVOVElUWSBhbWFjciAiJiN4MTAxOyI%2BPCFFTlRJVFkgQWJyZXZlICImI3gxMDI7Ij48IUVOVElUWSBhYnJldmUgIiYjeDEwMzsiPjwhRU5USVRZIEFvZ29uICImI3gxMDQ7Ij48IUVOVElUWSBhb2dvbiAiJiN4MTA1OyI%2BPCFFTlRJVFkgQ2FjdXRlICImI3gxMDY7Ij48IUVOVElUWSBjYWN1dGUgIiYjeDEwNzsiPjwhRU5USVRZIENjaXJjICImI3gxMDg7Ij48IUVOVElUWSBjY2lyYyAiJiN4MTA5OyI%2BPCFFTlRJVFkgQ2RvdCAiJiN4MTBBOyI%2BPCFFTlRJVFkgY2RvdCAiJiN4MTBCOyI%2BPCFFTlRJVFkgQ2Nhcm9uICImI3gxMEM7Ij48IUVOVElUWSBjY2Fyb24gIiYjeDEwRDsiPjwhRU5USVRZIERjYXJvbiAiJiN4MTBFOyI%2BPCFFTlRJVFkgZGNhcm9uICImI3gxMEY7Ij48IUVOVElUWSBEc3Ryb2sgIiYjeDExMDsiPjwhRU5USVRZIGRzdHJvayAiJiN4MTExOyI%2BPCFFTlRJVFkgRW1hY3IgIiYjeDExMjsiPjwhRU5USVRZIGVtYWNyICImI3gxMTM7Ij48IUVOVElUWSBFZG90ICImI3gxMTY7Ij48IUVOVElUWSBlZG90ICImI3gxMTc7Ij48IUVOVElUWSBFb2dvbiAiJiN4MTE4OyI%2BPCFFTlRJVFkgZW9nb24gIiYjeDExOTsiPjwhRU5USVRZIEVjYXJvbiAiJiN4MTFBOyI%2BPCFFTlRJVFkgZWNhcm9uICImI3gxMUI7Ij48IUVOVElUWSBHY2lyYyAiJiN4MTFDOyI%2BPCFFTlRJVFkgZ2NpcmMgIiYjeDExRDsiPjwhRU5USVRZIEdicmV2ZSAiJiN4MTFFOyI%2BPCFFTlRJVFkgZ2JyZXZlICImI3gxMUY7Ij48IUVOVElUWSBHZG90ICImI3gxMjA7Ij48IUVOVElUWSBnZG90ICImI3gxMjE7Ij48IUVOVElUWSBHY2VkaWwgIiYjeDEyMjsiPjwhRU5USVRZIEhjaXJjICImI3gxMjQ7Ij48IUVOVElUWSBoY2lyYyAiJiN4MTI1OyI%2BPCFFTlRJVFkgSHN0cm9rICImI3gxMjY7Ij48IUVOVElUWSBoc3Ryb2sgIiYjeDEyNzsiPjwhRU5USVRZIEl0aWxkZSAiJiN4MTI4OyI%2BPCFFTlRJVFkgaXRpbGRlICImI3gxMjk7Ij48IUVOVElUWSBJbWFjciAiJiN4MTJBOyI%2BPCFFTlRJVFkgaW1hY3IgIiYjeDEyQjsiPjwhRU5USVRZIElvZ29uICImI3gxMkU7Ij48IUVOVElUWSBpb2dvbiAiJiN4MTJGOyI%2BPCFFTlRJVFkgSWRvdCAiJiN4MTMwOyI%2BPCFFTlRJVFkgaW1hdGggIiYjeDEzMTsiPjwhRU5USVRZIGlub2RvdCAiJiN4MTMxOyI%2BPCFFTlRJVFkgSUpsaWcgIiYjeDEzMjsiPjwhRU5USVRZIGlqbGlnICImI3gxMzM7Ij48IUVOVElUWSBKY2lyYyAiJiN4MTM0OyI%2BPCFFTlRJVFkgamNpcmMgIiYjeDEzNTsiPjwhRU5USVRZIEtjZWRpbCAiJiN4MTM2OyI%2BPCFFTlRJVFkga2NlZGlsICImI3gxMzc7Ij48IUVOVElUWSBrZ3JlZW4gIiYjeDEzODsiPjwhRU5USVRZIExhY3V0ZSAiJiN4MTM5OyI%2BPCFFTlRJVFkgbGFjdXRlICImI3gxM0E7Ij48IUVOVElUWSBMY2VkaWwgIiYjeDEzQjsiPjwhRU5USVRZIGxjZWRpbCAiJiN4MTNDOyI%2BPCFFTlRJVFkgTGNhcm9uICImI3gxM0Q7Ij48IUVOVElUWSBsY2Fyb24gIiYjeDEzRTsiPjwhRU5USVRZIExtaWRvdCAiJiN4MTNGOyI%2BPCFFTlRJVFkgbG1pZG90ICImI3gxNDA7Ij48IUVOVElUWSBMc3Ryb2sgIiYjeDE0MTsiPjwhRU5USVRZIGxzdHJvayAiJiN4MTQyOyI%2BPCFFTlRJVFkgTmFjdXRlICImI3gxNDM7Ij48IUVOVElUWSBuYWN1dGUgIiYjeDE0NDsiPjwhRU5USVRZIE5jZWRpbCAiJiN4MTQ1OyI%2BPCFFTlRJVFkgbmNlZGlsICImI3gxNDY7Ij48IUVOVElUWSBOY2Fyb24gIiYjeDE0NzsiPjwhRU5USVRZIG5jYXJvbiAiJiN4MTQ4OyI%2BPCFFTlRJVFkgbmFwb3MgIiYjeDE0OTsiPjwhRU5USVRZIEVORyAiJiN4MTRBOyI%2BPCFFTlRJVFkgZW5nICImI3gxNEI7Ij48IUVOVElUWSBPbWFjciAiJiN4MTRDOyI%2BPCFFTlRJVFkgb21hY3IgIiYjeDE0RDsiPjwhRU5USVRZIE9kYmxhYyAiJiN4MTUwOyI%2BPCFFTlRJVFkgb2RibGFjICImI3gxNTE7Ij48IUVOVElUWSBPRWxpZyAiJiN4MTUyOyI%2BPCFFTlRJVFkgb2VsaWcgIiYjeDE1MzsiPjwhRU5USVRZIFJhY3V0ZSAiJiN4MTU0OyI%2BPCFFTlRJVFkgcmFjdXRlICImI3gxNTU7Ij48IUVOVElUWSBSY2VkaWwgIiYjeDE1NjsiPjwhRU5USVRZIHJjZWRpbCAiJiN4MTU3OyI%2BPCFFTlRJVFkgUmNhcm9uICImI3gxNTg7Ij48IUVOVElUWSByY2Fyb24gIiYjeDE1OTsiPjwhRU5USVRZIFNhY3V0ZSAiJiN4MTVBOyI%2BPCFFTlRJVFkgc2FjdXRlICImI3gxNUI7Ij48IUVOVElUWSBTY2lyYyAiJiN4MTVDOyI%2BPCFFTlRJVFkgc2NpcmMgIiYjeDE1RDsiPjwhRU5USVRZIFNjZWRpbCAiJiN4MTVFOyI%2BPCFFTlRJVFkgc2NlZGlsICImI3gxNUY7Ij48IUVOVElUWSBTY2Fyb24gIiYjeDE2MDsiPjwhRU5USVRZIHNjYXJvbiAiJiN4MTYxOyI%2BPCFFTlRJVFkgVGNlZGlsICImI3gxNjI7Ij48IUVOVElUWSB0Y2VkaWwgIiYjeDE2MzsiPjwhRU5USVRZIFRjYXJvbiAiJiN4MTY0OyI%2BPCFFTlRJVFkgdGNhcm9uICImI3gxNjU7Ij48IUVOVElUWSBUc3Ryb2sgIiYjeDE2NjsiPjwhRU5USVRZIHRzdHJvayAiJiN4MTY3OyI%2BPCFFTlRJVFkgVXRpbGRlICImI3gxNjg7Ij48IUVOVElUWSB1dGlsZGUgIiYjeDE2OTsiPjwhRU5USVRZIFVtYWNyICImI3gxNkE7Ij48IUVOVElUWSB1bWFjciAiJiN4MTZCOyI%2BPCFFTlRJVFkgVWJyZXZlICImI3gxNkM7Ij48IUVOVElUWSB1YnJldmUgIiYjeDE2RDsiPjwhRU5USVRZIFVyaW5nICImI3gxNkU7Ij48IUVOVElUWSB1cmluZyAiJiN4MTZGOyI%2BPCFFTlRJVFkgVWRibGFjICImI3gxNzA7Ij48IUVOVElUWSB1ZGJsYWMgIiYjeDE3MTsiPjwhRU5USVRZIFVvZ29uICImI3gxNzI7Ij48IUVOVElUWSB1b2dvbiAiJiN4MTczOyI%2BPCFFTlRJVFkgV2NpcmMgIiYjeDE3NDsiPjwhRU5USVRZIHdjaXJjICImI3gxNzU7Ij48IUVOVElUWSBZY2lyYyAiJiN4MTc2OyI%2BPCFFTlRJVFkgeWNpcmMgIiYjeDE3NzsiPjwhRU5USVRZIFl1bWwgIiYjeDE3ODsiPjwhRU5USVRZIFphY3V0ZSAiJiN4MTc5OyI%2BPCFFTlRJVFkgemFjdXRlICImI3gxN0E7Ij48IUVOVElUWSBaZG90ICImI3gxN0I7Ij48IUVOVElUWSB6ZG90ICImI3gxN0M7Ij48IUVOVElUWSBaY2Fyb24gIiYjeDE3RDsiPjwhRU5USVRZIHpjYXJvbiAiJiN4MTdFOyI%2BPCFFTlRJVFkgZm5vZiAiJiN4MTkyOyI%2BPCFFTlRJVFkgaW1wZWQgIiYjeDFCNTsiPjwhRU5USVRZIGdhY3V0ZSAiJiN4MUY1OyI%2BPCFFTlRJVFkgam1hdGggIiYjeDIzNzsiPjwhRU5USVRZIGNpcmMgIiYjeDJDNjsiPjwhRU5USVRZIGNhcm9uICImI3gyQzc7Ij48IUVOVElUWSBIYWNlayAiJiN4MkM3OyI%2BPCFFTlRJVFkgYnJldmUgIiYjeDJEODsiPjwhRU5USVRZIEJyZXZlICImI3gyRDg7Ij48IUVOVElUWSBkb3QgIiYjeDJEOTsiPjwhRU5USVRZIERpYWNyaXRpY2FsRG90ICImI3gyRDk7Ij48IUVOVElUWSByaW5nICImI3gyREE7Ij48IUVOVElUWSBvZ29uICImI3gyREI7Ij48IUVOVElUWSB0aWxkZSAiJiN4MkRDOyI%2BPCFFTlRJVFkgRGlhY3JpdGljYWxUaWxkZSAiJiN4MkRDOyI%2BPCFFTlRJVFkgZGJsYWMgIiYjeDJERDsiPjwhRU5USVRZIERpYWNyaXRpY2FsRG91YmxlQWN1dGUgIiYjeDJERDsiPjwhRU5USVRZIERvd25CcmV2ZSAiJiN4MzExOyI%2BPCFFTlRJVFkgQWxwaGEgIiYjeDM5MTsiPjwhRU5USVRZIEJldGEgIiYjeDM5MjsiPjwhRU5USVRZIEdhbW1hICImI3gzOTM7Ij48IUVOVElUWSBEZWx0YSAiJiN4Mzk0OyI%2BPCFFTlRJVFkgRXBzaWxvbiAiJiN4Mzk1OyI%2BPCFFTlRJVFkgWmV0YSAiJiN4Mzk2OyI%2BPCFFTlRJVFkgRXRhICImI3gzOTc7Ij48IUVOVElUWSBUaGV0YSAiJiN4Mzk4OyI%2BPCFFTlRJVFkgSW90YSAiJiN4Mzk5OyI%2BPCFFTlRJVFkgS2FwcGEgIiYjeDM5QTsiPjwhRU5USVRZIExhbWJkYSAiJiN4MzlCOyI%2BPCFFTlRJVFkgTXUgIiYjeDM5QzsiPjwhRU5USVRZIE51ICImI3gzOUQ7Ij48IUVOVElUWSBYaSAiJiN4MzlFOyI%2BPCFFTlRJVFkgT21pY3JvbiAiJiN4MzlGOyI%2BPCFFTlRJVFkgUGkgIiYjeDNBMDsiPjwhRU5USVRZIFJobyAiJiN4M0ExOyI%2BPCFFTlRJVFkgU2lnbWEgIiYjeDNBMzsiPjwhRU5USVRZIFRhdSAiJiN4M0E0OyI%2BPCFFTlRJVFkgVXBzaWxvbiAiJiN4M0E1OyI%2BPCFFTlRJVFkgUGhpICImI3gzQTY7Ij48IUVOVElUWSBDaGkgIiYjeDNBNzsiPjwhRU5USVRZIFBzaSAiJiN4M0E4OyI%2BPCFFTlRJVFkgT21lZ2EgIiYjeDNBOTsiPjwhRU5USVRZIG9obSAiJiN4M0E5OyI%2BPCFFTlRJVFkgYWxwaGEgIiYjeDNCMTsiPjwhRU5USVRZIGJldGEgIiYjeDNCMjsiPjwhRU5USVRZIGdhbW1hICImI3gzQjM7Ij48IUVOVElUWSBkZWx0YSAiJiN4M0I0OyI%2BPCFFTlRJVFkgZXBzaSAiJiN4M0I1OyI%2BPCFFTlRJVFkgZXBzaWxvbiAiJiN4M0I1OyI%2BPCFFTlRJVFkgemV0YSAiJiN4M0I2OyI%2BPCFFTlRJVFkgZXRhICImI3gzQjc7Ij48IUVOVElUWSB0aGV0YSAiJiN4M0I4OyI%2BPCFFTlRJVFkgaW90YSAiJiN4M0I5OyI%2BPCFFTlRJVFkga2FwcGEgIiYjeDNCQTsiPjwhRU5USVRZIGxhbWJkYSAiJiN4M0JCOyI%2BPCFFTlRJVFkgbXUgIiYjeDNCQzsiPjwhRU5USVRZIG51ICImI3gzQkQ7Ij48IUVOVElUWSB4aSAiJiN4M0JFOyI%2BPCFFTlRJVFkgb21pY3JvbiAiJiN4M0JGOyI%2BPCFFTlRJVFkgcGkgIiYjeDNDMDsiPjwhRU5USVRZIHJobyAiJiN4M0MxOyI%2BPCFFTlRJVFkgc2lnbWF2ICImI3gzQzI7Ij48IUVOVElUWSB2YXJzaWdtYSAiJiN4M0MyOyI%2BPCFFTlRJVFkgc2lnbWFmICImI3gzQzI7Ij48IUVOVElUWSBzaWdtYSAiJiN4M0MzOyI%2BPCFFTlRJVFkgdGF1ICImI3gzQzQ7Ij48IUVOVElUWSB1cHNpICImI3gzQzU7Ij48IUVOVElUWSB1cHNpbG9uICImI3gzQzU7Ij48IUVOVElUWSBwaGkgIiYjeDNDNjsiPjwhRU5USVRZIGNoaSAiJiN4M0M3OyI%2BPCFFTlRJVFkgcHNpICImI3gzQzg7Ij48IUVOVElUWSBvbWVnYSAiJiN4M0M5OyI%2BPCFFTlRJVFkgdGhldGF2ICImI3gzRDE7Ij48IUVOVElUWSB2YXJ0aGV0YSAiJiN4M0QxOyI%2BPCFFTlRJVFkgdGhldGFzeW0gIiYjeDNEMTsiPjwhRU5USVRZIFVwc2kgIiYjeDNEMjsiPjwhRU5USVRZIHVwc2loICImI3gzRDI7Ij48IUVOVElUWSBzdHJhaWdodHBoaSAiJiN4M0Q1OyI%2BPCFFTlRJVFkgcGhpdiAiJiN4M0Q1OyI%2BPCFFTlRJVFkgdmFycGhpICImI3gzRDU7Ij48IUVOVElUWSBwaXYgIiYjeDNENjsiPjwhRU5USVRZIHZhcnBpICImI3gzRDY7Ij48IUVOVElUWSBHYW1tYWQgIiYjeDNEQzsiPjwhRU5USVRZIGdhbW1hZCAiJiN4M0REOyI%2BPCFFTlRJVFkgZGlnYW1tYSAiJiN4M0REOyI%2BPCFFTlRJVFkga2FwcGF2ICImI3gzRjA7Ij48IUVOVElUWSB2YXJrYXBwYSAiJiN4M0YwOyI%2BPCFFTlRJVFkgcmhvdiAiJiN4M0YxOyI%2BPCFFTlRJVFkgdmFycmhvICImI3gzRjE7Ij48IUVOVElUWSBlcHNpdiAiJiN4M0Y1OyI%2BPCFFTlRJVFkgc3RyYWlnaHRlcHNpbG9uICImI3gzRjU7Ij48IUVOVElUWSB2YXJlcHNpbG9uICImI3gzRjU7Ij48IUVOVElUWSBiZXBzaSAiJiN4M0Y2OyI%2BPCFFTlRJVFkgYmFja2Vwc2lsb24gIiYjeDNGNjsiPjwhRU5USVRZIElPY3kgIiYjeDQwMTsiPjwhRU5USVRZIERKY3kgIiYjeDQwMjsiPjwhRU5USVRZIEdKY3kgIiYjeDQwMzsiPjwhRU5USVRZIEp1a2N5ICImI3g0MDQ7Ij48IUVOVElUWSBEU2N5ICImI3g0MDU7Ij48IUVOVElUWSBJdWtjeSAiJiN4NDA2OyI%2BPCFFTlRJVFkgWUljeSAiJiN4NDA3OyI%2BPCFFTlRJVFkgSnNlcmN5ICImI3g0MDg7Ij48IUVOVElUWSBMSmN5ICImI3g0MDk7Ij48IUVOVElUWSBOSmN5ICImI3g0MEE7Ij48IUVOVElUWSBUU0hjeSAiJiN4NDBCOyI%2BPCFFTlRJVFkgS0pjeSAiJiN4NDBDOyI%2BPCFFTlRJVFkgVWJyY3kgIiYjeDQwRTsiPjwhRU5USVRZIERaY3kgIiYjeDQwRjsiPjwhRU5USVRZIEFjeSAiJiN4NDEwOyI%2BPCFFTlRJVFkgQmN5ICImI3g0MTE7Ij48IUVOVElUWSBWY3kgIiYjeDQxMjsiPjwhRU5USVRZIEdjeSAiJiN4NDEzOyI%2BPCFFTlRJVFkgRGN5ICImI3g0MTQ7Ij48IUVOVElUWSBJRWN5ICImI3g0MTU7Ij48IUVOVElUWSBaSGN5ICImI3g0MTY7Ij48IUVOVElUWSBaY3kgIiYjeDQxNzsiPjwhRU5USVRZIEljeSAiJiN4NDE4OyI%2BPCFFTlRJVFkgSmN5ICImI3g0MTk7Ij48IUVOVElUWSBLY3kgIiYjeDQxQTsiPjwhRU5USVRZIExjeSAiJiN4NDFCOyI%2BPCFFTlRJVFkgTWN5ICImI3g0MUM7Ij48IUVOVElUWSBOY3kgIiYjeDQxRDsiPjwhRU5USVRZIE9jeSAiJiN4NDFFOyI%2BPCFFTlRJVFkgUGN5ICImI3g0MUY7Ij48IUVOVElUWSBSY3kgIiYjeDQyMDsiPjwhRU5USVRZIFNjeSAiJiN4NDIxOyI%2BPCFFTlRJVFkgVGN5ICImI3g0MjI7Ij48IUVOVElUWSBVY3kgIiYjeDQyMzsiPjwhRU5USVRZIEZjeSAiJiN4NDI0OyI%2BPCFFTlRJVFkgS0hjeSAiJiN4NDI1OyI%2BPCFFTlRJVFkgVFNjeSAiJiN4NDI2OyI%2BPCFFTlRJVFkgQ0hjeSAiJiN4NDI3OyI%2BPCFFTlRJVFkgU0hjeSAiJiN4NDI4OyI%2BPCFFTlRJVFkgU0hDSGN5ICImI3g0Mjk7Ij48IUVOVElUWSBIQVJEY3kgIiYjeDQyQTsiPjwhRU5USVRZIFljeSAiJiN4NDJCOyI%2BPCFFTlRJVFkgU09GVGN5ICImI3g0MkM7Ij48IUVOVElUWSBFY3kgIiYjeDQyRDsiPjwhRU5USVRZIFlVY3kgIiYjeDQyRTsiPjwhRU5USVRZIFlBY3kgIiYjeDQyRjsiPjwhRU5USVRZIGFjeSAiJiN4NDMwOyI%2BPCFFTlRJVFkgYmN5ICImI3g0MzE7Ij48IUVOVElUWSB2Y3kgIiYjeDQzMjsiPjwhRU5USVRZIGdjeSAiJiN4NDMzOyI%2BPCFFTlRJVFkgZGN5ICImI3g0MzQ7Ij48IUVOVElUWSBpZWN5ICImI3g0MzU7Ij48IUVOVElUWSB6aGN5ICImI3g0MzY7Ij48IUVOVElUWSB6Y3kgIiYjeDQzNzsiPjwhRU5USVRZIGljeSAiJiN4NDM4OyI%2BPCFFTlRJVFkgamN5ICImI3g0Mzk7Ij48IUVOVElUWSBrY3kgIiYjeDQzQTsiPjwhRU5USVRZIGxjeSAiJiN4NDNCOyI%2BPCFFTlRJVFkgbWN5ICImI3g0M0M7Ij48IUVOVElUWSBuY3kgIiYjeDQzRDsiPjwhRU5USVRZIG9jeSAiJiN4NDNFOyI%2BPCFFTlRJVFkgcGN5ICImI3g0M0Y7Ij48IUVOVElUWSByY3kgIiYjeDQ0MDsiPjwhRU5USVRZIHNjeSAiJiN4NDQxOyI%2BPCFFTlRJVFkgdGN5ICImI3g0NDI7Ij48IUVOVElUWSB1Y3kgIiYjeDQ0MzsiPjwhRU5USVRZIGZjeSAiJiN4NDQ0OyI%2BPCFFTlRJVFkga2hjeSAiJiN4NDQ1OyI%2BPCFFTlRJVFkgdHNjeSAiJiN4NDQ2OyI%2BPCFFTlRJVFkgY2hjeSAiJiN4NDQ3OyI%2BPCFFTlRJVFkgc2hjeSAiJiN4NDQ4OyI%2BPCFFTlRJVFkgc2hjaGN5ICImI3g0NDk7Ij48IUVOVElUWSBoYXJkY3kgIiYjeDQ0QTsiPjwhRU5USVRZIHljeSAiJiN4NDRCOyI%2BPCFFTlRJVFkgc29mdGN5ICImI3g0NEM7Ij48IUVOVElUWSBlY3kgIiYjeDQ0RDsiPjwhRU5USVRZIHl1Y3kgIiYjeDQ0RTsiPjwhRU5USVRZIHlhY3kgIiYjeDQ0RjsiPjwhRU5USVRZIGlvY3kgIiYjeDQ1MTsiPjwhRU5USVRZIGRqY3kgIiYjeDQ1MjsiPjwhRU5USVRZIGdqY3kgIiYjeDQ1MzsiPjwhRU5USVRZIGp1a2N5ICImI3g0NTQ7Ij48IUVOVElUWSBkc2N5ICImI3g0NTU7Ij48IUVOVElUWSBpdWtjeSAiJiN4NDU2OyI%2BPCFFTlRJVFkgeWljeSAiJiN4NDU3OyI%2BPCFFTlRJVFkganNlcmN5ICImI3g0NTg7Ij48IUVOVElUWSBsamN5ICImI3g0NTk7Ij48IUVOVElUWSBuamN5ICImI3g0NUE7Ij48IUVOVElUWSB0c2hjeSAiJiN4NDVCOyI%2BPCFFTlRJVFkga2pjeSAiJiN4NDVDOyI%2BPCFFTlRJVFkgdWJyY3kgIiYjeDQ1RTsiPjwhRU5USVRZIGR6Y3kgIiYjeDQ1RjsiPjwhRU5USVRZIGVuc3AgIiYjeDIwMDI7Ij48IUVOVElUWSBlbXNwICImI3gyMDAzOyI%2BPCFFTlRJVFkgZW1zcDEzICImI3gyMDA0OyI%2BPCFFTlRJVFkgZW1zcDE0ICImI3gyMDA1OyI%2BPCFFTlRJVFkgbnVtc3AgIiYjeDIwMDc7Ij48IUVOVElUWSBwdW5jc3AgIiYjeDIwMDg7Ij48IUVOVElUWSB0aGluc3AgIiYjeDIwMDk7Ij48IUVOVElUWSBUaGluU3BhY2UgIiYjeDIwMDk7Ij48IUVOVElUWSBoYWlyc3AgIiYjeDIwMEE7Ij48IUVOVElUWSBWZXJ5VGhpblNwYWNlICImI3gyMDBBOyI%2BPCFFTlRJVFkgWmVyb1dpZHRoU3BhY2UgIiYjeDIwMEI7Ij48IUVOVElUWSBOZWdhdGl2ZVZlcnlUaGluU3BhY2UgIiYjeDIwMEI7Ij48IUVOVElUWSBOZWdhdGl2ZVRoaW5TcGFjZSAiJiN4MjAwQjsiPjwhRU5USVRZIE5lZ2F0aXZlTWVkaXVtU3BhY2UgIiYjeDIwMEI7Ij48IUVOVElUWSBOZWdhdGl2ZVRoaWNrU3BhY2UgIiYjeDIwMEI7Ij48IUVOVElUWSB6d25qICImI3gyMDBDOyI%2BPCFFTlRJVFkgendqICImI3gyMDBEOyI%2BPCFFTlRJVFkgbHJtICImI3gyMDBFOyI%2BPCFFTlRJVFkgcmxtICImI3gyMDBGOyI%2BPCFFTlRJVFkgaHlwaGVuICImI3gyMDEwOyI%2BPCFFTlRJVFkgZGFzaCAiJiN4MjAxMDsiPjwhRU5USVRZIG5kYXNoICImI3gyMDEzOyI%2BPCFFTlRJVFkgbWRhc2ggIiYjeDIwMTQ7Ij48IUVOVElUWSBob3JiYXIgIiYjeDIwMTU7Ij48IUVOVElUWSBWZXJiYXIgIiYjeDIwMTY7Ij48IUVOVElUWSBWZXJ0ICImI3gyMDE2OyI%2BPCFFTlRJVFkgbHNxdW8gIiYjeDIwMTg7Ij48IUVOVElUWSBPcGVuQ3VybHlRdW90ZSAiJiN4MjAxODsiPjwhRU5USVRZIHJzcXVvICImI3gyMDE5OyI%2BPCFFTlRJVFkgcnNxdW9yICImI3gyMDE5OyI%2BPCFFTlRJVFkgQ2xvc2VDdXJseVF1b3RlICImI3gyMDE5OyI%2BPCFFTlRJVFkgbHNxdW9yICImI3gyMDFBOyI%2BPCFFTlRJVFkgc2JxdW8gIiYjeDIwMUE7Ij48IUVOVElUWSBsZHF1byAiJiN4MjAxQzsiPjwhRU5USVRZIE9wZW5DdXJseURvdWJsZVF1b3RlICImI3gyMDFDOyI%2BPCFFTlRJVFkgcmRxdW8gIiYjeDIwMUQ7Ij48IUVOVElUWSByZHF1b3IgIiYjeDIwMUQ7Ij48IUVOVElUWSBDbG9zZUN1cmx5RG91YmxlUXVvdGUgIiYjeDIwMUQ7Ij48IUVOVElUWSBsZHF1b3IgIiYjeDIwMUU7Ij48IUVOVElUWSBiZHF1byAiJiN4MjAxRTsiPjwhRU5USVRZIGRhZ2dlciAiJiN4MjAyMDsiPjwhRU5USVRZIERhZ2dlciAiJiN4MjAyMTsiPjwhRU5USVRZIGRkYWdnZXIgIiYjeDIwMjE7Ij48IUVOVElUWSBidWxsICImI3gyMDIyOyI%2BPCFFTlRJVFkgYnVsbGV0ICImI3gyMDIyOyI%2BPCFFTlRJVFkgbmxkciAiJiN4MjAyNTsiPjwhRU5USVRZIGhlbGxpcCAiJiN4MjAyNjsiPjwhRU5USVRZIG1sZHIgIiYjeDIwMjY7Ij48IUVOVElUWSBwZXJtaWwgIiYjeDIwMzA7Ij48IUVOVElUWSBwZXJ0ZW5rICImI3gyMDMxOyI%2BPCFFTlRJVFkgcHJpbWUgIiYjeDIwMzI7Ij48IUVOVElUWSBQcmltZSAiJiN4MjAzMzsiPjwhRU5USVRZIHRwcmltZSAiJiN4MjAzNDsiPjwhRU5USVRZIGJwcmltZSAiJiN4MjAzNTsiPjwhRU5USVRZIGJhY2twcmltZSAiJiN4MjAzNTsiPjwhRU5USVRZIGxzYXF1byAiJiN4MjAzOTsiPjwhRU5USVRZIHJzYXF1byAiJiN4MjAzQTsiPjwhRU5USVRZIG9saW5lICImI3gyMDNFOyI%2BPCFFTlRJVFkgT3ZlckJhciAiJiN4MjAzRTsiPjwhRU5USVRZIGNhcmV0ICImI3gyMDQxOyI%2BPCFFTlRJVFkgaHlidWxsICImI3gyMDQzOyI%2BPCFFTlRJVFkgZnJhc2wgIiYjeDIwNDQ7Ij48IUVOVElUWSBic2VtaSAiJiN4MjA0RjsiPjwhRU5USVRZIHFwcmltZSAiJiN4MjA1NzsiPjwhRU5USVRZIE1lZGl1bVNwYWNlICImI3gyMDVGOyI%2BPCFFTlRJVFkgVGhpY2tTcGFjZSAiJiN4MjA1RjsmI3gyMDBBOyI%2BPCFFTlRJVFkgTm9CcmVhayAiJiN4MjA2MDsiPjwhRU5USVRZIEFwcGx5RnVuY3Rpb24gIiYjeDIwNjE7Ij48IUVOVElUWSBhZiAiJiN4MjA2MTsiPjwhRU5USVRZIEludmlzaWJsZVRpbWVzICImI3gyMDYyOyI%2BPCFFTlRJVFkgaXQgIiYjeDIwNjI7Ij48IUVOVElUWSBJbnZpc2libGVDb21tYSAiJiN4MjA2MzsiPjwhRU5USVRZIGljICImI3gyMDYzOyI%2BPCFFTlRJVFkgZXVybyAiJiN4MjBBQzsiPjwhRU5USVRZIHRkb3QgIiYjeDIwREI7Ij48IUVOVElUWSBUcmlwbGVEb3QgIiYjeDIwREI7Ij48IUVOVElUWSBEb3REb3QgIiYjeDIwREM7Ij48IUVOVElUWSBDb3BmICImI3gyMTAyOyI%2BPCFFTlRJVFkgY29tcGxleGVzICImI3gyMTAyOyI%2BPCFFTlRJVFkgaW5jYXJlICImI3gyMTA1OyI%2BPCFFTlRJVFkgZ3NjciAiJiN4MjEwQTsiPjwhRU5USVRZIGhhbWlsdCAiJiN4MjEwQjsiPjwhRU5USVRZIEhpbGJlcnRTcGFjZSAiJiN4MjEwQjsiPjwhRU5USVRZIEhzY3IgIiYjeDIxMEI7Ij48IUVOVElUWSBIZnIgIiYjeDIxMEM7Ij48IUVOVElUWSBQb2luY2FyZXBsYW5lICImI3gyMTBDOyI%2BPCFFTlRJVFkgcXVhdGVybmlvbnMgIiYjeDIxMEQ7Ij48IUVOVElUWSBIb3BmICImI3gyMTBEOyI%2BPCFFTlRJVFkgcGxhbmNraCAiJiN4MjEwRTsiPjwhRU5USVRZIHBsYW5jayAiJiN4MjEwRjsiPjwhRU5USVRZIGhiYXIgIiYjeDIxMEY7Ij48IUVOVElUWSBwbGFua3YgIiYjeDIxMEY7Ij48IUVOVElUWSBoc2xhc2ggIiYjeDIxMEY7Ij48IUVOVElUWSBJc2NyICImI3gyMTEwOyI%2BPCFFTlRJVFkgaW1hZ2xpbmUgIiYjeDIxMTA7Ij48IUVOVElUWSBpbWFnZSAiJiN4MjExMTsiPjwhRU5USVRZIEltICImI3gyMTExOyI%2BPCFFTlRJVFkgaW1hZ3BhcnQgIiYjeDIxMTE7Ij48IUVOVElUWSBJZnIgIiYjeDIxMTE7Ij48IUVOVElUWSBMc2NyICImI3gyMTEyOyI%2BPCFFTlRJVFkgbGFncmFuICImI3gyMTEyOyI%2BPCFFTlRJVFkgTGFwbGFjZXRyZiAiJiN4MjExMjsiPjwhRU5USVRZIGVsbCAiJiN4MjExMzsiPjwhRU5USVRZIE5vcGYgIiYjeDIxMTU7Ij48IUVOVElUWSBuYXR1cmFscyAiJiN4MjExNTsiPjwhRU5USVRZIG51bWVybyAiJiN4MjExNjsiPjwhRU5USVRZIGNvcHlzciAiJiN4MjExNzsiPjwhRU5USVRZIHdlaWVycCAiJiN4MjExODsiPjwhRU5USVRZIHdwICImI3gyMTE4OyI%2BPCFFTlRJVFkgUG9wZiAiJiN4MjExOTsiPjwhRU5USVRZIHByaW1lcyAiJiN4MjExOTsiPjwhRU5USVRZIHJhdGlvbmFscyAiJiN4MjExQTsiPjwhRU5USVRZIFFvcGYgIiYjeDIxMUE7Ij48IUVOVElUWSBSc2NyICImI3gyMTFCOyI%2BPCFFTlRJVFkgcmVhbGluZSAiJiN4MjExQjsiPjwhRU5USVRZIHJlYWwgIiYjeDIxMUM7Ij48IUVOVElUWSBSZSAiJiN4MjExQzsiPjwhRU5USVRZIHJlYWxwYXJ0ICImI3gyMTFDOyI%2BPCFFTlRJVFkgUmZyICImI3gyMTFDOyI%2BPCFFTlRJVFkgcmVhbHMgIiYjeDIxMUQ7Ij48IUVOVElUWSBSb3BmICImI3gyMTFEOyI%2BPCFFTlRJVFkgcnggIiYjeDIxMUU7Ij48IUVOVElUWSB0cmFkZSAiJiN4MjEyMjsiPjwhRU5USVRZIFRSQURFICImI3gyMTIyOyI%2BPCFFTlRJVFkgaW50ZWdlcnMgIiYjeDIxMjQ7Ij48IUVOVElUWSBab3BmICImI3gyMTI0OyI%2BPCFFTlRJVFkgbWhvICImI3gyMTI3OyI%2BPCFFTlRJVFkgWmZyICImI3gyMTI4OyI%2BPCFFTlRJVFkgemVldHJmICImI3gyMTI4OyI%2BPCFFTlRJVFkgaWlvdGEgIiYjeDIxMjk7Ij48IUVOVElUWSBiZXJub3UgIiYjeDIxMkM7Ij48IUVOVElUWSBCZXJub3VsbGlzICImI3gyMTJDOyI%2BPCFFTlRJVFkgQnNjciAiJiN4MjEyQzsiPjwhRU5USVRZIENmciAiJiN4MjEyRDsiPjwhRU5USVRZIENheWxleXMgIiYjeDIxMkQ7Ij48IUVOVElUWSBlc2NyICImI3gyMTJGOyI%2BPCFFTlRJVFkgRXNjciAiJiN4MjEzMDsiPjwhRU5USVRZIGV4cGVjdGF0aW9uICImI3gyMTMwOyI%2BPCFFTlRJVFkgRnNjciAiJiN4MjEzMTsiPjwhRU5USVRZIEZvdXJpZXJ0cmYgIiYjeDIxMzE7Ij48IUVOVElUWSBwaG1tYXQgIiYjeDIxMzM7Ij48IUVOVElUWSBNZWxsaW50cmYgIiYjeDIxMzM7Ij48IUVOVElUWSBNc2NyICImI3gyMTMzOyI%2BPCFFTlRJVFkgb3JkZXIgIiYjeDIxMzQ7Ij48IUVOVElUWSBvcmRlcm9mICImI3gyMTM0OyI%2BPCFFTlRJVFkgb3NjciAiJiN4MjEzNDsiPjwhRU5USVRZIGFsZWZzeW0gIiYjeDIxMzU7Ij48IUVOVElUWSBhbGVwaCAiJiN4MjEzNTsiPjwhRU5USVRZIGJldGggIiYjeDIxMzY7Ij48IUVOVElUWSBnaW1lbCAiJiN4MjEzNzsiPjwhRU5USVRZIGRhbGV0aCAiJiN4MjEzODsiPjwhRU5USVRZIENhcGl0YWxEaWZmZXJlbnRpYWxEICImI3gyMTQ1OyI%2BPCFFTlRJVFkgREQgIiYjeDIxNDU7Ij48IUVOVElUWSBEaWZmZXJlbnRpYWxEICImI3gyMTQ2OyI%2BPCFFTlRJVFkgZGQgIiYjeDIxNDY7Ij48IUVOVElUWSBFeHBvbmVudGlhbEUgIiYjeDIxNDc7Ij48IUVOVElUWSBleHBvbmVudGlhbGUgIiYjeDIxNDc7Ij48IUVOVElUWSBlZSAiJiN4MjE0NzsiPjwhRU5USVRZIEltYWdpbmFyeUkgIiYjeDIxNDg7Ij48IUVOVElUWSBpaSAiJiN4MjE0ODsiPjwhRU5USVRZIGZyYWMxMyAiJiN4MjE1MzsiPjwhRU5USVRZIGZyYWMyMyAiJiN4MjE1NDsiPjwhRU5USVRZIGZyYWMxNSAiJiN4MjE1NTsiPjwhRU5USVRZIGZyYWMyNSAiJiN4MjE1NjsiPjwhRU5USVRZIGZyYWMzNSAiJiN4MjE1NzsiPjwhRU5USVRZIGZyYWM0NSAiJiN4MjE1ODsiPjwhRU5USVRZIGZyYWMxNiAiJiN4MjE1OTsiPjwhRU5USVRZIGZyYWM1NiAiJiN4MjE1QTsiPjwhRU5USVRZIGZyYWMxOCAiJiN4MjE1QjsiPjwhRU5USVRZIGZyYWMzOCAiJiN4MjE1QzsiPjwhRU5USVRZIGZyYWM1OCAiJiN4MjE1RDsiPjwhRU5USVRZIGZyYWM3OCAiJiN4MjE1RTsiPjwhRU5USVRZIGxhcnIgIiYjeDIxOTA7Ij48IUVOVElUWSBsZWZ0YXJyb3cgIiYjeDIxOTA7Ij48IUVOVElUWSBMZWZ0QXJyb3cgIiYjeDIxOTA7Ij48IUVOVElUWSBzbGFyciAiJiN4MjE5MDsiPjwhRU5USVRZIFNob3J0TGVmdEFycm93ICImI3gyMTkwOyI%2BPCFFTlRJVFkgdWFyciAiJiN4MjE5MTsiPjwhRU5USVRZIHVwYXJyb3cgIiYjeDIxOTE7Ij48IUVOVElUWSBVcEFycm93ICImI3gyMTkxOyI%2BPCFFTlRJVFkgU2hvcnRVcEFycm93ICImI3gyMTkxOyI%2BPCFFTlRJVFkgcmFyciAiJiN4MjE5MjsiPjwhRU5USVRZIHJpZ2h0YXJyb3cgIiYjeDIxOTI7Ij48IUVOVElUWSBSaWdodEFycm93ICImI3gyMTkyOyI%2BPCFFTlRJVFkgc3JhcnIgIiYjeDIxOTI7Ij48IUVOVElUWSBTaG9ydFJpZ2h0QXJyb3cgIiYjeDIxOTI7Ij48IUVOVElUWSBkYXJyICImI3gyMTkzOyI%2BPCFFTlRJVFkgZG93bmFycm93ICImI3gyMTkzOyI%2BPCFFTlRJVFkgRG93bkFycm93ICImI3gyMTkzOyI%2BPCFFTlRJVFkgU2hvcnREb3duQXJyb3cgIiYjeDIxOTM7Ij48IUVOVElUWSBoYXJyICImI3gyMTk0OyI%2BPCFFTlRJVFkgbGVmdHJpZ2h0YXJyb3cgIiYjeDIxOTQ7Ij48IUVOVElUWSBMZWZ0UmlnaHRBcnJvdyAiJiN4MjE5NDsiPjwhRU5USVRZIHZhcnIgIiYjeDIxOTU7Ij48IUVOVElUWSB1cGRvd25hcnJvdyAiJiN4MjE5NTsiPjwhRU5USVRZIFVwRG93bkFycm93ICImI3gyMTk1OyI%2BPCFFTlRJVFkgbndhcnIgIiYjeDIxOTY7Ij48IUVOVElUWSBVcHBlckxlZnRBcnJvdyAiJiN4MjE5NjsiPjwhRU5USVRZIG53YXJyb3cgIiYjeDIxOTY7Ij48IUVOVElUWSBuZWFyciAiJiN4MjE5NzsiPjwhRU5USVRZIFVwcGVyUmlnaHRBcnJvdyAiJiN4MjE5NzsiPjwhRU5USVRZIG5lYXJyb3cgIiYjeDIxOTc7Ij48IUVOVElUWSBzZWFyciAiJiN4MjE5ODsiPjwhRU5USVRZIHNlYXJyb3cgIiYjeDIxOTg7Ij48IUVOVElUWSBMb3dlclJpZ2h0QXJyb3cgIiYjeDIxOTg7Ij48IUVOVElUWSBzd2FyciAiJiN4MjE5OTsiPjwhRU5USVRZIHN3YXJyb3cgIiYjeDIxOTk7Ij48IUVOVElUWSBMb3dlckxlZnRBcnJvdyAiJiN4MjE5OTsiPjwhRU5USVRZIG5sYXJyICImI3gyMTlBOyI%2BPCFFTlRJVFkgbmxlZnRhcnJvdyAiJiN4MjE5QTsiPjwhRU5USVRZIG5yYXJyICImI3gyMTlCOyI%2BPCFFTlRJVFkgbnJpZ2h0YXJyb3cgIiYjeDIxOUI7Ij48IUVOVElUWSByYXJydyAiJiN4MjE5RDsiPjwhRU5USVRZIHJpZ2h0c3F1aWdhcnJvdyAiJiN4MjE5RDsiPjwhRU5USVRZIG5yYXJydyAiJiN4MjE5RDsmI3gzMzg7Ij48IUVOVElUWSBMYXJyICImI3gyMTlFOyI%2BPCFFTlRJVFkgdHdvaGVhZGxlZnRhcnJvdyAiJiN4MjE5RTsiPjwhRU5USVRZIFVhcnIgIiYjeDIxOUY7Ij48IUVOVElUWSBSYXJyICImI3gyMUEwOyI%2BPCFFTlRJVFkgdHdvaGVhZHJpZ2h0YXJyb3cgIiYjeDIxQTA7Ij48IUVOVElUWSBEYXJyICImI3gyMUExOyI%2BPCFFTlRJVFkgbGFycnRsICImI3gyMUEyOyI%2BPCFFTlRJVFkgbGVmdGFycm93dGFpbCAiJiN4MjFBMjsiPjwhRU5USVRZIHJhcnJ0bCAiJiN4MjFBMzsiPjwhRU5USVRZIHJpZ2h0YXJyb3d0YWlsICImI3gyMUEzOyI%2BPCFFTlRJVFkgTGVmdFRlZUFycm93ICImI3gyMUE0OyI%2BPCFFTlRJVFkgbWFwc3RvbGVmdCAiJiN4MjFBNDsiPjwhRU5USVRZIFVwVGVlQXJyb3cgIiYjeDIxQTU7Ij48IUVOVElUWSBtYXBzdG91cCAiJiN4MjFBNTsiPjwhRU5USVRZIG1hcCAiJiN4MjFBNjsiPjwhRU5USVRZIFJpZ2h0VGVlQXJyb3cgIiYjeDIxQTY7Ij48IUVOVElUWSBtYXBzdG8gIiYjeDIxQTY7Ij48IUVOVElUWSBEb3duVGVlQXJyb3cgIiYjeDIxQTc7Ij48IUVOVElUWSBtYXBzdG9kb3duICImI3gyMUE3OyI%2BPCFFTlRJVFkgbGFycmhrICImI3gyMUE5OyI%2BPCFFTlRJVFkgaG9va2xlZnRhcnJvdyAiJiN4MjFBOTsiPjwhRU5USVRZIHJhcnJoayAiJiN4MjFBQTsiPjwhRU5USVRZIGhvb2tyaWdodGFycm93ICImI3gyMUFBOyI%2BPCFFTlRJVFkgbGFycmxwICImI3gyMUFCOyI%2BPCFFTlRJVFkgbG9vcGFycm93bGVmdCAiJiN4MjFBQjsiPjwhRU5USVRZIHJhcnJscCAiJiN4MjFBQzsiPjwhRU5USVRZIGxvb3BhcnJvd3JpZ2h0ICImI3gyMUFDOyI%2BPCFFTlRJVFkgaGFycncgIiYjeDIxQUQ7Ij48IUVOVElUWSBsZWZ0cmlnaHRzcXVpZ2Fycm93ICImI3gyMUFEOyI%2BPCFFTlRJVFkgbmhhcnIgIiYjeDIxQUU7Ij48IUVOVElUWSBubGVmdHJpZ2h0YXJyb3cgIiYjeDIxQUU7Ij48IUVOVElUWSBsc2ggIiYjeDIxQjA7Ij48IUVOVElUWSBMc2ggIiYjeDIxQjA7Ij48IUVOVElUWSByc2ggIiYjeDIxQjE7Ij48IUVOVElUWSBSc2ggIiYjeDIxQjE7Ij48IUVOVElUWSBsZHNoICImI3gyMUIyOyI%2BPCFFTlRJVFkgcmRzaCAiJiN4MjFCMzsiPjwhRU5USVRZIGNyYXJyICImI3gyMUI1OyI%2BPCFFTlRJVFkgY3VsYXJyICImI3gyMUI2OyI%2BPCFFTlRJVFkgY3VydmVhcnJvd2xlZnQgIiYjeDIxQjY7Ij48IUVOVElUWSBjdXJhcnIgIiYjeDIxQjc7Ij48IUVOVElUWSBjdXJ2ZWFycm93cmlnaHQgIiYjeDIxQjc7Ij48IUVOVElUWSBvbGFyciAiJiN4MjFCQTsiPjwhRU5USVRZIGNpcmNsZWFycm93bGVmdCAiJiN4MjFCQTsiPjwhRU5USVRZIG9yYXJyICImI3gyMUJCOyI%2BPCFFTlRJVFkgY2lyY2xlYXJyb3dyaWdodCAiJiN4MjFCQjsiPjwhRU5USVRZIGxoYXJ1ICImI3gyMUJDOyI%2BPCFFTlRJVFkgTGVmdFZlY3RvciAiJiN4MjFCQzsiPjwhRU5USVRZIGxlZnRoYXJwb29udXAgIiYjeDIxQkM7Ij48IUVOVElUWSBsaGFyZCAiJiN4MjFCRDsiPjwhRU5USVRZIGxlZnRoYXJwb29uZG93biAiJiN4MjFCRDsiPjwhRU5USVRZIERvd25MZWZ0VmVjdG9yICImI3gyMUJEOyI%2BPCFFTlRJVFkgdWhhcnIgIiYjeDIxQkU7Ij48IUVOVElUWSB1cGhhcnBvb25yaWdodCAiJiN4MjFCRTsiPjwhRU5USVRZIFJpZ2h0VXBWZWN0b3IgIiYjeDIxQkU7Ij48IUVOVElUWSB1aGFybCAiJiN4MjFCRjsiPjwhRU5USVRZIHVwaGFycG9vbmxlZnQgIiYjeDIxQkY7Ij48IUVOVElUWSBMZWZ0VXBWZWN0b3IgIiYjeDIxQkY7Ij48IUVOVElUWSByaGFydSAiJiN4MjFDMDsiPjwhRU5USVRZIFJpZ2h0VmVjdG9yICImI3gyMUMwOyI%2BPCFFTlRJVFkgcmlnaHRoYXJwb29udXAgIiYjeDIxQzA7Ij48IUVOVElUWSByaGFyZCAiJiN4MjFDMTsiPjwhRU5USVRZIHJpZ2h0aGFycG9vbmRvd24gIiYjeDIxQzE7Ij48IUVOVElUWSBEb3duUmlnaHRWZWN0b3IgIiYjeDIxQzE7Ij48IUVOVElUWSBkaGFyciAiJiN4MjFDMjsiPjwhRU5USVRZIFJpZ2h0RG93blZlY3RvciAiJiN4MjFDMjsiPjwhRU5USVRZIGRvd25oYXJwb29ucmlnaHQgIiYjeDIxQzI7Ij48IUVOVElUWSBkaGFybCAiJiN4MjFDMzsiPjwhRU5USVRZIExlZnREb3duVmVjdG9yICImI3gyMUMzOyI%2BPCFFTlRJVFkgZG93bmhhcnBvb25sZWZ0ICImI3gyMUMzOyI%2BPCFFTlRJVFkgcmxhcnIgIiYjeDIxQzQ7Ij48IUVOVElUWSByaWdodGxlZnRhcnJvd3MgIiYjeDIxQzQ7Ij48IUVOVElUWSBSaWdodEFycm93TGVmdEFycm93ICImI3gyMUM0OyI%2BPCFFTlRJVFkgdWRhcnIgIiYjeDIxQzU7Ij48IUVOVElUWSBVcEFycm93RG93bkFycm93ICImI3gyMUM1OyI%2BPCFFTlRJVFkgbHJhcnIgIiYjeDIxQzY7Ij48IUVOVElUWSBsZWZ0cmlnaHRhcnJvd3MgIiYjeDIxQzY7Ij48IUVOVElUWSBMZWZ0QXJyb3dSaWdodEFycm93ICImI3gyMUM2OyI%2BPCFFTlRJVFkgbGxhcnIgIiYjeDIxQzc7Ij48IUVOVElUWSBsZWZ0bGVmdGFycm93cyAiJiN4MjFDNzsiPjwhRU5USVRZIHV1YXJyICImI3gyMUM4OyI%2BPCFFTlRJVFkgdXB1cGFycm93cyAiJiN4MjFDODsiPjwhRU5USVRZIHJyYXJyICImI3gyMUM5OyI%2BPCFFTlRJVFkgcmlnaHRyaWdodGFycm93cyAiJiN4MjFDOTsiPjwhRU5USVRZIGRkYXJyICImI3gyMUNBOyI%2BPCFFTlRJVFkgZG93bmRvd25hcnJvd3MgIiYjeDIxQ0E7Ij48IUVOVElUWSBscmhhciAiJiN4MjFDQjsiPjwhRU5USVRZIFJldmVyc2VFcXVpbGlicml1bSAiJiN4MjFDQjsiPjwhRU5USVRZIGxlZnRyaWdodGhhcnBvb25zICImI3gyMUNCOyI%2BPCFFTlRJVFkgcmxoYXIgIiYjeDIxQ0M7Ij48IUVOVElUWSByaWdodGxlZnRoYXJwb29ucyAiJiN4MjFDQzsiPjwhRU5USVRZIEVxdWlsaWJyaXVtICImI3gyMUNDOyI%2BPCFFTlRJVFkgbmxBcnIgIiYjeDIxQ0Q7Ij48IUVOVElUWSBuTGVmdGFycm93ICImI3gyMUNEOyI%2BPCFFTlRJVFkgbmhBcnIgIiYjeDIxQ0U7Ij48IUVOVElUWSBuTGVmdHJpZ2h0YXJyb3cgIiYjeDIxQ0U7Ij48IUVOVElUWSBuckFyciAiJiN4MjFDRjsiPjwhRU5USVRZIG5SaWdodGFycm93ICImI3gyMUNGOyI%2BPCFFTlRJVFkgbEFyciAiJiN4MjFEMDsiPjwhRU5USVRZIExlZnRhcnJvdyAiJiN4MjFEMDsiPjwhRU5USVRZIERvdWJsZUxlZnRBcnJvdyAiJiN4MjFEMDsiPjwhRU5USVRZIHVBcnIgIiYjeDIxRDE7Ij48IUVOVElUWSBVcGFycm93ICImI3gyMUQxOyI%2BPCFFTlRJVFkgRG91YmxlVXBBcnJvdyAiJiN4MjFEMTsiPjwhRU5USVRZIHJBcnIgIiYjeDIxRDI7Ij48IUVOVElUWSBSaWdodGFycm93ICImI3gyMUQyOyI%2BPCFFTlRJVFkgSW1wbGllcyAiJiN4MjFEMjsiPjwhRU5USVRZIERvdWJsZVJpZ2h0QXJyb3cgIiYjeDIxRDI7Ij48IUVOVElUWSBkQXJyICImI3gyMUQzOyI%2BPCFFTlRJVFkgRG93bmFycm93ICImI3gyMUQzOyI%2BPCFFTlRJVFkgRG91YmxlRG93bkFycm93ICImI3gyMUQzOyI%2BPCFFTlRJVFkgaEFyciAiJiN4MjFENDsiPjwhRU5USVRZIExlZnRyaWdodGFycm93ICImI3gyMUQ0OyI%2BPCFFTlRJVFkgRG91YmxlTGVmdFJpZ2h0QXJyb3cgIiYjeDIxRDQ7Ij48IUVOVElUWSBpZmYgIiYjeDIxRDQ7Ij48IUVOVElUWSB2QXJyICImI3gyMUQ1OyI%2BPCFFTlRJVFkgVXBkb3duYXJyb3cgIiYjeDIxRDU7Ij48IUVOVElUWSBEb3VibGVVcERvd25BcnJvdyAiJiN4MjFENTsiPjwhRU5USVRZIG53QXJyICImI3gyMUQ2OyI%2BPCFFTlRJVFkgbmVBcnIgIiYjeDIxRDc7Ij48IUVOVElUWSBzZUFyciAiJiN4MjFEODsiPjwhRU5USVRZIHN3QXJyICImI3gyMUQ5OyI%2BPCFFTlRJVFkgbEFhcnIgIiYjeDIxREE7Ij48IUVOVElUWSBMbGVmdGFycm93ICImI3gyMURBOyI%2BPCFFTlRJVFkgckFhcnIgIiYjeDIxREI7Ij48IUVOVElUWSBScmlnaHRhcnJvdyAiJiN4MjFEQjsiPjwhRU5USVRZIHppZ3JhcnIgIiYjeDIxREQ7Ij48IUVOVElUWSBsYXJyYiAiJiN4MjFFNDsiPjwhRU5USVRZIExlZnRBcnJvd0JhciAiJiN4MjFFNDsiPjwhRU5USVRZIHJhcnJiICImI3gyMUU1OyI%2BPCFFTlRJVFkgUmlnaHRBcnJvd0JhciAiJiN4MjFFNTsiPjwhRU5USVRZIGR1YXJyICImI3gyMUY1OyI%2BPCFFTlRJVFkgRG93bkFycm93VXBBcnJvdyAiJiN4MjFGNTsiPjwhRU5USVRZIGxvYXJyICImI3gyMUZEOyI%2BPCFFTlRJVFkgcm9hcnIgIiYjeDIxRkU7Ij48IUVOVElUWSBob2FyciAiJiN4MjFGRjsiPjwhRU5USVRZIGZvcmFsbCAiJiN4MjIwMDsiPjwhRU5USVRZIEZvckFsbCAiJiN4MjIwMDsiPjwhRU5USVRZIGNvbXAgIiYjeDIyMDE7Ij48IUVOVElUWSBjb21wbGVtZW50ICImI3gyMjAxOyI%2BPCFFTlRJVFkgcGFydCAiJiN4MjIwMjsiPjwhRU5USVRZIFBhcnRpYWxEICImI3gyMjAyOyI%2BPCFFTlRJVFkgbnBhcnQgIiYjeDIyMDI7JiN4MzM4OyI%2BPCFFTlRJVFkgZXhpc3QgIiYjeDIyMDM7Ij48IUVOVElUWSBFeGlzdHMgIiYjeDIyMDM7Ij48IUVOVElUWSBuZXhpc3QgIiYjeDIyMDQ7Ij48IUVOVElUWSBOb3RFeGlzdHMgIiYjeDIyMDQ7Ij48IUVOVElUWSBuZXhpc3RzICImI3gyMjA0OyI%2BPCFFTlRJVFkgZW1wdHkgIiYjeDIyMDU7Ij48IUVOVElUWSBlbXB0eXNldCAiJiN4MjIwNTsiPjwhRU5USVRZIGVtcHR5diAiJiN4MjIwNTsiPjwhRU5USVRZIHZhcm5vdGhpbmcgIiYjeDIyMDU7Ij48IUVOVElUWSBuYWJsYSAiJiN4MjIwNzsiPjwhRU5USVRZIERlbCAiJiN4MjIwNzsiPjwhRU5USVRZIGlzaW4gIiYjeDIyMDg7Ij48IUVOVElUWSBpc2ludiAiJiN4MjIwODsiPjwhRU5USVRZIEVsZW1lbnQgIiYjeDIyMDg7Ij48IUVOVElUWSBpbiAiJiN4MjIwODsiPjwhRU5USVRZIG5vdGluICImI3gyMjA5OyI%2BPCFFTlRJVFkgTm90RWxlbWVudCAiJiN4MjIwOTsiPjwhRU5USVRZIG5vdGludmEgIiYjeDIyMDk7Ij48IUVOVElUWSBuaXYgIiYjeDIyMEI7Ij48IUVOVElUWSBSZXZlcnNlRWxlbWVudCAiJiN4MjIwQjsiPjwhRU5USVRZIG5pICImI3gyMjBCOyI%2BPCFFTlRJVFkgU3VjaFRoYXQgIiYjeDIyMEI7Ij48IUVOVElUWSBub3RuaSAiJiN4MjIwQzsiPjwhRU5USVRZIG5vdG5pdmEgIiYjeDIyMEM7Ij48IUVOVElUWSBOb3RSZXZlcnNlRWxlbWVudCAiJiN4MjIwQzsiPjwhRU5USVRZIHByb2QgIiYjeDIyMEY7Ij48IUVOVElUWSBQcm9kdWN0ICImI3gyMjBGOyI%2BPCFFTlRJVFkgY29wcm9kICImI3gyMjEwOyI%2BPCFFTlRJVFkgQ29wcm9kdWN0ICImI3gyMjEwOyI%2BPCFFTlRJVFkgc3VtICImI3gyMjExOyI%2BPCFFTlRJVFkgU3VtICImI3gyMjExOyI%2BPCFFTlRJVFkgbWludXMgIiYjeDIyMTI7Ij48IUVOVElUWSBtbnBsdXMgIiYjeDIyMTM7Ij48IUVOVElUWSBtcCAiJiN4MjIxMzsiPjwhRU5USVRZIE1pbnVzUGx1cyAiJiN4MjIxMzsiPjwhRU5USVRZIHBsdXNkbyAiJiN4MjIxNDsiPjwhRU5USVRZIGRvdHBsdXMgIiYjeDIyMTQ7Ij48IUVOVElUWSBzZXRtbiAiJiN4MjIxNjsiPjwhRU5USVRZIHNldG1pbnVzICImI3gyMjE2OyI%2BPCFFTlRJVFkgQmFja3NsYXNoICImI3gyMjE2OyI%2BPCFFTlRJVFkgc3NldG1uICImI3gyMjE2OyI%2BPCFFTlRJVFkgc21hbGxzZXRtaW51cyAiJiN4MjIxNjsiPjwhRU5USVRZIGxvd2FzdCAiJiN4MjIxNzsiPjwhRU5USVRZIGNvbXBmbiAiJiN4MjIxODsiPjwhRU5USVRZIFNtYWxsQ2lyY2xlICImI3gyMjE4OyI%2BPCFFTlRJVFkgcmFkaWMgIiYjeDIyMUE7Ij48IUVOVElUWSBTcXJ0ICImI3gyMjFBOyI%2BPCFFTlRJVFkgcHJvcCAiJiN4MjIxRDsiPjwhRU5USVRZIHByb3B0byAiJiN4MjIxRDsiPjwhRU5USVRZIFByb3BvcnRpb25hbCAiJiN4MjIxRDsiPjwhRU5USVRZIHZwcm9wICImI3gyMjFEOyI%2BPCFFTlRJVFkgdmFycHJvcHRvICImI3gyMjFEOyI%2BPCFFTlRJVFkgaW5maW4gIiYjeDIyMUU7Ij48IUVOVElUWSBhbmdydCAiJiN4MjIxRjsiPjwhRU5USVRZIGFuZyAiJiN4MjIyMDsiPjwhRU5USVRZIGFuZ2xlICImI3gyMjIwOyI%2BPCFFTlRJVFkgbmFuZyAiJiN4MjIyMDsmI3gyMEQyOyI%2BPCFFTlRJVFkgYW5nbXNkICImI3gyMjIxOyI%2BPCFFTlRJVFkgbWVhc3VyZWRhbmdsZSAiJiN4MjIyMTsiPjwhRU5USVRZIGFuZ3NwaCAiJiN4MjIyMjsiPjwhRU5USVRZIG1pZCAiJiN4MjIyMzsiPjwhRU5USVRZIFZlcnRpY2FsQmFyICImI3gyMjIzOyI%2BPCFFTlRJVFkgc21pZCAiJiN4MjIyMzsiPjwhRU5USVRZIHNob3J0bWlkICImI3gyMjIzOyI%2BPCFFTlRJVFkgbm1pZCAiJiN4MjIyNDsiPjwhRU5USVRZIE5vdFZlcnRpY2FsQmFyICImI3gyMjI0OyI%2BPCFFTlRJVFkgbnNtaWQgIiYjeDIyMjQ7Ij48IUVOVElUWSBuc2hvcnRtaWQgIiYjeDIyMjQ7Ij48IUVOVElUWSBwYXIgIiYjeDIyMjU7Ij48IUVOVElUWSBwYXJhbGxlbCAiJiN4MjIyNTsiPjwhRU5USVRZIERvdWJsZVZlcnRpY2FsQmFyICImI3gyMjI1OyI%2BPCFFTlRJVFkgc3BhciAiJiN4MjIyNTsiPjwhRU5USVRZIHNob3J0cGFyYWxsZWwgIiYjeDIyMjU7Ij48IUVOVElUWSBucGFyICImI3gyMjI2OyI%2BPCFFTlRJVFkgbnBhcmFsbGVsICImI3gyMjI2OyI%2BPCFFTlRJVFkgTm90RG91YmxlVmVydGljYWxCYXIgIiYjeDIyMjY7Ij48IUVOVElUWSBuc3BhciAiJiN4MjIyNjsiPjwhRU5USVRZIG5zaG9ydHBhcmFsbGVsICImI3gyMjI2OyI%2BPCFFTlRJVFkgYW5kICImI3gyMjI3OyI%2BPCFFTlRJVFkgd2VkZ2UgIiYjeDIyMjc7Ij48IUVOVElUWSBvciAiJiN4MjIyODsiPjwhRU5USVRZIHZlZSAiJiN4MjIyODsiPjwhRU5USVRZIGNhcCAiJiN4MjIyOTsiPjwhRU5USVRZIGNhcHMgIiYjeDIyMjk7JiN4RkUwMDsiPjwhRU5USVRZIGN1cCAiJiN4MjIyQTsiPjwhRU5USVRZIGN1cHMgIiYjeDIyMkE7JiN4RkUwMDsiPjwhRU5USVRZIGludCAiJiN4MjIyQjsiPjwhRU5USVRZIEludGVncmFsICImI3gyMjJCOyI%2BPCFFTlRJVFkgSW50ICImI3gyMjJDOyI%2BPCFFTlRJVFkgdGludCAiJiN4MjIyRDsiPjwhRU5USVRZIGlpaW50ICImI3gyMjJEOyI%2BPCFFTlRJVFkgY29uaW50ICImI3gyMjJFOyI%2BPCFFTlRJVFkgb2ludCAiJiN4MjIyRTsiPjwhRU5USVRZIENvbnRvdXJJbnRlZ3JhbCAiJiN4MjIyRTsiPjwhRU5USVRZIENvbmludCAiJiN4MjIyRjsiPjwhRU5USVRZIERvdWJsZUNvbnRvdXJJbnRlZ3JhbCAiJiN4MjIyRjsiPjwhRU5USVRZIENjb25pbnQgIiYjeDIyMzA7Ij48IUVOVElUWSBjd2ludCAiJiN4MjIzMTsiPjwhRU5USVRZIGN3Y29uaW50ICImI3gyMjMyOyI%2BPCFFTlRJVFkgQ2xvY2t3aXNlQ29udG91ckludGVncmFsICImI3gyMjMyOyI%2BPCFFTlRJVFkgYXdjb25pbnQgIiYjeDIyMzM7Ij48IUVOVElUWSBDb3VudGVyQ2xvY2t3aXNlQ29udG91ckludGVncmFsICImI3gyMjMzOyI%2BPCFFTlRJVFkgdGhlcmU0ICImI3gyMjM0OyI%2BPCFFTlRJVFkgdGhlcmVmb3JlICImI3gyMjM0OyI%2BPCFFTlRJVFkgVGhlcmVmb3JlICImI3gyMjM0OyI%2BPCFFTlRJVFkgYmVjYXVzICImI3gyMjM1OyI%2BPCFFTlRJVFkgYmVjYXVzZSAiJiN4MjIzNTsiPjwhRU5USVRZIEJlY2F1c2UgIiYjeDIyMzU7Ij48IUVOVElUWSByYXRpbyAiJiN4MjIzNjsiPjwhRU5USVRZIENvbG9uICImI3gyMjM3OyI%2BPCFFTlRJVFkgUHJvcG9ydGlvbiAiJiN4MjIzNzsiPjwhRU5USVRZIG1pbnVzZCAiJiN4MjIzODsiPjwhRU5USVRZIGRvdG1pbnVzICImI3gyMjM4OyI%2BPCFFTlRJVFkgbUREb3QgIiYjeDIyM0E7Ij48IUVOVElUWSBob210aHQgIiYjeDIyM0I7Ij48IUVOVElUWSBzaW0gIiYjeDIyM0M7Ij48IUVOVElUWSBUaWxkZSAiJiN4MjIzQzsiPjwhRU5USVRZIHRoa3NpbSAiJiN4MjIzQzsiPjwhRU5USVRZIHRoaWNrc2ltICImI3gyMjNDOyI%2BPCFFTlRJVFkgbnZzaW0gIiYjeDIyM0M7JiN4MjBEMjsiPjwhRU5USVRZIGJzaW0gIiYjeDIyM0Q7Ij48IUVOVElUWSBiYWNrc2ltICImI3gyMjNEOyI%2BPCFFTlRJVFkgcmFjZSAiJiN4MjIzRDsmI3gzMzE7Ij48IUVOVElUWSBhYyAiJiN4MjIzRTsiPjwhRU5USVRZIG1zdHBvcyAiJiN4MjIzRTsiPjwhRU5USVRZIGFjRSAiJiN4MjIzRTsmI3gzMzM7Ij48IUVOVElUWSBhY2QgIiYjeDIyM0Y7Ij48IUVOVElUWSB3cmVhdGggIiYjeDIyNDA7Ij48IUVOVElUWSBWZXJ0aWNhbFRpbGRlICImI3gyMjQwOyI%2BPCFFTlRJVFkgd3IgIiYjeDIyNDA7Ij48IUVOVElUWSBuc2ltICImI3gyMjQxOyI%2BPCFFTlRJVFkgTm90VGlsZGUgIiYjeDIyNDE7Ij48IUVOVElUWSBlc2ltICImI3gyMjQyOyI%2BPCFFTlRJVFkgRXF1YWxUaWxkZSAiJiN4MjI0MjsiPjwhRU5USVRZIGVxc2ltICImI3gyMjQyOyI%2BPCFFTlRJVFkgTm90RXF1YWxUaWxkZSAiJiN4MjI0MjsmI3gzMzg7Ij48IUVOVElUWSBuZXNpbSAiJiN4MjI0MjsmI3gzMzg7Ij48IUVOVElUWSBzaW1lICImI3gyMjQzOyI%2BPCFFTlRJVFkgVGlsZGVFcXVhbCAiJiN4MjI0MzsiPjwhRU5USVRZIHNpbWVxICImI3gyMjQzOyI%2BPCFFTlRJVFkgbnNpbWUgIiYjeDIyNDQ7Ij48IUVOVElUWSBuc2ltZXEgIiYjeDIyNDQ7Ij48IUVOVElUWSBOb3RUaWxkZUVxdWFsICImI3gyMjQ0OyI%2BPCFFTlRJVFkgY29uZyAiJiN4MjI0NTsiPjwhRU5USVRZIFRpbGRlRnVsbEVxdWFsICImI3gyMjQ1OyI%2BPCFFTlRJVFkgc2ltbmUgIiYjeDIyNDY7Ij48IUVOVElUWSBuY29uZyAiJiN4MjI0NzsiPjwhRU5USVRZIE5vdFRpbGRlRnVsbEVxdWFsICImI3gyMjQ3OyI%2BPCFFTlRJVFkgYXN5bXAgIiYjeDIyNDg7Ij48IUVOVElUWSBhcCAiJiN4MjI0ODsiPjwhRU5USVRZIFRpbGRlVGlsZGUgIiYjeDIyNDg7Ij48IUVOVElUWSBhcHByb3ggIiYjeDIyNDg7Ij48IUVOVElUWSB0aGthcCAiJiN4MjI0ODsiPjwhRU5USVRZIHRoaWNrYXBwcm94ICImI3gyMjQ4OyI%2BPCFFTlRJVFkgbmFwICImI3gyMjQ5OyI%2BPCFFTlRJVFkgTm90VGlsZGVUaWxkZSAiJiN4MjI0OTsiPjwhRU5USVRZIG5hcHByb3ggIiYjeDIyNDk7Ij48IUVOVElUWSBhcGUgIiYjeDIyNEE7Ij48IUVOVElUWSBhcHByb3hlcSAiJiN4MjI0QTsiPjwhRU5USVRZIGFwaWQgIiYjeDIyNEI7Ij48IUVOVElUWSBuYXBpZCAiJiN4MjI0QjsmI3gzMzg7Ij48IUVOVElUWSBiY29uZyAiJiN4MjI0QzsiPjwhRU5USVRZIGJhY2tjb25nICImI3gyMjRDOyI%2BPCFFTlRJVFkgYXN5bXBlcSAiJiN4MjI0RDsiPjwhRU5USVRZIEN1cENhcCAiJiN4MjI0RDsiPjwhRU5USVRZIG52YXAgIiYjeDIyNEQ7JiN4MjBEMjsiPjwhRU5USVRZIGJ1bXAgIiYjeDIyNEU7Ij48IUVOVElUWSBIdW1wRG93bkh1bXAgIiYjeDIyNEU7Ij48IUVOVElUWSBCdW1wZXEgIiYjeDIyNEU7Ij48IUVOVElUWSBOb3RIdW1wRG93bkh1bXAgIiYjeDIyNEU7JiN4MzM4OyI%2BPCFFTlRJVFkgbmJ1bXAgIiYjeDIyNEU7JiN4MzM4OyI%2BPCFFTlRJVFkgYnVtcGUgIiYjeDIyNEY7Ij48IUVOVElUWSBIdW1wRXF1YWwgIiYjeDIyNEY7Ij48IUVOVElUWSBidW1wZXEgIiYjeDIyNEY7Ij48IUVOVElUWSBuYnVtcGUgIiYjeDIyNEY7JiN4MzM4OyI%2BPCFFTlRJVFkgTm90SHVtcEVxdWFsICImI3gyMjRGOyYjeDMzODsiPjwhRU5USVRZIGVzZG90ICImI3gyMjUwOyI%2BPCFFTlRJVFkgRG90RXF1YWwgIiYjeDIyNTA7Ij48IUVOVElUWSBkb3RlcSAiJiN4MjI1MDsiPjwhRU5USVRZIG5lZG90ICImI3gyMjUwOyYjeDMzODsiPjwhRU5USVRZIGVEb3QgIiYjeDIyNTE7Ij48IUVOVElUWSBkb3RlcWRvdCAiJiN4MjI1MTsiPjwhRU5USVRZIGVmRG90ICImI3gyMjUyOyI%2BPCFFTlRJVFkgZmFsbGluZ2RvdHNlcSAiJiN4MjI1MjsiPjwhRU5USVRZIGVyRG90ICImI3gyMjUzOyI%2BPCFFTlRJVFkgcmlzaW5nZG90c2VxICImI3gyMjUzOyI%2BPCFFTlRJVFkgY29sb25lICImI3gyMjU0OyI%2BPCFFTlRJVFkgY29sb25lcSAiJiN4MjI1NDsiPjwhRU5USVRZIEFzc2lnbiAiJiN4MjI1NDsiPjwhRU5USVRZIGVjb2xvbiAiJiN4MjI1NTsiPjwhRU5USVRZIGVxY29sb24gIiYjeDIyNTU7Ij48IUVOVElUWSBlY2lyICImI3gyMjU2OyI%2BPCFFTlRJVFkgZXFjaXJjICImI3gyMjU2OyI%2BPCFFTlRJVFkgY2lyZSAiJiN4MjI1NzsiPjwhRU5USVRZIGNpcmNlcSAiJiN4MjI1NzsiPjwhRU5USVRZIHdlZGdlcSAiJiN4MjI1OTsiPjwhRU5USVRZIHZlZWVxICImI3gyMjVBOyI%2BPCFFTlRJVFkgdHJpZSAiJiN4MjI1QzsiPjwhRU5USVRZIHRyaWFuZ2xlcSAiJiN4MjI1QzsiPjwhRU5USVRZIGVxdWVzdCAiJiN4MjI1RjsiPjwhRU5USVRZIHF1ZXN0ZXEgIiYjeDIyNUY7Ij48IUVOVElUWSBuZSAiJiN4MjI2MDsiPjwhRU5USVRZIE5vdEVxdWFsICImI3gyMjYwOyI%2BPCFFTlRJVFkgZXF1aXYgIiYjeDIyNjE7Ij48IUVOVElUWSBDb25ncnVlbnQgIiYjeDIyNjE7Ij48IUVOVElUWSBibmVxdWl2ICImI3gyMjYxOyYjeDIwRTU7Ij48IUVOVElUWSBuZXF1aXYgIiYjeDIyNjI7Ij48IUVOVElUWSBOb3RDb25ncnVlbnQgIiYjeDIyNjI7Ij48IUVOVElUWSBsZSAiJiN4MjI2NDsiPjwhRU5USVRZIGxlcSAiJiN4MjI2NDsiPjwhRU5USVRZIG52bGUgIiYjeDIyNjQ7JiN4MjBEMjsiPjwhRU5USVRZIGdlICImI3gyMjY1OyI%2BPCFFTlRJVFkgR3JlYXRlckVxdWFsICImI3gyMjY1OyI%2BPCFFTlRJVFkgZ2VxICImI3gyMjY1OyI%2BPCFFTlRJVFkgbnZnZSAiJiN4MjI2NTsmI3gyMEQyOyI%2BPCFFTlRJVFkgbEUgIiYjeDIyNjY7Ij48IUVOVElUWSBMZXNzRnVsbEVxdWFsICImI3gyMjY2OyI%2BPCFFTlRJVFkgbGVxcSAiJiN4MjI2NjsiPjwhRU5USVRZIG5sRSAiJiN4MjI2NjsmI3gzMzg7Ij48IUVOVElUWSBubGVxcSAiJiN4MjI2NjsmI3gzMzg7Ij48IUVOVElUWSBnRSAiJiN4MjI2NzsiPjwhRU5USVRZIEdyZWF0ZXJGdWxsRXF1YWwgIiYjeDIyNjc7Ij48IUVOVElUWSBnZXFxICImI3gyMjY3OyI%2BPCFFTlRJVFkgbmdFICImI3gyMjY3OyYjeDMzODsiPjwhRU5USVRZIG5nZXFxICImI3gyMjY3OyYjeDMzODsiPjwhRU5USVRZIE5vdEdyZWF0ZXJGdWxsRXF1YWwgIiYjeDIyNjc7JiN4MzM4OyI%2BPCFFTlRJVFkgbG5FICImI3gyMjY4OyI%2BPCFFTlRJVFkgbG5lcXEgIiYjeDIyNjg7Ij48IUVOVElUWSBsdm5FICImI3gyMjY4OyYjeEZFMDA7Ij48IUVOVElUWSBsdmVydG5lcXEgIiYjeDIyNjg7JiN4RkUwMDsiPjwhRU5USVRZIGduRSAiJiN4MjI2OTsiPjwhRU5USVRZIGduZXFxICImI3gyMjY5OyI%2BPCFFTlRJVFkgZ3ZuRSAiJiN4MjI2OTsmI3hGRTAwOyI%2BPCFFTlRJVFkgZ3ZlcnRuZXFxICImI3gyMjY5OyYjeEZFMDA7Ij48IUVOVElUWSBMdCAiJiN4MjI2QTsiPjwhRU5USVRZIE5lc3RlZExlc3NMZXNzICImI3gyMjZBOyI%2BPCFFTlRJVFkgbGwgIiYjeDIyNkE7Ij48IUVOVElUWSBuTHR2ICImI3gyMjZBOyYjeDMzODsiPjwhRU5USVRZIE5vdExlc3NMZXNzICImI3gyMjZBOyYjeDMzODsiPjwhRU5USVRZIG5MdCAiJiN4MjI2QTsmI3gyMEQyOyI%2BPCFFTlRJVFkgR3QgIiYjeDIyNkI7Ij48IUVOVElUWSBOZXN0ZWRHcmVhdGVyR3JlYXRlciAiJiN4MjI2QjsiPjwhRU5USVRZIGdnICImI3gyMjZCOyI%2BPCFFTlRJVFkgbkd0diAiJiN4MjI2QjsmI3gzMzg7Ij48IUVOVElUWSBOb3RHcmVhdGVyR3JlYXRlciAiJiN4MjI2QjsmI3gzMzg7Ij48IUVOVElUWSBuR3QgIiYjeDIyNkI7JiN4MjBEMjsiPjwhRU5USVRZIHR3aXh0ICImI3gyMjZDOyI%2BPCFFTlRJVFkgYmV0d2VlbiAiJiN4MjI2QzsiPjwhRU5USVRZIE5vdEN1cENhcCAiJiN4MjI2RDsiPjwhRU5USVRZIG5sdCAiJiN4MjI2RTsiPjwhRU5USVRZIE5vdExlc3MgIiYjeDIyNkU7Ij48IUVOVElUWSBubGVzcyAiJiN4MjI2RTsiPjwhRU5USVRZIG5ndCAiJiN4MjI2RjsiPjwhRU5USVRZIE5vdEdyZWF0ZXIgIiYjeDIyNkY7Ij48IUVOVElUWSBuZ3RyICImI3gyMjZGOyI%2BPCFFTlRJVFkgbmxlICImI3gyMjcwOyI%2BPCFFTlRJVFkgTm90TGVzc0VxdWFsICImI3gyMjcwOyI%2BPCFFTlRJVFkgbmxlcSAiJiN4MjI3MDsiPjwhRU5USVRZIG5nZSAiJiN4MjI3MTsiPjwhRU5USVRZIE5vdEdyZWF0ZXJFcXVhbCAiJiN4MjI3MTsiPjwhRU5USVRZIG5nZXEgIiYjeDIyNzE7Ij48IUVOVElUWSBsc2ltICImI3gyMjcyOyI%2BPCFFTlRJVFkgTGVzc1RpbGRlICImI3gyMjcyOyI%2BPCFFTlRJVFkgbGVzc3NpbSAiJiN4MjI3MjsiPjwhRU5USVRZIGdzaW0gIiYjeDIyNzM7Ij48IUVOVElUWSBndHJzaW0gIiYjeDIyNzM7Ij48IUVOVElUWSBHcmVhdGVyVGlsZGUgIiYjeDIyNzM7Ij48IUVOVElUWSBubHNpbSAiJiN4MjI3NDsiPjwhRU5USVRZIE5vdExlc3NUaWxkZSAiJiN4MjI3NDsiPjwhRU5USVRZIG5nc2ltICImI3gyMjc1OyI%2BPCFFTlRJVFkgTm90R3JlYXRlclRpbGRlICImI3gyMjc1OyI%2BPCFFTlRJVFkgbGcgIiYjeDIyNzY7Ij48IUVOVElUWSBsZXNzZ3RyICImI3gyMjc2OyI%2BPCFFTlRJVFkgTGVzc0dyZWF0ZXIgIiYjeDIyNzY7Ij48IUVOVElUWSBnbCAiJiN4MjI3NzsiPjwhRU5USVRZIGd0cmxlc3MgIiYjeDIyNzc7Ij48IUVOVElUWSBHcmVhdGVyTGVzcyAiJiN4MjI3NzsiPjwhRU5USVRZIG50bGcgIiYjeDIyNzg7Ij48IUVOVElUWSBOb3RMZXNzR3JlYXRlciAiJiN4MjI3ODsiPjwhRU5USVRZIG50Z2wgIiYjeDIyNzk7Ij48IUVOVElUWSBOb3RHcmVhdGVyTGVzcyAiJiN4MjI3OTsiPjwhRU5USVRZIHByICImI3gyMjdBOyI%2BPCFFTlRJVFkgUHJlY2VkZXMgIiYjeDIyN0E7Ij48IUVOVElUWSBwcmVjICImI3gyMjdBOyI%2BPCFFTlRJVFkgc2MgIiYjeDIyN0I7Ij48IUVOVElUWSBTdWNjZWVkcyAiJiN4MjI3QjsiPjwhRU5USVRZIHN1Y2MgIiYjeDIyN0I7Ij48IUVOVElUWSBwcmN1ZSAiJiN4MjI3QzsiPjwhRU5USVRZIFByZWNlZGVzU2xhbnRFcXVhbCAiJiN4MjI3QzsiPjwhRU5USVRZIHByZWNjdXJseWVxICImI3gyMjdDOyI%2BPCFFTlRJVFkgc2NjdWUgIiYjeDIyN0Q7Ij48IUVOVElUWSBTdWNjZWVkc1NsYW50RXF1YWwgIiYjeDIyN0Q7Ij48IUVOVElUWSBzdWNjY3VybHllcSAiJiN4MjI3RDsiPjwhRU5USVRZIHByc2ltICImI3gyMjdFOyI%2BPCFFTlRJVFkgcHJlY3NpbSAiJiN4MjI3RTsiPjwhRU5USVRZIFByZWNlZGVzVGlsZGUgIiYjeDIyN0U7Ij48IUVOVElUWSBzY3NpbSAiJiN4MjI3RjsiPjwhRU5USVRZIHN1Y2NzaW0gIiYjeDIyN0Y7Ij48IUVOVElUWSBTdWNjZWVkc1RpbGRlICImI3gyMjdGOyI%2BPCFFTlRJVFkgTm90U3VjY2VlZHNUaWxkZSAiJiN4MjI3RjsmI3gzMzg7Ij48IUVOVElUWSBucHIgIiYjeDIyODA7Ij48IUVOVElUWSBucHJlYyAiJiN4MjI4MDsiPjwhRU5USVRZIE5vdFByZWNlZGVzICImI3gyMjgwOyI%2BPCFFTlRJVFkgbnNjICImI3gyMjgxOyI%2BPCFFTlRJVFkgbnN1Y2MgIiYjeDIyODE7Ij48IUVOVElUWSBOb3RTdWNjZWVkcyAiJiN4MjI4MTsiPjwhRU5USVRZIHN1YiAiJiN4MjI4MjsiPjwhRU5USVRZIHN1YnNldCAiJiN4MjI4MjsiPjwhRU5USVRZIHZuc3ViICImI3gyMjgyOyYjeDIwRDI7Ij48IUVOVElUWSBuc3Vic2V0ICImI3gyMjgyOyYjeDIwRDI7Ij48IUVOVElUWSBOb3RTdWJzZXQgIiYjeDIyODI7JiN4MjBEMjsiPjwhRU5USVRZIHN1cCAiJiN4MjI4MzsiPjwhRU5USVRZIHN1cHNldCAiJiN4MjI4MzsiPjwhRU5USVRZIFN1cGVyc2V0ICImI3gyMjgzOyI%2BPCFFTlRJVFkgdm5zdXAgIiYjeDIyODM7JiN4MjBEMjsiPjwhRU5USVRZIG5zdXBzZXQgIiYjeDIyODM7JiN4MjBEMjsiPjwhRU5USVRZIE5vdFN1cGVyc2V0ICImI3gyMjgzOyYjeDIwRDI7Ij48IUVOVElUWSBuc3ViICImI3gyMjg0OyI%2BPCFFTlRJVFkgbnN1cCAiJiN4MjI4NTsiPjwhRU5USVRZIHN1YmUgIiYjeDIyODY7Ij48IUVOVElUWSBTdWJzZXRFcXVhbCAiJiN4MjI4NjsiPjwhRU5USVRZIHN1YnNldGVxICImI3gyMjg2OyI%2BPCFFTlRJVFkgc3VwZSAiJiN4MjI4NzsiPjwhRU5USVRZIHN1cHNldGVxICImI3gyMjg3OyI%2BPCFFTlRJVFkgU3VwZXJzZXRFcXVhbCAiJiN4MjI4NzsiPjwhRU5USVRZIG5zdWJlICImI3gyMjg4OyI%2BPCFFTlRJVFkgbnN1YnNldGVxICImI3gyMjg4OyI%2BPCFFTlRJVFkgTm90U3Vic2V0RXF1YWwgIiYjeDIyODg7Ij48IUVOVElUWSBuc3VwZSAiJiN4MjI4OTsiPjwhRU5USVRZIG5zdXBzZXRlcSAiJiN4MjI4OTsiPjwhRU5USVRZIE5vdFN1cGVyc2V0RXF1YWwgIiYjeDIyODk7Ij48IUVOVElUWSBzdWJuZSAiJiN4MjI4QTsiPjwhRU5USVRZIHN1YnNldG5lcSAiJiN4MjI4QTsiPjwhRU5USVRZIHZzdWJuZSAiJiN4MjI4QTsmI3hGRTAwOyI%2BPCFFTlRJVFkgdmFyc3Vic2V0bmVxICImI3gyMjhBOyYjeEZFMDA7Ij48IUVOVElUWSBzdXBuZSAiJiN4MjI4QjsiPjwhRU5USVRZIHN1cHNldG5lcSAiJiN4MjI4QjsiPjwhRU5USVRZIHZzdXBuZSAiJiN4MjI4QjsmI3hGRTAwOyI%2BPCFFTlRJVFkgdmFyc3Vwc2V0bmVxICImI3gyMjhCOyYjeEZFMDA7Ij48IUVOVElUWSBjdXBkb3QgIiYjeDIyOEQ7Ij48IUVOVElUWSB1cGx1cyAiJiN4MjI4RTsiPjwhRU5USVRZIFVuaW9uUGx1cyAiJiN4MjI4RTsiPjwhRU5USVRZIHNxc3ViICImI3gyMjhGOyI%2BPCFFTlRJVFkgU3F1YXJlU3Vic2V0ICImI3gyMjhGOyI%2BPCFFTlRJVFkgc3FzdWJzZXQgIiYjeDIyOEY7Ij48IUVOVElUWSBOb3RTcXVhcmVTdWJzZXQgIiYjeDIyOEY7JiN4MzM4OyI%2BPCFFTlRJVFkgc3FzdXAgIiYjeDIyOTA7Ij48IUVOVElUWSBTcXVhcmVTdXBlcnNldCAiJiN4MjI5MDsiPjwhRU5USVRZIHNxc3Vwc2V0ICImI3gyMjkwOyI%2BPCFFTlRJVFkgTm90U3F1YXJlU3VwZXJzZXQgIiYjeDIyOTA7JiN4MzM4OyI%2BPCFFTlRJVFkgc3FzdWJlICImI3gyMjkxOyI%2BPCFFTlRJVFkgU3F1YXJlU3Vic2V0RXF1YWwgIiYjeDIyOTE7Ij48IUVOVElUWSBzcXN1YnNldGVxICImI3gyMjkxOyI%2BPCFFTlRJVFkgc3FzdXBlICImI3gyMjkyOyI%2BPCFFTlRJVFkgU3F1YXJlU3VwZXJzZXRFcXVhbCAiJiN4MjI5MjsiPjwhRU5USVRZIHNxc3Vwc2V0ZXEgIiYjeDIyOTI7Ij48IUVOVElUWSBzcWNhcCAiJiN4MjI5MzsiPjwhRU5USVRZIFNxdWFyZUludGVyc2VjdGlvbiAiJiN4MjI5MzsiPjwhRU5USVRZIHNxY2FwcyAiJiN4MjI5MzsmI3hGRTAwOyI%2BPCFFTlRJVFkgc3FjdXAgIiYjeDIyOTQ7Ij48IUVOVElUWSBTcXVhcmVVbmlvbiAiJiN4MjI5NDsiPjwhRU5USVRZIHNxY3VwcyAiJiN4MjI5NDsmI3hGRTAwOyI%2BPCFFTlRJVFkgb3BsdXMgIiYjeDIyOTU7Ij48IUVOVElUWSBDaXJjbGVQbHVzICImI3gyMjk1OyI%2BPCFFTlRJVFkgb21pbnVzICImI3gyMjk2OyI%2BPCFFTlRJVFkgQ2lyY2xlTWludXMgIiYjeDIyOTY7Ij48IUVOVElUWSBvdGltZXMgIiYjeDIyOTc7Ij48IUVOVElUWSBDaXJjbGVUaW1lcyAiJiN4MjI5NzsiPjwhRU5USVRZIG9zb2wgIiYjeDIyOTg7Ij48IUVOVElUWSBvZG90ICImI3gyMjk5OyI%2BPCFFTlRJVFkgQ2lyY2xlRG90ICImI3gyMjk5OyI%2BPCFFTlRJVFkgb2NpciAiJiN4MjI5QTsiPjwhRU5USVRZIGNpcmNsZWRjaXJjICImI3gyMjlBOyI%2BPCFFTlRJVFkgb2FzdCAiJiN4MjI5QjsiPjwhRU5USVRZIGNpcmNsZWRhc3QgIiYjeDIyOUI7Ij48IUVOVElUWSBvZGFzaCAiJiN4MjI5RDsiPjwhRU5USVRZIGNpcmNsZWRkYXNoICImI3gyMjlEOyI%2BPCFFTlRJVFkgcGx1c2IgIiYjeDIyOUU7Ij48IUVOVElUWSBib3hwbHVzICImI3gyMjlFOyI%2BPCFFTlRJVFkgbWludXNiICImI3gyMjlGOyI%2BPCFFTlRJVFkgYm94bWludXMgIiYjeDIyOUY7Ij48IUVOVElUWSB0aW1lc2IgIiYjeDIyQTA7Ij48IUVOVElUWSBib3h0aW1lcyAiJiN4MjJBMDsiPjwhRU5USVRZIHNkb3RiICImI3gyMkExOyI%2BPCFFTlRJVFkgZG90c3F1YXJlICImI3gyMkExOyI%2BPCFFTlRJVFkgdmRhc2ggIiYjeDIyQTI7Ij48IUVOVElUWSBSaWdodFRlZSAiJiN4MjJBMjsiPjwhRU5USVRZIGRhc2h2ICImI3gyMkEzOyI%2BPCFFTlRJVFkgTGVmdFRlZSAiJiN4MjJBMzsiPjwhRU5USVRZIHRvcCAiJiN4MjJBNDsiPjwhRU5USVRZIERvd25UZWUgIiYjeDIyQTQ7Ij48IUVOVElUWSBib3R0b20gIiYjeDIyQTU7Ij48IUVOVElUWSBib3QgIiYjeDIyQTU7Ij48IUVOVElUWSBwZXJwICImI3gyMkE1OyI%2BPCFFTlRJVFkgVXBUZWUgIiYjeDIyQTU7Ij48IUVOVElUWSBtb2RlbHMgIiYjeDIyQTc7Ij48IUVOVElUWSB2RGFzaCAiJiN4MjJBODsiPjwhRU5USVRZIERvdWJsZVJpZ2h0VGVlICImI3gyMkE4OyI%2BPCFFTlRJVFkgVmRhc2ggIiYjeDIyQTk7Ij48IUVOVElUWSBWdmRhc2ggIiYjeDIyQUE7Ij48IUVOVElUWSBWRGFzaCAiJiN4MjJBQjsiPjwhRU5USVRZIG52ZGFzaCAiJiN4MjJBQzsiPjwhRU5USVRZIG52RGFzaCAiJiN4MjJBRDsiPjwhRU5USVRZIG5WZGFzaCAiJiN4MjJBRTsiPjwhRU5USVRZIG5WRGFzaCAiJiN4MjJBRjsiPjwhRU5USVRZIHBydXJlbCAiJiN4MjJCMDsiPjwhRU5USVRZIHZsdHJpICImI3gyMkIyOyI%2BPCFFTlRJVFkgdmFydHJpYW5nbGVsZWZ0ICImI3gyMkIyOyI%2BPCFFTlRJVFkgTGVmdFRyaWFuZ2xlICImI3gyMkIyOyI%2BPCFFTlRJVFkgdnJ0cmkgIiYjeDIyQjM7Ij48IUVOVElUWSB2YXJ0cmlhbmdsZXJpZ2h0ICImI3gyMkIzOyI%2BPCFFTlRJVFkgUmlnaHRUcmlhbmdsZSAiJiN4MjJCMzsiPjwhRU5USVRZIGx0cmllICImI3gyMkI0OyI%2BPCFFTlRJVFkgdHJpYW5nbGVsZWZ0ZXEgIiYjeDIyQjQ7Ij48IUVOVElUWSBMZWZ0VHJpYW5nbGVFcXVhbCAiJiN4MjJCNDsiPjwhRU5USVRZIG52bHRyaWUgIiYjeDIyQjQ7JiN4MjBEMjsiPjwhRU5USVRZIHJ0cmllICImI3gyMkI1OyI%2BPCFFTlRJVFkgdHJpYW5nbGVyaWdodGVxICImI3gyMkI1OyI%2BPCFFTlRJVFkgUmlnaHRUcmlhbmdsZUVxdWFsICImI3gyMkI1OyI%2BPCFFTlRJVFkgbnZydHJpZSAiJiN4MjJCNTsmI3gyMEQyOyI%2BPCFFTlRJVFkgb3JpZ29mICImI3gyMkI2OyI%2BPCFFTlRJVFkgaW1vZiAiJiN4MjJCNzsiPjwhRU5USVRZIG11bWFwICImI3gyMkI4OyI%2BPCFFTlRJVFkgbXVsdGltYXAgIiYjeDIyQjg7Ij48IUVOVElUWSBoZXJjb24gIiYjeDIyQjk7Ij48IUVOVElUWSBpbnRjYWwgIiYjeDIyQkE7Ij48IUVOVElUWSBpbnRlcmNhbCAiJiN4MjJCQTsiPjwhRU5USVRZIHZlZWJhciAiJiN4MjJCQjsiPjwhRU5USVRZIGJhcnZlZSAiJiN4MjJCRDsiPjwhRU5USVRZIGFuZ3J0dmIgIiYjeDIyQkU7Ij48IUVOVElUWSBscnRyaSAiJiN4MjJCRjsiPjwhRU5USVRZIHh3ZWRnZSAiJiN4MjJDMDsiPjwhRU5USVRZIFdlZGdlICImI3gyMkMwOyI%2BPCFFTlRJVFkgYmlnd2VkZ2UgIiYjeDIyQzA7Ij48IUVOVElUWSB4dmVlICImI3gyMkMxOyI%2BPCFFTlRJVFkgVmVlICImI3gyMkMxOyI%2BPCFFTlRJVFkgYmlndmVlICImI3gyMkMxOyI%2BPCFFTlRJVFkgeGNhcCAiJiN4MjJDMjsiPjwhRU5USVRZIEludGVyc2VjdGlvbiAiJiN4MjJDMjsiPjwhRU5USVRZIGJpZ2NhcCAiJiN4MjJDMjsiPjwhRU5USVRZIHhjdXAgIiYjeDIyQzM7Ij48IUVOVElUWSBVbmlvbiAiJiN4MjJDMzsiPjwhRU5USVRZIGJpZ2N1cCAiJiN4MjJDMzsiPjwhRU5USVRZIGRpYW0gIiYjeDIyQzQ7Ij48IUVOVElUWSBkaWFtb25kICImI3gyMkM0OyI%2BPCFFTlRJVFkgRGlhbW9uZCAiJiN4MjJDNDsiPjwhRU5USVRZIHNkb3QgIiYjeDIyQzU7Ij48IUVOVElUWSBzc3RhcmYgIiYjeDIyQzY7Ij48IUVOVElUWSBTdGFyICImI3gyMkM2OyI%2BPCFFTlRJVFkgZGl2b254ICImI3gyMkM3OyI%2BPCFFTlRJVFkgZGl2aWRlb250aW1lcyAiJiN4MjJDNzsiPjwhRU5USVRZIGJvd3RpZSAiJiN4MjJDODsiPjwhRU5USVRZIGx0aW1lcyAiJiN4MjJDOTsiPjwhRU5USVRZIHJ0aW1lcyAiJiN4MjJDQTsiPjwhRU5USVRZIGx0aHJlZSAiJiN4MjJDQjsiPjwhRU5USVRZIGxlZnR0aHJlZXRpbWVzICImI3gyMkNCOyI%2BPCFFTlRJVFkgcnRocmVlICImI3gyMkNDOyI%2BPCFFTlRJVFkgcmlnaHR0aHJlZXRpbWVzICImI3gyMkNDOyI%2BPCFFTlRJVFkgYnNpbWUgIiYjeDIyQ0Q7Ij48IUVOVElUWSBiYWNrc2ltZXEgIiYjeDIyQ0Q7Ij48IUVOVElUWSBjdXZlZSAiJiN4MjJDRTsiPjwhRU5USVRZIGN1cmx5dmVlICImI3gyMkNFOyI%2BPCFFTlRJVFkgY3V3ZWQgIiYjeDIyQ0Y7Ij48IUVOVElUWSBjdXJseXdlZGdlICImI3gyMkNGOyI%2BPCFFTlRJVFkgU3ViICImI3gyMkQwOyI%2BPCFFTlRJVFkgU3Vic2V0ICImI3gyMkQwOyI%2BPCFFTlRJVFkgU3VwICImI3gyMkQxOyI%2BPCFFTlRJVFkgU3Vwc2V0ICImI3gyMkQxOyI%2BPCFFTlRJVFkgQ2FwICImI3gyMkQyOyI%2BPCFFTlRJVFkgQ3VwICImI3gyMkQzOyI%2BPCFFTlRJVFkgZm9yayAiJiN4MjJENDsiPjwhRU5USVRZIHBpdGNoZm9yayAiJiN4MjJENDsiPjwhRU5USVRZIGVwYXIgIiYjeDIyRDU7Ij48IUVOVElUWSBsdGRvdCAiJiN4MjJENjsiPjwhRU5USVRZIGxlc3Nkb3QgIiYjeDIyRDY7Ij48IUVOVElUWSBndGRvdCAiJiN4MjJENzsiPjwhRU5USVRZIGd0cmRvdCAiJiN4MjJENzsiPjwhRU5USVRZIExsICImI3gyMkQ4OyI%2BPCFFTlRJVFkgbkxsICImI3gyMkQ4OyYjeDMzODsiPjwhRU5USVRZIEdnICImI3gyMkQ5OyI%2BPCFFTlRJVFkgZ2dnICImI3gyMkQ5OyI%2BPCFFTlRJVFkgbkdnICImI3gyMkQ5OyYjeDMzODsiPjwhRU5USVRZIGxlZyAiJiN4MjJEQTsiPjwhRU5USVRZIExlc3NFcXVhbEdyZWF0ZXIgIiYjeDIyREE7Ij48IUVOVElUWSBsZXNzZXFndHIgIiYjeDIyREE7Ij48IUVOVElUWSBsZXNnICImI3gyMkRBOyYjeEZFMDA7Ij48IUVOVElUWSBnZWwgIiYjeDIyREI7Ij48IUVOVElUWSBndHJlcWxlc3MgIiYjeDIyREI7Ij48IUVOVElUWSBHcmVhdGVyRXF1YWxMZXNzICImI3gyMkRCOyI%2BPCFFTlRJVFkgZ2VzbCAiJiN4MjJEQjsmI3hGRTAwOyI%2BPCFFTlRJVFkgY3VlcHIgIiYjeDIyREU7Ij48IUVOVElUWSBjdXJseWVxcHJlYyAiJiN4MjJERTsiPjwhRU5USVRZIGN1ZXNjICImI3gyMkRGOyI%2BPCFFTlRJVFkgY3VybHllcXN1Y2MgIiYjeDIyREY7Ij48IUVOVElUWSBucHJjdWUgIiYjeDIyRTA7Ij48IUVOVElUWSBOb3RQcmVjZWRlc1NsYW50RXF1YWwgIiYjeDIyRTA7Ij48IUVOVElUWSBuc2NjdWUgIiYjeDIyRTE7Ij48IUVOVElUWSBOb3RTdWNjZWVkc1NsYW50RXF1YWwgIiYjeDIyRTE7Ij48IUVOVElUWSBuc3FzdWJlICImI3gyMkUyOyI%2BPCFFTlRJVFkgTm90U3F1YXJlU3Vic2V0RXF1YWwgIiYjeDIyRTI7Ij48IUVOVElUWSBuc3FzdXBlICImI3gyMkUzOyI%2BPCFFTlRJVFkgTm90U3F1YXJlU3VwZXJzZXRFcXVhbCAiJiN4MjJFMzsiPjwhRU5USVRZIGxuc2ltICImI3gyMkU2OyI%2BPCFFTlRJVFkgZ25zaW0gIiYjeDIyRTc7Ij48IUVOVElUWSBwcm5zaW0gIiYjeDIyRTg7Ij48IUVOVElUWSBwcmVjbnNpbSAiJiN4MjJFODsiPjwhRU5USVRZIHNjbnNpbSAiJiN4MjJFOTsiPjwhRU5USVRZIHN1Y2Nuc2ltICImI3gyMkU5OyI%2BPCFFTlRJVFkgbmx0cmkgIiYjeDIyRUE7Ij48IUVOVElUWSBudHJpYW5nbGVsZWZ0ICImI3gyMkVBOyI%2BPCFFTlRJVFkgTm90TGVmdFRyaWFuZ2xlICImI3gyMkVBOyI%2BPCFFTlRJVFkgbnJ0cmkgIiYjeDIyRUI7Ij48IUVOVElUWSBudHJpYW5nbGVyaWdodCAiJiN4MjJFQjsiPjwhRU5USVRZIE5vdFJpZ2h0VHJpYW5nbGUgIiYjeDIyRUI7Ij48IUVOVElUWSBubHRyaWUgIiYjeDIyRUM7Ij48IUVOVElUWSBudHJpYW5nbGVsZWZ0ZXEgIiYjeDIyRUM7Ij48IUVOVElUWSBOb3RMZWZ0VHJpYW5nbGVFcXVhbCAiJiN4MjJFQzsiPjwhRU5USVRZIG5ydHJpZSAiJiN4MjJFRDsiPjwhRU5USVRZIG50cmlhbmdsZXJpZ2h0ZXEgIiYjeDIyRUQ7Ij48IUVOVElUWSBOb3RSaWdodFRyaWFuZ2xlRXF1YWwgIiYjeDIyRUQ7Ij48IUVOVElUWSB2ZWxsaXAgIiYjeDIyRUU7Ij48IUVOVElUWSBjdGRvdCAiJiN4MjJFRjsiPjwhRU5USVRZIHV0ZG90ICImI3gyMkYwOyI%2BPCFFTlRJVFkgZHRkb3QgIiYjeDIyRjE7Ij48IUVOVElUWSBkaXNpbiAiJiN4MjJGMjsiPjwhRU5USVRZIGlzaW5zdiAiJiN4MjJGMzsiPjwhRU5USVRZIGlzaW5zICImI3gyMkY0OyI%2BPCFFTlRJVFkgaXNpbmRvdCAiJiN4MjJGNTsiPjwhRU5USVRZIG5vdGluZG90ICImI3gyMkY1OyYjeDMzODsiPjwhRU5USVRZIG5vdGludmMgIiYjeDIyRjY7Ij48IUVOVElUWSBub3RpbnZiICImI3gyMkY3OyI%2BPCFFTlRJVFkgaXNpbkUgIiYjeDIyRjk7Ij48IUVOVElUWSBub3RpbkUgIiYjeDIyRjk7JiN4MzM4OyI%2BPCFFTlRJVFkgbmlzZCAiJiN4MjJGQTsiPjwhRU5USVRZIHhuaXMgIiYjeDIyRkI7Ij48IUVOVElUWSBuaXMgIiYjeDIyRkM7Ij48IUVOVElUWSBub3RuaXZjICImI3gyMkZEOyI%2BPCFFTlRJVFkgbm90bml2YiAiJiN4MjJGRTsiPjwhRU5USVRZIGJhcndlZCAiJiN4MjMwNTsiPjwhRU5USVRZIGJhcndlZGdlICImI3gyMzA1OyI%2BPCFFTlRJVFkgQmFyd2VkICImI3gyMzA2OyI%2BPCFFTlRJVFkgZG91YmxlYmFyd2VkZ2UgIiYjeDIzMDY7Ij48IUVOVElUWSBsY2VpbCAiJiN4MjMwODsiPjwhRU5USVRZIExlZnRDZWlsaW5nICImI3gyMzA4OyI%2BPCFFTlRJVFkgcmNlaWwgIiYjeDIzMDk7Ij48IUVOVElUWSBSaWdodENlaWxpbmcgIiYjeDIzMDk7Ij48IUVOVElUWSBsZmxvb3IgIiYjeDIzMEE7Ij48IUVOVElUWSBMZWZ0Rmxvb3IgIiYjeDIzMEE7Ij48IUVOVElUWSByZmxvb3IgIiYjeDIzMEI7Ij48IUVOVElUWSBSaWdodEZsb29yICImI3gyMzBCOyI%2BPCFFTlRJVFkgZHJjcm9wICImI3gyMzBDOyI%2BPCFFTlRJVFkgZGxjcm9wICImI3gyMzBEOyI%2BPCFFTlRJVFkgdXJjcm9wICImI3gyMzBFOyI%2BPCFFTlRJVFkgdWxjcm9wICImI3gyMzBGOyI%2BPCFFTlRJVFkgYm5vdCAiJiN4MjMxMDsiPjwhRU5USVRZIHByb2ZsaW5lICImI3gyMzEyOyI%2BPCFFTlRJVFkgcHJvZnN1cmYgIiYjeDIzMTM7Ij48IUVOVElUWSB0ZWxyZWMgIiYjeDIzMTU7Ij48IUVOVElUWSB0YXJnZXQgIiYjeDIzMTY7Ij48IUVOVElUWSB1bGNvcm4gIiYjeDIzMUM7Ij48IUVOVElUWSB1bGNvcm5lciAiJiN4MjMxQzsiPjwhRU5USVRZIHVyY29ybiAiJiN4MjMxRDsiPjwhRU5USVRZIHVyY29ybmVyICImI3gyMzFEOyI%2BPCFFTlRJVFkgZGxjb3JuICImI3gyMzFFOyI%2BPCFFTlRJVFkgbGxjb3JuZXIgIiYjeDIzMUU7Ij48IUVOVElUWSBkcmNvcm4gIiYjeDIzMUY7Ij48IUVOVElUWSBscmNvcm5lciAiJiN4MjMxRjsiPjwhRU5USVRZIGZyb3duICImI3gyMzIyOyI%2BPCFFTlRJVFkgc2Zyb3duICImI3gyMzIyOyI%2BPCFFTlRJVFkgc21pbGUgIiYjeDIzMjM7Ij48IUVOVElUWSBzc21pbGUgIiYjeDIzMjM7Ij48IUVOVElUWSBjeWxjdHkgIiYjeDIzMkQ7Ij48IUVOVElUWSBwcm9mYWxhciAiJiN4MjMyRTsiPjwhRU5USVRZIHRvcGJvdCAiJiN4MjMzNjsiPjwhRU5USVRZIG92YmFyICImI3gyMzNEOyI%2BPCFFTlRJVFkgc29sYmFyICImI3gyMzNGOyI%2BPCFFTlRJVFkgYW5nemFyciAiJiN4MjM3QzsiPjwhRU5USVRZIGxtb3VzdCAiJiN4MjNCMDsiPjwhRU5USVRZIGxtb3VzdGFjaGUgIiYjeDIzQjA7Ij48IUVOVElUWSBybW91c3QgIiYjeDIzQjE7Ij48IUVOVElUWSBybW91c3RhY2hlICImI3gyM0IxOyI%2BPCFFTlRJVFkgdGJyayAiJiN4MjNCNDsiPjwhRU5USVRZIE92ZXJCcmFja2V0ICImI3gyM0I0OyI%2BPCFFTlRJVFkgYmJyayAiJiN4MjNCNTsiPjwhRU5USVRZIFVuZGVyQnJhY2tldCAiJiN4MjNCNTsiPjwhRU5USVRZIGJicmt0YnJrICImI3gyM0I2OyI%2BPCFFTlRJVFkgT3ZlclBhcmVudGhlc2lzICImI3gyM0RDOyI%2BPCFFTlRJVFkgVW5kZXJQYXJlbnRoZXNpcyAiJiN4MjNERDsiPjwhRU5USVRZIE92ZXJCcmFjZSAiJiN4MjNERTsiPjwhRU5USVRZIFVuZGVyQnJhY2UgIiYjeDIzREY7Ij48IUVOVElUWSB0cnBleml1bSAiJiN4MjNFMjsiPjwhRU5USVRZIGVsaW50ZXJzICImI3gyM0U3OyI%2BPCFFTlRJVFkgYmxhbmsgIiYjeDI0MjM7Ij48IUVOVElUWSBvUyAiJiN4MjRDODsiPjwhRU5USVRZIGNpcmNsZWRTICImI3gyNEM4OyI%2BPCFFTlRJVFkgYm94aCAiJiN4MjUwMDsiPjwhRU5USVRZIEhvcml6b250YWxMaW5lICImI3gyNTAwOyI%2BPCFFTlRJVFkgYm94diAiJiN4MjUwMjsiPjwhRU5USVRZIGJveGRyICImI3gyNTBDOyI%2BPCFFTlRJVFkgYm94ZGwgIiYjeDI1MTA7Ij48IUVOVElUWSBib3h1ciAiJiN4MjUxNDsiPjwhRU5USVRZIGJveHVsICImI3gyNTE4OyI%2BPCFFTlRJVFkgYm94dnIgIiYjeDI1MUM7Ij48IUVOVElUWSBib3h2bCAiJiN4MjUyNDsiPjwhRU5USVRZIGJveGhkICImI3gyNTJDOyI%2BPCFFTlRJVFkgYm94aHUgIiYjeDI1MzQ7Ij48IUVOVElUWSBib3h2aCAiJiN4MjUzQzsiPjwhRU5USVRZIGJveEggIiYjeDI1NTA7Ij48IUVOVElUWSBib3hWICImI3gyNTUxOyI%2BPCFFTlRJVFkgYm94ZFIgIiYjeDI1NTI7Ij48IUVOVElUWSBib3hEciAiJiN4MjU1MzsiPjwhRU5USVRZIGJveERSICImI3gyNTU0OyI%2BPCFFTlRJVFkgYm94ZEwgIiYjeDI1NTU7Ij48IUVOVElUWSBib3hEbCAiJiN4MjU1NjsiPjwhRU5USVRZIGJveERMICImI3gyNTU3OyI%2BPCFFTlRJVFkgYm94dVIgIiYjeDI1NTg7Ij48IUVOVElUWSBib3hVciAiJiN4MjU1OTsiPjwhRU5USVRZIGJveFVSICImI3gyNTVBOyI%2BPCFFTlRJVFkgYm94dUwgIiYjeDI1NUI7Ij48IUVOVElUWSBib3hVbCAiJiN4MjU1QzsiPjwhRU5USVRZIGJveFVMICImI3gyNTVEOyI%2BPCFFTlRJVFkgYm94dlIgIiYjeDI1NUU7Ij48IUVOVElUWSBib3hWciAiJiN4MjU1RjsiPjwhRU5USVRZIGJveFZSICImI3gyNTYwOyI%2BPCFFTlRJVFkgYm94dkwgIiYjeDI1NjE7Ij48IUVOVElUWSBib3hWbCAiJiN4MjU2MjsiPjwhRU5USVRZIGJveFZMICImI3gyNTYzOyI%2BPCFFTlRJVFkgYm94SGQgIiYjeDI1NjQ7Ij48IUVOVElUWSBib3hoRCAiJiN4MjU2NTsiPjwhRU5USVRZIGJveEhEICImI3gyNTY2OyI%2BPCFFTlRJVFkgYm94SHUgIiYjeDI1Njc7Ij48IUVOVElUWSBib3hoVSAiJiN4MjU2ODsiPjwhRU5USVRZIGJveEhVICImI3gyNTY5OyI%2BPCFFTlRJVFkgYm94dkggIiYjeDI1NkE7Ij48IUVOVElUWSBib3hWaCAiJiN4MjU2QjsiPjwhRU5USVRZIGJveFZIICImI3gyNTZDOyI%2BPCFFTlRJVFkgdWhibGsgIiYjeDI1ODA7Ij48IUVOVElUWSBsaGJsayAiJiN4MjU4NDsiPjwhRU5USVRZIGJsb2NrICImI3gyNTg4OyI%2BPCFFTlRJVFkgYmxrMTQgIiYjeDI1OTE7Ij48IUVOVElUWSBibGsxMiAiJiN4MjU5MjsiPjwhRU5USVRZIGJsazM0ICImI3gyNTkzOyI%2BPCFFTlRJVFkgc3F1ICImI3gyNUExOyI%2BPCFFTlRJVFkgc3F1YXJlICImI3gyNUExOyI%2BPCFFTlRJVFkgU3F1YXJlICImI3gyNUExOyI%2BPCFFTlRJVFkgc3F1ZiAiJiN4MjVBQTsiPjwhRU5USVRZIHNxdWFyZiAiJiN4MjVBQTsiPjwhRU5USVRZIGJsYWNrc3F1YXJlICImI3gyNUFBOyI%2BPCFFTlRJVFkgRmlsbGVkVmVyeVNtYWxsU3F1YXJlICImI3gyNUFBOyI%2BPCFFTlRJVFkgRW1wdHlWZXJ5U21hbGxTcXVhcmUgIiYjeDI1QUI7Ij48IUVOVElUWSByZWN0ICImI3gyNUFEOyI%2BPCFFTlRJVFkgbWFya2VyICImI3gyNUFFOyI%2BPCFFTlRJVFkgZmx0bnMgIiYjeDI1QjE7Ij48IUVOVElUWSB4dXRyaSAiJiN4MjVCMzsiPjwhRU5USVRZIGJpZ3RyaWFuZ2xldXAgIiYjeDI1QjM7Ij48IUVOVElUWSB1dHJpZiAiJiN4MjVCNDsiPjwhRU5USVRZIGJsYWNrdHJpYW5nbGUgIiYjeDI1QjQ7Ij48IUVOVElUWSB1dHJpICImI3gyNUI1OyI%2BPCFFTlRJVFkgdHJpYW5nbGUgIiYjeDI1QjU7Ij48IUVOVElUWSBydHJpZiAiJiN4MjVCODsiPjwhRU5USVRZIGJsYWNrdHJpYW5nbGVyaWdodCAiJiN4MjVCODsiPjwhRU5USVRZIHJ0cmkgIiYjeDI1Qjk7Ij48IUVOVElUWSB0cmlhbmdsZXJpZ2h0ICImI3gyNUI5OyI%2BPCFFTlRJVFkgeGR0cmkgIiYjeDI1QkQ7Ij48IUVOVElUWSBiaWd0cmlhbmdsZWRvd24gIiYjeDI1QkQ7Ij48IUVOVElUWSBkdHJpZiAiJiN4MjVCRTsiPjwhRU5USVRZIGJsYWNrdHJpYW5nbGVkb3duICImI3gyNUJFOyI%2BPCFFTlRJVFkgZHRyaSAiJiN4MjVCRjsiPjwhRU5USVRZIHRyaWFuZ2xlZG93biAiJiN4MjVCRjsiPjwhRU5USVRZIGx0cmlmICImI3gyNUMyOyI%2BPCFFTlRJVFkgYmxhY2t0cmlhbmdsZWxlZnQgIiYjeDI1QzI7Ij48IUVOVElUWSBsdHJpICImI3gyNUMzOyI%2BPCFFTlRJVFkgdHJpYW5nbGVsZWZ0ICImI3gyNUMzOyI%2BPCFFTlRJVFkgbG96ICImI3gyNUNBOyI%2BPCFFTlRJVFkgbG96ZW5nZSAiJiN4MjVDQTsiPjwhRU5USVRZIGNpciAiJiN4MjVDQjsiPjwhRU5USVRZIHRyaWRvdCAiJiN4MjVFQzsiPjwhRU5USVRZIHhjaXJjICImI3gyNUVGOyI%2BPCFFTlRJVFkgYmlnY2lyYyAiJiN4MjVFRjsiPjwhRU5USVRZIHVsdHJpICImI3gyNUY4OyI%2BPCFFTlRJVFkgdXJ0cmkgIiYjeDI1Rjk7Ij48IUVOVElUWSBsbHRyaSAiJiN4MjVGQTsiPjwhRU5USVRZIEVtcHR5U21hbGxTcXVhcmUgIiYjeDI1RkI7Ij48IUVOVElUWSBGaWxsZWRTbWFsbFNxdWFyZSAiJiN4MjVGQzsiPjwhRU5USVRZIHN0YXJmICImI3gyNjA1OyI%2BPCFFTlRJVFkgYmlnc3RhciAiJiN4MjYwNTsiPjwhRU5USVRZIHN0YXIgIiYjeDI2MDY7Ij48IUVOVElUWSBwaG9uZSAiJiN4MjYwRTsiPjwhRU5USVRZIGZlbWFsZSAiJiN4MjY0MDsiPjwhRU5USVRZIG1hbGUgIiYjeDI2NDI7Ij48IUVOVElUWSBzcGFkZXMgIiYjeDI2NjA7Ij48IUVOVElUWSBzcGFkZXN1aXQgIiYjeDI2NjA7Ij48IUVOVElUWSBjbHVicyAiJiN4MjY2MzsiPjwhRU5USVRZIGNsdWJzdWl0ICImI3gyNjYzOyI%2BPCFFTlRJVFkgaGVhcnRzICImI3gyNjY1OyI%2BPCFFTlRJVFkgaGVhcnRzdWl0ICImI3gyNjY1OyI%2BPCFFTlRJVFkgZGlhbXMgIiYjeDI2NjY7Ij48IUVOVElUWSBkaWFtb25kc3VpdCAiJiN4MjY2NjsiPjwhRU5USVRZIHN1bmcgIiYjeDI2NkE7Ij48IUVOVElUWSBmbGF0ICImI3gyNjZEOyI%2BPCFFTlRJVFkgbmF0dXIgIiYjeDI2NkU7Ij48IUVOVElUWSBuYXR1cmFsICImI3gyNjZFOyI%2BPCFFTlRJVFkgc2hhcnAgIiYjeDI2NkY7Ij48IUVOVElUWSBjaGVjayAiJiN4MjcxMzsiPjwhRU5USVRZIGNoZWNrbWFyayAiJiN4MjcxMzsiPjwhRU5USVRZIGNyb3NzICImI3gyNzE3OyI%2BPCFFTlRJVFkgbWFsdCAiJiN4MjcyMDsiPjwhRU5USVRZIG1hbHRlc2UgIiYjeDI3MjA7Ij48IUVOVElUWSBzZXh0ICImI3gyNzM2OyI%2BPCFFTlRJVFkgVmVydGljYWxTZXBhcmF0b3IgIiYjeDI3NTg7Ij48IUVOVElUWSBsYmJyayAiJiN4Mjc3MjsiPjwhRU5USVRZIHJiYnJrICImI3gyNzczOyI%2BPCFFTlRJVFkgYnNvbGhzdWIgIiYjeDI3Qzg7Ij48IUVOVElUWSBzdXBoc29sICImI3gyN0M5OyI%2BPCFFTlRJVFkgbG9icmsgIiYjeDI3RTY7Ij48IUVOVElUWSBMZWZ0RG91YmxlQnJhY2tldCAiJiN4MjdFNjsiPjwhRU5USVRZIHJvYnJrICImI3gyN0U3OyI%2BPCFFTlRJVFkgUmlnaHREb3VibGVCcmFja2V0ICImI3gyN0U3OyI%2BPCFFTlRJVFkgbGFuZyAiJiN4MjdFODsiPjwhRU5USVRZIExlZnRBbmdsZUJyYWNrZXQgIiYjeDI3RTg7Ij48IUVOVElUWSBsYW5nbGUgIiYjeDI3RTg7Ij48IUVOVElUWSByYW5nICImI3gyN0U5OyI%2BPCFFTlRJVFkgUmlnaHRBbmdsZUJyYWNrZXQgIiYjeDI3RTk7Ij48IUVOVElUWSByYW5nbGUgIiYjeDI3RTk7Ij48IUVOVElUWSBMYW5nICImI3gyN0VBOyI%2BPCFFTlRJVFkgUmFuZyAiJiN4MjdFQjsiPjwhRU5USVRZIGxvYW5nICImI3gyN0VDOyI%2BPCFFTlRJVFkgcm9hbmcgIiYjeDI3RUQ7Ij48IUVOVElUWSB4bGFyciAiJiN4MjdGNTsiPjwhRU5USVRZIGxvbmdsZWZ0YXJyb3cgIiYjeDI3RjU7Ij48IUVOVElUWSBMb25nTGVmdEFycm93ICImI3gyN0Y1OyI%2BPCFFTlRJVFkgeHJhcnIgIiYjeDI3RjY7Ij48IUVOVElUWSBsb25ncmlnaHRhcnJvdyAiJiN4MjdGNjsiPjwhRU5USVRZIExvbmdSaWdodEFycm93ICImI3gyN0Y2OyI%2BPCFFTlRJVFkgeGhhcnIgIiYjeDI3Rjc7Ij48IUVOVElUWSBsb25nbGVmdHJpZ2h0YXJyb3cgIiYjeDI3Rjc7Ij48IUVOVElUWSBMb25nTGVmdFJpZ2h0QXJyb3cgIiYjeDI3Rjc7Ij48IUVOVElUWSB4bEFyciAiJiN4MjdGODsiPjwhRU5USVRZIExvbmdsZWZ0YXJyb3cgIiYjeDI3Rjg7Ij48IUVOVElUWSBEb3VibGVMb25nTGVmdEFycm93ICImI3gyN0Y4OyI%2BPCFFTlRJVFkgeHJBcnIgIiYjeDI3Rjk7Ij48IUVOVElUWSBMb25ncmlnaHRhcnJvdyAiJiN4MjdGOTsiPjwhRU5USVRZIERvdWJsZUxvbmdSaWdodEFycm93ICImI3gyN0Y5OyI%2BPCFFTlRJVFkgeGhBcnIgIiYjeDI3RkE7Ij48IUVOVElUWSBMb25nbGVmdHJpZ2h0YXJyb3cgIiYjeDI3RkE7Ij48IUVOVElUWSBEb3VibGVMb25nTGVmdFJpZ2h0QXJyb3cgIiYjeDI3RkE7Ij48IUVOVElUWSB4bWFwICImI3gyN0ZDOyI%2BPCFFTlRJVFkgbG9uZ21hcHN0byAiJiN4MjdGQzsiPjwhRU5USVRZIGR6aWdyYXJyICImI3gyN0ZGOyI%2BPCFFTlRJVFkgbnZsQXJyICImI3gyOTAyOyI%2BPCFFTlRJVFkgbnZyQXJyICImI3gyOTAzOyI%2BPCFFTlRJVFkgbnZIYXJyICImI3gyOTA0OyI%2BPCFFTlRJVFkgTWFwICImI3gyOTA1OyI%2BPCFFTlRJVFkgbGJhcnIgIiYjeDI5MEM7Ij48IUVOVElUWSByYmFyciAiJiN4MjkwRDsiPjwhRU5USVRZIGJrYXJvdyAiJiN4MjkwRDsiPjwhRU5USVRZIGxCYXJyICImI3gyOTBFOyI%2BPCFFTlRJVFkgckJhcnIgIiYjeDI5MEY7Ij48IUVOVElUWSBkYmthcm93ICImI3gyOTBGOyI%2BPCFFTlRJVFkgUkJhcnIgIiYjeDI5MTA7Ij48IUVOVElUWSBkcmJrYXJvdyAiJiN4MjkxMDsiPjwhRU5USVRZIEREb3RyYWhkICImI3gyOTExOyI%2BPCFFTlRJVFkgVXBBcnJvd0JhciAiJiN4MjkxMjsiPjwhRU5USVRZIERvd25BcnJvd0JhciAiJiN4MjkxMzsiPjwhRU5USVRZIFJhcnJ0bCAiJiN4MjkxNjsiPjwhRU5USVRZIGxhdGFpbCAiJiN4MjkxOTsiPjwhRU5USVRZIHJhdGFpbCAiJiN4MjkxQTsiPjwhRU5USVRZIGxBdGFpbCAiJiN4MjkxQjsiPjwhRU5USVRZIHJBdGFpbCAiJiN4MjkxQzsiPjwhRU5USVRZIGxhcnJmcyAiJiN4MjkxRDsiPjwhRU5USVRZIHJhcnJmcyAiJiN4MjkxRTsiPjwhRU5USVRZIGxhcnJiZnMgIiYjeDI5MUY7Ij48IUVOVElUWSByYXJyYmZzICImI3gyOTIwOyI%2BPCFFTlRJVFkgbndhcmhrICImI3gyOTIzOyI%2BPCFFTlRJVFkgbmVhcmhrICImI3gyOTI0OyI%2BPCFFTlRJVFkgc2VhcmhrICImI3gyOTI1OyI%2BPCFFTlRJVFkgaGtzZWFyb3cgIiYjeDI5MjU7Ij48IUVOVElUWSBzd2FyaGsgIiYjeDI5MjY7Ij48IUVOVElUWSBoa3N3YXJvdyAiJiN4MjkyNjsiPjwhRU5USVRZIG53bmVhciAiJiN4MjkyNzsiPjwhRU5USVRZIG5lc2VhciAiJiN4MjkyODsiPjwhRU5USVRZIHRvZWEgIiYjeDI5Mjg7Ij48IUVOVElUWSBzZXN3YXIgIiYjeDI5Mjk7Ij48IUVOVElUWSB0b3NhICImI3gyOTI5OyI%2BPCFFTlRJVFkgc3dud2FyICImI3gyOTJBOyI%2BPCFFTlRJVFkgcmFycmMgIiYjeDI5MzM7Ij48IUVOVElUWSBucmFycmMgIiYjeDI5MzM7JiN4MzM4OyI%2BPCFFTlRJVFkgY3VkYXJyciAiJiN4MjkzNTsiPjwhRU5USVRZIGxkY2EgIiYjeDI5MzY7Ij48IUVOVElUWSByZGNhICImI3gyOTM3OyI%2BPCFFTlRJVFkgY3VkYXJybCAiJiN4MjkzODsiPjwhRU5USVRZIGxhcnJwbCAiJiN4MjkzOTsiPjwhRU5USVRZIGN1cmFycm0gIiYjeDI5M0M7Ij48IUVOVElUWSBjdWxhcnJwICImI3gyOTNEOyI%2BPCFFTlRJVFkgcmFycnBsICImI3gyOTQ1OyI%2BPCFFTlRJVFkgaGFycmNpciAiJiN4Mjk0ODsiPjwhRU5USVRZIFVhcnJvY2lyICImI3gyOTQ5OyI%2BPCFFTlRJVFkgbHVyZHNoYXIgIiYjeDI5NEE7Ij48IUVOVElUWSBsZHJ1c2hhciAiJiN4Mjk0QjsiPjwhRU5USVRZIExlZnRSaWdodFZlY3RvciAiJiN4Mjk0RTsiPjwhRU5USVRZIFJpZ2h0VXBEb3duVmVjdG9yICImI3gyOTRGOyI%2BPCFFTlRJVFkgRG93bkxlZnRSaWdodFZlY3RvciAiJiN4Mjk1MDsiPjwhRU5USVRZIExlZnRVcERvd25WZWN0b3IgIiYjeDI5NTE7Ij48IUVOVElUWSBMZWZ0VmVjdG9yQmFyICImI3gyOTUyOyI%2BPCFFTlRJVFkgUmlnaHRWZWN0b3JCYXIgIiYjeDI5NTM7Ij48IUVOVElUWSBSaWdodFVwVmVjdG9yQmFyICImI3gyOTU0OyI%2BPCFFTlRJVFkgUmlnaHREb3duVmVjdG9yQmFyICImI3gyOTU1OyI%2BPCFFTlRJVFkgRG93bkxlZnRWZWN0b3JCYXIgIiYjeDI5NTY7Ij48IUVOVElUWSBEb3duUmlnaHRWZWN0b3JCYXIgIiYjeDI5NTc7Ij48IUVOVElUWSBMZWZ0VXBWZWN0b3JCYXIgIiYjeDI5NTg7Ij48IUVOVElUWSBMZWZ0RG93blZlY3RvckJhciAiJiN4Mjk1OTsiPjwhRU5USVRZIExlZnRUZWVWZWN0b3IgIiYjeDI5NUE7Ij48IUVOVElUWSBSaWdodFRlZVZlY3RvciAiJiN4Mjk1QjsiPjwhRU5USVRZIFJpZ2h0VXBUZWVWZWN0b3IgIiYjeDI5NUM7Ij48IUVOVElUWSBSaWdodERvd25UZWVWZWN0b3IgIiYjeDI5NUQ7Ij48IUVOVElUWSBEb3duTGVmdFRlZVZlY3RvciAiJiN4Mjk1RTsiPjwhRU5USVRZIERvd25SaWdodFRlZVZlY3RvciAiJiN4Mjk1RjsiPjwhRU5USVRZIExlZnRVcFRlZVZlY3RvciAiJiN4Mjk2MDsiPjwhRU5USVRZIExlZnREb3duVGVlVmVjdG9yICImI3gyOTYxOyI%2BPCFFTlRJVFkgbEhhciAiJiN4Mjk2MjsiPjwhRU5USVRZIHVIYXIgIiYjeDI5NjM7Ij48IUVOVElUWSBySGFyICImI3gyOTY0OyI%2BPCFFTlRJVFkgZEhhciAiJiN4Mjk2NTsiPjwhRU5USVRZIGx1cnVoYXIgIiYjeDI5NjY7Ij48IUVOVElUWSBsZHJkaGFyICImI3gyOTY3OyI%2BPCFFTlRJVFkgcnVsdWhhciAiJiN4Mjk2ODsiPjwhRU5USVRZIHJkbGRoYXIgIiYjeDI5Njk7Ij48IUVOVElUWSBsaGFydWwgIiYjeDI5NkE7Ij48IUVOVElUWSBsbGhhcmQgIiYjeDI5NkI7Ij48IUVOVElUWSByaGFydWwgIiYjeDI5NkM7Ij48IUVOVElUWSBscmhhcmQgIiYjeDI5NkQ7Ij48IUVOVElUWSB1ZGhhciAiJiN4Mjk2RTsiPjwhRU5USVRZIFVwRXF1aWxpYnJpdW0gIiYjeDI5NkU7Ij48IUVOVElUWSBkdWhhciAiJiN4Mjk2RjsiPjwhRU5USVRZIFJldmVyc2VVcEVxdWlsaWJyaXVtICImI3gyOTZGOyI%2BPCFFTlRJVFkgUm91bmRJbXBsaWVzICImI3gyOTcwOyI%2BPCFFTlRJVFkgZXJhcnIgIiYjeDI5NzE7Ij48IUVOVElUWSBzaW1yYXJyICImI3gyOTcyOyI%2BPCFFTlRJVFkgbGFycnNpbSAiJiN4Mjk3MzsiPjwhRU5USVRZIHJhcnJzaW0gIiYjeDI5NzQ7Ij48IUVOVElUWSByYXJyYXAgIiYjeDI5NzU7Ij48IUVOVElUWSBsdGxhcnIgIiYjeDI5NzY7Ij48IUVOVElUWSBndHJhcnIgIiYjeDI5Nzg7Ij48IUVOVElUWSBzdWJyYXJyICImI3gyOTc5OyI%2BPCFFTlRJVFkgc3VwbGFyciAiJiN4Mjk3QjsiPjwhRU5USVRZIGxmaXNodCAiJiN4Mjk3QzsiPjwhRU5USVRZIHJmaXNodCAiJiN4Mjk3RDsiPjwhRU5USVRZIHVmaXNodCAiJiN4Mjk3RTsiPjwhRU5USVRZIGRmaXNodCAiJiN4Mjk3RjsiPjwhRU5USVRZIGxvcGFyICImI3gyOTg1OyI%2BPCFFTlRJVFkgcm9wYXIgIiYjeDI5ODY7Ij48IUVOVElUWSBsYnJrZSAiJiN4Mjk4QjsiPjwhRU5USVRZIHJicmtlICImI3gyOThDOyI%2BPCFFTlRJVFkgbGJya3NsdSAiJiN4Mjk4RDsiPjwhRU5USVRZIHJicmtzbGQgIiYjeDI5OEU7Ij48IUVOVElUWSBsYnJrc2xkICImI3gyOThGOyI%2BPCFFTlRJVFkgcmJya3NsdSAiJiN4Mjk5MDsiPjwhRU5USVRZIGxhbmdkICImI3gyOTkxOyI%2BPCFFTlRJVFkgcmFuZ2QgIiYjeDI5OTI7Ij48IUVOVElUWSBscGFybHQgIiYjeDI5OTM7Ij48IUVOVElUWSBycGFyZ3QgIiYjeDI5OTQ7Ij48IUVOVElUWSBndGxQYXIgIiYjeDI5OTU7Ij48IUVOVElUWSBsdHJQYXIgIiYjeDI5OTY7Ij48IUVOVElUWSB2emlnemFnICImI3gyOTlBOyI%2BPCFFTlRJVFkgdmFuZ3J0ICImI3gyOTlDOyI%2BPCFFTlRJVFkgYW5ncnR2YmQgIiYjeDI5OUQ7Ij48IUVOVElUWSBhbmdlICImI3gyOUE0OyI%2BPCFFTlRJVFkgcmFuZ2UgIiYjeDI5QTU7Ij48IUVOVElUWSBkd2FuZ2xlICImI3gyOUE2OyI%2BPCFFTlRJVFkgdXdhbmdsZSAiJiN4MjlBNzsiPjwhRU5USVRZIGFuZ21zZGFhICImI3gyOUE4OyI%2BPCFFTlRJVFkgYW5nbXNkYWIgIiYjeDI5QTk7Ij48IUVOVElUWSBhbmdtc2RhYyAiJiN4MjlBQTsiPjwhRU5USVRZIGFuZ21zZGFkICImI3gyOUFCOyI%2BPCFFTlRJVFkgYW5nbXNkYWUgIiYjeDI5QUM7Ij48IUVOVElUWSBhbmdtc2RhZiAiJiN4MjlBRDsiPjwhRU5USVRZIGFuZ21zZGFnICImI3gyOUFFOyI%2BPCFFTlRJVFkgYW5nbXNkYWggIiYjeDI5QUY7Ij48IUVOVElUWSBiZW1wdHl2ICImI3gyOUIwOyI%2BPCFFTlRJVFkgZGVtcHR5diAiJiN4MjlCMTsiPjwhRU5USVRZIGNlbXB0eXYgIiYjeDI5QjI7Ij48IUVOVElUWSByYWVtcHR5diAiJiN4MjlCMzsiPjwhRU5USVRZIGxhZW1wdHl2ICImI3gyOUI0OyI%2BPCFFTlRJVFkgb2hiYXIgIiYjeDI5QjU7Ij48IUVOVElUWSBvbWlkICImI3gyOUI2OyI%2BPCFFTlRJVFkgb3BhciAiJiN4MjlCNzsiPjwhRU5USVRZIG9wZXJwICImI3gyOUI5OyI%2BPCFFTlRJVFkgb2xjcm9zcyAiJiN4MjlCQjsiPjwhRU5USVRZIG9kc29sZCAiJiN4MjlCQzsiPjwhRU5USVRZIG9sY2lyICImI3gyOUJFOyI%2BPCFFTlRJVFkgb2ZjaXIgIiYjeDI5QkY7Ij48IUVOVElUWSBvbHQgIiYjeDI5QzA7Ij48IUVOVElUWSBvZ3QgIiYjeDI5QzE7Ij48IUVOVElUWSBjaXJzY2lyICImI3gyOUMyOyI%2BPCFFTlRJVFkgY2lyRSAiJiN4MjlDMzsiPjwhRU5USVRZIHNvbGIgIiYjeDI5QzQ7Ij48IUVOVElUWSBic29sYiAiJiN4MjlDNTsiPjwhRU5USVRZIGJveGJveCAiJiN4MjlDOTsiPjwhRU5USVRZIHRyaXNiICImI3gyOUNEOyI%2BPCFFTlRJVFkgcnRyaWx0cmkgIiYjeDI5Q0U7Ij48IUVOVElUWSBMZWZ0VHJpYW5nbGVCYXIgIiYjeDI5Q0Y7Ij48IUVOVElUWSBOb3RMZWZ0VHJpYW5nbGVCYXIgIiYjeDI5Q0Y7JiN4MzM4OyI%2BPCFFTlRJVFkgUmlnaHRUcmlhbmdsZUJhciAiJiN4MjlEMDsiPjwhRU5USVRZIE5vdFJpZ2h0VHJpYW5nbGVCYXIgIiYjeDI5RDA7JiN4MzM4OyI%2BPCFFTlRJVFkgaWluZmluICImI3gyOURDOyI%2BPCFFTlRJVFkgaW5maW50aWUgIiYjeDI5REQ7Ij48IUVOVElUWSBudmluZmluICImI3gyOURFOyI%2BPCFFTlRJVFkgZXBhcnNsICImI3gyOUUzOyI%2BPCFFTlRJVFkgc21lcGFyc2wgIiYjeDI5RTQ7Ij48IUVOVElUWSBlcXZwYXJzbCAiJiN4MjlFNTsiPjwhRU5USVRZIGxvemYgIiYjeDI5RUI7Ij48IUVOVElUWSBibGFja2xvemVuZ2UgIiYjeDI5RUI7Ij48IUVOVElUWSBSdWxlRGVsYXllZCAiJiN4MjlGNDsiPjwhRU5USVRZIGRzb2wgIiYjeDI5RjY7Ij48IUVOVElUWSB4b2RvdCAiJiN4MkEwMDsiPjwhRU5USVRZIGJpZ29kb3QgIiYjeDJBMDA7Ij48IUVOVElUWSB4b3BsdXMgIiYjeDJBMDE7Ij48IUVOVElUWSBiaWdvcGx1cyAiJiN4MkEwMTsiPjwhRU5USVRZIHhvdGltZSAiJiN4MkEwMjsiPjwhRU5USVRZIGJpZ290aW1lcyAiJiN4MkEwMjsiPjwhRU5USVRZIHh1cGx1cyAiJiN4MkEwNDsiPjwhRU5USVRZIGJpZ3VwbHVzICImI3gyQTA0OyI%2BPCFFTlRJVFkgeHNxY3VwICImI3gyQTA2OyI%2BPCFFTlRJVFkgYmlnc3FjdXAgIiYjeDJBMDY7Ij48IUVOVElUWSBxaW50ICImI3gyQTBDOyI%2BPCFFTlRJVFkgaWlpaW50ICImI3gyQTBDOyI%2BPCFFTlRJVFkgZnBhcnRpbnQgIiYjeDJBMEQ7Ij48IUVOVElUWSBjaXJmbmludCAiJiN4MkExMDsiPjwhRU5USVRZIGF3aW50ICImI3gyQTExOyI%2BPCFFTlRJVFkgcnBwb2xpbnQgIiYjeDJBMTI7Ij48IUVOVElUWSBzY3BvbGludCAiJiN4MkExMzsiPjwhRU5USVRZIG5wb2xpbnQgIiYjeDJBMTQ7Ij48IUVOVElUWSBwb2ludGludCAiJiN4MkExNTsiPjwhRU5USVRZIHF1YXRpbnQgIiYjeDJBMTY7Ij48IUVOVElUWSBpbnRsYXJoayAiJiN4MkExNzsiPjwhRU5USVRZIHBsdXNjaXIgIiYjeDJBMjI7Ij48IUVOVElUWSBwbHVzYWNpciAiJiN4MkEyMzsiPjwhRU5USVRZIHNpbXBsdXMgIiYjeDJBMjQ7Ij48IUVOVElUWSBwbHVzZHUgIiYjeDJBMjU7Ij48IUVOVElUWSBwbHVzc2ltICImI3gyQTI2OyI%2BPCFFTlRJVFkgcGx1c3R3byAiJiN4MkEyNzsiPjwhRU5USVRZIG1jb21tYSAiJiN4MkEyOTsiPjwhRU5USVRZIG1pbnVzZHUgIiYjeDJBMkE7Ij48IUVOVElUWSBsb3BsdXMgIiYjeDJBMkQ7Ij48IUVOVElUWSByb3BsdXMgIiYjeDJBMkU7Ij48IUVOVElUWSBDcm9zcyAiJiN4MkEyRjsiPjwhRU5USVRZIHRpbWVzZCAiJiN4MkEzMDsiPjwhRU5USVRZIHRpbWVzYmFyICImI3gyQTMxOyI%2BPCFFTlRJVFkgc21hc2hwICImI3gyQTMzOyI%2BPCFFTlRJVFkgbG90aW1lcyAiJiN4MkEzNDsiPjwhRU5USVRZIHJvdGltZXMgIiYjeDJBMzU7Ij48IUVOVElUWSBvdGltZXNhcyAiJiN4MkEzNjsiPjwhRU5USVRZIE90aW1lcyAiJiN4MkEzNzsiPjwhRU5USVRZIG9kaXYgIiYjeDJBMzg7Ij48IUVOVElUWSB0cmlwbHVzICImI3gyQTM5OyI%2BPCFFTlRJVFkgdHJpbWludXMgIiYjeDJBM0E7Ij48IUVOVElUWSB0cml0aW1lICImI3gyQTNCOyI%2BPCFFTlRJVFkgaXByb2QgIiYjeDJBM0M7Ij48IUVOVElUWSBpbnRwcm9kICImI3gyQTNDOyI%2BPCFFTlRJVFkgYW1hbGcgIiYjeDJBM0Y7Ij48IUVOVElUWSBjYXBkb3QgIiYjeDJBNDA7Ij48IUVOVElUWSBuY3VwICImI3gyQTQyOyI%2BPCFFTlRJVFkgbmNhcCAiJiN4MkE0MzsiPjwhRU5USVRZIGNhcGFuZCAiJiN4MkE0NDsiPjwhRU5USVRZIGN1cG9yICImI3gyQTQ1OyI%2BPCFFTlRJVFkgY3VwY2FwICImI3gyQTQ2OyI%2BPCFFTlRJVFkgY2FwY3VwICImI3gyQTQ3OyI%2BPCFFTlRJVFkgY3VwYnJjYXAgIiYjeDJBNDg7Ij48IUVOVElUWSBjYXBicmN1cCAiJiN4MkE0OTsiPjwhRU5USVRZIGN1cGN1cCAiJiN4MkE0QTsiPjwhRU5USVRZIGNhcGNhcCAiJiN4MkE0QjsiPjwhRU5USVRZIGNjdXBzICImI3gyQTRDOyI%2BPCFFTlRJVFkgY2NhcHMgIiYjeDJBNEQ7Ij48IUVOVElUWSBjY3Vwc3NtICImI3gyQTUwOyI%2BPCFFTlRJVFkgQW5kICImI3gyQTUzOyI%2BPCFFTlRJVFkgT3IgIiYjeDJBNTQ7Ij48IUVOVElUWSBhbmRhbmQgIiYjeDJBNTU7Ij48IUVOVElUWSBvcm9yICImI3gyQTU2OyI%2BPCFFTlRJVFkgb3JzbG9wZSAiJiN4MkE1NzsiPjwhRU5USVRZIGFuZHNsb3BlICImI3gyQTU4OyI%2BPCFFTlRJVFkgYW5kdiAiJiN4MkE1QTsiPjwhRU5USVRZIG9ydiAiJiN4MkE1QjsiPjwhRU5USVRZIGFuZGQgIiYjeDJBNUM7Ij48IUVOVElUWSBvcmQgIiYjeDJBNUQ7Ij48IUVOVElUWSB3ZWRiYXIgIiYjeDJBNUY7Ij48IUVOVElUWSBzZG90ZSAiJiN4MkE2NjsiPjwhRU5USVRZIHNpbWRvdCAiJiN4MkE2QTsiPjwhRU5USVRZIGNvbmdkb3QgIiYjeDJBNkQ7Ij48IUVOVElUWSBuY29uZ2RvdCAiJiN4MkE2RDsmI3gzMzg7Ij48IUVOVElUWSBlYXN0ZXIgIiYjeDJBNkU7Ij48IUVOVElUWSBhcGFjaXIgIiYjeDJBNkY7Ij48IUVOVElUWSBhcEUgIiYjeDJBNzA7Ij48IUVOVElUWSBuYXBFICImI3gyQTcwOyYjeDMzODsiPjwhRU5USVRZIGVwbHVzICImI3gyQTcxOyI%2BPCFFTlRJVFkgcGx1c2UgIiYjeDJBNzI7Ij48IUVOVElUWSBFc2ltICImI3gyQTczOyI%2BPCFFTlRJVFkgQ29sb25lICImI3gyQTc0OyI%2BPCFFTlRJVFkgRXF1YWwgIiYjeDJBNzU7Ij48IUVOVElUWSBlRERvdCAiJiN4MkE3NzsiPjwhRU5USVRZIGRkb3RzZXEgIiYjeDJBNzc7Ij48IUVOVElUWSBlcXVpdkREICImI3gyQTc4OyI%2BPCFFTlRJVFkgbHRjaXIgIiYjeDJBNzk7Ij48IUVOVElUWSBndGNpciAiJiN4MkE3QTsiPjwhRU5USVRZIGx0cXVlc3QgIiYjeDJBN0I7Ij48IUVOVElUWSBndHF1ZXN0ICImI3gyQTdDOyI%2BPCFFTlRJVFkgbGVzICImI3gyQTdEOyI%2BPCFFTlRJVFkgTGVzc1NsYW50RXF1YWwgIiYjeDJBN0Q7Ij48IUVOVElUWSBsZXFzbGFudCAiJiN4MkE3RDsiPjwhRU5USVRZIG5sZXMgIiYjeDJBN0Q7JiN4MzM4OyI%2BPCFFTlRJVFkgTm90TGVzc1NsYW50RXF1YWwgIiYjeDJBN0Q7JiN4MzM4OyI%2BPCFFTlRJVFkgbmxlcXNsYW50ICImI3gyQTdEOyYjeDMzODsiPjwhRU5USVRZIGdlcyAiJiN4MkE3RTsiPjwhRU5USVRZIEdyZWF0ZXJTbGFudEVxdWFsICImI3gyQTdFOyI%2BPCFFTlRJVFkgZ2Vxc2xhbnQgIiYjeDJBN0U7Ij48IUVOVElUWSBuZ2VzICImI3gyQTdFOyYjeDMzODsiPjwhRU5USVRZIE5vdEdyZWF0ZXJTbGFudEVxdWFsICImI3gyQTdFOyYjeDMzODsiPjwhRU5USVRZIG5nZXFzbGFudCAiJiN4MkE3RTsmI3gzMzg7Ij48IUVOVElUWSBsZXNkb3QgIiYjeDJBN0Y7Ij48IUVOVElUWSBnZXNkb3QgIiYjeDJBODA7Ij48IUVOVElUWSBsZXNkb3RvICImI3gyQTgxOyI%2BPCFFTlRJVFkgZ2VzZG90byAiJiN4MkE4MjsiPjwhRU5USVRZIGxlc2RvdG9yICImI3gyQTgzOyI%2BPCFFTlRJVFkgZ2VzZG90b2wgIiYjeDJBODQ7Ij48IUVOVElUWSBsYXAgIiYjeDJBODU7Ij48IUVOVElUWSBsZXNzYXBwcm94ICImI3gyQTg1OyI%2BPCFFTlRJVFkgZ2FwICImI3gyQTg2OyI%2BPCFFTlRJVFkgZ3RyYXBwcm94ICImI3gyQTg2OyI%2BPCFFTlRJVFkgbG5lICImI3gyQTg3OyI%2BPCFFTlRJVFkgbG5lcSAiJiN4MkE4NzsiPjwhRU5USVRZIGduZSAiJiN4MkE4ODsiPjwhRU5USVRZIGduZXEgIiYjeDJBODg7Ij48IUVOVElUWSBsbmFwICImI3gyQTg5OyI%2BPCFFTlRJVFkgbG5hcHByb3ggIiYjeDJBODk7Ij48IUVOVElUWSBnbmFwICImI3gyQThBOyI%2BPCFFTlRJVFkgZ25hcHByb3ggIiYjeDJBOEE7Ij48IUVOVElUWSBsRWcgIiYjeDJBOEI7Ij48IUVOVElUWSBsZXNzZXFxZ3RyICImI3gyQThCOyI%2BPCFFTlRJVFkgZ0VsICImI3gyQThDOyI%2BPCFFTlRJVFkgZ3RyZXFxbGVzcyAiJiN4MkE4QzsiPjwhRU5USVRZIGxzaW1lICImI3gyQThEOyI%2BPCFFTlRJVFkgZ3NpbWUgIiYjeDJBOEU7Ij48IUVOVElUWSBsc2ltZyAiJiN4MkE4RjsiPjwhRU5USVRZIGdzaW1sICImI3gyQTkwOyI%2BPCFFTlRJVFkgbGdFICImI3gyQTkxOyI%2BPCFFTlRJVFkgZ2xFICImI3gyQTkyOyI%2BPCFFTlRJVFkgbGVzZ2VzICImI3gyQTkzOyI%2BPCFFTlRJVFkgZ2VzbGVzICImI3gyQTk0OyI%2BPCFFTlRJVFkgZWxzICImI3gyQTk1OyI%2BPCFFTlRJVFkgZXFzbGFudGxlc3MgIiYjeDJBOTU7Ij48IUVOVElUWSBlZ3MgIiYjeDJBOTY7Ij48IUVOVElUWSBlcXNsYW50Z3RyICImI3gyQTk2OyI%2BPCFFTlRJVFkgZWxzZG90ICImI3gyQTk3OyI%2BPCFFTlRJVFkgZWdzZG90ICImI3gyQTk4OyI%2BPCFFTlRJVFkgZWwgIiYjeDJBOTk7Ij48IUVOVElUWSBlZyAiJiN4MkE5QTsiPjwhRU5USVRZIHNpbWwgIiYjeDJBOUQ7Ij48IUVOVElUWSBzaW1nICImI3gyQTlFOyI%2BPCFFTlRJVFkgc2ltbEUgIiYjeDJBOUY7Ij48IUVOVElUWSBzaW1nRSAiJiN4MkFBMDsiPjwhRU5USVRZIExlc3NMZXNzICImI3gyQUExOyI%2BPCFFTlRJVFkgTm90TmVzdGVkTGVzc0xlc3MgIiYjeDJBQTE7JiN4MzM4OyI%2BPCFFTlRJVFkgR3JlYXRlckdyZWF0ZXIgIiYjeDJBQTI7Ij48IUVOVElUWSBOb3ROZXN0ZWRHcmVhdGVyR3JlYXRlciAiJiN4MkFBMjsmI3gzMzg7Ij48IUVOVElUWSBnbGogIiYjeDJBQTQ7Ij48IUVOVElUWSBnbGEgIiYjeDJBQTU7Ij48IUVOVElUWSBsdGNjICImI3gyQUE2OyI%2BPCFFTlRJVFkgZ3RjYyAiJiN4MkFBNzsiPjwhRU5USVRZIGxlc2NjICImI3gyQUE4OyI%2BPCFFTlRJVFkgZ2VzY2MgIiYjeDJBQTk7Ij48IUVOVElUWSBzbXQgIiYjeDJBQUE7Ij48IUVOVElUWSBsYXQgIiYjeDJBQUI7Ij48IUVOVElUWSBzbXRlICImI3gyQUFDOyI%2BPCFFTlRJVFkgc210ZXMgIiYjeDJBQUM7JiN4RkUwMDsiPjwhRU5USVRZIGxhdGUgIiYjeDJBQUQ7Ij48IUVOVElUWSBsYXRlcyAiJiN4MkFBRDsmI3hGRTAwOyI%2BPCFFTlRJVFkgYnVtcEUgIiYjeDJBQUU7Ij48IUVOVElUWSBwcmUgIiYjeDJBQUY7Ij48IUVOVElUWSBwcmVjZXEgIiYjeDJBQUY7Ij48IUVOVElUWSBQcmVjZWRlc0VxdWFsICImI3gyQUFGOyI%2BPCFFTlRJVFkgbnByZSAiJiN4MkFBRjsmI3gzMzg7Ij48IUVOVElUWSBucHJlY2VxICImI3gyQUFGOyYjeDMzODsiPjwhRU5USVRZIE5vdFByZWNlZGVzRXF1YWwgIiYjeDJBQUY7JiN4MzM4OyI%2BPCFFTlRJVFkgc2NlICImI3gyQUIwOyI%2BPCFFTlRJVFkgc3VjY2VxICImI3gyQUIwOyI%2BPCFFTlRJVFkgU3VjY2VlZHNFcXVhbCAiJiN4MkFCMDsiPjwhRU5USVRZIG5zY2UgIiYjeDJBQjA7JiN4MzM4OyI%2BPCFFTlRJVFkgbnN1Y2NlcSAiJiN4MkFCMDsmI3gzMzg7Ij48IUVOVElUWSBOb3RTdWNjZWVkc0VxdWFsICImI3gyQUIwOyYjeDMzODsiPjwhRU5USVRZIHByRSAiJiN4MkFCMzsiPjwhRU5USVRZIHNjRSAiJiN4MkFCNDsiPjwhRU5USVRZIHBybkUgIiYjeDJBQjU7Ij48IUVOVElUWSBwcmVjbmVxcSAiJiN4MkFCNTsiPjwhRU5USVRZIHNjbkUgIiYjeDJBQjY7Ij48IUVOVElUWSBzdWNjbmVxcSAiJiN4MkFCNjsiPjwhRU5USVRZIHByYXAgIiYjeDJBQjc7Ij48IUVOVElUWSBwcmVjYXBwcm94ICImI3gyQUI3OyI%2BPCFFTlRJVFkgc2NhcCAiJiN4MkFCODsiPjwhRU5USVRZIHN1Y2NhcHByb3ggIiYjeDJBQjg7Ij48IUVOVElUWSBwcm5hcCAiJiN4MkFCOTsiPjwhRU5USVRZIHByZWNuYXBwcm94ICImI3gyQUI5OyI%2BPCFFTlRJVFkgc2NuYXAgIiYjeDJBQkE7Ij48IUVOVElUWSBzdWNjbmFwcHJveCAiJiN4MkFCQTsiPjwhRU5USVRZIFByICImI3gyQUJCOyI%2BPCFFTlRJVFkgU2MgIiYjeDJBQkM7Ij48IUVOVElUWSBzdWJkb3QgIiYjeDJBQkQ7Ij48IUVOVElUWSBzdXBkb3QgIiYjeDJBQkU7Ij48IUVOVElUWSBzdWJwbHVzICImI3gyQUJGOyI%2BPCFFTlRJVFkgc3VwcGx1cyAiJiN4MkFDMDsiPjwhRU5USVRZIHN1Ym11bHQgIiYjeDJBQzE7Ij48IUVOVElUWSBzdXBtdWx0ICImI3gyQUMyOyI%2BPCFFTlRJVFkgc3ViZWRvdCAiJiN4MkFDMzsiPjwhRU5USVRZIHN1cGVkb3QgIiYjeDJBQzQ7Ij48IUVOVElUWSBzdWJFICImI3gyQUM1OyI%2BPCFFTlRJVFkgc3Vic2V0ZXFxICImI3gyQUM1OyI%2BPCFFTlRJVFkgbnN1YkUgIiYjeDJBQzU7JiN4MzM4OyI%2BPCFFTlRJVFkgbnN1YnNldGVxcSAiJiN4MkFDNTsmI3gzMzg7Ij48IUVOVElUWSBzdXBFICImI3gyQUM2OyI%2BPCFFTlRJVFkgc3Vwc2V0ZXFxICImI3gyQUM2OyI%2BPCFFTlRJVFkgbnN1cEUgIiYjeDJBQzY7JiN4MzM4OyI%2BPCFFTlRJVFkgbnN1cHNldGVxcSAiJiN4MkFDNjsmI3gzMzg7Ij48IUVOVElUWSBzdWJzaW0gIiYjeDJBQzc7Ij48IUVOVElUWSBzdXBzaW0gIiYjeDJBQzg7Ij48IUVOVElUWSBzdWJuRSAiJiN4MkFDQjsiPjwhRU5USVRZIHN1YnNldG5lcXEgIiYjeDJBQ0I7Ij48IUVOVElUWSB2c3VibkUgIiYjeDJBQ0I7JiN4RkUwMDsiPjwhRU5USVRZIHZhcnN1YnNldG5lcXEgIiYjeDJBQ0I7JiN4RkUwMDsiPjwhRU5USVRZIHN1cG5FICImI3gyQUNDOyI%2BPCFFTlRJVFkgc3Vwc2V0bmVxcSAiJiN4MkFDQzsiPjwhRU5USVRZIHZzdXBuRSAiJiN4MkFDQzsmI3hGRTAwOyI%2BPCFFTlRJVFkgdmFyc3Vwc2V0bmVxcSAiJiN4MkFDQzsmI3hGRTAwOyI%2BPCFFTlRJVFkgY3N1YiAiJiN4MkFDRjsiPjwhRU5USVRZIGNzdXAgIiYjeDJBRDA7Ij48IUVOVElUWSBjc3ViZSAiJiN4MkFEMTsiPjwhRU5USVRZIGNzdXBlICImI3gyQUQyOyI%2BPCFFTlRJVFkgc3Vic3VwICImI3gyQUQzOyI%2BPCFFTlRJVFkgc3Vwc3ViICImI3gyQUQ0OyI%2BPCFFTlRJVFkgc3Vic3ViICImI3gyQUQ1OyI%2BPCFFTlRJVFkgc3Vwc3VwICImI3gyQUQ2OyI%2BPCFFTlRJVFkgc3VwaHN1YiAiJiN4MkFENzsiPjwhRU5USVRZIHN1cGRzdWIgIiYjeDJBRDg7Ij48IUVOVElUWSBmb3JrdiAiJiN4MkFEOTsiPjwhRU5USVRZIHRvcGZvcmsgIiYjeDJBREE7Ij48IUVOVElUWSBtbGNwICImI3gyQURCOyI%2BPCFFTlRJVFkgRGFzaHYgIiYjeDJBRTQ7Ij48IUVOVElUWSBEb3VibGVMZWZ0VGVlICImI3gyQUU0OyI%2BPCFFTlRJVFkgVmRhc2hsICImI3gyQUU2OyI%2BPCFFTlRJVFkgQmFydiAiJiN4MkFFNzsiPjwhRU5USVRZIHZCYXIgIiYjeDJBRTg7Ij48IUVOVElUWSB2QmFydiAiJiN4MkFFOTsiPjwhRU5USVRZIFZiYXIgIiYjeDJBRUI7Ij48IUVOVElUWSBOb3QgIiYjeDJBRUM7Ij48IUVOVElUWSBiTm90ICImI3gyQUVEOyI%2BPCFFTlRJVFkgcm5taWQgIiYjeDJBRUU7Ij48IUVOVElUWSBjaXJtaWQgIiYjeDJBRUY7Ij48IUVOVElUWSBtaWRjaXIgIiYjeDJBRjA7Ij48IUVOVElUWSB0b3BjaXIgIiYjeDJBRjE7Ij48IUVOVElUWSBuaHBhciAiJiN4MkFGMjsiPjwhRU5USVRZIHBhcnNpbSAiJiN4MkFGMzsiPjwhRU5USVRZIHBhcnNsICImI3gyQUZEOyI%2BPCFFTlRJVFkgbnBhcnNsICImI3gyQUZEOyYjeDIwRTU7Ij48IUVOVElUWSBmZmxpZyAiJiN4RkIwMDsiPjwhRU5USVRZIGZpbGlnICImI3hGQjAxOyI%2BPCFFTlRJVFkgZmxsaWcgIiYjeEZCMDI7Ij48IUVOVElUWSBmZmlsaWcgIiYjeEZCMDM7Ij48IUVOVElUWSBmZmxsaWcgIiYjeEZCMDQ7Ij48IUVOVElUWSBBc2NyICImI3gxRDQ5QzsiPjwhRU5USVRZIENzY3IgIiYjeDFENDlFOyI%2BPCFFTlRJVFkgRHNjciAiJiN4MUQ0OUY7Ij48IUVOVElUWSBHc2NyICImI3gxRDRBMjsiPjwhRU5USVRZIEpzY3IgIiYjeDFENEE1OyI%2BPCFFTlRJVFkgS3NjciAiJiN4MUQ0QTY7Ij48IUVOVElUWSBOc2NyICImI3gxRDRBOTsiPjwhRU5USVRZIE9zY3IgIiYjeDFENEFBOyI%2BPCFFTlRJVFkgUHNjciAiJiN4MUQ0QUI7Ij48IUVOVElUWSBRc2NyICImI3gxRDRBQzsiPjwhRU5USVRZIFNzY3IgIiYjeDFENEFFOyI%2BPCFFTlRJVFkgVHNjciAiJiN4MUQ0QUY7Ij48IUVOVElUWSBVc2NyICImI3gxRDRCMDsiPjwhRU5USVRZIFZzY3IgIiYjeDFENEIxOyI%2BPCFFTlRJVFkgV3NjciAiJiN4MUQ0QjI7Ij48IUVOVElUWSBYc2NyICImI3gxRDRCMzsiPjwhRU5USVRZIFlzY3IgIiYjeDFENEI0OyI%2BPCFFTlRJVFkgWnNjciAiJiN4MUQ0QjU7Ij48IUVOVElUWSBhc2NyICImI3gxRDRCNjsiPjwhRU5USVRZIGJzY3IgIiYjeDFENEI3OyI%2BPCFFTlRJVFkgY3NjciAiJiN4MUQ0Qjg7Ij48IUVOVElUWSBkc2NyICImI3gxRDRCOTsiPjwhRU5USVRZIGZzY3IgIiYjeDFENEJCOyI%2BPCFFTlRJVFkgaHNjciAiJiN4MUQ0QkQ7Ij48IUVOVElUWSBpc2NyICImI3gxRDRCRTsiPjwhRU5USVRZIGpzY3IgIiYjeDFENEJGOyI%2BPCFFTlRJVFkga3NjciAiJiN4MUQ0QzA7Ij48IUVOVElUWSBsc2NyICImI3gxRDRDMTsiPjwhRU5USVRZIG1zY3IgIiYjeDFENEMyOyI%2BPCFFTlRJVFkgbnNjciAiJiN4MUQ0QzM7Ij48IUVOVElUWSBwc2NyICImI3gxRDRDNTsiPjwhRU5USVRZIHFzY3IgIiYjeDFENEM2OyI%2BPCFFTlRJVFkgcnNjciAiJiN4MUQ0Qzc7Ij48IUVOVElUWSBzc2NyICImI3gxRDRDODsiPjwhRU5USVRZIHRzY3IgIiYjeDFENEM5OyI%2BPCFFTlRJVFkgdXNjciAiJiN4MUQ0Q0E7Ij48IUVOVElUWSB2c2NyICImI3gxRDRDQjsiPjwhRU5USVRZIHdzY3IgIiYjeDFENENDOyI%2BPCFFTlRJVFkgeHNjciAiJiN4MUQ0Q0Q7Ij48IUVOVElUWSB5c2NyICImI3gxRDRDRTsiPjwhRU5USVRZIHpzY3IgIiYjeDFENENGOyI%2BPCFFTlRJVFkgQWZyICImI3gxRDUwNDsiPjwhRU5USVRZIEJmciAiJiN4MUQ1MDU7Ij48IUVOVElUWSBEZnIgIiYjeDFENTA3OyI%2BPCFFTlRJVFkgRWZyICImI3gxRDUwODsiPjwhRU5USVRZIEZmciAiJiN4MUQ1MDk7Ij48IUVOVElUWSBHZnIgIiYjeDFENTBBOyI%2BPCFFTlRJVFkgSmZyICImI3gxRDUwRDsiPjwhRU5USVRZIEtmciAiJiN4MUQ1MEU7Ij48IUVOVElUWSBMZnIgIiYjeDFENTBGOyI%2BPCFFTlRJVFkgTWZyICImI3gxRDUxMDsiPjwhRU5USVRZIE5mciAiJiN4MUQ1MTE7Ij48IUVOVElUWSBPZnIgIiYjeDFENTEyOyI%2BPCFFTlRJVFkgUGZyICImI3gxRDUxMzsiPjwhRU5USVRZIFFmciAiJiN4MUQ1MTQ7Ij48IUVOVElUWSBTZnIgIiYjeDFENTE2OyI%2BPCFFTlRJVFkgVGZyICImI3gxRDUxNzsiPjwhRU5USVRZIFVmciAiJiN4MUQ1MTg7Ij48IUVOVElUWSBWZnIgIiYjeDFENTE5OyI%2BPCFFTlRJVFkgV2ZyICImI3gxRDUxQTsiPjwhRU5USVRZIFhmciAiJiN4MUQ1MUI7Ij48IUVOVElUWSBZZnIgIiYjeDFENTFDOyI%2BPCFFTlRJVFkgYWZyICImI3gxRDUxRTsiPjwhRU5USVRZIGJmciAiJiN4MUQ1MUY7Ij48IUVOVElUWSBjZnIgIiYjeDFENTIwOyI%2BPCFFTlRJVFkgZGZyICImI3gxRDUyMTsiPjwhRU5USVRZIGVmciAiJiN4MUQ1MjI7Ij48IUVOVElUWSBmZnIgIiYjeDFENTIzOyI%2BPCFFTlRJVFkgZ2ZyICImI3gxRDUyNDsiPjwhRU5USVRZIGhmciAiJiN4MUQ1MjU7Ij48IUVOVElUWSBpZnIgIiYjeDFENTI2OyI%2BPCFFTlRJVFkgamZyICImI3gxRDUyNzsiPjwhRU5USVRZIGtmciAiJiN4MUQ1Mjg7Ij48IUVOVElUWSBsZnIgIiYjeDFENTI5OyI%2BPCFFTlRJVFkgbWZyICImI3gxRDUyQTsiPjwhRU5USVRZIG5mciAiJiN4MUQ1MkI7Ij48IUVOVElUWSBvZnIgIiYjeDFENTJDOyI%2BPCFFTlRJVFkgcGZyICImI3gxRDUyRDsiPjwhRU5USVRZIHFmciAiJiN4MUQ1MkU7Ij48IUVOVElUWSByZnIgIiYjeDFENTJGOyI%2BPCFFTlRJVFkgc2ZyICImI3gxRDUzMDsiPjwhRU5USVRZIHRmciAiJiN4MUQ1MzE7Ij48IUVOVElUWSB1ZnIgIiYjeDFENTMyOyI%2BPCFFTlRJVFkgdmZyICImI3gxRDUzMzsiPjwhRU5USVRZIHdmciAiJiN4MUQ1MzQ7Ij48IUVOVElUWSB4ZnIgIiYjeDFENTM1OyI%2BPCFFTlRJVFkgeWZyICImI3gxRDUzNjsiPjwhRU5USVRZIHpmciAiJiN4MUQ1Mzc7Ij48IUVOVElUWSBBb3BmICImI3gxRDUzODsiPjwhRU5USVRZIEJvcGYgIiYjeDFENTM5OyI%2BPCFFTlRJVFkgRG9wZiAiJiN4MUQ1M0I7Ij48IUVOVElUWSBFb3BmICImI3gxRDUzQzsiPjwhRU5USVRZIEZvcGYgIiYjeDFENTNEOyI%2BPCFFTlRJVFkgR29wZiAiJiN4MUQ1M0U7Ij48IUVOVElUWSBJb3BmICImI3gxRDU0MDsiPjwhRU5USVRZIEpvcGYgIiYjeDFENTQxOyI%2BPCFFTlRJVFkgS29wZiAiJiN4MUQ1NDI7Ij48IUVOVElUWSBMb3BmICImI3gxRDU0MzsiPjwhRU5USVRZIE1vcGYgIiYjeDFENTQ0OyI%2BPCFFTlRJVFkgT29wZiAiJiN4MUQ1NDY7Ij48IUVOVElUWSBTb3BmICImI3gxRDU0QTsiPjwhRU5USVRZIFRvcGYgIiYjeDFENTRCOyI%2BPCFFTlRJVFkgVW9wZiAiJiN4MUQ1NEM7Ij48IUVOVElUWSBWb3BmICImI3gxRDU0RDsiPjwhRU5USVRZIFdvcGYgIiYjeDFENTRFOyI%2BPCFFTlRJVFkgWG9wZiAiJiN4MUQ1NEY7Ij48IUVOVElUWSBZb3BmICImI3gxRDU1MDsiPjwhRU5USVRZIGFvcGYgIiYjeDFENTUyOyI%2BPCFFTlRJVFkgYm9wZiAiJiN4MUQ1NTM7Ij48IUVOVElUWSBjb3BmICImI3gxRDU1NDsiPjwhRU5USVRZIGRvcGYgIiYjeDFENTU1OyI%2BPCFFTlRJVFkgZW9wZiAiJiN4MUQ1NTY7Ij48IUVOVElUWSBmb3BmICImI3gxRDU1NzsiPjwhRU5USVRZIGdvcGYgIiYjeDFENTU4OyI%2BPCFFTlRJVFkgaG9wZiAiJiN4MUQ1NTk7Ij48IUVOVElUWSBpb3BmICImI3gxRDU1QTsiPjwhRU5USVRZIGpvcGYgIiYjeDFENTVCOyI%2BPCFFTlRJVFkga29wZiAiJiN4MUQ1NUM7Ij48IUVOVElUWSBsb3BmICImI3gxRDU1RDsiPjwhRU5USVRZIG1vcGYgIiYjeDFENTVFOyI%2BPCFFTlRJVFkgbm9wZiAiJiN4MUQ1NUY7Ij48IUVOVElUWSBvb3BmICImI3gxRDU2MDsiPjwhRU5USVRZIHBvcGYgIiYjeDFENTYxOyI%2BPCFFTlRJVFkgcW9wZiAiJiN4MUQ1NjI7Ij48IUVOVElUWSByb3BmICImI3gxRDU2MzsiPjwhRU5USVRZIHNvcGYgIiYjeDFENTY0OyI%2BPCFFTlRJVFkgdG9wZiAiJiN4MUQ1NjU7Ij48IUVOVElUWSB1b3BmICImI3gxRDU2NjsiPjwhRU5USVRZIHZvcGYgIiYjeDFENTY3OyI%2BPCFFTlRJVFkgd29wZiAiJiN4MUQ1Njg7Ij48IUVOVElUWSB4b3BmICImI3gxRDU2OTsiPjwhRU5USVRZIHlvcGYgIiYjeDFENTZBOyI%2BPCFFTlRJVFkgem9wZiAiJiN4MUQ1NkI7Ij4%3D">the URL given by this
|
|
link</a>.</p>
|
|
|
|
<ul class="brief"><li><code title="">-//W3C//DTD XHTML 1.0 Transitional//EN</code></li>
|
|
<li><code title="">-//W3C//DTD XHTML 1.1//EN</code></li>
|
|
<li><code title="">-//W3C//DTD XHTML 1.0 Strict//EN</code></li>
|
|
<li><code title="">-//W3C//DTD XHTML 1.0 Frameset//EN</code></li>
|
|
<li><code title="">-//W3C//DTD XHTML Basic 1.0//EN</code></li>
|
|
<li><code title="">-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN</code></li>
|
|
<li><code title="">-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN</code></li>
|
|
<li><code title="">-//W3C//DTD MathML 2.0//EN</code></li>
|
|
<li><code title="">-//WAPFORUM//DTD XHTML Mobile 1.0//EN</code></li>
|
|
</ul><p>Furthermore, user agents should attempt to retrieve the above
|
|
external entity's content when one of the above public identifiers
|
|
is used, and should not attempt to retrieve any other external
|
|
entity's content.</p>
|
|
|
|
<p class="note">This is not strictly a <a href="#willful-violation" title="willful
|
|
violation">violation</a> of the XML specification, but it does
|
|
contradict the spirit of the XML specification's requirements. This
|
|
is motivated by a desire for user agents to all handle entities in
|
|
an interoperable fashion without requiring any network access for
|
|
handling external subsets. <a href="#refsXML">[XML]</a></p>
|
|
|
|
<p id="scriptTagXML">When an <a href="#xml-parser">XML parser</a> creates a
|
|
<code><a href="#the-script-element">script</a></code> element, it must be marked as being
|
|
<a href="#parser-inserted">"parser-inserted"</a> and its <a href="#force-async">"force-async"</a>
|
|
flag must be unset. If the parser was originally created for the
|
|
<a href="#xml-fragment-parsing-algorithm">XML fragment parsing algorithm</a>, then the element must
|
|
be marked as <a href="#already-started">"already started"</a> also. When the element's
|
|
end tag is parsed, the user agent must <a href="#provide-a-stable-state">provide a stable
|
|
state</a>, and then <a href="#prepare-a-script" title="prepare a script">prepare</a>
|
|
the <code><a href="#the-script-element">script</a></code> element. If this causes there to be a
|
|
<a href="#pending-parsing-blocking-script">pending parsing-blocking script</a>, then the user agent
|
|
must run the following steps:</p>
|
|
|
|
<ol><li><p>Block this instance of the <a href="#xml-parser">XML parser</a>, such
|
|
that the <a href="#event-loop">event loop</a> will not run <a href="#concept-task" title="concept-task">tasks</a> that invoke it.</li>
|
|
|
|
<li><p><a href="#spin-the-event-loop">Spin the event loop</a> until the parser's
|
|
<code><a href="#document">Document</a></code> <a href="#has-no-style-sheet-that-is-blocking-scripts">has no style sheet that is blocking
|
|
scripts</a> and the <a href="#pending-parsing-blocking-script">pending parsing-blocking
|
|
script</a>'s <a href="#ready-to-be-parser-executed">"ready to be parser-executed"</a> flag is
|
|
set.</li>
|
|
|
|
<li><p>Unblock this instance of the <a href="#xml-parser">XML parser</a>, such
|
|
that <a href="#concept-task" title="concept-task">tasks</a> that invoke it can
|
|
again be run.</li>
|
|
|
|
<li><p><a href="#execute-the-script-block" title="execute the script block">Execute</a> the
|
|
<a href="#pending-parsing-blocking-script">pending parsing-blocking script</a>.</li>
|
|
|
|
<li><p>There is no longer a <a href="#pending-parsing-blocking-script">pending parsing-blocking
|
|
script</a>.</li>
|
|
|
|
</ol><p class="note">Since the <code title="dom-document-write"><a href="#dom-document-write">document.write()</a></code> API is not
|
|
available for <a href="#xml-documents">XML documents</a>, much of the complexity in
|
|
the <a href="#html-parser">HTML parser</a> is not needed in the <a href="#xml-parser">XML
|
|
parser</a>.</p>
|
|
|
|
<p>Certain algorithms in this specification <dfn id="feed-the-parser" title="feed the
|
|
parser">spoon-feed the parser</dfn> characters one string at a
|
|
time. In such cases, the <a href="#xml-parser">XML parser</a> must act as it
|
|
would have if faced with a single string consisting of the
|
|
concatenation of all those characters.</p>
|
|
|
|
<p>When an <a href="#xml-parser">XML parser</a> reaches the end of its input, it
|
|
must <a href="#stop-parsing">stop parsing</a>, following the same rules as the
|
|
<a href="#html-parser">HTML parser</a>. An <a href="#xml-parser">XML parser</a> can also be
|
|
<a href="#abort-a-parser" title="abort a parser">aborted</a>, which must again by
|
|
done in the same way as for an <a href="#html-parser">HTML parser</a>.</p>
|
|
|
|
<p>For the purposes of conformance checkers, if a resource is
|
|
determined to be in <a href="#the-xhtml-syntax">the XHTML syntax</a>, then it is an
|
|
<a href="#xml-documents" title="XML documents">XML document</a>.</p>
|
|
|
|
|
|
|
|
<h3 id="serializing-xhtml-fragments"><span class="secno">9.3 </span>Serializing XHTML fragments</h3>
|
|
|
|
<p>The <dfn id="xml-fragment-serialization-algorithm">XML fragment serialization algorithm</dfn> for a
|
|
<code><a href="#document">Document</a></code> or <code><a href="#element">Element</a></code> node either returns a
|
|
fragment of XML that represents that node or raises an
|
|
exception.</p>
|
|
|
|
<p>For <code><a href="#document">Document</a></code>s, the algorithm must return a string in
|
|
the form of a <a href="http://www.w3.org/TR/xml/#sec-well-formed">document
|
|
entity</a>, if none of the error cases below apply.</p>
|
|
|
|
<p>For <code><a href="#element">Element</a></code>s, the algorithm must return a string in
|
|
the form of an <a href="http://www.w3.org/TR/xml/#wf-entities">internal general parsed
|
|
entity</a>, if none of the error cases below apply.</p>
|
|
|
|
<p>In both cases, the string returned must be XML
|
|
namespace-well-formed and must be an isomorphic serialization of all
|
|
of that node's child nodes, in <a href="#tree-order">tree order</a>. User agents
|
|
may adjust prefixes and namespace declarations in the serialization
|
|
(and indeed might be forced to do so in some cases to obtain
|
|
namespace-well-formed XML). User agents may use a combination of
|
|
regular text, character references, and CDATA sections to represent
|
|
<a href="#text-node" title="text node">text nodes</a> in the DOM (and indeed
|
|
might be forced to use representations that don't match the DOM's,
|
|
e.g. if a <code><a href="#cdatasection">CDATASection</a></code> node contains the string "<code title="">]]></code>").</p>
|
|
|
|
<p>For <code><a href="#element">Element</a></code>s, 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. (This doesn't
|
|
apply in the <code><a href="#document">Document</a></code> case.) <a href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a></p>
|
|
|
|
<p>For the purposes of this section, an internal general parsed
|
|
entity is considered XML namespace-well-formed if a document
|
|
consisting of an element with no namespace declarations whose
|
|
contents are the internal general parsed entity would itself be XML
|
|
namespace-well-formed.</p>
|
|
|
|
<p>If any of the following error cases are found in the DOM subtree
|
|
being serialized, then the algorithm must raise an
|
|
<code><a href="#invalid_state_err">INVALID_STATE_ERR</a></code> exception instead of returning a
|
|
string:</p>
|
|
|
|
<ul><li>A <code><a href="#document">Document</a></code> node with no child element nodes.</li>
|
|
|
|
<li>A <code><a href="#documenttype">DocumentType</a></code> node that has an external subset
|
|
public identifier that contains characters that are not matched by
|
|
the XML <code title="">PubidChar</code> production. <a href="#refsXML">[XML]</a></li>
|
|
|
|
<li>A <code><a href="#documenttype">DocumentType</a></code> node that has an external subset
|
|
system identifier that contains both a U+0022 QUOTATION MARK (")
|
|
and a U+0027 APOSTROPHE (') or that contains characters that are
|
|
not matched by the XML <code title="">Char</code> production. <a href="#refsXML">[XML]</a></li>
|
|
|
|
<li>A node with a local name containing a U+003A
|
|
COLON (:).</li>
|
|
<li>A node with a local name that does not match
|
|
the XML <code title="">Name</code> production. <a href="#refsXML">[XML]</a></li>
|
|
<li>An <code><a href="#attr">Attr</a></code> node with no namespace whose local name is
|
|
the lowercase string "<code title="">xmlns</code>". <a href="#refsXMLNS">[XMLNS]</a></li>
|
|
|
|
<li>An <code><a href="#element">Element</a></code> node with two or more attributes with
|
|
the same local name and namespace.</li>
|
|
|
|
<li>An <code><a href="#attr">Attr</a></code> node, <code><a href="#text">Text</a></code> node,
|
|
<code><a href="#cdatasection">CDATASection</a></code> node, <code><a href="#comment-0">Comment</a></code> node, or
|
|
<code><a href="#processinginstruction">ProcessingInstruction</a></code> node whose data contains
|
|
characters that are not matched by the XML <code title="">Char</code> production. <a href="#refsXML">[XML]</a></li>
|
|
|
|
|
|
<li>A <code><a href="#comment-0">Comment</a></code> node whose data contains two adjacent
|
|
U+002D HYPHEN-MINUS characters (-) or ends with such a
|
|
character.</li>
|
|
|
|
<li>A <code><a href="#processinginstruction">ProcessingInstruction</a></code> node whose target name is
|
|
an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">xml</code>".</li>
|
|
|
|
<li>A <code><a href="#processinginstruction">ProcessingInstruction</a></code> node whose target name
|
|
contains a U+003A COLON (:).</li>
|
|
|
|
<li>A <code><a href="#processinginstruction">ProcessingInstruction</a></code> node whose data contains
|
|
the string "<code title="">?></code>".</li>
|
|
|
|
</ul><p class="note">These are the only ways to make a DOM
|
|
unserializable. The DOM enforces all the other XML constraints; for
|
|
example, trying to append two elements to a <code><a href="#document">Document</a></code>
|
|
node will raise a <code><a href="#hierarchy_request_err">HIERARCHY_REQUEST_ERR</a></code> exception.</p>
|
|
|
|
|
|
|
|
<h3 id="parsing-xhtml-fragments"><span class="secno">9.4 </span>Parsing XHTML fragments</h3>
|
|
|
|
<p>The <dfn id="xml-fragment-parsing-algorithm">XML fragment parsing algorithm</dfn> either returns a
|
|
<code><a href="#document">Document</a></code> or raises a <code><a href="#syntax_err">SYNTAX_ERR</a></code> exception.
|
|
Given a string <var title="">input</var> and an optional context
|
|
element <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var>, the
|
|
algorithm is as follows:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Create a new <a href="#xml-parser">XML parser</a>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element,
|
|
<a href="#feed-the-parser">feed the parser</a> 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>
|
|
|
|
<p>A namespace prefix is in scope if the DOM Core <code title="">lookupNamespaceURI()</code> method on the element would
|
|
return a non-null value for that prefix.</p>
|
|
|
|
<p>The default namespace is the namespace for which the DOM Core
|
|
<code title="">isDefaultNamespace()</code> method on the element
|
|
would return true.</p>
|
|
|
|
<p class="note">If there is a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element, no <code title="">DOCTYPE</code> is passed to the parser, and therefore no
|
|
external subset is referenced, and therefore no entities will be
|
|
recognized.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><a href="#feed-the-parser">Feed the parser</a> just created the string <var title="">input</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element,
|
|
<a href="#feed-the-parser">feed the parser</a> just created the string corresponding
|
|
to the end tag of that element.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is an XML well-formedness or XML namespace
|
|
well-formedness error, then raise a <code><a href="#syntax_err">SYNTAX_ERR</a></code>
|
|
exception and abort these steps.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there is a <var title="concept-frag-parse-context"><a href="#concept-frag-parse-context">context</a></var> element, then
|
|
return the child nodes of the root element of the resulting
|
|
<code><a href="#document">Document</a></code>, in <a href="#tree-order">tree order</a>.</p>
|
|
|
|
<p>Otherwise, return the children of the <code><a href="#document">Document</a></code>
|
|
object, in <a href="#tree-order">tree order</a>.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h2 id="rendering"><span class="secno">10 </span>Rendering</h2>
|
|
|
|
<p><i>User agents are not required to present HTML documents in any
|
|
particular way. However, this section provides a set of suggestions
|
|
for rendering HTML documents that, if followed, are likely to lead
|
|
to a user experience that closely resembles the experience intended
|
|
by the documents' authors. So as to avoid confusion regarding the
|
|
normativity of this section, RFC2119 terms have not been used.
|
|
Instead, the term "expected" is used to indicate behavior that will
|
|
lead to this experience. For the purposes of conformance for user
|
|
agents designated as <a href="#renderingUA">supporting the suggested
|
|
default rendering</a>, the term "expected" in this section has the
|
|
same conformance implications as the RFC2119-defined term
|
|
"must".</i></p>
|
|
|
|
|
|
<h3 id="introduction-8"><span class="secno">10.1 </span>Introduction</h3>
|
|
|
|
<p>In general, user agents are expected to support CSS, and many of
|
|
the suggestions in this section are expressed in CSS terms. User
|
|
agents that use other presentation mechanisms can derive their
|
|
expected behavior by translating from the CSS rules given in this
|
|
section.</p>
|
|
|
|
<p>In the absence of style-layer rules to the contrary (e.g. author
|
|
style sheets), user agents are expected to render an element so that
|
|
it conveys to the user the meaning that the element
|
|
<dfn id="represents">represents</dfn>, as described by this specification.</p>
|
|
|
|
<p>The suggestions in this section generally assume a visual output
|
|
medium with a resolution of 96dpi or greater, but HTML is intended
|
|
to apply to multiple media (it is a <i>media-independent</i>
|
|
language). User agent implementors are encouraged to adapt the
|
|
suggestions in this section to their target media.</p>
|
|
|
|
<hr><p>An element is <dfn id="being-rendered">being rendered</dfn> if it is <a href="#in-a-document">in a
|
|
<code>Document</code></a>, either its parent node is itself
|
|
<a href="#being-rendered">being rendered</a> or it is the <code><a href="#document">Document</a></code> node,
|
|
and it is not explicitly excluded from the rendering using either:</p>
|
|
<ul class="brief"><li>the CSS 'display' property's 'none' value, or</li>
|
|
<li>the 'visibility' property's 'collapse' value unless it is being treated as equivalent to the 'hidden' value, or</li>
|
|
<li>some equivalent in other styling languages.</li>
|
|
</ul><p class="note">Just being off-screen does not mean the element is
|
|
not <a href="#being-rendered">being rendered</a>. The presence of the <code title="attr-hidden"><a href="#the-hidden-attribute">hidden</a></code> attribute normally means the
|
|
element is not <a href="#being-rendered">being rendered</a>, though this might be
|
|
overridden by the style sheets.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h3 id="the-css-user-agent-style-sheet-and-presentational-hints"><span class="secno">10.2 </span>The CSS user agent style sheet and presentational hints</h3>
|
|
|
|
<h4 id="introduction-9"><span class="secno">10.2.1 </span>Introduction</h4>
|
|
|
|
<p>The CSS rules given in these subsections are, except where
|
|
otherwise specified, expected to be used as part of the user-agent
|
|
level style sheet defaults for all documents that contain <a href="#html-elements">HTML
|
|
elements</a>.</p>
|
|
|
|
<p>Some rules are intended for the author-level zero-specificity
|
|
presentational hints part of the CSS cascade; these are explicitly
|
|
called out as <dfn id="presentational-hints">presentational hints</dfn>.</p>
|
|
|
|
<p>Some of the rules regarding left and right margins are given here
|
|
as appropriate for elements whose 'direction' property is 'ltr', and
|
|
are expected to be flipped around on elements whose 'direction'
|
|
property is 'rtl'. These are marked "<dfn id="ltr-specific">LTR-specific</dfn>".</p>
|
|
<p id="case-insensitive-selector-exception">Similarly, for the
|
|
purpose of the rules marked "case-insensitive", user agents are
|
|
expected to use <a href="#ascii-case-insensitive">ASCII case-insensitive</a> matching of
|
|
attribute values rather than case-sensitive matching, even for
|
|
attributes in XHTML documents.</p>
|
|
|
|
<p class="note">These markings only affect the handling of attribute
|
|
<em>values</em>, not attribute names or element names.</p>
|
|
|
|
<hr><p>When the text below says that an attribute <var title="">attribute</var> on an element <var title="">element</var>
|
|
<dfn id="maps-to-the-pixel-length-property">maps to the pixel length property</dfn> (or properties) <var title="">properties</var>, it means that if <var title="">element</var> has an attribute <var title="">attribute</var> set, and parsing that attribute's value
|
|
using the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</a>
|
|
doesn't generate an error, then the user agent is expected to use
|
|
the parsed value as a pixel length for a <a href="#presentational-hints" title="presentational
|
|
hints">presentational hint</a> for <var title="">properties</var>.</p>
|
|
|
|
<p>When the text below says that an attribute <var title="">attribute</var> on an element <var title="">element</var>
|
|
<dfn id="maps-to-the-dimension-property">maps to the dimension property</dfn> (or properties) <var title="">properties</var>, it means that if <var title="">element</var> has an attribute <var title="">attribute</var> set, and parsing that attribute's value
|
|
using the <a href="#rules-for-parsing-dimension-values">rules for parsing dimension values</a> doesn't
|
|
generate an error, then the user agent is expected to use the parsed
|
|
dimension as the value for a <a href="#presentational-hints" title="presentational
|
|
hints">presentational hint</a> for <var title="">properties</var>, with the value given as a pixel length if
|
|
the dimension was an integer, and with the value given as a
|
|
percentage if the dimension was a percentage.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="display-types"><span class="secno">10.2.2 </span>Display types</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
[hidden], area, base, basefont, command, datalist, head,
|
|
input[type=hidden], link, menu[type=context], meta, noembed, noframes,
|
|
param, rp, script, source, style, track, title { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
display: none;
|
|
}
|
|
|
|
address, article, aside, blockquote, body, center, dd, dir, div, dl,
|
|
dt, figure, figcaption, footer, form, h1, h2, h3, h4, h5, h6, header,
|
|
hgroup, hr, html, legend, listing, menu, nav, ol, p, plaintext, pre,
|
|
section, summary, ul, xmp { display: block; unicode-bidi: isolate; }
|
|
|
|
table { display: table; unicode-bidi: isolate; }
|
|
caption { display: table-caption; unicode-bidi: isolate; }
|
|
colgroup, colgroup[hidden] { display: table-column-group; unicode-bidi: isolate; }
|
|
col, col[hidden] { display: table-column; unicode-bidi: isolate; }
|
|
thead, thead[hidden] { display: table-header-group; unicode-bidi: isolate; }
|
|
tbody, tbody[hidden] { display: table-row-group; unicode-bidi: isolate; }
|
|
tfoot, tfoot[hidden] { display: table-footer-group; unicode-bidi: isolate; }
|
|
tr, tr[hidden] { display: table-row; unicode-bidi: isolate; }
|
|
td, th, td[hidden], th[hidden] { display: table-cell; unicode-bidi: isolate; }
|
|
|
|
colgroup[hidden], col[hidden], thead[hidden], tbody[hidden],
|
|
tfoot[hidden], tr[hidden], td[hidden], th[hidden] {
|
|
visibility: collapse;
|
|
}
|
|
|
|
li { display: list-item; unicode-bidi: isolate; }
|
|
|
|
ruby { display: ruby; }
|
|
rt { display: ruby-text; }</pre>
|
|
|
|
|
|
|
|
<p>For the purposes of the CSS table model, the <code><a href="#the-col-element">col</a></code>
|
|
element is expected to be treated as if it was present as many times
|
|
as its <code title="attr-col-span"><a href="#attr-col-span">span</a></code> attribute <a href="#rules-for-parsing-non-negative-integers" title="rules for parsing non-negative
|
|
integers">specifies</a>.</p>
|
|
|
|
<p>For the purposes of the CSS table model, the
|
|
<code><a href="#the-colgroup-element">colgroup</a></code> element, if it contains no <code><a href="#the-col-element">col</a></code>
|
|
element, is expected to be treated as if it had as many such
|
|
children as its <code title="attr-colgroup-span"><a href="#attr-colgroup-span">span</a></code>
|
|
attribute <a href="#rules-for-parsing-non-negative-integers" title="rules for parsing non-negative
|
|
integers">specifies</a>.</p>
|
|
|
|
<p>For the purposes of the CSS table model, the <code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code> and <code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">rowspan</a></code> attributes on
|
|
<code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements are expected to <a href="#rules-for-parsing-non-negative-integers" title="rules for parsing non-negative integers">provide</a> the
|
|
<i>special knowledge</i> regarding cells spanning rows and
|
|
columns.</p>
|
|
|
|
<p>For the purposes of the CSS ruby model, runs of children of
|
|
<code><a href="#the-ruby-element">ruby</a></code> elements that are not <code><a href="#the-rt-element">rt</a></code> or
|
|
<code><a href="#the-rp-element">rp</a></code> elements are expected to be wrapped in anonymous
|
|
boxes whose 'display' property has the value 'ruby-base'. <a href="#refsCSSRUBY">[CSSRUBY]</a></p>
|
|
|
|
<p>User agents that do not support correct ruby rendering are
|
|
expected to render parentheses around the text of <code><a href="#the-rt-element">rt</a></code>
|
|
elements in the absence of <code><a href="#the-rp-element">rp</a></code> elements.</p>
|
|
|
|
<p>The user agent is expected to hide <code><a href="#the-noscript-element">noscript</a></code> elements
|
|
for whom <a href="#concept-n-script" title="concept-n-script">scripting is enabled</a>,
|
|
irrespective of CSS rules.</p>
|
|
|
|
<p>In <a href="#html-documents">HTML documents</a>, the user agent is expected to
|
|
hide <code><a href="#the-form-element">form</a></code> elements that are children of
|
|
<code><a href="#the-table-element">table</a></code>, <code><a href="#the-thead-element">thead</a></code>, <code><a href="#the-tbody-element">tbody</a></code>,
|
|
<code><a href="#the-tfoot-element">tfoot</a></code>, or <code><a href="#the-tr-element">tr</a></code> elements, irrespective of CSS
|
|
rules.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="margins-and-padding"><span class="secno">10.2.3 </span>Margins and padding</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
blockquote, dir, dl, figure, listing, menu, ol, p, plaintext,
|
|
pre, ul, xmp {
|
|
margin-top: 1em; margin-bottom: 1em;
|
|
}
|
|
|
|
dir dir, dir dl, dir menu, dir ol, dir ul,
|
|
dl dir, dl dl, dl menu, dl ol, dl ul,
|
|
menu dir, menu dl, menu menu, menu ol, menu ul,
|
|
ol dir, ol dl, ol menu, ol ol, ol ul,
|
|
ul dir, ul dl, ul menu, ul ol, ul ul {
|
|
margin-top: 0; margin-bottom: 0;
|
|
}
|
|
|
|
h1 { margin-top: 0.67em; margin-bottom: 0.67em; }
|
|
h2 { margin-top: 0.83em; margin-bottom: 0.83em; }
|
|
h3 { margin-top: 1.00em; margin-bottom: 1.00em; }
|
|
h4 { margin-top: 1.33em; margin-bottom: 1.33em; }
|
|
h5 { margin-top: 1.67em; margin-bottom: 1.67em; }
|
|
h6 { margin-top: 2.33em; margin-bottom: 2.33em; }
|
|
|
|
dd { margin-left: 40px; } /* <a href="#ltr-specific">LTR-specific</a>: use 'margin-right' for rtl elements */
|
|
dir, menu, ol, ul { padding-left: 40px; } /* <a href="#ltr-specific">LTR-specific</a>: use 'padding-right' for rtl elements */
|
|
blockquote, figure { margin-left: 40px; margin-right: 40px; }
|
|
|
|
table { border-spacing: 2px; border-collapse: separate; }
|
|
td, th { padding: 1px; }</pre>
|
|
|
|
<p>The <code><a href="#the-article-element">article</a></code>, <code><a href="#the-aside-element">aside</a></code>, <code><a href="#the-nav-element">nav</a></code>,
|
|
and <code><a href="#the-section-element">section</a></code> elements are expected to affect the margins
|
|
of <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> elements, based on the nesting depth. If <var title="">x</var> is a selector that matches elements that are either
|
|
<code><a href="#the-article-element">article</a></code>, <code><a href="#the-aside-element">aside</a></code>, <code><a href="#the-nav-element">nav</a></code>, or
|
|
<code><a href="#the-section-element">section</a></code> elements, then the following rules capture what
|
|
is expected:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
<var title="">x</var> h1 { margin-top: 0.83em; margin-bottom: 0.83em; }
|
|
<var title="">x</var> <var title="">x</var> h1 { margin-top: 1.00em; margin-bottom: 1.00em; }
|
|
<var title="">x</var> <var title="">x</var> <var title="">x</var> h1 { margin-top: 1.33em; margin-bottom: 1.33em; }
|
|
<var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> h1 { margin-top: 1.67em; margin-bottom: 1.67em; }
|
|
<var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> h1 { margin-top: 2.33em; margin-bottom: 2.33em; }</pre>
|
|
|
|
<hr><p>For each property in the table below, given a <code><a href="#the-body-element">body</a></code>
|
|
element, the first attribute that exists <a href="#maps-to-the-pixel-length-property">maps to the pixel
|
|
length property</a> on the <code><a href="#the-body-element">body</a></code> element. If none of
|
|
the attributes for a property are found, or if the value of the
|
|
attribute that was found cannot be parsed successfully, then a
|
|
default value of 8px is expected to be used for that property
|
|
instead.</p>
|
|
|
|
<table><thead><tr><th>Property
|
|
<th>Source
|
|
<tbody><tr><td rowspan="3">'margin-top'
|
|
<td><code><a href="#the-body-element">body</a></code> element's <code title="attr-body-marginheight"><a href="#attr-body-marginheight">marginheight</a></code> attribute
|
|
<tr><td>The <code><a href="#the-body-element">body</a></code> element's <a href="#container-frame-element">container frame element</a>'s <code title="attr-iframe-marginheight"><a href="#attr-iframe-marginheight">marginheight</a></code> attribute
|
|
<tr><td><code><a href="#the-body-element">body</a></code> element's <code title="attr-body-topmargin">topmargin</code> attribute
|
|
<tbody><tr><td rowspan="3">'margin-right'
|
|
<td><code><a href="#the-body-element">body</a></code> element's <code title="attr-body-marginwidth"><a href="#attr-body-marginwidth">marginwidth</a></code> attribute
|
|
<tr><td>The <code><a href="#the-body-element">body</a></code> element's <a href="#container-frame-element">container frame element</a>'s <code title="attr-iframe-marginwidth"><a href="#attr-iframe-marginwidth">marginwidth</a></code> attribute
|
|
<tr><td><code><a href="#the-body-element">body</a></code> element's <code title="attr-body-rightmargin">rightmargin</code> attribute
|
|
<tbody><tr><td rowspan="3">'margin-bottom'
|
|
<td><code><a href="#the-body-element">body</a></code> element's <code title="attr-body-marginheight"><a href="#attr-body-marginheight">marginheight</a></code> attribute
|
|
<tr><td>The <code><a href="#the-body-element">body</a></code> element's <a href="#container-frame-element">container frame element</a>'s <code title="attr-iframe-marginheight"><a href="#attr-iframe-marginheight">marginheight</a></code> attribute
|
|
<tr><td><code><a href="#the-body-element">body</a></code> element's <code title="attr-body-bottommargin">bottommargin</code> attribute
|
|
<tbody><tr><td rowspan="3">'margin-left'
|
|
<td><code><a href="#the-body-element">body</a></code> element's <code title="attr-body-marginwidth"><a href="#attr-body-marginwidth">marginwidth</a></code> attribute
|
|
<tr><td>The <code><a href="#the-body-element">body</a></code> element's <a href="#container-frame-element">container frame element</a>'s <code title="attr-iframe-marginwidth"><a href="#attr-iframe-marginwidth">marginwidth</a></code> attribute
|
|
<tr><td><code><a href="#the-body-element">body</a></code> element's <code title="attr-body-leftmargin">leftmargin</code> attribute
|
|
</table><p>If the <code><a href="#the-body-element">body</a></code> element's <code><a href="#document">Document</a></code>'s
|
|
<a href="#browsing-context">browsing context</a> is a <a href="#nested-browsing-context">nested browsing
|
|
context</a>, and the <a href="#browsing-context-container">browsing context container</a> of
|
|
that <a href="#nested-browsing-context">nested browsing context</a> is a <code><a href="#frame">frame</a></code> or
|
|
<code><a href="#the-iframe-element">iframe</a></code> element, then the <dfn id="container-frame-element">container frame
|
|
element</dfn> of the <code><a href="#the-body-element">body</a></code> element is that
|
|
<code><a href="#frame">frame</a></code> or <code><a href="#the-iframe-element">iframe</a></code> element. Otherwise, there
|
|
is no <a href="#container-frame-element">container frame element</a>.</p>
|
|
|
|
<p class="warning">The above requirements imply that a page can
|
|
change the margins of another page (including one from another
|
|
<a href="#origin">origin</a>) using, for example, an
|
|
<code><a href="#the-iframe-element">iframe</a></code>. This is potentially a security risk, as it
|
|
might in some cases allow an attack to contrive a situation in which
|
|
a page is rendered not as the author intended, possibly for the
|
|
purposes of phishing or otherwise misleading the user.</p>
|
|
|
|
<hr><p>If the <code><a href="#document">Document</a></code> has a <a href="#root-element">root element</a>, and
|
|
the <code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> is a
|
|
<a href="#nested-browsing-context">nested browsing context</a>, and the <a href="#browsing-context-container">browsing context
|
|
container</a> of that <a href="#nested-browsing-context">nested browsing context</a> is a
|
|
<code><a href="#frame">frame</a></code> or <code><a href="#the-iframe-element">iframe</a></code> element, and that element
|
|
has a <code title="attr-frames-scrolling">scrolling</code>
|
|
attribute, then the user agent is expected to compare the value of
|
|
the attribute in an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> manner to
|
|
the values in the first column of the following table, and if one of
|
|
them matches, then the user agent is expected to treat that
|
|
attribute as a <a href="#presentational-hints" title="presentational hints">presentational
|
|
hint</a> for the aforementioned root element's 'overflow'
|
|
property, setting it to the value given in the corresponding cell on
|
|
the same row in the second column:</p>
|
|
|
|
<table><thead><tr><th> Attribute value
|
|
<th> 'overflow' value
|
|
<tbody><tr><td><code title="">on</code>
|
|
<td>'scroll'
|
|
<tr><td><code title="">scroll</code>
|
|
<td>'scroll'
|
|
<tr><td><code title="">yes</code>
|
|
<td>'scroll'
|
|
<tr><td><code title="">off</code>
|
|
<td>'hidden'
|
|
<tr><td><code title="">noscroll</code>
|
|
<td>'hidden'
|
|
<tr><td><code title="">no</code>
|
|
<td>'hidden'
|
|
<tr><td><code title="">auto</code>
|
|
<td>'auto'
|
|
</table><hr><p>The <code><a href="#the-table-element">table</a></code> element's <code title="attr-table-cellspacing"><a href="#attr-table-cellspacing">cellspacing</a></code> attribute
|
|
<a href="#maps-to-the-pixel-length-property">maps to the pixel length property</a> 'border-spacing' on the
|
|
element.</p>
|
|
|
|
<p>The <code><a href="#the-table-element">table</a></code> element's <code title="attr-table-cellpadding"><a href="#attr-table-cellpadding">cellpadding</a></code> attribute <a href="#maps-to-the-pixel-length-property" title="maps to the pixel length property">maps to the pixel length
|
|
properties</a> 'padding-top', 'padding-right', 'padding-bottom',
|
|
and 'padding-left' of any <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code>
|
|
elements that have corresponding <a href="#concept-cell" title="concept-cell">cells</a> in the <a href="#concept-table" title="concept-table">table</a> corresponding to the
|
|
<code><a href="#the-table-element">table</a></code> element.</p>
|
|
|
|
<p>The <code><a href="#the-table-element">table</a></code> element's <code title="attr-table-hspace">hspace</code> attribute <a href="#maps-to-the-dimension-property" title="maps
|
|
to the dimension property">maps to the dimension properties</a>
|
|
'margin-left' and 'margin-right' on the <code><a href="#the-table-element">table</a></code>
|
|
element.</p>
|
|
|
|
<p>The <code><a href="#the-table-element">table</a></code> element's <code title="attr-table-vspace">vspace</code> attribute <a href="#maps-to-the-dimension-property" title="maps
|
|
to the dimension property">maps to the dimension properties</a>
|
|
'margin-top' and 'margin-bottom' on the <code><a href="#the-table-element">table</a></code>
|
|
element.</p>
|
|
|
|
<p>The <code><a href="#the-table-element">table</a></code> element's <code title="attr-table-height">height</code> attribute <a href="#maps-to-the-dimension-property">maps to the
|
|
dimension property</a> 'height' on the <code><a href="#the-table-element">table</a></code>
|
|
element.</p>
|
|
|
|
<p>The <code><a href="#the-table-element">table</a></code> element's <code title="attr-table-width"><a href="#attr-table-width">width</a></code> attribute <a href="#maps-to-the-dimension-property">maps to the
|
|
dimension property</a> 'width' on the <code><a href="#the-table-element">table</a></code>
|
|
element.</p>
|
|
|
|
<p>The <code><a href="#the-col-element">col</a></code> element's <code title="attr-col-width"><a href="#attr-col-width">width</a></code> attribute <a href="#maps-to-the-dimension-property">maps to the
|
|
dimension property</a> 'width' on the <code><a href="#the-col-element">col</a></code>
|
|
element.</p>
|
|
|
|
<p>The <code><a href="#the-tr-element">tr</a></code> element's <code title="attr-tr-height">height</code> attribute <a href="#maps-to-the-dimension-property">maps to the
|
|
dimension property</a> 'height' on the <code><a href="#the-tr-element">tr</a></code>
|
|
element.</p>
|
|
|
|
<p>The <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements' <code title="attr-tdth-height"><a href="#attr-tdth-height">height</a></code> attributes <a href="#maps-to-the-dimension-property" title="maps
|
|
to the dimension property">map to the dimension property</a> 'height'
|
|
on the element.</p>
|
|
|
|
<p>The <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements' <code title="attr-tdth-width"><a href="#attr-tdth-width">width</a></code> attributes <a href="#maps-to-the-dimension-property" title="maps
|
|
to the dimension property">map to the dimension property</a> 'width'
|
|
on the element.</p>
|
|
|
|
<hr><p>In <a href="#quirks-mode">quirks mode</a>, the following rules are also
|
|
expected to apply:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
form { margin-bottom: 1em; }</pre>
|
|
|
|
<p>When a <code><a href="#document">Document</a></code> is in <a href="#quirks-mode">quirks mode</a>,
|
|
margins on <a href="#html-elements">HTML elements</a> at the top or bottom of
|
|
<code><a href="#the-body-element">body</a></code>, <code><a href="#the-td-element">td</a></code>, or <code><a href="#the-th-element">th</a></code> elements are
|
|
expected to be collapsed to zero.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="alignment"><span class="secno">10.2.4 </span>Alignment</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
thead, tbody, tfoot, table > tr { vertical-align: middle; }
|
|
tr, td, th { vertical-align: inherit; }
|
|
sub { vertical-align: sub; }
|
|
sup { vertical-align: super; }</pre>
|
|
|
|
<hr><p>The following rules are also expected to apply, as
|
|
<a href="#presentational-hints">presentational hints</a>:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
table[align=left] { float: left; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
table[align=right] { float: right; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
table[align=center], table[align=abscenter],
|
|
table[align=absmiddle], table[align=middle] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
margin-left: auto; margin-right: auto;
|
|
}
|
|
thead[align=absmiddle], tbody[align=absmiddle], tfoot[align=absmiddle],
|
|
tr[align=absmiddle], td[align=absmiddle], th[align=absmiddle] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
text-align: center;
|
|
}
|
|
|
|
caption[align=bottom] { caption-side: bottom; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
p[align=left], h1[align=left], h2[align=left], h3[align=left],
|
|
h4[align=left], h5[align=left], h6[align=left] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
text-align: left;
|
|
}
|
|
p[align=right], h1[align=right], h2[align=right], h3[align=right],
|
|
h4[align=right], h5[align=right], h6[align=right] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
text-align: right;
|
|
}
|
|
p[align=center], h1[align=center], h2[align=center], h3[align=center],
|
|
h4[align=center], h5[align=center], h6[align=center] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
text-align: center;
|
|
}
|
|
p[align=justify], h1[align=justify], h2[align=justify], h3[align=justify],
|
|
h4[align=justify], h5[align=justify], h6[align=justify] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
text-align: justify;
|
|
}
|
|
thead[valign=top], tbody[valign=top], tfoot[valign=top],
|
|
tr[valign=top], td[valign=top], th[valign=top] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: top;
|
|
}
|
|
thead[valign=middle], tbody[valign=middle], tfoot[valign=middle],
|
|
tr[valign=middle], td[valign=middle], th[valign=middle] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: middle;
|
|
}
|
|
thead[valign=bottom], tbody[valign=bottom], tfoot[valign=bottom],
|
|
tr[valign=bottom], td[valign=bottom], th[valign=bottom] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: bottom;
|
|
}
|
|
thead[valign=baseline], tbody[valign=baseline], tfoot[valign=baseline],
|
|
tr[valign=baseline], td[valign=baseline], th[valign=baseline] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: baseline;
|
|
}</pre>
|
|
|
|
<p>The <code><a href="#center">center</a></code> element, the <code><a href="#the-caption-element">caption</a></code> element
|
|
unless specified otherwise below, and the <code><a href="#the-div-element">div</a></code>,
|
|
<code><a href="#the-thead-element">thead</a></code>, <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>,
|
|
<code><a href="#the-tr-element">tr</a></code>, <code><a href="#the-td-element">td</a></code>, and <code><a href="#the-th-element">th</a></code> elements when
|
|
they have an <code title="attr-div-align"><a href="#attr-div-align">align</a></code> attribute
|
|
whose value is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for
|
|
either the string "<code title="">center</code>" or the string
|
|
"<code title="">middle</code>", are expected to center text within
|
|
themselves, as if they had their 'text-align' property set to
|
|
'center' in a <a href="#presentational-hints" title="presentational hints">presentational
|
|
hint</a>, and to <a href="#align-descendants">align descendants</a> to the
|
|
center.</p>
|
|
|
|
<p>The <code><a href="#the-div-element">div</a></code>, <code><a href="#the-caption-element">caption</a></code>, <code><a href="#the-thead-element">thead</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, <code><a href="#the-tr-element">tr</a></code>,
|
|
<code><a href="#the-td-element">td</a></code>, and <code><a href="#the-th-element">th</a></code> elements, when they have an
|
|
<code title="attr-align">align</code> attribute whose value is an
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">left</code>", are expected to left-align text within
|
|
themselves, as if they had their 'text-align' property set to 'left'
|
|
in a <a href="#presentational-hints" title="presentational hints">presentational hint</a>,
|
|
and to <a href="#align-descendants">align descendants</a> to the left.</p>
|
|
|
|
<p>The <code><a href="#the-div-element">div</a></code>, <code><a href="#the-caption-element">caption</a></code>, <code><a href="#the-thead-element">thead</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, <code><a href="#the-tr-element">tr</a></code>,
|
|
<code><a href="#the-td-element">td</a></code>, and <code><a href="#the-th-element">th</a></code> elements, when they have an
|
|
<code title="attr-align">align</code> attribute whose value is an
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">right</code>", are expected to right-align text within
|
|
themselves, as if they had their 'text-align' property set to
|
|
'right' in a <a href="#presentational-hints" title="presentational hints">presentational
|
|
hint</a>, and to <a href="#align-descendants">align descendants</a> to the right.</p>
|
|
|
|
<p>The <code><a href="#the-div-element">div</a></code>, <code><a href="#the-caption-element">caption</a></code>, <code><a href="#the-thead-element">thead</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, <code><a href="#the-tr-element">tr</a></code>,
|
|
<code><a href="#the-td-element">td</a></code>, and <code><a href="#the-th-element">th</a></code> elements, when they have an
|
|
<code title="attr-align">align</code> attribute whose value is an
|
|
<a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">justify</code>", are expected to full-justify text within
|
|
themselves, as if they had their 'text-align' property set to
|
|
'justify' in a <a href="#presentational-hints" title="presentational hints">presentational
|
|
hint</a>, and to <a href="#align-descendants">align descendants</a> to the left.</p>
|
|
|
|
<p>When a user agent is to <dfn id="align-descendants">align descendants</dfn> of a node,
|
|
the user agent is expected to align only those descendants that have
|
|
both their 'margin-left' and 'margin-right' properties computing to
|
|
a value other than 'auto', that are over-constrained and that have
|
|
one of those two margins with a used value forced to a greater
|
|
value, and that do not themselves have an applicable <code title="attr-align">align</code> attribute. When multiple elements
|
|
are to <a href="#align-descendants" title="align descendants">align</a> a particular
|
|
descendant, the most deeply nested such element is expected to
|
|
override the others.</p>
|
|
|
|
<p>User agents are expected to have a rule in their user agent
|
|
stylesheet that matches <code><a href="#the-th-element">th</a></code> elements that have a parent
|
|
node whose computed value for the 'text-align' property is its
|
|
initial value, whose declaration block consists of just a single
|
|
declaration that sets the 'text-align' property to the value
|
|
'center'.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="fonts-and-colors"><span class="secno">10.2.5 </span>Fonts and colors</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
address, cite, dfn, em, i, var { font-style: italic; }
|
|
b, strong, th { font-weight: bold; }
|
|
code, kbd, listing, plaintext, pre, samp, tt, xmp { font-family: monospace; }
|
|
h1 { font-size: 2.00em; font-weight: bold; }
|
|
h2 { font-size: 1.50em; font-weight: bold; }
|
|
h3 { font-size: 1.17em; font-weight: bold; }
|
|
h4 { font-size: 1.00em; font-weight: bold; }
|
|
h5 { font-size: 0.83em; font-weight: bold; }
|
|
h6 { font-size: 0.67em; font-weight: bold; }
|
|
big { font-size: larger; }
|
|
small, sub, sup { font-size: smaller; }
|
|
sub, sup { line-height: normal; }
|
|
|
|
:link { color: blue; }
|
|
:visited { color: purple; }
|
|
mark { background: yellow; color: black; }
|
|
|
|
table, td, th { border-color: gray; }
|
|
thead, tbody, tfoot, tr { border-color: inherit; }
|
|
table[rules=none], table[rules=groups], table[rules=rows],
|
|
table[rules=cols], table[rules=all], table[frame=void],
|
|
table[frame=above], table[frame=below], table[frame=hsides],
|
|
table[frame=lhs], table[frame=rhs], table[frame=vsides],
|
|
table[frame=box], table[frame=border],
|
|
table[rules=none] > tr > td, table[rules=none] > tr > th,
|
|
table[rules=groups] > tr > td, table[rules=groups] > tr > th,
|
|
table[rules=rows] > tr > td, table[rules=rows] > tr > th,
|
|
table[rules=cols] > tr > td, table[rules=cols] > tr > th,
|
|
table[rules=all] > tr > td, table[rules=all] > tr > th,
|
|
table[rules=none] > thead > tr > td, table[rules=none] > thead > tr > th,
|
|
table[rules=groups] > thead > tr > td, table[rules=groups] > thead > tr > th,
|
|
table[rules=rows] > thead > tr > td, table[rules=rows] > thead > tr > th,
|
|
table[rules=cols] > thead > tr > td, table[rules=cols] > thead > tr > th,
|
|
table[rules=all] > thead > tr > td, table[rules=all] > thead > tr > th,
|
|
table[rules=none] > tbody > tr > td, table[rules=none] > tbody > tr > th,
|
|
table[rules=groups] > tbody > tr > td, table[rules=groups] > tbody > tr > th,
|
|
table[rules=rows] > tbody > tr > td, table[rules=rows] > tbody > tr > th,
|
|
table[rules=cols] > tbody > tr > td, table[rules=cols] > tbody > tr > th,
|
|
table[rules=all] > tbody > tr > td, table[rules=all] > tbody > tr > th,
|
|
table[rules=none] > tfoot > tr > td, table[rules=none] > tfoot > tr > th,
|
|
table[rules=groups] > tfoot > tr > td, table[rules=groups] > tfoot > tr > th,
|
|
table[rules=rows] > tfoot > tr > td, table[rules=rows] > tfoot > tr > th,
|
|
table[rules=cols] > tfoot > tr > td, table[rules=cols] > tfoot > tr > th,
|
|
table[rules=all] > tfoot > tr > td, table[rules=all] > tfoot > tr > th { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
border-color: black;
|
|
}</pre>
|
|
|
|
<hr><p>The initial value for the 'color' property is expected to be
|
|
black. The initial value for the 'background-color' property is
|
|
expected to be 'transparent'. The canvas' background is expected to
|
|
be white.</p>
|
|
|
|
<hr><p>The <code><a href="#the-article-element">article</a></code>, <code><a href="#the-aside-element">aside</a></code>, <code><a href="#the-nav-element">nav</a></code>,
|
|
and <code><a href="#the-section-element">section</a></code> elements are expected to affect the font
|
|
size of <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> elements, based on the nesting depth. If
|
|
<var title="">x</var> is a selector that matches elements that are
|
|
either <code><a href="#the-article-element">article</a></code>, <code><a href="#the-aside-element">aside</a></code>, <code><a href="#the-nav-element">nav</a></code>,
|
|
or <code><a href="#the-section-element">section</a></code> elements, then the following rules capture
|
|
what is expected:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
<var title="">x</var> h1 { font-size: 1.50em; }
|
|
<var title="">x</var> <var title="">x</var> h1 { font-size: 1.17em; }
|
|
<var title="">x</var> <var title="">x</var> <var title="">x</var> h1 { font-size: 1.00em; }
|
|
<var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> h1 { font-size: 0.83em; }
|
|
<var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> <var title="">x</var> h1 { font-size: 0.67em; }</pre>
|
|
|
|
<hr><p>When a <code><a href="#the-body-element">body</a></code>, <code><a href="#the-table-element">table</a></code>, <code><a href="#the-thead-element">thead</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, <code><a href="#the-tr-element">tr</a></code>,
|
|
<code><a href="#the-td-element">td</a></code>, or <code><a href="#the-th-element">th</a></code> element has a <code title="attr-background"><a href="#attr-background">background</a></code> attribute set to a
|
|
non-empty value, the new value is expected to be <a href="#resolve-a-url" title="resolve a url">resolved</a> relative to the element, and
|
|
if this is successful, the user agent is expected to treat the
|
|
attribute as a <a href="#presentational-hints" title="presentational hints">presentational
|
|
hint</a> setting the element's 'background-image' property to the
|
|
resulting <a href="#absolute-url">absolute URL</a>.</p>
|
|
|
|
<p>When a <code><a href="#the-body-element">body</a></code>, <code><a href="#the-table-element">table</a></code>, <code><a href="#the-thead-element">thead</a></code>,
|
|
<code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, <code><a href="#the-tr-element">tr</a></code>,
|
|
<code><a href="#the-td-element">td</a></code>, or <code><a href="#the-th-element">th</a></code> element has a <code title="">bgcolor</code> attribute set, the new value is expected to
|
|
be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy color
|
|
value</a>, and if that does not return an error, the user agent
|
|
is expected to treat the attribute as a <a href="#presentational-hints" title="presentational
|
|
hints">presentational hint</a> setting the element's
|
|
'background-color' property to the resulting color.</p>
|
|
|
|
<p>When a <code><a href="#the-body-element">body</a></code> element has a <code title="attr-body-text"><a href="#attr-body-text">text</a></code> attribute, its value is expected
|
|
to be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy color
|
|
value</a>, and if that does not return an error, the user
|
|
agent is expected to treat the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> setting the
|
|
element's 'color' property to the resulting color.</p>
|
|
|
|
<p>When a <code><a href="#the-body-element">body</a></code> element has a <code title="attr-body-link"><a href="#attr-body-link">link</a></code> attribute, its value is expected
|
|
to be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy color
|
|
value</a>, and if that does not return an error, the user agent
|
|
is expected to treat the attribute as a <a href="#presentational-hints" title="presentational
|
|
hints">presentational hint</a> setting the 'color' property of
|
|
any element in the <code><a href="#document">Document</a></code> matching the ':link'
|
|
pseudo-class to the resulting color.</p>
|
|
|
|
<p>When a <code><a href="#the-body-element">body</a></code> element has a <code title="attr-body-vlink"><a href="#attr-body-vlink">vlink</a></code> attribute, its value is
|
|
expected to be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy
|
|
color value</a>, and if that does not return an error, the user
|
|
agent is expected to treat the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> setting the
|
|
'color' property of any element in the <code><a href="#document">Document</a></code>
|
|
matching the ':visited' pseudo-class to the resulting color.</p>
|
|
|
|
<p>When a <code><a href="#the-body-element">body</a></code> element has a <code title="attr-body-alink"><a href="#attr-body-alink">alink</a></code> attribute, its value is
|
|
expected to be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy
|
|
color value</a>, and if that does not return an error, the user
|
|
agent is expected to treat the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> setting the
|
|
'color' property of any element in the <code><a href="#document">Document</a></code>
|
|
matching the ':active' pseudo-class and either the ':link'
|
|
pseudo-class or the ':visited' pseudo-class to the resulting
|
|
color.</p>
|
|
|
|
<p>When a <code><a href="#the-table-element">table</a></code> element has a <code title="attr-table-bordercolor">bordercolor</code> attribute, its
|
|
value is expected to be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a
|
|
legacy color value</a>, and if that does not return an error, the
|
|
user agent is expected to treat the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> setting the
|
|
element's 'border-top-color', 'border-right-color',
|
|
'border-bottom-color', and 'border-right-color' properties to the
|
|
resulting color.</p>
|
|
|
|
<hr><p>When a <code><a href="#font">font</a></code> element has a <code title="attr-font-color">color</code> attribute, its value is
|
|
expected to be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy
|
|
color value</a>, and if that does not return an error, the user
|
|
agent is expected to treat the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> setting the
|
|
element's 'color' property to the resulting color.</p>
|
|
|
|
<p>When a <code><a href="#font">font</a></code> element has a <code title="attr-font-face">face</code> attribute, the user agent is
|
|
expected to treat the attribute as a <a href="#presentational-hints" title="presentational
|
|
hints">presentational hint</a> setting the element's
|
|
'font-family' property to the attribute's value.</p>
|
|
|
|
|
|
<p>When a <code><a href="#font">font</a></code> element has a <code title="attr-font-size">size</code> attribute, the user agent is
|
|
expected to use the following steps to treat the attribute as a
|
|
<a href="#presentational-hints" title="presentational hints">presentational hint</a>
|
|
setting the element's 'font-size' property:</p>
|
|
|
|
<ol><li><p>Let <var title="">input</var> be the attribute's
|
|
value.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
|
|
string.</li>
|
|
|
|
<li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
|
|
|
|
<li><p>If <var title="">position</var> is past the end of <var title="">input</var>, there is no <a href="#presentational-hints" title="presentational
|
|
hints">presentational hint</a>. Abort these steps.</li>
|
|
|
|
<li><p>If the character at <var title="">position</var> is a U+002B
|
|
PLUS SIGN character (+), then let <var title="">mode</var> be
|
|
<i>relative-plus</i>, and advance <var title="">position</var> to
|
|
the next character. Otherwise, if the character at <var title="">position</var> is a U+002D HYPHEN-MINUS character (-),
|
|
then let <var title="">mode</var> be <i>relative-minus</i>, and
|
|
advance <var title="">position</var> to the next
|
|
character. Otherwise, let <var title="">mode</var> be
|
|
<i>absolute</i>.</li>
|
|
|
|
<li><p><a href="#collect-a-sequence-of-characters">Collect a sequence of characters</a> in the range
|
|
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and let the
|
|
resulting sequence be <var title="">digits</var>.</li>
|
|
|
|
<li><p>If <var title="">digits</var> is the empty string, there is
|
|
no <a href="#presentational-hints" title="presentational hints">presentational
|
|
hint</a>. Abort these steps.</li>
|
|
|
|
<li><p>Interpret <var title="">digits</var> as a base-ten
|
|
integer. Let <var title="">value</var> be the resulting
|
|
number.</li>
|
|
|
|
<li>
|
|
|
|
|
|
|
|
<p>If <var title="">mode</var> is <i>relative-plus</i>, then
|
|
increment <var title="">value</var> by 3. If <var title="">mode</var> is <i>relative-minus</i>, then let <var title="">value</var> be the result of subtracting <var title="">value</var> from 3.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If <var title="">value</var> is greater than 7, let it be
|
|
7.</li>
|
|
|
|
<li><p>If <var title="">value</var> is less than 1, let it be
|
|
1.</li>
|
|
|
|
<li>
|
|
|
|
<p>Set 'font-size' to the keyword corresponding to the value of
|
|
<var title="">value</var> according to the following table:</p>
|
|
|
|
<table><thead><tr><th><var title="">value</var>
|
|
<th>'font-size' keyword
|
|
<th>Notes
|
|
<tbody><tr><td>1
|
|
<td>xx-small
|
|
<td>
|
|
<tr><td>2
|
|
<td>small
|
|
<td>
|
|
<tr><td>3
|
|
<td>medium
|
|
<td>
|
|
<tr><td>4
|
|
<td>large
|
|
<td>
|
|
<tr><td>5
|
|
<td>x-large
|
|
<td>
|
|
<tr><td>6
|
|
<td>xx-large
|
|
<td>
|
|
<tr><td>7
|
|
<td>xxx-large
|
|
<td><i>see below</i>
|
|
</table><p>The 'xxx-large' value is a non-CSS value used here to
|
|
indicate a font size one "step" larger than 'xx-large'.</p>
|
|
|
|
</li>
|
|
|
|
</ol></div><div class="impl">
|
|
|
|
<h4 id="punctuation-and-decorations"><span class="secno">10.2.6 </span>Punctuation and decorations</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
:link, :visited, ins, u { text-decoration: underline; }
|
|
abbr[title], acronym[title] { text-decoration: dotted underline; }
|
|
del, s, strike { text-decoration: line-through; }
|
|
blink { text-decoration: blink; }
|
|
|
|
:focus { outline: auto; }
|
|
|
|
q:before { content: open-quote; }
|
|
q:after { content: close-quote; }
|
|
|
|
br { content: '\A'; white-space: pre; }
|
|
|
|
nobr { white-space: nowrap; }
|
|
listing, plaintext, pre, xmp { white-space: pre; }
|
|
textarea { white-space: pre-wrap; }
|
|
|
|
ol { list-style-type: decimal; }
|
|
|
|
dir, menu, ul {
|
|
list-style-type: disc;
|
|
}
|
|
|
|
dir dl, dir menu, dir ul,
|
|
menu dl, menu menu, menu ul,
|
|
ol dl, ol menu, ol ul,
|
|
ul dl, ul menu, ul ul {
|
|
list-style-type: circle;
|
|
}
|
|
|
|
dir dir dl, dir dir menu, dir dir ul,
|
|
dir menu dl, dir menu menu, dir menu ul,
|
|
dir ol dl, dir ol menu, dir ol ul,
|
|
dir ul dl, dir ul menu, dir ul ul,
|
|
menu dir dl, menu dir menu, menu dir ul,
|
|
menu menu dl, menu menu menu, menu menu ul,
|
|
menu ol dl, menu ol menu, menu ol ul,
|
|
menu ul dl, menu ul menu, menu ul ul,
|
|
ol dir dl, ol dir menu, ol dir ul,
|
|
ol menu dl, ol menu menu, ol menu ul,
|
|
ol ol dl, ol ol menu, ol ol ul,
|
|
ol ul dl, ol ul menu, ol ul ul,
|
|
ul dir dl, ul dir menu, ul dir ul,
|
|
ul menu dl, ul menu menu, ul menu ul,
|
|
ul ol dl, ul ol menu, ul ol ul,
|
|
ul ul dl, ul ul menu, ul ul ul {
|
|
list-style-type: square;
|
|
}
|
|
|
|
table { border-style: outset; }
|
|
td, th { border-style: inset; }
|
|
|
|
:ltr { direction: ltr; }
|
|
:rtl { direction: rtl; }
|
|
[dir] { unicode-bidi: embed; }
|
|
bdi, output, [dir=auto] { unicode-bidi: isolate; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
bdo, bdo[dir] { unicode-bidi: bidi-override; }
|
|
bdo[dir=auto] { unicode-bidi: bidi-override isolate; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
textarea[dir=auto], pre[dir=auto] { unicode-bidi: plaintext; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */</pre>
|
|
|
|
<p>Rules setting the 'quotes' property appropriately for the locales
|
|
and languages understood by the user are expected to be present.</p>
|
|
|
|
<p>User agents are expected to
|
|
support the 'clear' property on inline elements (in order to render
|
|
<code><a href="#the-br-element">br</a></code> elements with <code title="attr-br-clear"><a href="#attr-br-clear">clear</a></code> attributes) in the manner
|
|
described in the non-normative note to this effect in CSS2.1.</p>
|
|
|
|
|
|
<hr><p id="decohints">The following rules are also expected to apply, as
|
|
<a href="#presentational-hints">presentational hints</a>:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
td[nowrap], th[nowrap] { white-space: nowrap; }
|
|
pre[wrap] { white-space: pre-wrap; }
|
|
|
|
br[clear=left] { clear: left; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
br[clear=right] { clear: right; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
br[clear=all], br[clear=both] { clear: both; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
|
|
ol[type=1], li[type=1] { list-style-type: decimal; }
|
|
ol[type=a], li[type=a] { list-style-type: lower-alpha; }
|
|
ol[type=A], li[type=A] { list-style-type: upper-alpha; }
|
|
ol[type=i], li[type=i] { list-style-type: lower-roman; }
|
|
ol[type=I], li[type=I] { list-style-type: upper-roman; }
|
|
ul[type=disc], li[type=disc] { list-style-type: disc; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
ul[type=circle], li[type=circle] { list-style-type: circle; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
ul[type=square], li[type=square] { list-style-type: square; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
|
|
table[rules=none], table[rules=groups], table[rules=rows],
|
|
table[rules=cols], table[rules=all] {
|
|
border-style: none;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
table[frame=void] { border-style: hidden hidden hidden hidden; }
|
|
table[frame=above] { border-style: solid hidden hidden hidden; }
|
|
table[frame=below] { border-style: hidden hidden solid hidden; }
|
|
table[frame=hsides] { border-style: solid hidden solid hidden; }
|
|
table[frame=lhs] { border-style: hidden hidden hidden solid; }
|
|
table[frame=rhs] { border-style: hidden solid hidden hidden; }
|
|
table[frame=vsides] { border-style: hidden solid hidden solid; }
|
|
table[frame=box],
|
|
table[frame=border] { border-style: solid solid solid solid; }
|
|
|
|
table[rules=none] > tr > td, table[rules=none] > tr > th,
|
|
table[rules=none] > thead > tr > td, table[rules=none] > thead > tr > th,
|
|
table[rules=none] > tbody > tr > td, table[rules=none] > tbody > tr > th,
|
|
table[rules=none] > tfoot > tr > td, table[rules=none] > tfoot > tr > th,
|
|
table[rules=groups] > tr > td, table[rules=groups] > tr > th,
|
|
table[rules=groups] > thead > tr > td, table[rules=groups] > thead > tr > th,
|
|
table[rules=groups] > tbody > tr > td, table[rules=groups] > tbody > tr > th,
|
|
table[rules=groups] > tfoot > tr > td, table[rules=groups] > tfoot > tr > th,
|
|
table[rules=rows] > tr > td, table[rules=rows] > tr > th,
|
|
table[rules=rows] > thead > tr > td, table[rules=rows] > thead > tr > th,
|
|
table[rules=rows] > tbody > tr > td, table[rules=rows] > tbody > tr > th,
|
|
table[rules=rows] > tfoot > tr > td, table[rules=rows] > tfoot > tr > th {
|
|
border-style: none;
|
|
}
|
|
|
|
table[rules=groups] > colgroup, table[rules=groups] > thead,
|
|
table[rules=groups] > tbody, table[rules=groups] > tfoot {
|
|
border-style: solid;
|
|
}
|
|
|
|
table[rules=rows] > tr, table[rules=rows] > thead > tr,
|
|
table[rules=rows] > tbody > tr, table[rules=rows] > tfoot > tr {
|
|
border-style: solid;
|
|
}
|
|
|
|
table[rules=cols] > tr > td, table[rules=cols] > tr > th,
|
|
table[rules=cols] > thead > tr > td, table[rules=cols] > thead > tr > th,
|
|
table[rules=cols] > tbody > tr > td, table[rules=cols] > tbody > tr > th,
|
|
table[rules=cols] > tfoot > tr > td, table[rules=cols] > tfoot > tr > th {
|
|
border-style: none solid none solid;
|
|
}
|
|
|
|
table[rules=all] > tr > td, table[rules=all] > tr > th,
|
|
table[rules=all] > thead > tr > td, table[rules=all] > thead > tr > th,
|
|
table[rules=all] > tbody > tr > td, table[rules=all] > tbody > tr > th,
|
|
table[rules=all] > tfoot > tr > td, table[rules=all] > tfoot > tr > th {
|
|
border-style: solid;
|
|
}
|
|
|
|
table[border] > tr > td, table[border] > tr > th,
|
|
table[border] > thead > tr > td, table[border] > thead > tr > th,
|
|
table[border] > tbody > tr > td, table[border] > tbody > tr > th,
|
|
table[border] > tfoot > tr > td, table[border] > tfoot > tr > th {
|
|
border-width: 1px;
|
|
}</pre>
|
|
|
|
<p>When rendering <code><a href="#the-li-element">li</a></code> elements, user agents are expected
|
|
to use the <a href="#ordinal-value">ordinal value</a> of the <code><a href="#the-li-element">li</a></code> element
|
|
to render the counter in the list item marker.</p>
|
|
|
|
<p>The <code><a href="#the-table-element">table</a></code> element's <code title="attr-table-border"><a href="#attr-table-border">border</a></code> attribute <a href="#maps-to-the-pixel-length-property" title="maps
|
|
to the pixel length property">maps to the pixel length
|
|
properties</a> 'border-top-width', 'border-right-width',
|
|
'border-bottom-width', 'border-left-width' on the element. If the
|
|
attribute is present but parsing the attribute's value using the
|
|
<a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</a> generates an
|
|
error, a default value of 1px is expected to be used for that
|
|
property instead.</p>
|
|
|
|
<p>The <code><a href="#the-wbr-element">wbr</a></code> element is expected to override the
|
|
'white-space' property and always provide a line-breaking
|
|
opportunity.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="resetting-rules-for-inherited-properties"><span class="secno">10.2.7 </span>Resetting rules for inherited properties</h4>
|
|
|
|
<p>The following rules are also expected to be in play, resetting
|
|
certain properties to block inheritance by default.</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
table, input, select, option, optgroup, button, textarea, keygen {
|
|
text-indent: initial;
|
|
}</pre>
|
|
|
|
|
|
<p>In <a href="#quirks-mode">quirks mode</a>, the following rules are also
|
|
expected to apply:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
table {
|
|
font-weight: initial;
|
|
font-style: initial;
|
|
font-variant: initial;
|
|
font-size: initial;
|
|
line-height: initial;
|
|
white-space: initial;
|
|
text-align: initial;
|
|
}
|
|
|
|
input { box-sizing: border-box; }</pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-hr-element-0"><span class="secno">10.2.8 </span>The <code><a href="#the-hr-element">hr</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
hr { color: gray; border-style: inset; border-width: 1px; margin: 0.5em auto; }</pre>
|
|
|
|
<p>The following rules are also expected to apply, as
|
|
<a href="#presentational-hints">presentational hints</a>:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
hr[align=left] { margin-left: 0; margin-right: auto; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
hr[align=right] { margin-left: auto; margin-right: 0; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
hr[align=center] { margin-left: auto; margin-right: auto; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
hr[color], hr[noshade] { border-style: solid; }</pre>
|
|
|
|
<p>If an <code><a href="#the-hr-element">hr</a></code> element has either a <code title="attr-hr-color"><a href="#attr-hr-color">color</a></code> attribute or a <code title="attr-hr-noshade"><a href="#attr-hr-noshade">noshade</a></code> attribute, and furthermore
|
|
also has a <code title="attr-hr-size"><a href="#attr-hr-size">size</a></code> attribute, and
|
|
parsing that attribute's value using the <a href="#rules-for-parsing-non-negative-integers">rules for parsing
|
|
non-negative integers</a> doesn't generate an error, then the
|
|
user agent is expected to use the parsed value divided by two as a
|
|
pixel length for <a href="#presentational-hints">presentational hints</a> for the properties
|
|
'border-top-width', 'border-right-width', 'border-bottom-width', and
|
|
'border-left-width' on the element.</p>
|
|
|
|
<p>Otherwise, if an <code><a href="#the-hr-element">hr</a></code> element has neither a <code title="attr-hr-color"><a href="#attr-hr-color">color</a></code> attribute nor a <code title="attr-hr-noshade"><a href="#attr-hr-noshade">noshade</a></code> attribute, but does have a
|
|
<code title="attr-hr-size"><a href="#attr-hr-size">size</a></code> attribute, and parsing that
|
|
attribute's value using the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative
|
|
integers</a> doesn't generate an error, then: if the parsed value
|
|
is one, then the user agent is expected to use the attribute as a
|
|
<a href="#presentational-hints" title="presentational hints">presentational hint</a>
|
|
setting the element's 'border-bottom-width' to 0; otherwise, if the
|
|
parsed value is greater than one, then the user agent is expected to
|
|
use the parsed value minus two as a pixel length for
|
|
<a href="#presentational-hints">presentational hints</a> for the 'height' property on the
|
|
element.</p>
|
|
|
|
<p>The <code title="attr-hr-width"><a href="#attr-hr-width">width</a></code> attribute on an
|
|
<code><a href="#the-hr-element">hr</a></code> element <a href="#maps-to-the-dimension-property">maps to the dimension property</a>
|
|
'width' on the element.</p>
|
|
|
|
<p>When an <code><a href="#the-hr-element">hr</a></code> element has a <code title="attr-hr-color"><a href="#attr-hr-color">color</a></code> attribute, its value is expected
|
|
to be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy color
|
|
value</a>, and if that does not return an error, the user agent
|
|
is expected to treat the attribute as a <a href="#presentational-hints" title="presentational
|
|
hints">presentational hint</a> setting the element's 'color'
|
|
property to the resulting color.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-fieldset-element-0"><span class="secno">10.2.9 </span>The <code><a href="#the-fieldset-element">fieldset</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
fieldset {
|
|
margin-left: 2px; margin-right: 2px;
|
|
border: groove 2px ThreeDFace;
|
|
padding: 0.35em 0.625em 0.75em;
|
|
}</pre>
|
|
|
|
<p>The <code><a href="#the-fieldset-element">fieldset</a></code> element is expected to establish a new
|
|
block formatting context.</p>
|
|
|
|
<p>If the <code><a href="#the-fieldset-element">fieldset</a></code> element has a child that matches the
|
|
conditions in the list below, then the first such child is the
|
|
<code><a href="#the-fieldset-element">fieldset</a></code> element's <dfn id="rendered-legend">rendered legend</dfn>:</p>
|
|
|
|
<ul class="brief"><li>The child is a <code><a href="#the-legend-element">legend</a></code> element.</li>
|
|
|
|
<li>The child is not out-of-flow (e.g. not absolutely positioned or floated).</li>
|
|
|
|
<li>The child is generating a box (e.g. it is not 'display:none').</li>
|
|
|
|
</ul><p>A <code><a href="#the-fieldset-element">fieldset</a></code> element's <a href="#rendered-legend">rendered legend</a>,
|
|
if any, is expected to be rendered over the top border edge of the
|
|
<code><a href="#the-fieldset-element">fieldset</a></code> element as a 'block' box (overriding any
|
|
explicit 'display' value). In the absence of an explicit width, the
|
|
box should shrink-wrap. If the <code><a href="#the-legend-element">legend</a></code> element in
|
|
question has an <code title="attr-legend-align"><a href="#attr-legend-align">align</a></code>
|
|
attribute, and its value is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a>
|
|
match for one of the strings in the first column of the following
|
|
table, then the <code><a href="#the-legend-element">legend</a></code> is expected to be rendered
|
|
horizontally aligned over the border edge in the position given in
|
|
the corresponding cell on the same row in the second column. If the
|
|
attribute is absent or has a value that doesn't match any of the
|
|
cases in the table, then the position is expected to be on the right
|
|
if the 'direction' property on this element has a computed value of
|
|
'rtl', and on the left otherwise.</p>
|
|
|
|
<table><thead><tr><th>Attribute value
|
|
<th>Alignment position
|
|
<tbody><tr><td><code title="">left</code>
|
|
<td>On the left
|
|
<tr><td><code title="">right</code>
|
|
<td>On the right
|
|
<tr><td><code title="">center</code>
|
|
<td>In the middle
|
|
</table></div><div class="impl">
|
|
|
|
<h3 id="replaced-elements"><span class="secno">10.3 </span>Replaced elements</h3>
|
|
|
|
<h4 id="embedded-content-2"><span class="secno">10.3.1 </span>Embedded content</h4>
|
|
|
|
<p>The <code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, and
|
|
<code><a href="#the-video-element">video</a></code> elements are expected to be treated as replaced
|
|
elements.</p>
|
|
|
|
<p>A <code><a href="#the-canvas-element">canvas</a></code> element that <a href="#represents">represents</a>
|
|
<a href="#embedded-content">embedded content</a> is expected to be treated as a
|
|
replaced element. Other <code><a href="#the-canvas-element">canvas</a></code> elements are expected to
|
|
be treated as ordinary elements in the rendering model.</p>
|
|
|
|
<p>An <code><a href="#the-object-element">object</a></code> element that <a href="#represents">represents</a> an
|
|
image, plugin, or <a href="#nested-browsing-context">nested browsing context</a> is expected
|
|
to be treated as a replaced element. Other <code><a href="#the-object-element">object</a></code>
|
|
elements are expected to be treated as ordinary elements in the
|
|
rendering model.</p>
|
|
|
|
<p>An <code><a href="#the-applet-element">applet</a></code> element that <a href="#represents">represents</a> a
|
|
<a href="#plugin">plugin</a> is expected to be treated as a replaced
|
|
element. Other <code><a href="#the-applet-element">applet</a></code> elements are expected to be
|
|
treated as ordinary elements in the rendering model.</p>
|
|
|
|
<p>The <code><a href="#the-audio-element">audio</a></code> element, when it is <a href="#expose-a-user-interface-to-the-user" title="expose a
|
|
user interface to the user">exposing a user interface</a>, is
|
|
expected to be treated as a replaced element about one line high, as
|
|
wide as is necessary to expose the user agent's user interface
|
|
features. When an <code><a href="#the-audio-element">audio</a></code> element is not <a href="#expose-a-user-interface-to-the-user" title="expose a user interface to the user">exposing a user
|
|
interface</a>, the user agent is expected to hide it,
|
|
irrespective of CSS rules.</p>
|
|
|
|
<p>Whether a <code><a href="#the-video-element">video</a></code> element is <a href="#expose-a-user-interface-to-the-user" title="expose a
|
|
user interface to the user">exposing a user interface</a> is not
|
|
expected to affect the size of the rendering; controls are expected
|
|
to be overlaid with the page content without causing any layout
|
|
changes, and are expected to disappear when the user does not need
|
|
them.</p>
|
|
|
|
<p>When a <code><a href="#the-video-element">video</a></code> element represents a poster frame or
|
|
frame of video, the poster frame or frame of video is expected to be
|
|
rendered at the largest size that maintains the aspect ratio of that
|
|
poster frame or frame of video without being taller or wider than
|
|
the <code><a href="#the-video-element">video</a></code> element itself, and is expected to be
|
|
centered in the <code><a href="#the-video-element">video</a></code> element.</p>
|
|
|
|
<p>Any subtitles or captions are expected to be overlayed directly
|
|
on top of their <code><a href="#the-video-element">video</a></code> element, as defined by the
|
|
relevant rendering rules; for <span>WebVTT</span>, those are the
|
|
<a href="#webvtt-cue-text-rendering-rules">WebVTT cue text rendering rules</a> defined below.</p>
|
|
|
|
<p>When the user agent starts <a href="#expose-a-user-interface-to-the-user" title="expose a user interface
|
|
to the user">exposing a user interface</a> for a
|
|
<code><a href="#the-video-element">video</a></code> element, the user agent should run the <a href="#rules-for-updating-the-text-track-rendering">rules
|
|
for updating the text track rendering</a> of each of the <a href="#text-track" title="text track">text tracks</a> in the <code><a href="#the-video-element">video</a></code>
|
|
element's <a href="#list-of-text-tracks">list of text tracks</a> that are <a href="#text-track-showing" title="text track showing">showing</a> or <a href="#text-track-showing-by-default" title="text
|
|
track showing by default">showing by default</a> (e.g., for <a href="#text-track" title="text track">text tracks</a> based on
|
|
<span>WebVTT</span>, the <a href="#rules-for-updating-the-display-of-webvtt-text-tracks">rules for updating the display of
|
|
WebVTT text tracks</a>).</p>
|
|
|
|
<p class="note">Resizing <code><a href="#the-video-element">video</a></code> and <code><a href="#the-canvas-element">canvas</a></code>
|
|
elements does not interrupt video playback or clear the canvas.</p>
|
|
|
|
<hr><p>The following CSS rules are expected to apply:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
iframe:not([seamless]) { border: 2px inset; }
|
|
<span id="video-object-fit">video { object-fit: contain; }</span></pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="timed-text-tracks-0"><span class="secno">10.3.2 </span>Timed text tracks</h4>
|
|
|
|
<p class="note">This section is intended to be moved to its own CSS
|
|
module once an editor is found to run with it.</p>
|
|
|
|
|
|
|
|
<h5 id="webvtt-cue-text-rendering-rules"><span class="secno">10.3.2.1 </span><dfn>WebVTT cue text rendering rules</dfn></h5>
|
|
|
|
<p>The <dfn id="rules-for-updating-the-display-of-webvtt-text-tracks">rules for updating the display of WebVTT text
|
|
tracks</dfn> render the <a href="#text-track" title="text track">text
|
|
tracks</a> of a <a href="#media-element">media element</a> (specifically, a
|
|
<code><a href="#the-video-element">video</a></code> element), or of another playback mechanism, by
|
|
applying the steps below. All the <a href="#text-track" title="text track">text
|
|
tracks</a> that use these rules for a given <a href="#media-element">media
|
|
element</a>, or other playback mechanism, are rendered together,
|
|
to avoid overlapping subtitles from multiple tracks.</p>
|
|
|
|
<p>The output of the steps below is a set of CSS boxes that covers
|
|
the rendering area of the <a href="#media-element">media element</a> or other
|
|
playback mechanism, which user agents are expected to render in a
|
|
manner suiting the user.</p>
|
|
|
|
<p>The rules are as follows:</p>
|
|
|
|
<ol><li><p>If the <a href="#media-element">media element</a> is an <code><a href="#the-audio-element">audio</a></code>
|
|
element, or is another playback mechanism with no rendering area,
|
|
abort these steps. There is nothing to render.</li>
|
|
|
|
<li><p>Let <var title="">video</var> be the <a href="#media-element">media
|
|
element</a> or other playback mechanism.</li>
|
|
|
|
<li><p>Let <var title="">output</var> be an empty list of
|
|
absolutely positioned CSS block boxes.</li>
|
|
|
|
<li><p>If the user agent is <a href="#expose-a-user-interface-to-the-user" title="expose a user interface to
|
|
the user">exposing a user interface</a> for <var title="">video</var>, add to <var title="">output</var> one or more
|
|
completely transparent positioned CSS block boxes that cover the
|
|
same region as the user interface.</p>
|
|
|
|
<li><p>If the last time these rules were run, the user agent was
|
|
not <a href="#expose-a-user-interface-to-the-user" title="expose a user interface to the user">exposing a
|
|
user interface</a> for <var title="">video</var>, but now it is,
|
|
let <var title="">reset</var> be true. Otherwise, let <var title="">reset</var> be false.</p>
|
|
|
|
<li><p>Let <var title="">tracks</var> be the subset of <var title="">video</var>'s <a href="#list-of-text-tracks">list of text tracks</a> that have
|
|
as their <a href="#rules-for-updating-the-text-track-rendering">rules for updating the text track rendering</a>
|
|
these <a href="#rules-for-updating-the-display-of-webvtt-text-tracks">rules for updating the display of WebVTT text
|
|
tracks</a>, and whose <a href="#text-track-mode">text track mode</a> is <a href="#text-track-showing" title="text track showing">showing</a> or <a href="#text-track-showing-by-default" title="text
|
|
track showing by default">showing by default</a>.</li>
|
|
|
|
<li><p>Let <var title="">cues</var> be an empty list of <a href="#text-track-cue" title="text track cue">text track cues</a>.</li>
|
|
|
|
<li><p>For each track <var title="">track</var> in <var title="">tracks</var>, append to <var title="">cues</var> all the
|
|
<a href="#text-track-cue" title="text track cue">cues</a> from <var title="">track</var>'s <a href="#text-track-list-of-cues" title="text track list of cues">list
|
|
of cues</a> that have their <a href="#text-track-cue-active-flag">text track cue active
|
|
flag</a> set.</li>
|
|
|
|
<li><p>If <var title="">reset</var> is false, then, for each
|
|
<a href="#text-track-cue">text track cue</a> <var title="">cue</var> in <var title="">cues</var>: if <var title="">cue</var>'s <a href="#text-track-cue-display-state">text track
|
|
cue display state</a> has a set of CSS boxes, then add those
|
|
boxes to <var title="">output</var>, and remove <var title="">cue</var> from <var title="">cues</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p>For each <a href="#text-track-cue">text track cue</a> <var title="">cue</var>
|
|
in <var title="">cues</var> that has not yet had corresponding CSS
|
|
boxes added to <var title="">output</var>, in <a href="#text-track-cue-order">text track
|
|
cue order</a>, run the following substeps:</p>
|
|
|
|
<ol><li><p>Let <var title="">nodes</var> be the <span>list of WebVTT
|
|
Node Objects</span> obtained by applying the <span>WebVTT cue
|
|
text parsing rules</span> to the <var title="">cue</var>'s
|
|
<a href="#text-track-cue-text">text track cue text</a>.</p>
|
|
|
|
<li>
|
|
|
|
<p>Apply the Unicode Bidirectional Algorithm's Paragraph Level
|
|
steps to <var title="">nodes</var> using the following
|
|
constraints, to determine the <i>paragraph embedding level</i>
|
|
of the cue: <a href="#refsBIDI">[BIDI]</a></p>
|
|
|
|
<ul><li><var title="">nodes</var> represents a single paragraph.</li>
|
|
|
|
<li>The paragraph's text consists of the concatenation of the
|
|
values of each <span>WebVTT Text Object</span> in <var title="">nodes</var>, in a pre-order, depth-first traversal,
|
|
excluding <span title="WebVTT Ruby Text Object">WebVTT Ruby
|
|
Text Objects</span> and their descendants.</li>
|
|
|
|
</ul></li>
|
|
|
|
<li>
|
|
|
|
<p>If the <i>paragraph embedding level</i> determined in the
|
|
previous step is even (the <i>paragraph direction</i> is
|
|
left-to-right), let <var title="">direction</var> be 'ltr',
|
|
otherwise, let it be 'rtl'.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is
|
|
<a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing
|
|
direction">horizontal</a>, then let <var title="">block-flow</var> be 'tb'. Otherwise, if the <a href="#text-track-cue-writing-direction">text
|
|
track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track
|
|
cue vertical growing left writing direction">vertical growing
|
|
left</a>, then let <var title="">block-flow</var> be
|
|
'lr'. Otherwise, the <a href="#text-track-cue-writing-direction">text track cue writing
|
|
direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing
|
|
right writing direction">vertical growing right</a>; let <var title="">block-flow</var> be 'rl'.</li>
|
|
|
|
<li>
|
|
|
|
<p>Determine the value of <var title="">maximum size</var> for
|
|
<var title="">cue</var> as per the appropriate rules from the
|
|
following list:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue start alignment">start</span>,
|
|
and <var title="">direction</var> is 'ltr'</dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue end alignment">end</span>,
|
|
and <var title="">direction</var> is 'rtl'</dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing direction">vertical growing left</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue start alignment">start</span></dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing right writing direction">vertical growing right</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue start alignment">start</span></dt>
|
|
<dd>
|
|
<p>Let <var title="">maximum size</var> be the <span>text track cue text position</span> subtracted from 100.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue end alignment">end</span>,
|
|
and <var title="">direction</var> is 'ltr'</dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue start alignment">start</span>,
|
|
and <var title="">direction</var> is 'rtl'</dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing direction">vertical growing left</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue end alignment">end</span></dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing right writing direction">vertical growing right</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue end alignment">end</span></dt>
|
|
<dd>
|
|
<p>Let <var title="">maximum size</var> be the <span>text track cue text position</span>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <span>text track cue alignment</span> is <span title="text track cue middle alignment">middle</span>,
|
|
the <span>text track cue text position</span> is less than or equal to 50</dt>
|
|
<dd>
|
|
<p>Let <var title="">maximum size</var> be the <span>text track cue text position</span> multiplied by two.</p>
|
|
</dd>
|
|
|
|
<dt>If the <span>text track cue alignment</span> is <span title="text track cue middle alignment">middle</span>,
|
|
the <span>text track cue text position</span> is greater than 50</dt>
|
|
<dd>
|
|
<p>Let <var title="">maximum size</var> be the result of subtracting <span>text track cue text position</span> from 100 and then multiplying the result by two.</p>
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>If the <a href="#text-track-cue-size">text track cue size</a> is less than <var title="">maximum size</var>, then let <var title="">size</var> be
|
|
<a href="#text-track-cue-size">text track cue size</a>. Otherwise, let <var title="">size</var> be <var title="">maximum size</var>.</li>
|
|
|
|
<li><p>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is
|
|
<a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing
|
|
direction">horizontal</a>, then let <var title="">width</var>
|
|
be '<var title="">size</var> vw' and <var title="">height</var> be 'auto'. Otherwise, let <var title="">width</var> be 'auto' and <var title="">height</var> be
|
|
'<var title="">size</var> vh'. (These are CSS values used
|
|
by the next section to set CSS properties for the rendering; 'vw'
|
|
and 'vh' are CSS units.) <a href="#refsCSSVALUES">[CSSVALUES]</a></li>
|
|
|
|
<li>
|
|
|
|
<p>Determine the value of <var title="">x-position</var> or <var title="">y-position</var> for <var title="">cue</var> as per the
|
|
appropriate rules from the following list:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue start alignment">start</span>,
|
|
and <var title="">direction</var> is 'ltr'</dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue end alignment">end</span>,
|
|
and <var title="">direction</var> is 'rtl'</dt>
|
|
<dd>
|
|
<p>Let <var title="">x-position</var> be the <span>text track cue text position</span>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue end alignment">end</span>,
|
|
and <var title="">direction</var> is 'ltr'</dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue start alignment">start</span>,
|
|
and <var title="">direction</var> is 'rtl'</dt>
|
|
<dd>
|
|
<p>Let <var title="">x-position</var> be the <span>text track cue text position</span> subtracted from 100.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing direction">vertical growing left</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue start alignment">start</span></dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing right writing direction">vertical growing right</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue start alignment">start</span></dt>
|
|
<dd>
|
|
<p>Let <var title="">y-position</var> be the <span>text track cue text position</span>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing direction">vertical growing left</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue end alignment">end</span></dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing right writing direction">vertical growing right</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue end alignment">end</span></dt>
|
|
<dd>
|
|
<p>Let <var title="">y-position</var> be the <span>text track cue text position</span> subtracted from 100.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue middle alignment">middle</span>,
|
|
and <var title="">direction</var> is 'ltr'</dt>
|
|
<dd>
|
|
<p>Let <var title="">x-position</var> be the <span>text track cue text position</span> minus half of <var title="">size</var>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
the <span>text track cue alignment</span> is <span title="text track cue middle alignment">middle</span>,
|
|
and <var title="">direction</var> is 'rtl'</dt>
|
|
<dd>
|
|
<p>Let <var title="">x-position-reverse</var> be the <span>text track cue text position</span> minus half of <var title="">size</var>.</p>
|
|
<p>Let <var title="">x-position</var> be <var title="">x-position-reverse</var> subtracted from 100.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing direction">vertical growing left</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue middle alignment">middle</span></dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing right writing direction">vertical growing right</a>,
|
|
and the <span>text track cue alignment</span> is <span title="text track cue middle alignment">middle</span></dt>
|
|
<dd>
|
|
<p>Let <var title="">y-position</var> be the <span>text track cue text position</span> minus half of <var title="">size</var>.</p>
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li>
|
|
|
|
<p>Determine the value of whichever of <var title="">x-position</var> or <var title="">y-position</var> is
|
|
not yet calculated for <var title="">cue</var> as per the
|
|
appropriate rules from the following list:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
and the <span>text track cue snap-to-lines flag</span> is set</dt>
|
|
<dd>
|
|
<p>Let <var title="">y-position</var> be zero.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
and the <span>text track cue snap-to-lines flag</span> is not set</dt>
|
|
<dd>
|
|
<p>Let <var title="">y-position</var> be the <span>text track cue line position</span>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing direction">vertical growing left</a>,
|
|
and the <span>text track cue snap-to-lines flag</span> is set</dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing right writing direction">vertical growing right</a>,
|
|
and the <span>text track cue snap-to-lines flag</span> is set</dt>
|
|
<dd>
|
|
<p>Let <var title="">x-position</var> be zero.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing direction">vertical growing left</a>,
|
|
and the <span>text track cue snap-to-lines flag</span> is not set</dt>
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing right writing direction">vertical growing right</a>,
|
|
and the <span>text track cue snap-to-lines flag</span> is not set</dt>
|
|
<dd>
|
|
<p>Let <var title="">x-position</var> be the <span>text track cue line position</span>.</p>
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>Let <var title="">left</var> be '<var title="">x-position</var> vw' and <var title="">top</var>
|
|
be '<var title="">y-position</var> vh'. (These again are
|
|
CSS values used by the next section to set CSS properties for the
|
|
rendering; 'vw' and 'vh' are CSS units.) <a href="#refsCSSVALUES">[CSSVALUES]</a></li>
|
|
|
|
<li>
|
|
|
|
<p>Apply the terms of the CSS specifications to <var title="">nodes</var> within the following constraints, thus
|
|
obtaining a set of CSS boxes positioned relative to an initial
|
|
containing block: <a href="#refsCSS">[CSS]</a></p>
|
|
|
|
<ul><li><p>The <i>document tree</i> is the tree of <span title="WebVTT Node Object">WebVTT Node Objects</span> rooted at
|
|
<var title="">nodes</var>.</li>
|
|
|
|
<li><p>For the purposes of processing by the CSS specification,
|
|
<span title="WebVTT Internal Node Object">WebVTT Internal Node
|
|
Objects</span> are equivalent to elements with the same
|
|
contents.</li>
|
|
|
|
<li>For the purposes of processing by the CSS
|
|
specification, <span title="WebVTT Text Object">WebVTT Text
|
|
Objects</span> are equivalent to text nodes.</li>
|
|
|
|
<li>No style sheets are associated with <var title="">nodes</var>. (The nodes are subsequently restyled
|
|
using style sheets after their boxes are generated, as
|
|
described below.)</li>
|
|
|
|
<li>The children of the <var title="">nodes</var> must be
|
|
wrapped in an anonymous box whose 'display' property has the
|
|
value 'inline'. This is the <dfn id="webvtt-cue-background-box">WebVTT cue background
|
|
box</dfn>.</li>
|
|
|
|
<li>Runs of children of <span title="WebVTT Ruby Object">WebVTT
|
|
Ruby Objects</span> that are not <span title="WebVTT Ruby Text
|
|
Object">WebVTT Ruby Text Objects</span> must be wrapped in
|
|
anonymous boxes whose 'display' property has the value
|
|
'ruby-base'. <a href="#refsCSSRUBY">[CSSRUBY]</a></li>
|
|
|
|
<li>Properties on <span title="WebVTT Node Object">WebVTT Node
|
|
Objects</span> have their values set as defined in the next
|
|
section. (That section uses some of the variables whose values
|
|
were calculated earlier in this algorithm.)</li>
|
|
|
|
<li>Text runs must be wrapped at the edge of their containing
|
|
blocks, regardless of the value of the 'white-space' property,
|
|
even if doing so requires splitting a word where there is no
|
|
line breaking opportunity.</li>
|
|
|
|
<li>The viewport (and initial containing block) is
|
|
<var title="">video</var>'s rendering area.</li>
|
|
|
|
</ul><p>Let <var title="">boxes</var> be the boxes generated as
|
|
descendants of the initial containing block, along with their
|
|
positions.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If there are no line boxes in <var title="">boxes</var>,
|
|
skip the remainder of these substeps for <var title="">cue</var>. The cue is ignored.</li>
|
|
|
|
<li>
|
|
|
|
<p>Adjust the positions of <var title="">boxes</var> according
|
|
to the appropriate steps from the following list:</p>
|
|
|
|
<dl class="switch"><dt>If <var title="">cue</var>'s <span>text track cue snap-to-lines flag</span> is set</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Many of the steps in this algorithm vary according to the
|
|
<a href="#text-track-cue-writing-direction">text track cue writing direction</a>. Steps labeled
|
|
"<strong>Horizontal</strong>" must be followed only when the
|
|
<a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing
|
|
direction">horizontal</a>, steps labeled
|
|
"<strong>Vertical</strong>" must be followed when the
|
|
<a href="#text-track-cue-writing-direction">text track cue writing direction</a> is either <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing
|
|
direction">vertical growing left</a> or <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text
|
|
track cue vertical growing right writing direction">vertical
|
|
growing right</a>, steps labeled "<strong>Vertical Growing
|
|
Left</strong>" must be followed only when the <a href="#text-track-cue-writing-direction">text
|
|
track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track
|
|
cue vertical growing left writing direction">vertical growing
|
|
left</a>, and steps labeled "<strong>Vertical Growing
|
|
Right</strong>" must be followed only when the <a href="#text-track-cue-writing-direction">text
|
|
track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track
|
|
cue vertical growing right writing direction">vertical growing
|
|
right</a>.</p>
|
|
|
|
<ol><li>
|
|
|
|
<p><strong>Horizontal</strong>: Let <var title="">step</var>
|
|
be the height of the first line box in <var title="">boxes</var>.</p>
|
|
|
|
<p><strong>Vertical</strong>: Let <var title="">step</var>
|
|
be the width of the first line box in <var title="">boxes</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>If <var title="">step</var> is zero, then jump to the
|
|
step labeled <i>done positioning</i> below.</li>
|
|
|
|
<li><p>Let <var title="">line position</var> be the
|
|
<span>text track cue line position</span>.</li>
|
|
|
|
<li><p><strong>Vertical Growing Left</strong>: Add one to
|
|
<var title="">line position</var> then negate it.</li>
|
|
|
|
<li><p>Let <var title="">position</var> be the result of
|
|
multiplying <var title="">step</var> and <var title="">line
|
|
position</var>.</li>
|
|
|
|
<li><p><strong>Vertical Growing Left</strong>: Decrease <var title="">position</var> by the width of the bounding box of
|
|
the boxes in <var title="">boxes</var>, then increase <var title="">position</var> by <var title="">step</var>.</li>
|
|
|
|
<li>
|
|
|
|
<p><strong>Horizontal</strong>: If <var title="">line
|
|
position</var> is less than zero then increase <var title="">position</var> by the height of the <var title="">video</var>'s rendering area, and negate <var title="">step</var> (so its value is now minus the height of
|
|
the first line box in <var title="">boxes</var>).</p>
|
|
|
|
<p><strong>Vertical</strong>: If <var title="">line
|
|
position</var> is less than zero then increase <var title="">position</var> by the width of the <var title="">video</var>'s rendering area, and negate <var title="">step</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><strong>Horizontal</strong>: Move all the boxes in <var title="">boxes</var> down by the distance given by <var title="">position</var>.</p>
|
|
|
|
<p><strong>Vertical</strong>: Move all the boxes in <var title="">boxes</var> right by the distance given by <var title="">position</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p><i>Default</i>: Remember the position of all the boxes in
|
|
<var title="">boxes</var> as their <var title="">default
|
|
position</var>.</li>
|
|
|
|
<li><p>Let <var title="">switched</var> be false.</li>
|
|
|
|
<li><p><i>Step loop</i>: If none of the boxes in <var title="">boxes</var> would overlap any of the boxes in <var title="">output</var>, and all the boxes in <var title="">output</var> are within the <var title="">video</var>'s rendering area, then jump to the step
|
|
labeled <i>done positioning</i> below.</li>
|
|
|
|
<li>
|
|
|
|
<p><strong>Horizontal</strong>: If <var title="">step</var>
|
|
is negative and the top of the first line box in <var title="">boxes</var> is now above the top of the <var title="">video</var>'s rendering area, or if <var title="">step</var> is positive and the bottom of the first
|
|
line box in <var title="">boxes</var> is now below the
|
|
bottom of the <var title="">video</var>'s rendering area,
|
|
jump to the step labeled <i>switch direction</i>.</p>
|
|
|
|
<p><strong>Vertical</strong>: If <var title="">step</var> is
|
|
negative and the left edge of the first line box in <var title="">boxes</var> is now to the left of the left edge of
|
|
the <var title="">video</var>'s rendering area, or if <var title="">step</var> is positive and the right edge of the
|
|
first line box in <var title="">boxes</var> is now to the
|
|
right of the right edge of the <var title="">video</var>'s
|
|
rendering area, jump to the step labeled <i>switch
|
|
direction</i>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p><strong>Horizontal</strong>: Move all the boxes in <var title="">boxes</var> down by the distance given by <var title="">step</var>. (If <var title="">step</var> is
|
|
negative, then this will actually result in an upwards
|
|
movement of the boxes in absolute terms.)</p>
|
|
|
|
<p><strong>Vertical</strong>: Move all the boxes in <var title="">boxes</var> right by the distance given by <var title="">step</var>. (If <var title="">step</var> is
|
|
negative, then this will actually result in a leftwards
|
|
movement of the boxes in absolute terms.)</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Jump back to the step labeled <i>step
|
|
loop</i>.</li>
|
|
|
|
<li><p><i>Switch direction</i>: Move all the boxes in <var title="">boxes</var> back to their <var title="">default
|
|
position</var> as determined in the step above labeled
|
|
<i>default</i>.</li>
|
|
|
|
<li><p>If <var title="">switched</var> is true, jump to the step
|
|
labeled <i>done positioning</i> below.</li>
|
|
|
|
<li><p>Negate <var title="">step</var>.</li>
|
|
|
|
<li><p>Set <var title="">switched</var> to true.</li>
|
|
|
|
<li><p>Jump back to the step labeled <i>step
|
|
loop</i>.</li>
|
|
|
|
</ol></dd>
|
|
|
|
<dt>If <var title="">cue</var>'s <span>text track cue snap-to-lines flag</span> is not set</dt>
|
|
<dd>
|
|
|
|
<ol><li>
|
|
|
|
<p>Set up <var title="">x</var> and <var title="">y</var> as
|
|
follows:</p>
|
|
|
|
<dl class="switch"><dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
and <var title="">direction</var> is 'ltr'</dt>
|
|
<dd>
|
|
<p>Let <var title="">x</var> be a percentage given by the
|
|
<span>text track cue text position</span>, and let <var title="">y</var> be a percentage given by the <span>text
|
|
track cue line position</span>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-horizontal-writing-direction" title="text track cue horizontal writing direction">horizontal</a>,
|
|
and <var title="">direction</var> is 'rtl'</dt>
|
|
<dd>
|
|
<p>Let <var title="">x</var> be a percentage given by the
|
|
<span>text track cue text position</span> subtracted from
|
|
100, and let <var title="">y</var> be a percentage given
|
|
by the <span>text track cue line position</span>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-left-writing-direction" title="text track cue vertical growing left writing direction">vertical growing left</a></dt>
|
|
<dd>
|
|
<p>Let <var title="">x</var> be a percentage given by the
|
|
<span>text track cue line position</span> subtracted from
|
|
100, and let <var title="">y</var> be a percentage given
|
|
by the <span>text track cue text position</span>.</p>
|
|
</dd>
|
|
|
|
<dt>If the <a href="#text-track-cue-writing-direction">text track cue writing direction</a> is <a href="#text-track-cue-vertical-growing-right-writing-direction" title="text track cue vertical growing right writing direction">vertical growing right</a></dt>
|
|
<dd>
|
|
<p>Let <var title="">x</var> be a percentage given by the
|
|
<span>text track cue line position</span>, and let <var title="">y</var> be a percentage given by the <span>text
|
|
track cue text position</span>.</p>
|
|
</dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p>Position the boxes in <var title="">boxes</var> such
|
|
that the point <var title="">x</var>% along the width of the
|
|
bounding box of the boxes in <var title="">boxes</var> is
|
|
<var title="">x</var>% of the way across the width of the
|
|
<var title="">video</var>'s rendering area, and the point
|
|
<var title="">y</var>% along the height of the bounding box
|
|
of the boxes in <var title="">boxes</var> is <var title="">y</var>% of the way across the height of the <var title="">video</var>'s rendering area, while maintaining the
|
|
relative positions of the boxes in <var title="">boxes</var>
|
|
to each other.</li>
|
|
|
|
<li><p>If none of the boxes in <var title="">boxes</var>
|
|
would overlap any of the boxes in <var title="">output</var>,
|
|
and all the boxes in <var title="">output</var> are within
|
|
the <var title="">video</var>'s rendering area, then jump to
|
|
the step labeled <i>done positioning</i> below.</li>
|
|
|
|
<li><p>If there is a position to which the boxes in <var title="">boxes</var> can be moved while maintaining the
|
|
relative positions of the boxes in <var title="">boxes</var>
|
|
to each other such that none of the boxes in <var title="">boxes</var> would overlap any of the boxes in <var title="">output</var>, and all the boxes in <var title="">output</var> would be within the <var title="">video</var>'s rendering area, then move the boxes in
|
|
<var title="">boxes</var> to the closest such position to
|
|
their current position, and then jump to the step labeled
|
|
<i>done positioning</i> below. If there are multiple such
|
|
positions that are equidistant from their current position,
|
|
use the highest one amongst them; if there are several at
|
|
that height, then use the leftmost one amongst them.</li>
|
|
|
|
<li><p>Otherwise, jump to the step labeled <i>done
|
|
positioning</i> below. (The boxes will unfortunately
|
|
overlap.)</li>
|
|
|
|
</ol></dd>
|
|
|
|
</dl></li>
|
|
|
|
<li><p><i>Done positioning</i>: If there are any line boxes in
|
|
the (possibly now repositioned) <var title="">boxes</var> that do
|
|
not completely fit inside <var title="">video</var>'s rendering
|
|
area, remove those offending line boxes from <var title="">boxes</var>.</li>
|
|
|
|
<li><p>Let <var title="">cue</var>'s <a href="#text-track-cue-display-state">text track cue
|
|
display state</a> have the CSS boxes in <var title="">boxes</var>.</li>
|
|
|
|
<li><p>Add the CSS boxes in <var title="">boxes</var> to <var title="">output</var>.</li>
|
|
|
|
</ol></li>
|
|
|
|
<li><p>Return <var title="">output</var>.</li>
|
|
|
|
</ol><h5 id="applying-css-properties-to-webvtt-node-objects"><span class="secno">10.3.2.2 </span>Applying CSS properties to <span title="WebVTT Node Object">WebVTT Node Objects</span></h5>
|
|
|
|
<p>When following the <a href="#rules-for-updating-the-display-of-webvtt-text-tracks">rules for updating the display of WebVTT
|
|
text tracks</a>, user agents must set properties of <span title="WebVTT Node Object">WebVTT Node Objects</span> as defined in
|
|
this section. <a href="#refsCSS">[CSS]</a></p>
|
|
|
|
<p>On the (root) <span>List of WebVTT Node Objects</span>, the
|
|
'position' property must be set to 'absolute', the 'direction'
|
|
property must be set to <var title="">direction</var>, the
|
|
'block-flow' property must be set to <var title="">block-flow</var>,
|
|
the 'top' property must be set to <var title="">top</var>, the
|
|
'left' property must be set to <var title="">left</var>, the 'width'
|
|
property must be set to <var title="">width</var>, and the 'height'
|
|
property must be set to <var title="">height</var>, where <var title="">direction</var>, <var title="">block-flow</var>, <var title="">top</var>, <var title="">left</var>, <var title="">width</var>, and <var title="">height</var> are the values
|
|
with those names determined by the <a href="#rules-for-updating-the-display-of-webvtt-text-tracks">rules for updating the
|
|
display of WebVTT text tracks</a> for the <a href="#text-track-cue">text track
|
|
cue</a> from whose <a href="#text-track-cue-text" title="text track cue text">text</a>
|
|
the <span>List of WebVTT Node Objects</span> was constructed.</p>
|
|
|
|
<p>The 'font' shorthand property on the (root) <span>List of WebVTT
|
|
Node Objects</span> must be set to '0.1vh sans-serif'. <a href="#refsCSSRUBY">[CSSRUBY]</a> <a href="#refsCSSVALUES">[CSSVALUES]</a></p>
|
|
|
|
<p>The 'color' property on the (root) <span>List of WebVTT Node
|
|
Objects</span> must be set to 'rgba(255,255,255,0)'. <a href="#refsCSSCOLOR">[CSSCOLOR]</a></p>
|
|
|
|
<p>The 'background' shorthand property on the <a href="#webvtt-cue-background-box">WebVTT cue
|
|
background box</a> must be set to 'rgba(0,0,0,0.8)'. <a href="#refsCSSCOLOR">[CSSCOLOR]</a></p>
|
|
|
|
<p>A text outline or stroke may also be set on the (root) <span>List
|
|
of WebVTT Node Objects</span>, if supported.</p>
|
|
<p>The 'font-style' property on <span title="WebVTT Italic
|
|
Object">WebVTT Italic Objects</span> must be set to 'italic'.</p>
|
|
|
|
<p>The 'font-weight' property on <span title="WebVTT Bold
|
|
Object">WebVTT Bold Objects</span> must be set to 'bold'.</p>
|
|
|
|
<p>The 'text-decoration' property on <span title="WebVTT Underline
|
|
Object">WebVTT Underline Objects</span> must be set to 'underline'.</p>
|
|
|
|
<p>The 'display' property on <span title="WebVTT Ruby Object">WebVTT
|
|
Ruby Objects</span> must be set to 'ruby'. <a href="#refsCSSRUBY">[CSSRUBY]</a></p>
|
|
|
|
<p>The 'display' property on <span title="WebVTT Ruby Text
|
|
Object">WebVTT Ruby Text Objects</span> must be set to
|
|
'ruby-text'. <a href="#refsCSSRUBY">[CSSRUBY]</a></p>
|
|
|
|
<p>If there are style sheets that apply to the <a href="#media-element">media
|
|
element</a> or other playback mechanism, then they must be
|
|
interpreted as defined in the next section.</p>
|
|
|
|
<p>All other non-inherited properties must be set to their initial
|
|
values; inherited properties on the root <span>List of WebVTT Node
|
|
Objects</span> must inherit their values from the <a href="#media-element">media
|
|
element</a> for which the <a href="#text-track-cue">text track cue</a> is being
|
|
rendered, if any. If there is no <a href="#media-element">media element</a> (i.e. if
|
|
the <a href="#text-track">text track</a> is being rendered for another media
|
|
playback mechanism), then inherited properties on the root
|
|
<span>List of WebVTT Node Objects</span> must take their initial
|
|
values.</p>
|
|
|
|
|
|
<h5 id="css-extensions"><span class="secno">10.3.2.3 </span>CSS extensions</h5>
|
|
|
|
<p>When a user agent is rendering one or more <a href="#text-track-cue" title="text
|
|
track cue">text track cues</a> according to the <a href="#webvtt-cue-text-rendering-rules">WebVTT cue
|
|
text rendering rules</a>, <span title="WebVTT Node Object">WebVTT
|
|
Node Objects</span> in the <span>list of WebVTT Node Objects</span>
|
|
used in the rendering can be matched by certain pseudo-selectors as
|
|
defined below. These selectors can begin or stop matching individual
|
|
<span title="WebVTT Node Object">WebVTT Node Objects</span> while a
|
|
<a href="#text-track-cue" title="text track cue">cue</a> is being rendered, even in
|
|
between applications of the <a href="#webvtt-cue-text-rendering-rules">WebVTT cue text rendering
|
|
rules</a> (which are only run when the set of active cues
|
|
changes). User agents that support the pseudo-element described
|
|
below must dynamically update renderings accordingly.</p>
|
|
|
|
<p>Pseudo-elements apply to elements that are matched by
|
|
selectors. For the purpose of this section, that element is the
|
|
<i>matched element</i>. The pseudo-elements defined in the following
|
|
sections affect the styling of parts of <a href="#text-track-cue" title="text track
|
|
cue">text track cues</a> that are being rendered for the
|
|
<i>matched element</i>.</p>
|
|
|
|
<p class="note">If the <i>matched element</i> is not a
|
|
<code><a href="#the-video-element">video</a></code> element, the pseudo-elements defined below won't
|
|
have any effect according to this specification.</p>
|
|
|
|
<p>A CSS user agent that implements the <a href="#text-track" title="text
|
|
track">text tracks</a> model must implement the '::cue' and
|
|
'::cue(<var title="">selector</var>)' pseudo-elements, and the
|
|
':past' and ':future' pseudo-classes.</p>
|
|
|
|
|
|
<h6 id="the-::cue-pseudo-element"><span class="secno">10.3.2.3.1 </span>The '::cue' pseudo-element</h6>
|
|
|
|
<p>The '<dfn id="pseudo-cue" title="pseudo-cue">::cue</dfn>' pseudo-element (with no
|
|
argument) matches any <span>List of WebVTT Node Objects</span>
|
|
constructed for the <i>matched element</i>, with the exception that
|
|
the properties corresponding to the 'background' shorthand must be
|
|
applied to the <a href="#webvtt-cue-background-box">WebVTT cue background box</a> rather than
|
|
the <span>List of WebVTT Node Objects</span>.</p>
|
|
|
|
<p>The following properties apply to the '::cue' pseudo-element with
|
|
no argument; other properties set on the pseudo-element must be
|
|
ignored:</p>
|
|
|
|
<ul class="brief"><li>'color'</li>
|
|
<li>'text-shadow'</li>
|
|
<li>'text-outline'</li>
|
|
<li>the properties corresponding to the 'background' shorthand</li>
|
|
<li>the properties corresponding to the 'outline' shorthand</li>
|
|
<li>the properties corresponding to the 'font' shorthand, including 'line-height'</li>
|
|
|
|
</ul><p>The '<dfn id="pseudo-cue-selector" title="pseudo-cue-selector">::cue(<var title="">selector</var>)</dfn>' pseudo-element with an argument must
|
|
have an argument that consists of a group of selectors. It matches
|
|
any <span>WebVTT Internal Node Object</span> constructed for the
|
|
<i>matched element</i> that also matches the given group of
|
|
selectors, with the nodes being treated as follows:</p>
|
|
|
|
<ul><li><p>The <i>document tree</i> against which the selectors are
|
|
matched is the tree of <span title="WebVTT Node Object">WebVTT Node
|
|
Objects</span> rooted at the <span>list of WebVTT Node
|
|
Objects</span> for the cue.</li>
|
|
|
|
<li><p><span title="WebVTT Internal Node Object">WebVTT Internal
|
|
Node Objects</span> are elements in the tree.</li>
|
|
|
|
<li><span title="WebVTT Leaf Node Object">WebVTT Leaf Node
|
|
Objects</span> cannot be matched.</li>
|
|
|
|
<li>
|
|
|
|
<p>For the purposes of element type selectors, the names of <span title="WebVTT Internal Node Object">WebVTT Internal Node
|
|
Objects</span> are as given by the following table, where objects
|
|
having the concrete class given in a cell in the first column have
|
|
the name given by the second column of the same row:</p>
|
|
|
|
<table><thead><tr><th>Concrete class
|
|
<th>Name
|
|
|
|
<tbody><tr><td><span title="WebVTT Class Object">WebVTT Class Objects</span>
|
|
<td><code title="">c</code>
|
|
|
|
<tr><td><span title="WebVTT Italic Object">WebVTT Italic Objects</span>
|
|
<td><code title="">i</code>
|
|
|
|
<tr><td><span title="WebVTT Bold Object">WebVTT Bold Objects</span>
|
|
<td><code title="">b</code>
|
|
|
|
<tr><td><span title="WebVTT Underline Object">WebVTT Underline Objects</span>
|
|
<td><code title="">u</code>
|
|
|
|
<tr><td><span title="WebVTT Ruby Object">WebVTT Ruby Objects</span>
|
|
<td><code title="">ruby</code>
|
|
|
|
<tr><td><span title="WebVTT Ruby Text Object">WebVTT Ruby Text Objects</span>
|
|
<td><code title="">rt</code>
|
|
|
|
<tr><td><span title="WebVTT Voice Object">WebVTT Voice Objects</span>
|
|
<td><code title="">v</code>
|
|
|
|
<tr><td>Other elements (specifically, <span title="List of WebVTT Node Objects">Lists of WebVTT Node Objects</span>)
|
|
<td>No explicit name.
|
|
|
|
</table></li>
|
|
|
|
<li><p>For the purposes of element type and universal selectors,
|
|
<span title="WebVTT Internal Node Object">WebVTT Internal Node
|
|
Objects</span> are considered as being in the namespace expressed
|
|
as the empty string.</li>
|
|
|
|
<li><p>For the purposes of attribute selector matching, <span title="WebVTT Internal Node Object">WebVTT Internal Node
|
|
Objects</span> have no attributes, except for <span title="WebVTT Voice Object">WebVTT Voice Objects</span>, which
|
|
have a single attribute named "<code title="">voice</code>"
|
|
whose value is the value of the <span>WebVTT Voice
|
|
Object</span>.</li>
|
|
|
|
<li><p>For the purposes of class selector matching, <span title="WebVTT Internal Node Object">WebVTT Internal Node
|
|
Objects</span> have the classes described as the <span>WebVTT
|
|
Node Object's applicable classes</span>.</li>
|
|
</ul><p>The following properties apply to the '::cue()' pseudo-element
|
|
with an argument:</p>
|
|
|
|
<ul class="brief"><li>'color'</li>
|
|
<li>'text-shadow'</li>
|
|
<li>'text-outline'</li>
|
|
<li>the properties corresponding to the 'background' shorthand</li>
|
|
<li>the properties corresponding to the 'outline' shorthand</li>
|
|
<li>properties relating to the transition and animation features</li>
|
|
|
|
|
|
</ul><p>The following properties apply to the '::cue()' pseudo-element
|
|
with an argument when the selector does not contain the ':past' and
|
|
':future' pseudo-classes:</p>
|
|
|
|
<ul class="brief"><li>the properties corresponding to the 'font' shorthand, including 'line-height'</li>
|
|
|
|
</ul><p>Properties that do not apply must be ignored.</p>
|
|
|
|
<p>As a special exception, the properties corresponding to the
|
|
'background' shorthand, when they would have been applied to the
|
|
<span>List of WebVTT Node Objects</span>, must instead be applied to
|
|
the <a href="#webvtt-cue-background-box">WebVTT cue background box</a>.</p>
|
|
|
|
|
|
<h6 id="the-:past-and-:future-pseudo-classes"><span class="secno">10.3.2.3.2 </span>The ':past' and ':future' pseudo-classes</h6>
|
|
|
|
<p>The <dfn id="past-pseudo-class" title="past-pseudo-class">':past'</dfn> and <dfn id="future-pseudo-class" title="future-pseudo-class">':future'</dfn> pseudo-classes only
|
|
match <span title="WebVTT Node Object">WebVTT Node Objects</span>.</p>
|
|
|
|
<p>The ':past' pseudo-class only matches <span title="WebVTT Node
|
|
Object">WebVTT Node Objects</span> that are <i><a href="#in-the-past">in the past</a></i>.</p>
|
|
|
|
<p>A <span>WebVTT Node Object</span> <var title="">c</var> is
|
|
<dfn id="in-the-past">in the past</dfn> if, in a pre-order, depth-first traversal of
|
|
the <a href="#text-track-cue">text track cue</a>'s <span>List of WebVTT Node
|
|
Objects</span>, there exists a <span>WebVTT Timestamp Object</span>
|
|
whose value is less than the <a href="#current-playback-position">current playback position</a>
|
|
of the <a href="#media-element">media element</a> that is the <i>matched
|
|
element</i>, entirely after the <span>WebVTT Node Object</span> <var title="">c</var>.</p>
|
|
|
|
<p>The ':future' pseudo-class only matches <span title="WebVTT Node
|
|
Object">WebVTT Node Objects</span> that are <i><a href="#in-the-future">in the future</a></i>.</p>
|
|
|
|
<p>A <span>WebVTT Node Object</span> <var title="">c</var> is
|
|
<dfn id="in-the-future">in the future</dfn> if, in a pre-order, depth-first traversal
|
|
of the <a href="#text-track-cue">text track cue</a>'s <span>List of WebVTT Node
|
|
Objects</span>, there exists a <span>WebVTT Timestamp Object</span>
|
|
whose value is greater than the <a href="#current-playback-position">current playback
|
|
position</a> of the <a href="#media-element">media element</a> that is the
|
|
<i>matched element</i>, entirely before the <span>WebVTT Node
|
|
Object</span> <var title="">c</var>.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="images"><span class="secno">10.3.3 </span>Images</h4>
|
|
|
|
<p>When an <code><a href="#the-img-element">img</a></code> element or an <code><a href="#the-input-element">input</a></code> element
|
|
when its <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in
|
|
the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state
|
|
<a href="#represents">represents</a> an image, it is expected to be treated as a
|
|
replaced element.</p>
|
|
|
|
<p>When an <code><a href="#the-img-element">img</a></code> element or an <code><a href="#the-input-element">input</a></code> element
|
|
when its <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in
|
|
the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state
|
|
does not <a href="#represents" title="represents">represent</a> an image, but the
|
|
element already has intrinsic dimensions (e.g. from the
|
|
<a href="#dimension-attributes">dimension attributes</a> or CSS rules), and either the user
|
|
agent has reason to believe that the image will become <i title="img-available">available</i>
|
|
and be rendered in due course or the <code><a href="#document">Document</a></code> is in
|
|
<a href="#quirks-mode">quirks mode</a>, the element is expected to be treated as a
|
|
replaced element whose content is the text that the element
|
|
represents, if any, optionally alongside an icon indicating that the
|
|
image is being obtained. For <code><a href="#the-input-element">input</a></code> elements, the text
|
|
is expected to appear button-like to indicate that the element is a
|
|
<a href="#concept-button" title="concept-button">button</a>.</p>
|
|
|
|
<p>When an <code><a href="#the-img-element">img</a></code> element <a href="#represents">represents</a> some
|
|
text and the user agent does not expect this to change, the element
|
|
is expected to be treated as an inline element whose content is the
|
|
text, optionally with an icon indicating that an image is
|
|
missing.</p>
|
|
|
|
<p>When an <code><a href="#the-img-element">img</a></code> element <a href="#represents">represents</a> nothing
|
|
and the user agent does not expect this to change, the element is
|
|
expected to not be rendered at all.</p>
|
|
|
|
<p>When an <code><a href="#the-img-element">img</a></code> element might be a key part of the
|
|
content, but neither the image nor any kind of alternative text is
|
|
available, and the user agent does not expect this to change, the
|
|
element is expected to be treated as an inline element whose content
|
|
is an icon indicating that an image is missing.</p>
|
|
<p>When an <code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state does not
|
|
<a href="#represents" title="represents">represent</a> an image and the user
|
|
agent does not expect this to change, the element is expected to be
|
|
treated as a replaced element consisting of a button whose content
|
|
is the element's alternative text. The intrinsic dimensions of the
|
|
button are expected to be about one line in height and whatever
|
|
width is necessary to render the text on one line.</p>
|
|
|
|
<p>The icons mentioned above are expected to be relatively small so
|
|
as not to disrupt most text but be easily clickable. In a visual
|
|
environment, for instance, icons could be 16 pixels by 16 pixels
|
|
square, or 1em by 1em if the images are scalable. In an audio
|
|
environment, the icon could be a short bleep. The icons are intended
|
|
to indicate to the user that they can be used to get to whatever
|
|
options the UA provides for images, and, where appropriate, are
|
|
expected to provide access to the context menu that would have come
|
|
up if the user interacted with the actual image.</p>
|
|
|
|
<hr><p>All animated images with the same <a href="#absolute-url">absolute URL</a> and
|
|
the same image data are expected to be rendered synchronized to the
|
|
same timeline as a group, with the timeline starting at the time of
|
|
the most recent addition to the group.</p>
|
|
|
|
<p class="note">In other words, the animation loop of an animated
|
|
image is restarted each time another image with the same
|
|
<a href="#absolute-url">absolute URL</a> and image data begins to animate, e.g.
|
|
after being inserted into the document.</p>
|
|
|
|
<hr><p>The following CSS rules are expected to apply when the
|
|
<code><a href="#document">Document</a></code> is in <a href="#quirks-mode">quirks mode</a>:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
img[align=left] { margin-right: 3px; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
img[align=right] { margin-left: 3px; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */</pre>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="attributes-for-embedded-content-and-images"><span class="secno">10.3.4 </span>Attributes for embedded content and images</h4>
|
|
|
|
<p>The following CSS rules are expected to apply as
|
|
<a href="#presentational-hints">presentational hints</a>:</p>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
iframe[frameborder=0], iframe[frameborder=no] { border: none; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
|
|
applet[align=left], embed[align=left], iframe[align=left],
|
|
img[align=left], input[type=image][align=left], object[align=left] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
float: left;
|
|
}
|
|
|
|
applet[align=right], embed[align=right], iframe[align=right],
|
|
img[align=right], input[type=image][align=right], object[align=right] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
float: right;
|
|
}
|
|
|
|
applet[align=top], embed[align=top], iframe[align=top],
|
|
img[align=top], input[type=image][align=top], object[align=top] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: top;
|
|
}
|
|
|
|
applet[align=baseline], embed[align=baseline], iframe[align=baseline],
|
|
img[align=baseline], input[type=image][align=baseline], object[align=baseline] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: baseline;
|
|
}
|
|
|
|
applet[align=texttop], embed[align=texttop], iframe[align=texttop],
|
|
img[align=texttop], input[type=image][align=texttop], object[align=texttop] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: text-top;
|
|
}
|
|
|
|
applet[align=absmiddle], embed[align=absmiddle], iframe[align=absmiddle],
|
|
img[align=absmiddle], input[type=image][align=absmiddle], object[align=absmiddle],
|
|
applet[align=abscenter], embed[align=abscenter], iframe[align=abscenter],
|
|
img[align=abscenter], input[type=image][align=abscenter], object[align=abscenter] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: middle;
|
|
}
|
|
|
|
applet[align=bottom], embed[align=bottom], iframe[align=bottom],
|
|
img[align=bottom], input[type=image][align=bottom],
|
|
object[align=bottom] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
vertical-align: bottom;
|
|
}</pre>
|
|
|
|
<p>When an <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-embed-element">embed</a></code>,
|
|
<code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, or <code><a href="#the-object-element">object</a></code>
|
|
element, or an <code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, has an
|
|
<code title="attr-dim-align">align</code> attribute whose value is
|
|
an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string "<code title="">center</code>" or the string "<code title="">middle</code>", the user agent is expected to act as if the
|
|
element's 'vertical-align' property was set to a value that aligns
|
|
the vertical middle of the element with the parent element's
|
|
baseline.</p>
|
|
|
|
<p>The <code title="attr-dim-hspace">hspace</code> attribute of
|
|
<code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-iframe-element">iframe</a></code>,
|
|
<code><a href="#the-img-element">img</a></code>, or <code><a href="#the-object-element">object</a></code> elements, and
|
|
<code><a href="#the-input-element">input</a></code> elements with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, <a href="#maps-to-the-dimension-property" title="maps to the dimension property">maps to the dimension
|
|
properties</a> 'margin-left' and 'margin-right' on the
|
|
element.</p>
|
|
|
|
<p>The <code title="attr-dim-vspace">vspace</code> attribute of
|
|
<code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-iframe-element">iframe</a></code>,
|
|
<code><a href="#the-img-element">img</a></code>, or <code><a href="#the-object-element">object</a></code> elements, and
|
|
<code><a href="#the-input-element">input</a></code> elements with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, <a href="#maps-to-the-dimension-property" title="maps to the dimension property">maps to the dimension
|
|
properties</a> 'margin-top' and 'margin-bottom' on the
|
|
element.</p>
|
|
|
|
<p>When an <code><a href="#the-img-element">img</a></code> element, <code><a href="#the-object-element">object</a></code> element, or
|
|
<code><a href="#the-input-element">input</a></code> element with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state is contained
|
|
within a <a href="#hyperlink">hyperlink</a> and has a <code title="attr-dim-border">border</code> attribute whose value, when
|
|
parsed using the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative
|
|
integers</a>, is found to be a number greater than zero, the user
|
|
agent is expected to use the parsed value for eight
|
|
<a href="#presentational-hints">presentational hints</a>: four setting the parsed value as
|
|
a pixel length for the element's 'border-top-width',
|
|
'border-right-width', 'border-bottom-width', and 'border-left-width'
|
|
properties, and four setting the element's 'border-top-style',
|
|
'border-right-style', 'border-bottom-style', and 'border-left-style'
|
|
properties to the value 'solid'.</p>
|
|
|
|
<p id="dimRendering">The <code title="attr-dim-width"><a href="#attr-dim-width">width</a></code>
|
|
and <code title="attr-dim-height"><a href="#attr-dim-height">height</a></code> attributes on
|
|
<code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-embed-element">embed</a></code>, <code><a href="#the-iframe-element">iframe</a></code>,
|
|
<code><a href="#the-img-element">img</a></code>, <code><a href="#the-object-element">object</a></code> or <code><a href="#the-video-element">video</a></code>
|
|
elements, and <code><a href="#the-input-element">input</a></code> elements with a <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute in the <a href="#image-button-state" title="attr-input-type-image">Image Button</a> state, <a href="#maps-to-the-dimension-property" title="maps to the dimension property">map to the dimension
|
|
properties</a> 'width' and 'height' on the element
|
|
respectively.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="image-maps-0"><span class="secno">10.3.5 </span>Image maps</h4>
|
|
|
|
<p>Shapes on an <a href="#image-map">image map</a> are expected to act, for the
|
|
purpose of the CSS cascade, as elements independent of the original
|
|
<code><a href="#the-area-element">area</a></code> element that happen to match the same style rules
|
|
but inherit from the <code><a href="#the-img-element">img</a></code> or <code><a href="#the-object-element">object</a></code>
|
|
element.</p>
|
|
|
|
<p>For the purposes of the rendering, only the 'cursor' property is
|
|
expected to have any effect on the shape.</p>
|
|
|
|
<p class="example">Thus, for example, if an <code><a href="#the-area-element">area</a></code>
|
|
element has a <code title="attr-style"><a href="#the-style-attribute">style</a></code> attribute that
|
|
sets the 'cursor' property to 'help', then when the user designates
|
|
that shape, the cursor would change to a Help cursor.</p>
|
|
|
|
<p class="example">Similarly, if an <code><a href="#the-area-element">area</a></code> element had a
|
|
CSS rule that set its 'cursor' property to 'inherit' (or if no rule
|
|
setting the 'cursor' property matched the element at all), the
|
|
shape's cursor would be inherited from the <code><a href="#the-img-element">img</a></code> or
|
|
<code><a href="#the-object-element">object</a></code> element of the <a href="#image-map">image map</a>, not from
|
|
the parent of the <code><a href="#the-area-element">area</a></code> element.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="toolbars-0"><span class="secno">10.3.6 </span>Toolbars</h4>
|
|
|
|
<p>When a <code><a href="#the-menu-element">menu</a></code> element's <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute is in the <a href="#toolbar-state" title="toolbar state">toolbar</a> state, the element is
|
|
expected to be treated as a replaced element with a height about two
|
|
lines high and a width derived from the contents of the element.</p>
|
|
|
|
<p>The element is expected to have, by default, the appearance of a
|
|
toolbar on the user agent's platform. It is expected to contain the
|
|
menu that is <a href="#building-menus-and-toolbars" title="building menus and toolbars">built</a>
|
|
from the element.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h3 id="bindings"><span class="secno">10.4 </span>Bindings</h3>
|
|
|
|
<h4 id="introduction-10"><span class="secno">10.4.1 </span>Introduction</h4>
|
|
|
|
<p>A number of elements have their rendering defined in terms of the
|
|
'binding' property. <a href="#refsBECSS">[BECSS]</a></p>
|
|
|
|
<p>The CSS snippets below set the 'binding' property to a
|
|
user-agent-defined value, represented below by keywords like <code title=""><i title="">button</i></code>. The rules then described for
|
|
these bindings are only expected to apply if the element's 'binding'
|
|
property has not been overridden (e.g. by the author) to have
|
|
another value.</p>
|
|
|
|
<p>Exactly how the bindings are implemented is not specified by this
|
|
specification. User agents are encouraged to make their bindings set
|
|
the 'appearance' CSS property appropriately to achieve
|
|
platform-native appearances for widgets, and are expected to
|
|
implement any relevant animations, etc, that are appropriate for the
|
|
platform. <a href="#refsCSSUI">[CSSUI]</a></p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-button-element-0"><span class="secno">10.4.2 </span>The <code><a href="#the-button-element">button</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
button { binding: <i title="">button</i>; }</pre>
|
|
|
|
<p>When the <i title="">button</i> binding applies to a
|
|
<code><a href="#the-button-element">button</a></code> element, the element is expected to render as an
|
|
'inline-block' box rendered as a button whose contents are the
|
|
contents of the element.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-details-element-0"><span class="secno">10.4.3 </span>The <code><a href="#the-details-element">details</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
details { binding: <i title="">details</i>; }</pre>
|
|
|
|
<p>When the <i title="">details</i> binding applies to a
|
|
<code><a href="#the-details-element">details</a></code> element, the element is expected to render as a
|
|
'block' box with its 'padding-left' property set to '40px' for
|
|
left-to-right elements (<a href="#ltr-specific">LTR-specific</a>) and with its
|
|
'padding-right' property set to '40px' for right-to-left
|
|
elements. The element's shadow tree is expected to take the
|
|
element's first child <code><a href="#the-summary-element">summary</a></code> element, if any, and
|
|
place it in a first 'block' box container, and then take the
|
|
element's remaining descendants, if any, and place them in a second
|
|
'block' box container.</p>
|
|
|
|
<p>The first container is expected to contain at least one line box,
|
|
and that line box is expected to contain a disclosure widget
|
|
(typically a triangle), horizontally positioned within the left
|
|
padding of the <code><a href="#the-details-element">details</a></code> element. That widget is expected
|
|
to allow the user to request that the details be shown or
|
|
hidden.</p>
|
|
|
|
<p>The second container is expected to have its 'overflow' property
|
|
set to 'hidden'. When the <code><a href="#the-details-element">details</a></code> element does not have
|
|
an <code title="attr-details-open"><a href="#attr-details-open">open</a></code> attribute, this
|
|
second container is expected to be removed from the rendering.</p>
|
|
|
|
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-input-element-as-a-text-entry-widget"><span class="secno">10.4.4 </span>The <code><a href="#the-input-element">input</a></code> element as a text entry widget</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
input { binding: <i title="">input-textfield</i>; }
|
|
input[type=password] { binding: <i title="">input-password</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
/* later rules override this for other values of type="" */</pre>
|
|
|
|
<p>When the <i title="">input-textfield</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#text-state-and-search-state" title="attr-input-type-text">Text</a>, <a href="#text-state-and-search-state" title="attr-input-type-search">Search</a>, <a href="#telephone-state" title="attr-input-type-tel">Telephone</a>, <a href="#url-state" title="attr-input-type-url">URL</a>, or <a href="#e-mail-state" title="attr-input-type-email">E-mail</a> state, the element is
|
|
expected to render as an 'inline-block' box rendered as a text
|
|
field.</p>
|
|
|
|
<p>When the <i title="">input-password</i> binding applies, to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#password-state" title="attr-input-type-password">Password</a> state, the element
|
|
is expected to render as an 'inline-block' box rendered as a text
|
|
field whose contents are obscured.</p>
|
|
|
|
<p>If an <code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in one of the above
|
|
states has a <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute,
|
|
and parsing that attribute's value using the <a href="#rules-for-parsing-non-negative-integers">rules for parsing
|
|
non-negative integers</a> doesn't generate an error, then the
|
|
user agent is expected to use the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> for the
|
|
'width' property on the element, with the value obtained from
|
|
applying the <a href="#converting-a-character-width-to-pixels">converting a character width to pixels</a>
|
|
algorithm to the value of the attribute.</p>
|
|
|
|
<p>If an <code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in one of the above
|
|
states does <em>not</em> have a <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute, then the user agent
|
|
is expected to act as if it had a user-agent-level style sheet rule
|
|
setting the 'width' property on the element to the value obtained
|
|
from applying the <a href="#converting-a-character-width-to-pixels">converting a character width to
|
|
pixels</a> algorithm to the number 20.</p>
|
|
|
|
<p>The <dfn id="converting-a-character-width-to-pixels">converting a character width to pixels</dfn> algorithm
|
|
returns <span title="">(<var title="">size</var>-1)×<var title="">avg</var> + <var title="">max</var></span>, where
|
|
<var title="">size</var> is the character width to convert, <var title="">avg</var> is the average character width of the primary
|
|
font for the element for which the algorithm is being run, in
|
|
pixels, and <var title="">max</var> is the maximum character width
|
|
of that same font, also in pixels. (The element's 'letter-spacing'
|
|
property does not affect the result.)</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-input-element-as-domain-specific-widgets"><span class="secno">10.4.5 </span>The <code><a href="#the-input-element">input</a></code> element as domain-specific widgets</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
input[type=datetime] { binding: <i title="">input-datetime</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
input[type=date] { binding: <i title="">input-date</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
input[type=month] { binding: <i title="">input-month</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
input[type=week] { binding: <i title="">input-week</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
input[type=time] { binding: <i title="">input-time</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
input[type=datetime-local] { binding: <i title="">input-datetime-local</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
input[type=number] { binding: <i title="">input-number</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */</pre>
|
|
|
|
<p>When the <i title="">input-datetime</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#date-and-time-state" title="attr-input-type-datetime">Date and Time</a> state, the
|
|
element is expected to render as an 'inline-block' box depicting a
|
|
Date and Time control.</p>
|
|
|
|
<p>When the <i title="">input-date</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#date-state" title="attr-input-type-date">Date</a> state, the element is
|
|
expected to render as an 'inline-block' box depicting a Date
|
|
control.</p>
|
|
|
|
<p>When the <i title="">input-month</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#month-state" title="attr-input-type-month">Month</a> state, the element is
|
|
expected to render as an 'inline-block' box depicting a Month
|
|
control.</p>
|
|
|
|
<p>When the <i title="">input-week</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#week-state" title="attr-input-type-week">Week</a> state, the element is
|
|
expected to render as an 'inline-block' box depicting a Week
|
|
control.</p>
|
|
|
|
<p>When the <i title="">input-time</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#time-state" title="attr-input-type-time">Time</a> state, the element is
|
|
expected to render as an 'inline-block' box depicting a Time
|
|
control.</p>
|
|
|
|
<p>When the <i title="">input-datetime-local</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#local-date-and-time-state" title="attr-input-type-datetime-local">Local Date and Time</a>
|
|
state, the element is expected to render as an 'inline-block' box
|
|
depicting a Local Date and Time control.</p>
|
|
|
|
<p>When the <i title="">input-number</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#number-state" title="attr-input-type-number">Number</a> state, the element is
|
|
expected to render as an 'inline-block' box depicting a Number
|
|
control.</p>
|
|
|
|
<p>These controls are all expected to be about one line high, and
|
|
about as wide as necessary to show the widest possible value.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-input-element-as-a-range-control"><span class="secno">10.4.6 </span>The <code><a href="#the-input-element">input</a></code> element as a range control</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
input[type=range] { binding: <i title="">input-range</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */</pre>
|
|
|
|
<p>When the <i title="">input-range</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#range-state" title="attr-input-type-range">Range</a> state, the element is
|
|
expected to render as an 'inline-block' box depicting a slider
|
|
control.</p>
|
|
|
|
<p>When the control is wider than it is tall (or square), the
|
|
control is expected to be a horizontal slider, with the lowest value
|
|
on the right if the 'direction' property on this element has a
|
|
computed value of 'rtl', and on the left otherwise. When the control
|
|
is taller than it is wide, it is expected to be a vertical slider,
|
|
with the lowest value on the bottom.</p>
|
|
|
|
<p>Predefined suggested values (provided by the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute) are expected to be
|
|
shown as tick marks on the slider, which the slider can snap to.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-input-element-as-a-color-well"><span class="secno">10.4.7 </span>The <code><a href="#the-input-element">input</a></code> element as a color well</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
input[type=color] { binding: <i title="">input-color</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */</pre>
|
|
|
|
<p>When the <i title="">input-color</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#color-state" title="attr-input-type-color">Color</a> state, the element is
|
|
expected to render as an 'inline-block' box depicting a color well,
|
|
which, when activated, provides the user with a color picker (e.g. a
|
|
color wheel or color palette) from which the color can be
|
|
changed.</p>
|
|
|
|
<p>Predefined suggested values (provided by the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute) are expected to be
|
|
shown in the color picker interface, not on the color well
|
|
itself.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-input-element-as-a-checkbox-and-radio-button-widgets"><span class="secno">10.4.8 </span>The <code><a href="#the-input-element">input</a></code> element as a checkbox and radio button widgets</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
input[type=checkbox] { binding: <i title="">input-checkbox</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
input[type=radio] { binding: <i title="">input-radio</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */</pre>
|
|
|
|
<p>When the <i title="">input-checkbox</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#checkbox-state" title="attr-input-type-checkbox">Checkbox</a> state, the element
|
|
is expected to render as an 'inline-block' box containing a single
|
|
checkbox control, with no label.</p>
|
|
|
|
<p>When the <i title="">input-radio</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#radio-button-state" title="attr-input-type-radio">Radio Button</a> state, the element
|
|
is expected to render as an 'inline-block' box containing a single
|
|
radio button control, with no label.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-input-element-as-a-file-upload-control"><span class="secno">10.4.9 </span>The <code><a href="#the-input-element">input</a></code> element as a file upload control</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
input[type=file] { binding: <i title="">input-file</i>; } /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */</pre>
|
|
|
|
<p>When the <i title="">input-file</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#file-upload-state" title="attr-input-type-file">File Upload</a> state, the element
|
|
is expected to render as an 'inline-block' box containing a span of
|
|
text giving the filename(s) of the <a href="#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>, if
|
|
any, followed by a button that, when activated, provides the user
|
|
with a file picker from which the selection can be changed.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-input-element-as-a-button"><span class="secno">10.4.10 </span>The <code><a href="#the-input-element">input</a></code> element as a button</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
input[type=submit], input[type=reset], input[type=button] { /* <a href="#case-insensitive-selector-exception">case-insensitive</a> */
|
|
binding: <i title="">input-button</i>;
|
|
}</pre>
|
|
|
|
<p>When the <i title="">input-button</i> binding applies to an
|
|
<code><a href="#the-input-element">input</a></code> element whose <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is in the <a href="#submit-button-state" title="attr-input-type-submit">Submit Button</a>, <a href="#reset-button-state" title="attr-input-type-reset">Reset Button</a>, or <a href="#button-state" title="attr-input-type-button">Button</a> state, the element is
|
|
expected to render as an 'inline-block' box rendered as a button,
|
|
about one line high, containing the contents of the element's <code title="attr-input-value"><a href="#attr-input-value">value</a></code> attribute, if any, or text
|
|
derived from the element's <code title="attr-input-type"><a href="#attr-input-type">type</a></code>
|
|
attribute in a user-agent-defined (and probably locale-specific)
|
|
fashion, if not.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-marquee-element-0"><span class="secno">10.4.11 </span>The <code><a href="#the-marquee-element">marquee</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
marquee { binding: <i title="">marquee</i>; }</pre>
|
|
|
|
<p>When the <i title="">marquee</i> binding applies to a
|
|
<code><a href="#the-marquee-element">marquee</a></code> element, while the element is <a href="#concept-marquee-on" title="concept-marquee-on">turned on</a>, the element is expected
|
|
to render in an animated fashion according to its attributes as
|
|
follows:</p>
|
|
|
|
<dl><dt>If the element's <code title="attr-marquee-behavior"><a href="#attr-marquee-behavior">behavior</a></code> attribute is in the
|
|
<a href="#attr-marquee-behavior-scroll" title="attr-marquee-behavior-scroll">scroll</a> state</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Slide the contents of the element in the direction described by
|
|
the <code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code>
|
|
attribute as defined below, such that it begins off the start side
|
|
of the <code><a href="#the-marquee-element">marquee</a></code>, and ends flush with the inner end
|
|
side.</p>
|
|
|
|
<p class="example">For example, if the <code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code> attribute is <a href="#attr-marquee-direction-left" title="attr-marquee-direction-left">left</a> (the default),
|
|
then the contents would start such that their left edge are off
|
|
the side of the right edge of the <code><a href="#the-marquee-element">marquee</a></code>'s content
|
|
area, and the contents would then slide up to the point where the
|
|
left edge of the contents are flush with the left inner edge of
|
|
the <code><a href="#the-marquee-element">marquee</a></code>'s content area.</p>
|
|
|
|
<p>Once the animation has ended, the user agent is expected to
|
|
<a href="#increment-the-marquee-current-loop-index">increment the marquee current loop index</a>. If the
|
|
element is still <a href="#concept-marquee-on" title="concept-marquee-on">turned on</a>
|
|
after this, then the user agent is expected to restart the
|
|
animation.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the element's <code title="attr-marquee-behavior"><a href="#attr-marquee-behavior">behavior</a></code> attribute is in the
|
|
<a href="#attr-marquee-behavior-slide" title="attr-marquee-behavior-slide">slide</a> state</dt>
|
|
|
|
<dd>
|
|
|
|
<p>Slide the contents of the element in the direction described by
|
|
the <code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code>
|
|
attribute as defined below, such that it begins off the start side
|
|
of the <code><a href="#the-marquee-element">marquee</a></code>, and ends off the end side of the
|
|
<code><a href="#the-marquee-element">marquee</a></code>.</p>
|
|
|
|
<p class="example">For example, if the <code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code> attribute is <a href="#attr-marquee-direction-left" title="attr-marquee-direction-left">left</a> (the default),
|
|
then the contents would start such that their left edge are off
|
|
the side of the right edge of the <code><a href="#the-marquee-element">marquee</a></code>'s content
|
|
area, and the contents would then slide up to the point where the
|
|
<em>right</em> edge of the contents are flush with the left inner
|
|
edge of the <code><a href="#the-marquee-element">marquee</a></code>'s content area.</p>
|
|
|
|
<p>Once the animation has ended, the user agent is expected to
|
|
<a href="#increment-the-marquee-current-loop-index">increment the marquee current loop index</a>. If the
|
|
element is still <a href="#concept-marquee-on" title="concept-marquee-on">turned on</a>
|
|
after this, then the user agent is expected to restart the
|
|
animation.</p>
|
|
|
|
</dd>
|
|
|
|
<dt>If the element's <code title="attr-marquee-behavior"><a href="#attr-marquee-behavior">behavior</a></code> attribute is in the
|
|
<a href="#attr-marquee-behavior-alternate" title="attr-marquee-behavior-alternate">alternate</a>
|
|
state</dt>
|
|
|
|
<dd>
|
|
|
|
<p>When the <a href="#marquee-current-loop-index">marquee current loop index</a> is even (or
|
|
zero), slide the contents of the element in the direction
|
|
described by the <code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code> attribute as
|
|
defined below, such that it begins flush with the start side of
|
|
the <code><a href="#the-marquee-element">marquee</a></code>, and ends flush with the end side of the
|
|
<code><a href="#the-marquee-element">marquee</a></code>.</p>
|
|
|
|
<p>When the <a href="#marquee-current-loop-index">marquee current loop index</a> is odd, slide
|
|
the contents of the element in the opposite direction than that
|
|
described by the <code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code> attribute as
|
|
defined below, such that it begins flush with the end side of the
|
|
<code><a href="#the-marquee-element">marquee</a></code>, and ends flush with the start side of the
|
|
<code><a href="#the-marquee-element">marquee</a></code>.</p>
|
|
|
|
<p class="example">For example, if the <code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code> attribute is <a href="#attr-marquee-direction-left" title="attr-marquee-direction-left">left</a> (the default),
|
|
then the contents would with their right edge flush with the right
|
|
inner edge of the <code><a href="#the-marquee-element">marquee</a></code>'s content area, and the
|
|
contents would then slide up to the point where the <em>left</em>
|
|
edge of the contents are flush with the left inner edge of the
|
|
<code><a href="#the-marquee-element">marquee</a></code>'s content area.</p>
|
|
|
|
<p>Once the animation has ended, the user agent is expected to
|
|
<a href="#increment-the-marquee-current-loop-index">increment the marquee current loop index</a>. If the
|
|
element is still <a href="#concept-marquee-on" title="concept-marquee-on">turned on</a>
|
|
after this, then the user agent is expected to continue the
|
|
animation.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><p>The <code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code>
|
|
attribute has the meanings described in the following table:</p>
|
|
|
|
<table><thead><tr><th><code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code> attribute state
|
|
<th>Direction of animation
|
|
<th>Start edge
|
|
<th>End edge
|
|
<th>Opposite direction
|
|
<tbody><tr><td><a href="#attr-marquee-direction-left" title="attr-marquee-direction-left">left</a>
|
|
<td>← Right to left
|
|
<td>Right
|
|
<td>Left
|
|
<td>→ Left to Right
|
|
<tr><td><a href="#attr-marquee-direction-right" title="attr-marquee-direction-right">right</a>
|
|
<td>→ Left to Right
|
|
<td>Left
|
|
<td>Right
|
|
<td>← Right to left
|
|
<tr><td><a href="#attr-marquee-direction-up" title="attr-marquee-direction-up">up</a>
|
|
<td>↑ Up (Bottom to Top)
|
|
<td>Bottom
|
|
<td>Top
|
|
<td>↓ Down (Top to Bottom)
|
|
<tr><td><a href="#attr-marquee-direction-down" title="attr-marquee-direction-down">down</a>
|
|
<td>↓ Down (Top to Bottom)
|
|
<td>Top
|
|
<td>Bottom
|
|
<td>↑ Up (Bottom to Top)
|
|
</table><p>In any case, the animation should proceed such that there is a
|
|
delay given by the <a href="#marquee-scroll-interval">marquee scroll interval</a> between each
|
|
frame, and such that the content moves at most the distance given by
|
|
the <a href="#marquee-scroll-distance">marquee scroll distance</a> with each frame.</p>
|
|
|
|
<p>When a <code><a href="#the-marquee-element">marquee</a></code> element has a <code title="attr-marquee-bgcolor">bgcolor</code> attribute set, the value
|
|
is expected to be parsed using the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy
|
|
color value</a>, and if that does not return an error, the user
|
|
agent is expected to treat the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> setting the
|
|
element's 'background-color' property to the resulting color.</p>
|
|
|
|
<p>The <code title="attr-marquee-width">width</code> and <code title="attr-marquee-height">height</code> attributes on a
|
|
<code><a href="#the-marquee-element">marquee</a></code> element <a href="#maps-to-the-dimension-property" title="maps to the dimension
|
|
property">map to the dimension properties</a> 'width' and
|
|
'height' on the element respectively.</p>
|
|
|
|
<p>The intrinsic height of a <code><a href="#the-marquee-element">marquee</a></code> element with its
|
|
<code title="attr-marquee-direction"><a href="#attr-marquee-direction">direction</a></code> attribute in
|
|
the <a href="#attr-marquee-direction-up" title="attr-marquee-direction-up">up</a> or <a href="#attr-marquee-direction-down" title="attr-marquee-direction-down">down</a> states is 200 CSS
|
|
pixels.</p>
|
|
|
|
<p>The <code title="attr-marquee-vspace">vspace</code> attribute of
|
|
a <code><a href="#the-marquee-element">marquee</a></code> element <a href="#maps-to-the-dimension-property" title="maps to the dimension
|
|
property">maps to the dimension properties</a> 'margin-top' and
|
|
'margin-bottom' on the element. The <code title="attr-marquee-hspace">hspace</code> attribute of a
|
|
<code><a href="#the-marquee-element">marquee</a></code> element <a href="#maps-to-the-dimension-property" title="maps to the dimension
|
|
property">maps to the dimension properties</a> 'margin-left' and
|
|
'margin-right' on the element.</p>
|
|
|
|
<p>The 'overflow' property on the <code><a href="#the-marquee-element">marquee</a></code> element is
|
|
expected to be ignored; overflow is expected to always be
|
|
hidden.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-meter-element-0"><span class="secno">10.4.12 </span>The <code><a href="#the-meter-element">meter</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
meter { binding: <i title="">meter</i>; }</pre>
|
|
|
|
<p>When the <i title="">meter</i> binding applies to a
|
|
<code><a href="#the-meter-element">meter</a></code> element, the element is expected to render as an
|
|
'inline-block' box with a 'height' of '1em' and a 'width' of '5em',
|
|
a 'vertical-align' of '-0.2em', and with its contents depicting a
|
|
gauge.</p>
|
|
|
|
<p>When the element is wider than it is tall (or square), the
|
|
depiction is expected to be of a horizontal gauge, with the minimum
|
|
value on the right if the 'direction' property on this element has a
|
|
computed value of 'rtl', and on the left otherwise. When the element
|
|
is taller than it is wide, it is expected to depict a vertical
|
|
gauge, with the minimum value on the bottom.</p>
|
|
|
|
<p>User agents are expected to use a presentation consistent with
|
|
platform conventions for gauges, if any.</p>
|
|
|
|
<p class="note">Requirements for what must be depicted in the gauge
|
|
are included in the definition of the <code><a href="#the-meter-element">meter</a></code>
|
|
element.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-progress-element-0"><span class="secno">10.4.13 </span>The <code><a href="#the-progress-element">progress</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
progress { binding: <i title="">progress</i>; }</pre>
|
|
|
|
<p>When the <i title="">progress</i> binding applies to a
|
|
<code><a href="#the-progress-element">progress</a></code> element, the element is expected to render as
|
|
an 'inline-block' box with a 'height' of '1em' and a 'width' of
|
|
'10em', and a 'vertical-align' of '-0.2em'.</p>
|
|
|
|
|
|
|
|
<p> <img alt="" class="extra" src="sample-progress.png">
|
|
When the element is wider than it is tall, the element is
|
|
expected to be depicted as a horizontal progress bar, with the start
|
|
on the right and the end on the left if the 'direction' property on
|
|
this element has a computed value of 'rtl', and with the start on
|
|
the left and the end on the right otherwise. When the element is
|
|
taller than it is wide, it is expected to depicted as a vertical
|
|
progress bar, with the lowest value on the bottom. When the element
|
|
is square, it is expected to be depicted as a direction-independent
|
|
progress widget (e.g. a circular progress ring).</p>
|
|
|
|
<p>User agents are expected to use a presentation consistent with
|
|
platform conventions for progress bars. In particular, user agents
|
|
are expected to use different presentations for determinate and
|
|
indeterminate progress bars. User agents are also expected to vary
|
|
the presentation based on the dimensions of the element.</p>
|
|
|
|
<p class="example">For example, on some platforms for showing
|
|
indeterminate progress there is an asynchronous progress indicator
|
|
with square dimensions, which could be used when the element is
|
|
square, and an indeterminate progress bar, which could be used when
|
|
the element is wide.</p>
|
|
|
|
<p class="note">Requirements for how to determine if the progress
|
|
bar is determinate or indeterminate, and what progress a determinate
|
|
progress bar is to show, are included in the definition of the
|
|
<code><a href="#the-progress-element">progress</a></code> element.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-select-element-0"><span class="secno">10.4.14 </span>The <code><a href="#the-select-element">select</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
select { binding: <i title="">select</i>; }</pre>
|
|
|
|
<p>When the <i title="">select</i> binding applies to a
|
|
<code><a href="#the-select-element">select</a></code> element whose <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute is present,
|
|
the element is expected to render as a multi-select list box.</p>
|
|
|
|
<p>When the <i title="">select</i> binding applies to a
|
|
<code><a href="#the-select-element">select</a></code> element whose <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute is absent,
|
|
and the element's <a href="#concept-select-size" title="concept-select-size">display
|
|
size</a> is greater than 1, the element is expected to render as
|
|
a single-select list box.</p>
|
|
|
|
<p>When the element renders as a list box, it is expected to render
|
|
as an 'inline-block' box whose 'height' is the height necessary to
|
|
contain as many rows for items as given by the element's <a href="#concept-select-size" title="concept-select-size">display size</a>, or four rows if the
|
|
attribute is absent, and whose 'width' is the <a href="#width-of-the-select-s-labels">width of the
|
|
<code>select</code>'s labels</a> plus the width of a
|
|
scrollbar.</p>
|
|
|
|
<p>When the <i title="">select</i> binding applies to a
|
|
<code><a href="#the-select-element">select</a></code> element whose <code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code> attribute is absent,
|
|
and the element's <a href="#concept-select-size" title="concept-select-size">display
|
|
size</a> is 1, the element is expected to render as a one-line
|
|
drop down box whose width is the <a href="#width-of-the-select-s-labels">width of the
|
|
<code>select</code>'s labels</a>.</p>
|
|
|
|
<p>In either case (list box or drop-down box), the element's items
|
|
are expected to be the element's <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a>, with the
|
|
element's <code><a href="#the-optgroup-element">optgroup</a></code> element children providing headers
|
|
for groups of options where applicable.</p>
|
|
|
|
<p>An <code><a href="#the-optgroup-element">optgroup</a></code> element is expected to be rendered by
|
|
displaying the element's <code title="attr-optgroup-label"><a href="#attr-optgroup-label">label</a></code> attribute.</p>
|
|
|
|
<p>An <code><a href="#the-option-element">option</a></code> element is expected to be rendered by
|
|
displaying the element's <code title="concept-option-label"><a href="#concept-option-label">label</a></code>, indented under its
|
|
<code><a href="#the-optgroup-element">optgroup</a></code> element if it has one.</p>
|
|
|
|
<p>The <dfn id="width-of-the-select-s-labels">width of the <code>select</code>'s labels</dfn> is the
|
|
wider of the width necessary to render the widest
|
|
<code><a href="#the-optgroup-element">optgroup</a></code>, and the width necessary to render the widest
|
|
<code><a href="#the-option-element">option</a></code> element in the element's <a href="#concept-select-option-list" title="concept-select-option-list">list of options</a> (including
|
|
its indent, if any).</p>
|
|
|
|
<p>If a <code><a href="#the-select-element">select</a></code> element contains a <a href="#placeholder-label-option">placeholder
|
|
label option</a>, the user agent is expected to render that
|
|
<code><a href="#the-option-element">option</a></code> in a manner that conveys that it is a label,
|
|
rather than a valid option of the control. This can include
|
|
preventing the <a href="#placeholder-label-option">placeholder label option</a> from being
|
|
explicitly selected by the user. When the <a href="#placeholder-label-option">placeholder label
|
|
option</a>'s <a href="#concept-option-selectedness" title="concept-option-selectedness">selectedness</a> is true, the
|
|
control is expected to be displayed in a fashion that indicates that
|
|
no valid option is currently selected.</p>
|
|
|
|
<p>User agents are expected to render the labels in a
|
|
<code><a href="#the-select-element">select</a></code> in such a manner that any alignment remains
|
|
consistent whether the label is being displayed as part of the page
|
|
or in a menu control.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-textarea-element-0"><span class="secno">10.4.15 </span>The <code><a href="#the-textarea-element">textarea</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
textarea { binding: <i title="">textarea</i>; white-space: pre-wrap; }</pre>
|
|
|
|
<p>When the <i title="">textarea</i> binding applies to a
|
|
<code><a href="#the-textarea-element">textarea</a></code> element, the element is expected to render as
|
|
an 'inline-block' box rendered as a multiline text field.</p>
|
|
|
|
<p>If the element has a <code title="attr-textarea-cols"><a href="#attr-textarea-cols">cols</a></code>
|
|
attribute, and parsing that attribute's value using the <a href="#rules-for-parsing-non-negative-integers">rules
|
|
for parsing non-negative integers</a> doesn't generate an error,
|
|
then the user agent is expected to use the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> for the
|
|
'width' property on the element, with the value being the
|
|
<a href="#textarea-effective-width">textarea effective width</a> (as defined below). Otherwise,
|
|
the user agent is expected to act as if it had a user-agent-level
|
|
style sheet rule setting the 'width' property on the element to the
|
|
<a href="#textarea-effective-width">textarea effective width</a>.</p>
|
|
|
|
<p>The <dfn id="textarea-effective-width">textarea effective width</dfn> of a
|
|
<code><a href="#the-textarea-element">textarea</a></code> element is <span><var title="">size</var>×<var title="">avg</var> + <var title="">sbw</var></span>, where <var title="">size</var> is the
|
|
element's <a href="#attr-textarea-cols-value" title="attr-textarea-cols-value">character
|
|
width</a>, <var title="">avg</var> is the average character width
|
|
of the primary font of the element, in CSS pixels, and <var title="">sbw</var> is the width of a scroll bar, in CSS pixels. (The
|
|
element's 'letter-spacing' property does not affect the result.)</p>
|
|
|
|
<p>If the element has a <code title="attr-textarea-rows"><a href="#attr-textarea-rows">rows</a></code>
|
|
attribute, and parsing that attribute's value using the <a href="#rules-for-parsing-non-negative-integers">rules
|
|
for parsing non-negative integers</a> doesn't generate an error,
|
|
then the user agent is expected to use the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> for the
|
|
'height' property on the element, with the value being the
|
|
<a href="#textarea-effective-height">textarea effective height</a> (as defined
|
|
below). Otherwise, the user agent is expected to act as if it had a
|
|
user-agent-level style sheet rule setting the 'height' property on
|
|
the element to the <a href="#textarea-effective-height">textarea effective height</a>.</p>
|
|
|
|
<p>The <dfn id="textarea-effective-height">textarea effective height</dfn> of a
|
|
<code><a href="#the-textarea-element">textarea</a></code> element is the height in CSS pixels of the
|
|
number of lines specified the element's <a href="#attr-textarea-rows-value" title="attr-textarea-rows-value">character height</a>, plus the
|
|
height of a scrollbar in CSS pixels.</p>
|
|
|
|
<p>User agents are expected to apply the 'white-space' CSS property
|
|
to <code><a href="#the-textarea-element">textarea</a></code> elements. For historical reasons, if the
|
|
element has a <code title="attr-textarea-wrap"><a href="#attr-textarea-wrap">wrap</a></code> attribute
|
|
whose value is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the
|
|
string "<code title="attr-textarea-wrap-off">off</code>", then the
|
|
user agent is expected to treat the attribute as a <a href="#presentational-hints" title="presentational hints">presentational hint</a> setting the
|
|
element's 'white-space' property to 'pre'.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-keygen-element-0"><span class="secno">10.4.16 </span>The <code><a href="#the-keygen-element">keygen</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
keygen { binding: <i title="">keygen</i>; }</pre>
|
|
|
|
<p>When the <i title="">keygen</i> binding applies to a
|
|
<code><a href="#the-keygen-element">keygen</a></code> element, the element is expected to render as an
|
|
'inline-block' box containing a user interface to configure the key
|
|
pair to be generated.</p>
|
|
|
|
</div><div class="impl">
|
|
|
|
<h4 id="the-time-element-0"><span class="secno">10.4.17 </span>The <code><a href="#the-time-element">time</a></code> element</h4>
|
|
|
|
<pre class="css">@namespace url(http://www.w3.org/1999/xhtml);
|
|
|
|
time[datetime] { binding: <i title="">time</i>; }</pre>
|
|
|
|
<p>When the <i title="">time</i> binding applies to a
|
|
<code><a href="#the-time-element">time</a></code> element, the element is expected to render as if
|
|
it contained text conveying the <a href="#concept-time-date" title="concept-time-date">date</a> (if known), <a href="#concept-time-time" title="concept-time-time">time</a> (if known), and <a href="#concept-time-timezone" title="concept-time-timezone">time-zone offset</a> (if known)
|
|
represented by the element, in the fashion most convenient for the
|
|
user.</p>
|
|
|
|
|
|
|
|
</div><div class="impl">
|
|
|
|
<h3 id="frames-and-framesets"><span class="secno">10.5 </span>Frames and framesets</h3>
|
|
|
|
<p>When an <code><a href="#the-html-element">html</a></code> element's second child element is a
|
|
<code><a href="#frameset">frameset</a></code> element, the user agent is expected to render
|
|
the <code><a href="#frameset">frameset</a></code> element as described below across the
|
|
surface of the viewport, instead of applying the usual CSS rendering
|
|
rules.</p>
|
|
|
|
<p>When rendering a <code><a href="#frameset">frameset</a></code> on a surface, the user
|
|
agent is expected to use the following layout algorithm:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>The <var title="">cols</var> and <var title="">rows</var>
|
|
variables are lists of zero or more pairs consisting of a number
|
|
and a unit, the unit being one of <i>percentage</i>,
|
|
<i>relative</i>, and <i>absolute</i>.</p>
|
|
|
|
<p>Use the <a href="#rules-for-parsing-a-list-of-dimensions">rules for parsing a list of dimensions</a> to
|
|
parse the value of the element's <code title="attr-frameset-cols">cols</code> attribute, if there is
|
|
one. Let <var title="">cols</var> be the result, or an empty list
|
|
if there is no such attribute.</p>
|
|
|
|
<p>Use the <a href="#rules-for-parsing-a-list-of-dimensions">rules for parsing a list of dimensions</a> to
|
|
parse the value of the element's <code title="attr-frameset-rows">rows</code> attribute, if there is
|
|
one. Let <var title="">rows</var> be the result, or an empty list
|
|
if there is no such attribute.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>For any of the entries in <var title="">cols</var> or <var title="">rows</var> that have the number zero and the unit
|
|
<i>relative</i>, change the entry's number to one.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">cols</var> has no entries, then add a single
|
|
entry consisting of the value 1 and the unit <i>relative</i> to
|
|
<var title="">cols</var>.</p>
|
|
|
|
<p>If <var title="">rows</var> has no entries, then add a single
|
|
entry consisting of the value 1 and the unit <i>relative</i> to
|
|
<var title="">rows</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Invoke the algorithm defined below to <a href="#convert-a-list-of-dimensions-to-a-list-of-pixel-values">convert a list of
|
|
dimensions to a list of pixel values</a> using <var title="">cols</var> as the input list, and the width of the
|
|
surface that the <code><a href="#frameset">frameset</a></code> is being rendered into, in
|
|
CSS pixels, as the input dimension. Let <var title="">sized
|
|
cols</var> be the resulting list.</p>
|
|
|
|
<p>Invoke the algorithm defined below to <a href="#convert-a-list-of-dimensions-to-a-list-of-pixel-values">convert a list of
|
|
dimensions to a list of pixel values</a> using <var title="">rows</var> as the input list, and the height of the
|
|
surface that the <code><a href="#frameset">frameset</a></code> is being rendered into, in
|
|
CSS pixels, as the input dimension. Let <var title="">sized
|
|
rows</var> be the resulting list.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Split the surface into a grid of <span title=""><var title="">w</var>×<var title="">h</var></span> rectangles,
|
|
where <var title="">w</var> is the number of entries in <var title="">sized cols</var> and <var title="">h</var> is the number
|
|
of entries in <var title="">sized rows</var>.</p>
|
|
|
|
<p>Size the columns so that each column in the grid is as many CSS
|
|
pixels wide as the corresponding entry in the <var title="">sized
|
|
cols</var> list.</p>
|
|
|
|
<p>Size the rows so that each row in the grid is as many CSS
|
|
pixels high as the corresponding entry in the <var title="">sized
|
|
rows</var> list.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">children</var> be the list of
|
|
<code><a href="#frame">frame</a></code> and <code><a href="#frameset">frameset</a></code> elements that are
|
|
children of the <code><a href="#frameset">frameset</a></code> element for which the
|
|
algorithm was invoked.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>For each row of the grid of rectangles created in the previous
|
|
step, from top to bottom, run these substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>For each rectangle in the row, from left to right, run these
|
|
substeps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>If there are any elements left in <var title="">children</var>, take the first element in the list,
|
|
and assign it to the rectangle.</p>
|
|
|
|
<p>If this is a <code><a href="#frameset">frameset</a></code> element, then recurse
|
|
the entire <code><a href="#frameset">frameset</a></code> layout algorithm for that
|
|
<code><a href="#frameset">frameset</a></code> element, with the rectangle as the
|
|
surface.</p>
|
|
|
|
<p>Otherwise, it is a <code><a href="#frame">frame</a></code> element; create a
|
|
<a href="#nested-browsing-context">nested browsing context</a> sized to fit the
|
|
rectangle.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If there are any elements left in <var title="">children</var>, remove the first element from <var title="">children</var>.</p>
|
|
|
|
</ol></li>
|
|
|
|
</ol></li>
|
|
|
|
<li>
|
|
|
|
<p>If the <code><a href="#frameset">frameset</a></code> element <a href="#has-a-border">has a border</a>,
|
|
draw an outer set of borders around the rectangles, using the
|
|
element's <a href="#frame-border-color">frame border color</a>.</p>
|
|
|
|
<p>For each rectangle, if there is an element assigned to that
|
|
rectangle, and that element <a href="#has-a-border">has a border</a>, draw an
|
|
inner set of borders around that rectangle, using the
|
|
element's <a href="#frame-border-color">frame border color</a>.</p>
|
|
|
|
<p>For each (visible) border that does not abut a rectangle that
|
|
is assigned a <code><a href="#frame">frame</a></code> element with a <code title="attr-frame-noresize">noresize</code> attribute (including
|
|
rectangles in further nested <code><a href="#frameset">frameset</a></code> elements), the
|
|
user agent is expected to allow the user to move the border,
|
|
resizing the rectangles within, keeping the proportions of any
|
|
nested <code><a href="#frameset">frameset</a></code> grids.</p>
|
|
|
|
<p>A <code><a href="#frameset">frameset</a></code> or <code><a href="#frame">frame</a></code> element <dfn id="has-a-border">has
|
|
a border</dfn> if the following algorithm returns true:</p>
|
|
|
|
<ol><li><p>If the element has a <code title="attr-frames-frameborder">frameborder</code> attribute
|
|
whose value is not the empty string and whose first character is
|
|
either a U+0031 DIGIT ONE (1) character, a U+0079 LATIN SMALL
|
|
LETTER Y character (y), or a U+0059 LATIN CAPITAL LETTER Y
|
|
character (Y), then return true.</li>
|
|
|
|
<li><p>Otherwise, if the element has a <code title="attr-frames-frameborder">frameborder</code> attribute,
|
|
return false.</li>
|
|
|
|
<li><p>Otherwise, if the element has a parent element that is a
|
|
<code><a href="#frameset">frameset</a></code> element, then return true if <em>that</em>
|
|
element <a href="#has-a-border">has a border</a>, and false if it does
|
|
not.</li>
|
|
|
|
<li><p>Otherwise, return true.</li>
|
|
|
|
</ol><p>The <dfn id="frame-border-color">frame border color</dfn> of a <code><a href="#frameset">frameset</a></code> or
|
|
<code><a href="#frame">frame</a></code> element is the color obtained from the
|
|
following algorithm:</p>
|
|
|
|
<ol><li><p>If the element has a <code title="attr-frames-bordercolor">bordercolor</code> attribute, and
|
|
applying the <a href="#rules-for-parsing-a-legacy-color-value">rules for parsing a legacy color value</a>
|
|
to that attribute's value does not result in an error, then
|
|
return the color so obtained.</li>
|
|
|
|
<li><p>Otherwise, if the element has a parent element that is a
|
|
<code><a href="#frameset">frameset</a></code> element, then the <a href="#frame-border-color">frame border
|
|
color</a> of that element.</p>
|
|
|
|
<li><p>Otherwise, return gray.</li>
|
|
|
|
</ol></li>
|
|
|
|
</ol><p>The algorithm to <dfn id="convert-a-list-of-dimensions-to-a-list-of-pixel-values">convert a list of dimensions to a list of
|
|
pixel values</dfn> consists of the following steps:</p>
|
|
|
|
<ol><li>
|
|
|
|
<p>Let <var title="">input list</var> be the list of numbers and
|
|
units passed to the algorithm.</p>
|
|
|
|
<p>Let <var title="">output list</var> be a list of numbers the
|
|
same length as <var title="">input list</var>, all zero.</p>
|
|
|
|
<p>Entries in <var title="">output list</var> correspond to the
|
|
entries in <var title="">input list</var> that have the same
|
|
position.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Let <var title="">input dimension</var> be the size passed
|
|
to the algorithm.</p>
|
|
|
|
<li>
|
|
|
|
<p>Let <var title="">count percentage</var> be the number of
|
|
entries in <var title="">input list</var> whose unit is
|
|
<i>percentage</i>.</p>
|
|
|
|
<p>Let <var title="">total percentage</var> be the sum of all the
|
|
numbers in <var title="">input list</var> whose unit is
|
|
<i>percentage</i>.</p>
|
|
|
|
<p>Let <var title="">count relative</var> be the number of
|
|
entries in <var title="">input list</var> whose unit is
|
|
<i>relative</i>.</p>
|
|
|
|
<p>Let <var title="">total relative</var> be the sum of all the
|
|
numbers in <var title="">input list</var> whose unit is
|
|
<i>relative</i>.</p>
|
|
|
|
<p>Let <var title="">count absolute</var> be the number of
|
|
entries in <var title="">input list</var> whose unit is
|
|
<i>absolute</i>.</p>
|
|
|
|
<p>Let <var title="">total absolute</var> be the sum of all the
|
|
numbers in <var title="">input list</var> whose unit is
|
|
<i>absolute</i>.</p>
|
|
|
|
<p>Let <var title="">remaining space</var> be the value of <var title="">input dimension</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">total absolute</var> is greater than <var title="">remaining space</var>, then for each entry in <var title="">input list</var> whose unit is <i>absolute</i>, set the
|
|
corresponding value in <var title="">output list</var> to the
|
|
number of the entry in <var title="">input list</var> multiplied
|
|
by <var title="">remaining space</var> and divided by <var title="">total absolute</var>. Then, set <var title="">remaining
|
|
space</var> to zero.</p>
|
|
|
|
<p>Otherwise, for each entry in <var title="">input list</var>
|
|
whose unit is <i>absolute</i>, set the corresponding value in <var title="">output list</var> to the number of the entry in <var title="">input list</var>. Then, decrement <var title="">remaining
|
|
space</var> by <var title="">total absolute</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>If <var title="">total percentage</var> multiplied by the <var title="">input dimension</var> and divided by 100 is greater than
|
|
<var title="">remaining space</var>, then for each entry in <var title="">input list</var> whose unit is <i>percentage</i>, set the
|
|
corresponding value in <var title="">output list</var> to the
|
|
number of the entry in <var title="">input list</var> multiplied
|
|
by <var title="">remaining space</var> and divided by <var title="">total percentage</var>. Then, set <var title="">remaining
|
|
space</var> to zero.</p>
|
|
|
|
<p>Otherwise, for each entry in <var title="">input list</var>
|
|
whose unit is <i>percentage</i>, set the corresponding value in
|
|
<var title="">output list</var> to the number of the entry in <var title="">input list</var> multiplied by the <var title="">input
|
|
dimension</var> and divided by 100. Then, decrement <var title="">remaining space</var> by <var title="">total
|
|
percentage</var> multiplied by the <var title="">input
|
|
dimension</var> and divided by 100.</p>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<p>For each entry in <var title="">input list</var> whose unit is
|
|
<i>relative</i>, set the corresponding value in <var title="">output list</var> to the number of the entry in <var title="">input list</var> multiplied by <var title="">remaining
|
|
space</var> and divided by <var title="">total relative</var>.</p>
|
|
|
|
</li>
|
|
|
|
<li><p>Return <var title="">output list</var>.</li>
|
|
|
|
</ol><p>User agents working with integer values for frame widths (as
|
|
opposed to user agents that can lay frames out with subpixel
|
|
accuracy) are expected to distribute the remainder first to the last
|
|
entry whose unit is <i>relative</i>, then equally (not
|
|
proportionally) to each entry whose unit is <i>percentage</i>, then
|
|
equally (not proportionally) to each entry whose unit is
|
|
<i>absolute</i>, and finally, failing all else, to the last
|
|
entry.</p>
|
|
|
|
|
|
</div><div class="impl">
|
|
|
|
<h3 id="interactive-media"><span class="secno">10.6 </span>Interactive media</h3>
|
|
|
|
<h4 id="links-forms-and-navigation"><span class="secno">10.6.1 </span>Links, forms, and navigation</h4>
|
|
|
|
<p>User agents are expected to allow the user to control aspects of
|
|
<a href="#hyperlink">hyperlink</a> activation and <a href="#form-submission">form submission</a>,
|
|
such as which <a href="#browsing-context">browsing context</a> is to be used for the
|
|
subsequent <a href="#navigate" title="navigate">navigation</a>.</p>
|
|
|
|
<p>User agents are expected to allow users to discover the
|
|
destination of <a href="#hyperlink" title="hyperlink">hyperlinks</a> and of
|
|
<a href="#the-form-element" title="form">forms</a> before triggering their <a href="#navigate" title="navigate">navigation</a>.</p>
|
|
|
|
|
|
<p>User agents are expected to allow users to
|
|
<a href="#navigate">navigate</a> <a href="#browsing-context" title="browsing
|
|
context">browsing contexts</a> to the resources <a href="#resolve-a-url" title="resolve a url">indicated</a> by the <code title="">cite</code> attributes on <code><a href="#the-q-element">q</a></code>,
|
|
<code><a href="#the-blockquote-element">blockquote</a></code>,
|
|
<code><a href="#the-ins-element">ins</a></code>, and <code><a href="#the-del-element">del</a></code> elements.</p>
|
|
|
|
<p>User agents are expected to surface <a href="#hyperlink" title="hyperlink">hyperlinks</a> created by <code><a href="#the-link-element">link</a></code>
|
|
elements in their user interface.</p>
|
|
|
|
<p class="note">While <code><a href="#the-link-element">link</a></code> elements that create <a href="#hyperlink" title="hyperlink">hyperlinks</a> will match the ':link' or
|
|
':visited' pseudo-classes, will react to clicks if visible, and so
|
|
forth, this does not extend to any browser interface constructs that
|
|
expose those same links. Activating a link through the browser's
|
|
interface, rather than in the page itself, does not trigger <code title="event-click"><a href="#event-click">click</a></code> events and the like.</p>
|
|
|
|
|
|
|
|
|
|
<h4 id="the-title-attribute-0"><span class="secno">10.6.2 </span>The <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute</h4>
|
|
|
|
<p>Given an element (e.g. the element designated by the mouse
|
|
cursor), if the element, or one of its ancestors, has a <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute, and the nearest such
|
|
attribute has a value that is not the empty string, it is expected
|
|
that the user agent will expose the contents of that attribute as a
|
|
tooltip.</p>
|
|
|
|
<p>U+000A LINE FEED (LF) characters are expected to cause line
|
|
breaks in the tooltip, U+0009 CHARACTER TABULATION (tab) characters
|
|
are expected to render as a non-zero horizontal shift that lines up
|
|
the next glpyh with the next tab stop, with tab stops occurring at
|
|
points that are multiples of 8 times the width of a U+0020 SPACE
|
|
character.</p>
|
|
|
|
<p>User agents are encouraged to make it possible to view tooltips
|
|
without the use of a pointing device, since not all users are able
|
|
to use pointing devices.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, a visual user agent could make elements with a
|
|
<code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute focusable, and
|
|
could make any focused element with a <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute show its tooltip under
|
|
the element while the element has focus. This would allow a user to
|
|
tab around the document to find all the advisory text.</p>
|
|
|
|
</div>
|
|
|
|
<div class="example">
|
|
|
|
<p>As another example, a screen reader could provide an audio cue
|
|
when reading an element with a tooltip, with an associated key to
|
|
read the last tooltip for which a cue was played.</p>
|
|
|
|
</div>
|
|
|
|
|
|
<h4 id="editing-hosts"><span class="secno">10.6.3 </span>Editing hosts</h4>
|
|
|
|
<p>The current text editing caret (the one at the <a href="#caret-position">caret
|
|
position</a> in a focused <a href="#editing-host">editing host</a>) is expected
|
|
to act like an inline replaced element with the vertical dimensions
|
|
of the caret and with zero width for the purposes of the CSS
|
|
rendering model.</p>
|
|
|
|
<p class="note">This means that even an empty block can have the
|
|
caret inside it, and that when the caret is in such an element, it
|
|
prevents margins from collapsing through the element.</p>
|
|
|
|
|
|
|
|
<h4 id="text-rendered-in-native-user-interfaces"><span class="secno">10.6.4 </span>Text rendered in native user interfaces</h4>
|
|
|
|
<p>User agents are expected to honor the Unicode semantics of text
|
|
that is exposed in user interfaces, for example supporting the
|
|
bidirectional algorithm in text shown in dialogs, title bars, pop-up
|
|
menus, and tooltips. Text from elements (either attribute values or
|
|
the contents of elements) is expected to be rendered in a manner
|
|
that honors <a href="#the-directionality">the directionality</a> of the element from
|
|
which the text was obtained.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>Consider the following markup, which has Hebrew text asking for
|
|
a programming language, the languages being text for which a
|
|
left-to-right direction is important given the punctuation in some
|
|
of their names:</p>
|
|
|
|
<pre><p dir="rtl" lang="he">
|
|
<label>
|
|
<span dir="rtl" lang="he" title="">בחר שפת תכנות:</span>
|
|
<select>
|
|
<option dir="ltr">C++</option>
|
|
<option dir="ltr">C#</option>
|
|
<option dir="ltr">FreePascal</option>
|
|
<option dir="ltr">F#</option>
|
|
</select>
|
|
</label>
|
|
</p></pre>
|
|
|
|
<p>If the <code><a href="#the-select-element">select</a></code> element was rendered as a drop down
|
|
box, a correct rendering would ensure that the punctuation was the
|
|
same both in the drop down, and in the box showing the current
|
|
selection.</p>
|
|
|
|
<p><img alt="" height="105" src="bidiselect.png" width="206"></p>
|
|
</div>
|
|
|
|
<p>A string provided by a script (e.g. the argument to <code title="dom-alert"><a href="#dom-alert">window.alert()</a></code>) is expected to be treated
|
|
as an independent set of one or more bidirectional algorithm
|
|
paragraphs when displayed, as defined by the bidirectional
|
|
algorithm, including, for instance, supporting the
|
|
paragraph-breaking behaviour of U+000A LINE FEED (LF) characters.
|
|
For the purposes of determining the paragraph level of such text in
|
|
the bidirectional algorithm, this specification does <em>not</em>
|
|
provide a higher-level override of rules P2 and P3. <a href="#refsBIDI">[BIDI]</a></p>
|
|
|
|
<p>When necessary, authors can enforce a particular direction for a
|
|
given paragraph by starting it with the Unicode U+200E LEFT-TO-RIGHT
|
|
MARK or U+200F RIGHT-TO-LEFT MARK characters.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>Thus, the following script:</p>
|
|
|
|
<pre>alert('\u05DC\u05DE\u05D3 HTML \u05D4\u05D9\u05D5\u05DD!')</pre>
|
|
|
|
<p>...would always result in a message reading
|
|
"<bdo dir="rtl" title="">למד LMTH היום!</bdo>"
|
|
(not "<bdo dir="ltr" title="">דמל HTML םויה!</bdo>"),
|
|
regardless of the language of the user agent interface or the
|
|
direction of the page or any of its elements.</p>
|
|
|
|
</div>
|
|
|
|
<div class="example">
|
|
|
|
<p>For a more complex example, consider the following script:</p>
|
|
|
|
<pre class="bad">/* Warning: this script does not handle right-to-left scripts correctly */
|
|
var s;
|
|
if (s = prompt('What is your name?')) {
|
|
alert(s + '! Ok, Fred, ' + s + ', and Wilma will get the car.');
|
|
}</pre>
|
|
|
|
<p>When the user enters "<kbd>Kitty</kbd>", the user agent would
|
|
alert "<samp>Kitty! Ok, Fred, Kitty, and Wilma will get the
|
|
car.</samp>". However, if the user enters "<kbd dir="rtl" lang="ar">لا أفهم</kbd>",
|
|
then the bidirectional algorithm will determine that the direction
|
|
of the paragraph is right-to-left, and so the output will be the
|
|
following unintended mess: "<samp><bdo dir="rtl">لا أفهم! derF ,kO, لا أفهم, rac eht teg lliw amliW dna.</bdo></samp>"</p>
|
|
|
|
<p>To force an alert that starts with user-provided text (or other
|
|
text of unknown directionality) to render left-to-right, the string
|
|
can be prefixed with a U+200E LEFT-TO-RIGHT MARK character:</p>
|
|
|
|
<pre>var s;
|
|
if (s = prompt('What is your name?')) {
|
|
alert('<strong>\u200E</strong>' + s + '! Ok, Fred, ' + s + ', and Wilma will get the car.');
|
|
}</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3 id="print-media"><span class="secno">10.7 </span>Print media</h3>
|
|
|
|
<p>User agents are expected to allow the user to request the
|
|
opportunity to <dfn id="obtain-a-physical-form">obtain a physical form</dfn> (or a
|
|
representation of a physical form) of a <code><a href="#document">Document</a></code>. For
|
|
example, selecting the option to print a page or convert it to PDF
|
|
format.</p>
|
|
|
|
<p>When the user actually <a href="#obtain-a-physical-form" title="obtain a physical
|
|
form">obtains a physical form</a> (or a representation of a
|
|
physical form) of a <code><a href="#document">Document</a></code>, the user agent is
|
|
expected to create a new rendering of the <code><a href="#document">Document</a></code> for
|
|
the print media.</p>
|
|
|
|
|
|
|
|
</div><h2 id="obsolete"><span class="secno">11 </span>Obsolete features</h2><h3 id="obsolete-but-conforming-features"><span class="secno">11.1 </span>Obsolete but conforming features</h3><p>Features listed in this section will trigger warnings in
|
|
conformance checkers.<p>Authors should not specify a <code title="attr-img-border"><a href="#attr-img-border">border</a></code> attribute on an
|
|
<code><a href="#the-img-element">img</a></code> element. If the attribute is present, its value
|
|
must be the string "<code title="">0</code>". CSS should be used
|
|
instead.<p>Authors should not specify a <code title="attr-script-language"><a href="#attr-script-language">language</a></code> attribute on a
|
|
<code><a href="#the-script-element">script</a></code> element. If the attribute is present, its value
|
|
must be an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the string
|
|
"<code title="">JavaScript</code>" and either the <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute must be omitted or
|
|
its value must be an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for
|
|
the string "<code title="">text/javascript</code>". The attribute
|
|
should be entirely omitted instead (with the value "<code title="">JavaScript</code>", it has no effect), or replaced with use
|
|
of the <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute.<p>Authors should not specify the <code title="attr-a-name"><a href="#attr-a-name">name</a></code> attribute on <code><a href="#the-a-element">a</a></code>
|
|
elements. If the attribute is present, its value must not be the
|
|
empty string and must neither be equal to the value of any of the
|
|
<a href="#concept-id" title="concept-id">IDs</a> in the element's <a href="#home-subtree">home
|
|
subtree</a> other than the element's own <a href="#concept-id" title="concept-id">ID</a>, if any, nor be equal to the value of
|
|
any of the other <code title="attr-a-name"><a href="#attr-a-name">name</a></code> attributes on
|
|
<code><a href="#the-a-element">a</a></code> elements in the element's <a href="#home-subtree">home
|
|
subtree</a>. If this attribute is present and the element has an
|
|
<a href="#concept-id" title="concept-id">ID</a>, then the attribute's value must
|
|
be equal to the element's <a href="#concept-id" title="concept-id">ID</a>. In
|
|
earlier versions of the language, this attribute was intended as a
|
|
way to specify possible targets for fragment identifiers in <a href="#url" title="URL">URLs</a>. The <code title="attr-id"><a href="#the-id-attribute">id</a></code>
|
|
attribute should be used instead.<p class="note">In <a href="#syntax">the HTML syntax</a>, specifying a <a href="#syntax-doctype" title="syntax-DOCTYPE">DOCTYPE</a> that is an <a href="#obsolete-permitted-doctype">obsolete
|
|
permitted DOCTYPE</a> will also trigger a warning.<div class="impl">
|
|
|
|
<h4 id="warnings-for-obsolete-but-conforming-features"><span class="secno">11.1.1 </span>Warnings for obsolete but conforming features</h4>
|
|
|
|
<p>To ease the transition from HTML4 Transitional documents to the
|
|
language defined in <em>this</em> specification, and to discourage
|
|
certain features that are only allowed in very few circumstances,
|
|
conformance checkers are required to warn the user when the
|
|
following features are used in a document. These are generally old
|
|
obsolete features that have no effect, and are allowed only to
|
|
distinguish between likely mistakes (regular conformance errors) and
|
|
mere vestigial markup or unusual and discouraged practices (these
|
|
warnings).</p>
|
|
|
|
<p>The following features must be categorized as described
|
|
above:</p>
|
|
|
|
<ul><li><p>The presence of an <a href="#obsolete-permitted-doctype">obsolete permitted DOCTYPE</a>
|
|
in an <a href="#html-documents" title="HTML documents">HTML document</a>.</li>
|
|
|
|
<li><p>The presence of a <code title="attr-img-border"><a href="#attr-img-border">border</a></code> attribute on an
|
|
<code><a href="#the-img-element">img</a></code> element if its value is the string "<code title="">0</code>".</li>
|
|
|
|
<li><p>The presence of a <code title="attr-script-language"><a href="#attr-script-language">language</a></code> attribute on a
|
|
<code><a href="#the-script-element">script</a></code> element if its value is an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the string "<code title="">JavaScript</code>" and if there is no <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute or there is and its
|
|
value is an <a href="#ascii-case-insensitive">ASCII case-insensitive</a> match for the
|
|
string "<code title="">text/javascript</code>".</li>
|
|
|
|
<li><p>The presence of a <code title="attr-a-name"><a href="#attr-a-name">name</a></code>
|
|
attribute on an <code><a href="#the-a-element">a</a></code> element, if its value is not the
|
|
empty string.</li>
|
|
|
|
</ul><p>Conformance checkers must distinguish between pages that have no
|
|
conformance errors and have none of these obsolete features, and
|
|
pages that have no conformance errors but do have some of these
|
|
obsolete features.</p>
|
|
|
|
<p class="example">For example, a validator could report some pages
|
|
as "Valid HTML" and others as "Valid HTML with warnings".</p>
|
|
|
|
</div><h3 id="non-conforming-features"><span class="secno">11.2 </span>Non-conforming features</h3><p>Elements in the following list are entirely obsolete, and must
|
|
not be used by authors:<dl><dt><code><a href="#the-applet-element">applet</a></code></dt>
|
|
<dd><p>Use <code><a href="#the-embed-element">embed</a></code> or <code><a href="#the-object-element">object</a></code> instead.</dd>
|
|
|
|
<dt><dfn id="acronym"><code>acronym</code></dfn></dt>
|
|
<dd><p>Use <code><a href="#the-abbr-element">abbr</a></code> instead.</dd>
|
|
|
|
<dt><dfn id="bgsound"><code>bgsound</code></dfn></dt>
|
|
<dd><p>Use <code><a href="#the-audio-element">audio</a></code> instead.</dd>
|
|
|
|
<dt><dfn id="dir"><code>dir</code></dfn></dt>
|
|
<dd><p>Use <code><a href="#the-ul-element">ul</a></code> instead.</dd>
|
|
|
|
<dt><code><a href="#frame">frame</a></code></dt>
|
|
<dt><code><a href="#frameset">frameset</a></code></dt>
|
|
<dt><dfn id="noframes"><code>noframes</code></dfn></dt>
|
|
<dd><p>Either use <code><a href="#the-iframe-element">iframe</a></code> and CSS instead, or use server-side includes to generate complete pages with the various invariant parts merged in.</dd>
|
|
|
|
<dt><dfn id="isindex-0"><code>isindex</code></dfn></dt>
|
|
<dd><p>Use an explicit <code><a href="#the-form-element">form</a></code> and <a href="#text-state-and-search-state" title="attr-input-type-text">text field</a> combination instead.</dd>
|
|
|
|
<dt><dfn id="listing"><code>listing</code></dfn></dt>
|
|
<dd><p>Use <code><a href="#the-pre-element">pre</a></code> and <code><a href="#the-code-element">code</a></code> instead.</dd>
|
|
|
|
<dt><dfn id="nextid"><code>nextid</code></dfn></dt>
|
|
<dd><p>Use GUIDs instead.</dd>
|
|
|
|
<dt><dfn id="noembed"><code>noembed</code></dfn></dt>
|
|
<dd><p>Use <code><a href="#the-object-element">object</a></code> instead of <code><a href="#the-embed-element">embed</a></code> when fallback is necessary.</dd>
|
|
|
|
<dt><dfn id="plaintext"><code>plaintext</code></dfn></dt>
|
|
<dd><p>Use the "<code>text/plain</code>" <a href="#mime-type">MIME type</a> instead.</dd>
|
|
|
|
<dt><dfn id="rb"><code>rb</code></dfn></dt>
|
|
<dd><p>Providing the ruby base directly inside the <code><a href="#the-ruby-element">ruby</a></code> element is sufficient; the <code><a href="#rb">rb</a></code> element is unnecessary. Omit it altogether.</dd>
|
|
|
|
<dt><dfn id="strike"><code>strike</code></dfn></dt>
|
|
<dd><p>Use <code><a href="#the-del-element">del</a></code> instead if the element is marking an edit, otherwise use <code><a href="#the-s-element">s</a></code> instead.</dd>
|
|
|
|
<dt><dfn id="xmp"><code>xmp</code></dfn></dt>
|
|
<dd><p>Use <code><a href="#the-code-element">code</a></code> instead, and escape "<code title=""><</code>" and "<code title="">&</code>" characters as "<code title="">&lt;</code>" and "<code title="">&amp;</code>" respectively.</dd>
|
|
|
|
<dt><dfn id="basefont"><code>basefont</code></dfn></dt>
|
|
<dt><dfn id="big"><code>big</code></dfn></dt>
|
|
<dt><dfn id="blink"><code>blink</code></dfn></dt>
|
|
<dt><dfn id="center"><code>center</code></dfn></dt>
|
|
<dt><dfn id="font"><code>font</code></dfn></dt>
|
|
<dt><code><a href="#the-marquee-element">marquee</a></code></dt>
|
|
<dt><dfn id="multicol"><code>multicol</code></dfn></dt>
|
|
<dt><dfn id="nobr"><code>nobr</code></dfn></dt>
|
|
<dt><dfn id="spacer"><code>spacer</code></dfn></dt>
|
|
<dt><dfn id="tt"><code>tt</code></dfn></dt>
|
|
|
|
<dd>
|
|
|
|
<p>Use appropriate elements and/or CSS instead.</p>
|
|
|
|
<p>Where the <code><a href="#tt">tt</a></code> element would have been used for
|
|
marking up keyboard input, consider the <code><a href="#the-kbd-element">kbd</a></code> element;
|
|
for variables, consider the <code><a href="#the-var-element">var</a></code> element; for computer
|
|
code, consider the <code><a href="#the-code-element">code</a></code> element; and for computer
|
|
output, consider the <code><a href="#the-samp-element">samp</a></code> element.</p>
|
|
|
|
<p>Similarly, if the <code><a href="#big">big</a></code> element is being used to
|
|
denote a heading, consider using the <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code> element; if
|
|
it is being used for marking up important passages, consider the
|
|
<code><a href="#the-strong-element">strong</a></code> element; and if it is being used for
|
|
highlighting text for reference purposes, consider the
|
|
<code><a href="#the-mark-element">mark</a></code> element.</p>
|
|
|
|
<p>See also the <a href="#usage-summary">text-level semantics
|
|
usage summary</a> for more suggestions with examples.</p>
|
|
|
|
</dd>
|
|
|
|
</dl><hr><p>The following attributes are obsolete (though the elements are
|
|
still part of the language), and must not be used by authors:<dl><dt><dfn id="attr-a-charset" title="attr-a-charset"><code>charset</code></dfn> on <code><a href="#the-a-element">a</a></code> elements</dt>
|
|
<dt><dfn id="attr-link-charset" title="attr-link-charset"><code>charset</code></dfn> on <code><a href="#the-link-element">link</a></code> elements</dt>
|
|
<dd><p>Use an HTTP Content-Type header on the linked resource instead.</dd>
|
|
|
|
<dt><dfn id="attr-a-coords" title="attr-a-coords"><code>coords</code></dfn> on <code><a href="#the-a-element">a</a></code> elements</dt>
|
|
<dt><dfn id="attr-a-shape" title="attr-a-shape"><code>shape</code></dfn> on <code><a href="#the-a-element">a</a></code> elements</dt>
|
|
<dd><p>Use <code><a href="#the-area-element">area</a></code> instead of <code><a href="#the-a-element">a</a></code> for image maps.</dd>
|
|
|
|
<dt><dfn id="attr-a-methods" title="attr-a-methods"><code>methods</code></dfn> on <code><a href="#the-a-element">a</a></code> elements</dt>
|
|
<dt><dfn id="attr-link-methods" title="attr-link-methods"><code>methods</code></dfn> on <code><a href="#the-link-element">link</a></code> elements</dt>
|
|
<dd><p>Use the HTTP OPTIONS feature instead.</dd>
|
|
|
|
<dt><dfn id="attr-a-name" title="attr-a-name"><code>name</code></dfn> on <code><a href="#the-a-element">a</a></code> elements (except as noted in the previous section)</dt>
|
|
<dt><dfn id="attr-embed-name" title="attr-embed-name"><code>name</code></dfn> on <code><a href="#the-embed-element">embed</a></code> elements</dt>
|
|
<dt><dfn id="attr-img-name" title="attr-img-name"><code>name</code></dfn> on <code><a href="#the-img-element">img</a></code> elements</dt>
|
|
<dt><dfn id="attr-option-name" title="attr-option-name"><code>name</code></dfn> on <code><a href="#the-option-element">option</a></code> elements</dt>
|
|
<dd><p>Use the <code title="attr-id"><a href="#the-id-attribute">id</a></code> attribute instead.</dd>
|
|
|
|
<dt><dfn id="attr-a-rev" title="attr-a-rev"><code>rev</code></dfn> on <code><a href="#the-a-element">a</a></code> elements</dt>
|
|
<dt><dfn id="attr-link-rev" title="attr-link-rev"><code>rev</code></dfn> on <code><a href="#the-link-element">link</a></code> elements</dt>
|
|
<dd><p>Use the <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>
|
|
attribute instead, with an opposite term. (For example, instead of
|
|
<code title="">rev="made"</code>, use <code title="">rel="author"</code>.)</dd>
|
|
|
|
<dt><dfn id="attr-a-urn" title="attr-a-urn"><code>urn</code></dfn> on <code><a href="#the-a-element">a</a></code> elements</dt>
|
|
<dt><dfn id="attr-link-urn" title="attr-link-urn"><code>urn</code></dfn> on <code><a href="#the-link-element">link</a></code> elements</dt>
|
|
<dd><p>Specify the preferred persistent identifier using the <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code> attribute instead.</dd>
|
|
|
|
<dt><dfn id="attr-area-nohref" title="attr-area-nohref"><code>nohref</code></dfn> on <code><a href="#the-area-element">area</a></code> elements</dt>
|
|
<dd><p>Omitting the <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>
|
|
attribute is sufficient; the <code title="attr-area-nohref"><a href="#attr-area-nohref">nohref</a></code> attribute is
|
|
unnecessary. Omit it altogether.</dd>
|
|
|
|
<dt><dfn id="attr-head-profile" title="attr-head-profile"><code>profile</code></dfn> on <code><a href="#the-head-element">head</a></code> elements</dt>
|
|
<dd><p>When used for declaring which <code><a href="#the-meta-element">meta</a></code> terms are
|
|
used in the document, unnecessary; omit it altogether, and <a href="#concept-meta-extensions" title="concept-meta-extensions">register the names</a>.</dd>
|
|
<dd><p>When used for triggering specific user agent behaviors: use
|
|
a <code><a href="#the-link-element">link</a></code> element instead.</dd>
|
|
|
|
<dt><dfn id="attr-html-version" title="attr-html-version"><code>version</code></dfn> on <code><a href="#the-html-element">html</a></code> elements</dt>
|
|
<dd><p>Unnecessary. Omit it altogether.</dd>
|
|
|
|
<dt><dfn id="attr-input-usemap" title="attr-input-usemap"><code>usemap</code></dfn> on <code><a href="#the-input-element">input</a></code> elements</dt>
|
|
<dd><p>Use <code><a href="#the-img-element">img</a></code> instead of <code><a href="#the-input-element">input</a></code> for image maps.</dd>
|
|
|
|
<dt><dfn id="attr-iframe-longdesc" title="attr-iframe-longdesc"><code>longdesc</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-img-longdesc" title="attr-img-longdesc"><code>longdesc</code></dfn> on <code><a href="#the-img-element">img</a></code> elements</dt>
|
|
<dd><p>Use a regular <code><a href="#the-a-element">a</a></code> element to link to the
|
|
description, or (in the case of images) use an <a href="#image-map">image
|
|
map</a> to provide a link from the image to the image's
|
|
description.</dd>
|
|
|
|
<dt><dfn id="attr-img-lowsrc" title="attr-img-lowsrc"><code>lowsrc</code></dfn> on <code><a href="#the-img-element">img</a></code> elements</dt>
|
|
<dd><p>Use a progressive JPEG image (given in the <code title="attr-img-src"><a href="#attr-img-src">src</a></code> attribute),
|
|
instead of using two separate images.</dd>
|
|
|
|
<dt><dfn id="attr-link-target" title="attr-link-target"><code>target</code></dfn> on <code><a href="#the-link-element">link</a></code> elements</dt>
|
|
<dd><p>Unnecessary. Omit it altogether.</dd>
|
|
|
|
<dt><dfn id="attr-meta-scheme" title="attr-meta-scheme"><code>scheme</code></dfn> on <code><a href="#the-meta-element">meta</a></code> elements</dt>
|
|
<dd><p>Use only one scheme per field, or make the scheme declaration part of the value.</dd>
|
|
|
|
<dt><dfn id="attr-object-archive" title="attr-object-archive"><code>archive</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dt><dfn id="attr-object-classid" title="attr-object-classid"><code>classid</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dt><dfn id="attr-object-code" title="attr-object-code"><code>code</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dt><dfn id="attr-object-codebase" title="attr-object-codebase"><code>codebase</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dt><dfn id="attr-object-codetype" title="attr-object-codetype"><code>codetype</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dd><p>Use the <code title="attr-object-data"><a href="#attr-object-data">data</a></code> and <code title="attr-object-type"><a href="#attr-object-type">type</a></code> attributes to invoke <a href="#plugin" title="plugin">plugins</a>. To set parameters with these names
|
|
in particular, the <code><a href="#the-param-element">param</a></code> element can be used.</dd>
|
|
|
|
<dt><dfn id="attr-object-declare" title="attr-object-declare"><code>declare</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dd><p>Repeat the <code><a href="#the-object-element">object</a></code> element completely each time the resource is to be reused.</dd>
|
|
|
|
<dt><dfn id="attr-object-standby" title="attr-object-standby"><code>standby</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dd><p>Optimize the linked resource so that it loads quickly or, at least, incrementally.</dd>
|
|
|
|
<dt><dfn id="attr-param-type" title="attr-param-type"><code>type</code></dfn> on <code><a href="#the-param-element">param</a></code> elements</dt>
|
|
<dt><dfn id="attr-param-valuetype" title="attr-param-valuetype"><code>valuetype</code></dfn> on <code><a href="#the-param-element">param</a></code> elements</dt>
|
|
<dd><p>Use the <code title="attr-param-name"><a href="#attr-param-name">name</a></code> and <code title="attr-param-value"><a href="#attr-param-value">value</a></code> attributes without declaring
|
|
value types.</dd>
|
|
|
|
<dt><dfn id="attr-script-language" title="attr-script-language"><code>language</code></dfn> on <code><a href="#the-script-element">script</a></code> elements (except as noted in the previous section)</dt>
|
|
<dd><p>Use the <code title="attr-script-type"><a href="#attr-script-type">type</a></code> attribute
|
|
instead.</dd>
|
|
|
|
<dt><dfn id="attr-script-event" title="attr-script-event"><code>event</code></dfn> on <code><a href="#the-script-element">script</a></code> elements</dt>
|
|
<dt><dfn id="attr-script-for" title="attr-script-for"><code>for</code></dfn> on <code><a href="#the-script-element">script</a></code> elements</dt>
|
|
<dd><p>Use DOM Events mechanisms to register event listeners. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></dd>
|
|
|
|
<dt><dfn id="attr-table-datapagesize" title="attr-table-datapagesize"><code>datapagesize</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dd><p>Unnecessary. Omit it altogether.</dd>
|
|
|
|
<dt><dfn id="attr-table-summary" title="attr-table-summary"><code>summary</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dd><p>Use one of the <a href="#table-descriptions-techniques">techniques for describing
|
|
tables</a> given in the <code><a href="#the-table-element">table</a></code> section
|
|
instead.</dd>
|
|
|
|
<dt><dfn id="attr-tdth-abbr" title="attr-tdth-abbr"><code>abbr</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dd><p>Use text that begins in an unambiguous and terse manner, and include any more elaborate text after that. The <code title="attr-title"><a href="#the-title-attribute">title</a></code> attribute can also be useful in including more detailed text, so that the cell's contents can be made terse.</p>
|
|
|
|
<dt><dfn id="attr-tdth-axis" title="attr-tdth-axis"><code>axis</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dd><p>Use the <code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code> attribute on the relevant <code><a href="#the-th-element">th</a></code>.</p>
|
|
|
|
<dt><dfn id="attr-datasrc" title="attr-datasrc"><code>datasrc</code></dfn> on <code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-button-element">button</a></code>, <code><a href="#the-div-element">div</a></code>, <code><a href="#frame">frame</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, <code><a href="#the-input-element">input</a></code>, <code><a href="#the-label-element">label</a></code>, <code><a href="#the-legend-element">legend</a></code>, <code><a href="#the-marquee-element">marquee</a></code>, <code><a href="#the-object-element">object</a></code>, <code><a href="#the-option-element">option</a></code>, <code><a href="#the-select-element">select</a></code>, <code><a href="#the-span-element">span</a></code>, <code><a href="#the-table-element">table</a></code>, and <code><a href="#the-textarea-element">textarea</a></code> elements</dt>
|
|
<dt><dfn id="attr-datafld" title="attr-datafld"><code>datafld</code></dfn> on <code><a href="#the-a-element">a</a></code>, <code><a href="#the-applet-element">applet</a></code>, <code><a href="#the-button-element">button</a></code>, <code><a href="#the-div-element">div</a></code>, <code><a href="#the-fieldset-element">fieldset</a></code>, <code><a href="#frame">frame</a></code>, <code><a href="#the-iframe-element">iframe</a></code>, <code><a href="#the-img-element">img</a></code>, <code><a href="#the-input-element">input</a></code>, <code><a href="#the-label-element">label</a></code>, <code><a href="#the-legend-element">legend</a></code>, <code><a href="#the-marquee-element">marquee</a></code>, <code><a href="#the-object-element">object</a></code>, <code><a href="#the-param-element">param</a></code>, <code><a href="#the-select-element">select</a></code>, <code><a href="#the-span-element">span</a></code>, and <code><a href="#the-textarea-element">textarea</a></code> elements</dt>
|
|
<dt><dfn id="attr-dataformatas" title="attr-dataformatas"><code>dataformatas</code></dfn> on <code><a href="#the-button-element">button</a></code>, <code><a href="#the-div-element">div</a></code>, <code><a href="#the-input-element">input</a></code>, <code><a href="#the-label-element">label</a></code>, <code><a href="#the-legend-element">legend</a></code>, <code><a href="#the-marquee-element">marquee</a></code>, <code><a href="#the-object-element">object</a></code>, <code><a href="#the-option-element">option</a></code>, <code><a href="#the-select-element">select</a></code>, <code><a href="#the-span-element">span</a></code>, and <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dd><p>Use script and a mechanism such as <code>XMLHttpRequest</code> to populate the page dynamically. <a href="#refsXHR">[XHR]</a></dd>
|
|
|
|
<dt><dfn id="attr-body-alink" title="attr-body-alink"><code>alink</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-bgcolor" title="attr-body-bgcolor"><code>bgcolor</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-link" title="attr-body-link"><code>link</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-marginbottom" title="attr-body-marginbottom"><code>marginbottom</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-marginheight" title="attr-body-marginheight"><code>marginheight</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-marginleft" title="attr-body-marginleft"><code>marginleft</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-marginright" title="attr-body-marginright"><code>marginright</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-margintop" title="attr-body-margintop"><code>margintop</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-marginwidth" title="attr-body-marginwidth"><code>marginwidth</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-text" title="attr-body-text"><code>text</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-body-vlink" title="attr-body-vlink"><code>vlink</code></dfn> on <code><a href="#the-body-element">body</a></code> elements</dt>
|
|
<dt><dfn id="attr-br-clear" title="attr-br-clear"><code>clear</code></dfn> on <code><a href="#the-br-element">br</a></code> elements</dt>
|
|
<dt><dfn id="attr-caption-align" title="attr-caption-align"><code>align</code></dfn> on <code><a href="#the-caption-element">caption</a></code> elements</dt>
|
|
<dt><dfn id="attr-col-align" title="attr-col-align"><code>align</code></dfn> on <code><a href="#the-col-element">col</a></code> elements</dt>
|
|
<dt><dfn id="attr-col-char" title="attr-col-char"><code>char</code></dfn> on <code><a href="#the-col-element">col</a></code> elements</dt>
|
|
<dt><dfn id="attr-col-charoff" title="attr-col-charoff"><code>charoff</code></dfn> on <code><a href="#the-col-element">col</a></code> elements</dt>
|
|
<dt><dfn id="attr-col-valign" title="attr-col-valign"><code>valign</code></dfn> on <code><a href="#the-col-element">col</a></code> elements</dt>
|
|
<dt><dfn id="attr-col-width" title="attr-col-width"><code>width</code></dfn> on <code><a href="#the-col-element">col</a></code> elements</dt>
|
|
<dt><dfn id="attr-div-align" title="attr-div-align"><code>align</code></dfn> on <code><a href="#the-div-element">div</a></code> elements</dt>
|
|
<dt><dfn id="attr-dl-compact" title="attr-dl-compact"><code>compact</code></dfn> on <code><a href="#the-dl-element">dl</a></code> elements</dt>
|
|
<dt><dfn id="attr-embed-align" title="attr-embed-align"><code>align</code></dfn> on <code><a href="#the-embed-element">embed</a></code> elements</dt>
|
|
<dt><dfn id="attr-embed-hspace" title="attr-embed-hspace"><code>hspace</code></dfn> on <code><a href="#the-embed-element">embed</a></code> elements</dt>
|
|
<dt><dfn id="attr-embed-vspace" title="attr-embed-vspace"><code>vspace</code></dfn> on <code><a href="#the-embed-element">embed</a></code> elements</dt>
|
|
<dt><dfn id="attr-hr-align" title="attr-hr-align"><code>align</code></dfn> on <code><a href="#the-hr-element">hr</a></code> elements</dt>
|
|
<dt><dfn id="attr-hr-color" title="attr-hr-color"><code>color</code></dfn> on <code><a href="#the-hr-element">hr</a></code> elements</dt>
|
|
<dt><dfn id="attr-hr-noshade" title="attr-hr-noshade"><code>noshade</code></dfn> on <code><a href="#the-hr-element">hr</a></code> elements</dt>
|
|
<dt><dfn id="attr-hr-size" title="attr-hr-size"><code>size</code></dfn> on <code><a href="#the-hr-element">hr</a></code> elements</dt>
|
|
<dt><dfn id="attr-hr-width" title="attr-hr-width"><code>width</code></dfn> on <code><a href="#the-hr-element">hr</a></code> elements</dt>
|
|
<dt><dfn id="attr-hx-align" title="attr-hx-align"><code>align</code></dfn> on <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>—<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements</dt>
|
|
<dt><dfn id="attr-iframe-align" title="attr-iframe-align"><code>align</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-iframe-allowtransparency" title="attr-iframe-allowtransparency"><code>allowtransparency</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-iframe-frameborder" title="attr-iframe-frameborder"><code>frameborder</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-iframe-hspace" title="attr-iframe-hspace"><code>hspace</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-iframe-marginheight" title="attr-iframe-marginheight"><code>marginheight</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-iframe-marginwidth" title="attr-iframe-marginwidth"><code>marginwidth</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-iframe-scrolling" title="attr-iframe-scrolling"><code>scrolling</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-iframe-vspace" title="attr-iframe-vspace"><code>vspace</code></dfn> on <code><a href="#the-iframe-element">iframe</a></code> elements</dt>
|
|
<dt><dfn id="attr-input-align" title="attr-input-align"><code>align</code></dfn> on <code><a href="#the-input-element">input</a></code> elements</dt>
|
|
<dt><dfn id="attr-input-hspace" title="attr-input-hspace"><code>hspace</code></dfn> on <code><a href="#the-input-element">input</a></code> elements</dt>
|
|
<dt><dfn id="attr-input-vspace" title="attr-input-vspace"><code>vspace</code></dfn> on <code><a href="#the-input-element">input</a></code> elements</dt>
|
|
<dt><dfn id="attr-img-align" title="attr-img-align"><code>align</code></dfn> on <code><a href="#the-img-element">img</a></code> elements</dt>
|
|
<dt><dfn id="attr-img-border" title="attr-img-border"><code>border</code></dfn> on <code><a href="#the-img-element">img</a></code> elements (except as noted in the previous section)</dt>
|
|
<dt><dfn id="attr-img-hspace" title="attr-img-hspace"><code>hspace</code></dfn> on <code><a href="#the-img-element">img</a></code> elements</dt>
|
|
<dt><dfn id="attr-img-vspace" title="attr-img-vspace"><code>vspace</code></dfn> on <code><a href="#the-img-element">img</a></code> elements</dt>
|
|
<dt><dfn id="attr-legend-align" title="attr-legend-align"><code>align</code></dfn> on <code><a href="#the-legend-element">legend</a></code> elements</dt>
|
|
<dt><dfn id="attr-li-type" title="attr-li-type"><code>type</code></dfn> on <code><a href="#the-li-element">li</a></code> elements</dt>
|
|
<dt><dfn id="attr-menu-compact" title="attr-menu-compact"><code>compact</code></dfn> on <code><a href="#the-menu-element">menu</a></code> elements</dt>
|
|
<dt><dfn id="attr-object-align" title="attr-object-align"><code>align</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dt><dfn id="attr-object-border" title="attr-object-border"><code>border</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dt><dfn id="attr-object-hspace" title="attr-object-hspace"><code>hspace</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dt><dfn id="attr-object-vspace" title="attr-object-vspace"><code>vspace</code></dfn> on <code><a href="#the-object-element">object</a></code> elements</dt>
|
|
<dt><dfn id="attr-ol-compact" title="attr-ol-compact"><code>compact</code></dfn> on <code><a href="#the-ol-element">ol</a></code> elements</dt>
|
|
<dt><dfn id="attr-p-align" title="attr-p-align"><code>align</code></dfn> on <code><a href="#the-p-element">p</a></code> elements</dt>
|
|
<dt><dfn id="attr-pre-width" title="attr-pre-width"><code>width</code></dfn> on <code><a href="#the-pre-element">pre</a></code> elements</dt>
|
|
<dt><dfn id="attr-table-align" title="attr-table-align"><code>align</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dt><dfn id="attr-table-bgcolor" title="attr-table-bgcolor"><code>bgcolor</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dt><dfn id="attr-table-cellpadding" title="attr-table-cellpadding"><code>cellpadding</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dt><dfn id="attr-table-cellspacing" title="attr-table-cellspacing"><code>cellspacing</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dt><dfn id="attr-table-frame" title="attr-table-frame"><code>frame</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dt><dfn id="attr-table-rules" title="attr-table-rules"><code>rules</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dt><dfn id="attr-table-width" title="attr-table-width"><code>width</code></dfn> on <code><a href="#the-table-element">table</a></code> elements</dt>
|
|
<dt><dfn id="attr-tbody-align" title="attr-tbody-align"><code>align</code></dfn> on <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and <code><a href="#the-tfoot-element">tfoot</a></code> elements</dt>
|
|
<dt><dfn id="attr-tbody-char" title="attr-tbody-char"><code>char</code></dfn> on <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and <code><a href="#the-tfoot-element">tfoot</a></code> elements</dt>
|
|
<dt><dfn id="attr-tbody-charoff" title="attr-tbody-charoff"><code>charoff</code></dfn> on <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and <code><a href="#the-tfoot-element">tfoot</a></code> elements</dt>
|
|
<dt><dfn id="attr-tbody-valign" title="attr-tbody-vAlign"><code>valign</code></dfn> on <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and <code><a href="#the-tfoot-element">tfoot</a></code> elements</dt>
|
|
<dt><dfn id="attr-tdth-align" title="attr-tdth-align"><code>align</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dt><dfn id="attr-tdth-bgcolor" title="attr-tdth-bgcolor"><code>bgcolor</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dt><dfn id="attr-tdth-char" title="attr-tdth-char"><code>char</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dt><dfn id="attr-tdth-charoff" title="attr-tdth-charoff"><code>charoff</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dt><dfn id="attr-tdth-height" title="attr-tdth-height"><code>height</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dt><dfn id="attr-tdth-nowrap" title="attr-tdth-nowrap"><code>nowrap</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dt><dfn id="attr-tdth-valign" title="attr-tdth-valign"><code>valign</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dt><dfn id="attr-tdth-width" title="attr-tdth-width"><code>width</code></dfn> on <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dt><dfn id="attr-tr-align" title="attr-tr-align"><code>align</code></dfn> on <code><a href="#the-tr-element">tr</a></code> elements</dt>
|
|
<dt><dfn id="attr-tr-bgcolor" title="attr-tr-bgcolor"><code>bgcolor</code></dfn> on <code><a href="#the-tr-element">tr</a></code> elements</dt>
|
|
<dt><dfn id="attr-tr-char" title="attr-tr-char"><code>char</code></dfn> on <code><a href="#the-tr-element">tr</a></code> elements</dt>
|
|
<dt><dfn id="attr-tr-charoff" title="attr-tr-charoff"><code>charoff</code></dfn> on <code><a href="#the-tr-element">tr</a></code> elements</dt>
|
|
<dt><dfn id="attr-tr-valign" title="attr-tr-valign"><code>valign</code></dfn> on <code><a href="#the-tr-element">tr</a></code> elements</dt>
|
|
<dt><dfn id="attr-ul-compact" title="attr-ul-compact"><code>compact</code></dfn> on <code><a href="#the-ul-element">ul</a></code> elements</dt>
|
|
<dt><dfn id="attr-ul-type" title="attr-ul-type"><code>type</code></dfn> on <code><a href="#the-ul-element">ul</a></code> elements</dt>
|
|
<dt><dfn id="attr-background" title="attr-background"><code>background</code></dfn> on <code><a href="#the-body-element">body</a></code>, <code><a href="#the-table-element">table</a></code>, <code><a href="#the-thead-element">thead</a></code>, <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-tfoot-element">tfoot</a></code>, <code><a href="#the-tr-element">tr</a></code>, <code><a href="#the-td-element">td</a></code>, and <code><a href="#the-th-element">th</a></code> elements</dt>
|
|
<dd><p>Use CSS instead.</dd>
|
|
|
|
</dl><hr><p>The <code title="attr-table-border"><a href="#attr-table-border">border</a></code> attribute on
|
|
the <code><a href="#the-table-element">table</a></code> element can be used to provide basic fallback
|
|
styling for the purpose of making tables legible in browsing
|
|
environments where CSS support is limited or absent, such as
|
|
text-based browsers, WYSIWYG editors, and in situations where CSS
|
|
support is disabled or the style sheet is lost. Only the empty
|
|
string and the value "<code title="">1</code>" may be used as <code title="attr-table-border"><a href="#attr-table-border">border</a></code> values for this purpose.
|
|
Other values are considered obsolete. To regulate the thickness of
|
|
such borders, authors should instead use CSS.<div class="impl">
|
|
|
|
<h3 id="requirements-for-implementations"><span class="secno">11.3 </span>Requirements for implementations</h3>
|
|
|
|
<h4 id="the-applet-element"><span class="secno">11.3.1 </span>The <dfn><code>applet</code></dfn> element</h4>
|
|
|
|
<p>The <code><a href="#the-applet-element">applet</a></code> element is a Java-specific variant of the
|
|
<code><a href="#the-embed-element">embed</a></code> element. The <code><a href="#the-applet-element">applet</a></code> element is now
|
|
obsoleted so that all extension frameworks (Java, .NET, Flash, etc)
|
|
are handled in a consistent manner.</p>
|
|
|
|
<p id="sandboxPluginApplet">When the element is still in the
|
|
<a href="#stack-of-open-elements">stack of open elements</a> of an <a href="#html-parser">HTML parser</a>
|
|
or <a href="#xml-parser">XML parser</a>, and when the element is not <a href="#in-a-document">in a
|
|
<code>Document</code></a>, and when the element's document is not
|
|
<a href="#fully-active">fully active</a>, and when the element's
|
|
<code><a href="#document">Document</a></code>'s <a href="#browsing-context">browsing context</a> had its
|
|
<a href="#sandboxed-plugins-browsing-context-flag">sandboxed plugins browsing context flag</a> when that
|
|
<code><a href="#document">Document</a></code> was created, and when the element's
|
|
<code><a href="#document">Document</a></code> was parsed from a resource whose <a href="#content-type-sniffing-0" title="Content-Type sniffing">sniffed type</a> as determined
|
|
during <a href="#navigate" title="navigate">navigation</a> is
|
|
<code><a href="#text-html-sandboxed">text/html-sandboxed</a></code>, and when the element has an
|
|
ancestor <a href="#media-element">media element</a>, and when the element has an
|
|
ancestor <code><a href="#the-object-element">object</a></code> element that is <em>not</em> showing
|
|
its <a href="#fallback-content">fallback content</a>, and when no Java Language runtime
|
|
<a href="#plugin">plugin</a> is available, and when one <em>is</em> available
|
|
but it is disabled, the element <a href="#represents">represents</a> its
|
|
contents.</p>
|
|
|
|
<p>Otherwise, the user agent should instantiate a Java Language
|
|
runtime <a href="#plugin">plugin</a>, and should pass the names and values of
|
|
all the attributes on the element, in the order they were added to
|
|
the element, with the attributes added by the parser being ordered
|
|
in source order, and then a parameter named "PARAM" whose value is
|
|
null, and then all the names and values of <a href="#concept-param-parameter" title="concept-param-parameter">parameters</a> given by
|
|
<code><a href="#the-param-element">param</a></code> elements that are children of the
|
|
<code><a href="#the-applet-element">applet</a></code> element, in <a href="#tree-order">tree order</a>, to the
|
|
<a href="#plugin">plugin</a> used. If the <a href="#plugin">plugin</a> supports a
|
|
scriptable interface, the <code><a href="#htmlappletelement">HTMLAppletElement</a></code> object
|
|
representing the element should expose that interface. The
|
|
<code><a href="#the-applet-element">applet</a></code> element <a href="#represents">represents</a> the
|
|
<a href="#plugin">plugin</a>.</p>
|
|
|
|
|
|
<p class="note">The <code><a href="#the-applet-element">applet</a></code> element is unaffected by the
|
|
CSS 'display' property. The Java Language runtime is instantiated
|
|
even if the element is hidden with a 'display:none' CSS style.</p>
|
|
|
|
<p>The <code><a href="#the-applet-element">applet</a></code> element must implement the
|
|
<code><a href="#htmlappletelement">HTMLAppletElement</a></code> interface.</p>
|
|
|
|
<pre class="idl">interface <dfn id="htmlappletelement">HTMLAppletElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-applet-align" title="dom-applet-align">align</a>;
|
|
attribute DOMString <a href="#dom-applet-alt" title="dom-applet-alt">alt</a>;
|
|
attribute DOMString <a href="#dom-applet-archive" title="dom-applet-archive">archive</a>;
|
|
attribute DOMString <a href="#dom-applet-code" title="dom-applet-code">code</a>;
|
|
attribute DOMString <a href="#dom-applet-codebase" title="dom-applet-codeBase">codeBase</a>;
|
|
attribute DOMString <a href="#dom-applet-height" title="dom-applet-height">height</a>;
|
|
attribute unsigned long <a href="#dom-applet-hspace" title="dom-applet-hspace">hspace</a>;
|
|
attribute DOMString <a href="#dom-applet-name" title="dom-applet-name">name</a>;
|
|
attribute DOMString _<a href="#dom-applet-object" title="dom-applet-object">object</a>; // the underscore is not part of the identifier
|
|
attribute unsigned long <a href="#dom-applet-vspace" title="dom-applet-vspace">vspace</a>;
|
|
attribute DOMString <a href="#dom-applet-width" title="dom-applet-width">width</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-applet-align" title="dom-applet-align"><code>align</code></dfn>, <dfn id="dom-applet-alt" title="dom-applet-alt"><code>alt</code></dfn>, <dfn id="dom-applet-archive" title="dom-applet-archive"><code>archive</code></dfn>, <dfn id="dom-applet-code" title="dom-applet-code"><code>code</code></dfn>, <dfn id="dom-applet-height" title="dom-applet-height"><code>height</code></dfn>, <dfn id="dom-applet-hspace" title="dom-applet-hspace"><code>hspace</code></dfn>, <dfn id="dom-applet-name" title="dom-applet-name"><code>name</code></dfn>, <dfn id="dom-applet-object" title="dom-applet-object"><code>object</code></dfn>, <dfn id="dom-applet-vspace" title="dom-applet-vspace"><code>vspace</code></dfn>, and <dfn id="dom-applet-width" title="dom-applet-width"><code>width</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name. For the purposes of reflection, the <code><a href="#the-applet-element">applet</a></code>
|
|
element's <code title="attr-applet-object">object</code> content
|
|
attribute is defined as containing a <a href="#url">URL</a>.</p>
|
|
|
|
<p>The <dfn id="dom-applet-codebase" title="dom-applet-codeBase"><code>codeBase</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the <code title="attr-applet-codebase">codebase</code> content attribute,
|
|
which for the purposes of reflection is defined as containing a
|
|
<a href="#url">URL</a>.</p>
|
|
|
|
|
|
<h4 id="the-marquee-element"><span class="secno">11.3.2 </span>The <dfn><code>marquee</code></dfn> element</h4>
|
|
|
|
<p>The <code><a href="#the-marquee-element">marquee</a></code> element is a presentational element that
|
|
animates content. CSS transitions and animations are a more
|
|
appropriate mechanism.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for tasks mentioned in this section
|
|
is the <a href="#dom-manipulation-task-source">DOM manipulation task source</a>.</p>
|
|
|
|
<p>The <code><a href="#the-marquee-element">marquee</a></code> element must implement the
|
|
<code><a href="#htmlmarqueeelement">HTMLMarqueeElement</a></code> interface.</p>
|
|
|
|
<pre class="idl">interface <dfn id="htmlmarqueeelement">HTMLMarqueeElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-marquee-behavior" title="dom-marquee-behavior">behavior</a>;
|
|
attribute DOMString <a href="#dom-marquee-bgcolor" title="dom-marquee-bgColor">bgColor</a>;
|
|
attribute DOMString <a href="#dom-marquee-direction" title="dom-marquee-direction">direction</a>;
|
|
attribute DOMString <a href="#dom-marquee-height" title="dom-marquee-height">height</a>;
|
|
attribute unsigned long <a href="#dom-marquee-hspace" title="dom-marquee-hspace">hspace</a>;
|
|
attribute long <a href="#dom-marquee-loop" title="dom-marquee-loop">loop</a>;
|
|
attribute unsigned long <a href="#dom-marquee-scrollamount" title="dom-marquee-scrollamount">scrollAmount</a>;
|
|
attribute unsigned long <a href="#dom-marquee-scrolldelay" title="dom-marquee-scrollDelay">scrollDelay</a>;
|
|
attribute boolean <a href="#dom-marquee-truespeed" title="dom-marquee-trueSpeed">trueSpeed</a>;
|
|
attribute unsigned long <a href="#dom-marquee-vspace" title="dom-marquee-vspace">vspace</a>;
|
|
attribute DOMString <a href="#dom-marquee-width" title="dom-marquee-width">width</a>;
|
|
|
|
attribute <a href="#function">Function</a> <a href="#handler-marquee-onbounce" title="handler-marquee-onbounce">onbounce</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-marquee-onfinish" title="handler-marquee-onfinish">onfinish</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-marquee-onstart" title="handler-marquee-onstart">onstart</a>;
|
|
|
|
void <a href="#dom-marquee-start" title="dom-marquee-start">start</a>();
|
|
void <a href="#dom-marquee-stop" title="dom-marquee-stop">stop</a>();
|
|
};</pre>
|
|
|
|
<p>A <code><a href="#the-marquee-element">marquee</a></code> element can be <dfn id="concept-marquee-on" title="concept-marquee-on">turned on</dfn> or <dfn id="concept-marquee-off" title="concept-marquee-off">turned off</dfn>. When it is created, it
|
|
is <a href="#concept-marquee-on" title="concept-marquee-on">turned on</a>.</p>
|
|
|
|
<p>When the <dfn id="dom-marquee-start" title="dom-marquee-start"><code>start()</code></dfn> method is
|
|
called, the <code><a href="#the-marquee-element">marquee</a></code> element must be <a href="#concept-marquee-on" title="concept-marquee-on">turned on</a>.</p>
|
|
|
|
<p>When the <dfn id="dom-marquee-stop" title="dom-marquee-stop"><code>stop()</code></dfn>
|
|
method is called, the <code><a href="#the-marquee-element">marquee</a></code> element must be <a href="#concept-marquee-off" title="concept-marquee-off">turned off</a>.</p>
|
|
|
|
<p>When a <code><a href="#the-marquee-element">marquee</a></code> element is created, the user agent
|
|
must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple event</a>
|
|
named <code title="event-start">start</code> at the element.</p>
|
|
|
|
<hr><p>The <dfn id="attr-marquee-behavior" title="attr-marquee-behavior"><code>behavior</code></dfn> content
|
|
attribute on <code><a href="#the-marquee-element">marquee</a></code> elements is an <a href="#enumerated-attribute">enumerated
|
|
attribute</a> with the following keywords (all
|
|
non-conforming):</p>
|
|
|
|
<table><thead><tr><th>Keyword
|
|
<th>State
|
|
<tbody><tr><td><code title="">scroll</code>
|
|
<td><dfn id="attr-marquee-behavior-scroll" title="attr-marquee-behavior-scroll">scroll</dfn>
|
|
<tr><td><code title="">slide</code>
|
|
<td><dfn id="attr-marquee-behavior-slide" title="attr-marquee-behavior-slide">slide</dfn>
|
|
<tr><td><code title="">alternate</code>
|
|
<td><dfn id="attr-marquee-behavior-alternate" title="attr-marquee-behavior-alternate">alternate</dfn>
|
|
</table><p>The <i>missing value default</i> is the <a href="#attr-marquee-behavior-scroll" title="attr-marquee-behavior-scroll">scroll</a> state.</p>
|
|
|
|
<hr><p>The <dfn id="attr-marquee-direction" title="attr-marquee-direction"><code>direction</code></dfn> content
|
|
attribute on <code><a href="#the-marquee-element">marquee</a></code> elements is an <a href="#enumerated-attribute">enumerated
|
|
attribute</a> with the following keywords (all
|
|
non-conforming):</p>
|
|
|
|
<table><thead><tr><th>Keyword
|
|
<th>State
|
|
<tbody><tr><td><code title="">left</code>
|
|
<td><dfn id="attr-marquee-direction-left" title="attr-marquee-direction-left">left</dfn>
|
|
<tr><td><code title="">right</code>
|
|
<td><dfn id="attr-marquee-direction-right" title="attr-marquee-direction-right">right</dfn>
|
|
<tr><td><code title="">up</code>
|
|
<td><dfn id="attr-marquee-direction-up" title="attr-marquee-direction-up">up</dfn>
|
|
<tr><td><code title="">down</code>
|
|
<td><dfn id="attr-marquee-direction-down" title="attr-marquee-direction-down">down</dfn>
|
|
</table><p>The <i>missing value default</i> is the <a href="#attr-marquee-direction-left" title="attr-marquee-direction-left">left</a> state.</p>
|
|
|
|
<hr><p>The <dfn id="attr-marquee-truespeed" title="attr-marquee-truespeed"><code>truespeed</code></dfn> content
|
|
attribute on <code><a href="#the-marquee-element">marquee</a></code> elements is a <a href="#boolean-attribute">boolean
|
|
attribute</a>.</p>
|
|
|
|
<hr><p>A <code><a href="#the-marquee-element">marquee</a></code> element has a <dfn id="marquee-scroll-interval">marquee scroll
|
|
interval</dfn>, which is obtained as follows:</p>
|
|
|
|
<ol><li><p>If the element has a <code title="attr-marquee-scrolldelay">scrolldelay</code> attribute, and
|
|
parsing its value using the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative
|
|
integers</a> does not return an error, then let <var title="">delay</var> be the parsed value. Otherwise, let <var title="">delay</var> be 85.</li>
|
|
|
|
<li><p>If the element does not have a <code title="attr-marquee-truespeed"><a href="#attr-marquee-truespeed">truespeed</a></code> attribute, and the
|
|
<var title="">delay</var> value is less than 60, then let <var title="">delay</var> be 60 instead.</li>
|
|
|
|
<li><p>The <a href="#marquee-scroll-interval">marquee scroll interval</a> is <var title="">delay</var>, interpreted in milliseconds.</li>
|
|
|
|
</ol><hr><p>A <code><a href="#the-marquee-element">marquee</a></code> element has a <dfn id="marquee-scroll-distance">marquee scroll
|
|
distance</dfn>, which, if the element has a <code title="attr-marquee-scrollamount">scrollamount</code> attribute, and
|
|
parsing its value using the <a href="#rules-for-parsing-non-negative-integers">rules for parsing non-negative
|
|
integers</a> does not return an error, is the parsed value
|
|
interpreted in CSS pixels, and otherwise is 6 CSS pixels.</p>
|
|
|
|
<hr><p>A <code><a href="#the-marquee-element">marquee</a></code> element has a <dfn id="marquee-loop-count">marquee loop
|
|
count</dfn>, which, if the element has a <code title="attr-marquee-loop">loop</code> attribute, and parsing its
|
|
value using the <a href="#rules-for-parsing-integers">rules for parsing integers</a> does not
|
|
return an error or a number less than 1, is the parsed value, and
|
|
otherwise is −1.</p>
|
|
|
|
<p>The <dfn id="dom-marquee-loop" title="dom-marquee-loop"><code>loop</code></dfn> IDL
|
|
attribute, on getting, must return the element's <a href="#marquee-loop-count">marquee loop
|
|
count</a>; and on setting, if the new value is different than the
|
|
element's <a href="#marquee-loop-count">marquee loop count</a> and either greater than
|
|
zero or equal to −1, must set the element's <code title="attr-marquee-loop">loop</code> content attribute (adding it
|
|
if necessary) to the <a href="#valid-integer">valid integer</a> that represents the
|
|
new value. (Other values are ignored.)</p>
|
|
|
|
<p>A <code><a href="#the-marquee-element">marquee</a></code> element also has a <dfn id="marquee-current-loop-index">marquee current
|
|
loop index</dfn>, which is zero when the element is created.</p>
|
|
|
|
<p>The rendering layer will occasionally <dfn id="increment-the-marquee-current-loop-index">increment the marquee
|
|
current loop index</dfn>, which must cause the following steps to be
|
|
run:</p>
|
|
|
|
<ol><li><p>If the <a href="#marquee-loop-count">marquee loop count</a> is −1, then
|
|
abort these steps.</p>
|
|
|
|
<li><p>Increment the <a href="#marquee-current-loop-index">marquee current loop index</a> by
|
|
one.</li>
|
|
|
|
<li>
|
|
|
|
<p>If the <a href="#marquee-current-loop-index">marquee current loop index</a> is now equal to
|
|
or greater than the element's <a href="#marquee-loop-count">marquee loop count</a>,
|
|
<a href="#concept-marquee-off" title="concept-marquee-off">turn off</a> the
|
|
<code><a href="#the-marquee-element">marquee</a></code> element and <a href="#queue-a-task">queue a task</a> to
|
|
<a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-finish">finish</code> at the <code><a href="#the-marquee-element">marquee</a></code>
|
|
element.</p>
|
|
|
|
<p>Otherwise, if the <code title="attr-marquee-behavior"><a href="#attr-marquee-behavior">behavior</a></code> attribute is in the
|
|
<a href="#attr-marquee-behavior-alternate" title="attr-marquee-behavior-alternate">alternate</a>
|
|
state, then <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-bounce">bounce</code> at
|
|
the <code><a href="#the-marquee-element">marquee</a></code> element.</p>
|
|
|
|
<p>Otherwise, <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire a simple
|
|
event</a> named <code title="event-start">start</code> at the
|
|
<code><a href="#the-marquee-element">marquee</a></code> element.</p>
|
|
|
|
</li>
|
|
|
|
</ol><hr><p>The following are the <a href="#event-handlers">event handlers</a> (and their
|
|
corresponding <a href="#event-handler-event-type" title="event handler event type">event handler
|
|
event types</a>) that must be supported, as content and IDL
|
|
attributes, by <code><a href="#the-marquee-element">marquee</a></code> elements:</p>
|
|
|
|
<table><thead><tr><th><a href="#event-handlers" title="event handlers">Event handler</a> <th><a href="#event-handler-event-type">Event handler event type</a>
|
|
<tbody><tr><td><dfn id="handler-marquee-onbounce" title="handler-marquee-onbounce"><code>onbounce</code></dfn> <td> <code title="event-bounce">bounce</code>
|
|
<tr><td><dfn id="handler-marquee-onfinish" title="handler-marquee-onfinish"><code>onfinish</code></dfn> <td> <code title="event-finish">finish</code>
|
|
<tr><td><dfn id="handler-marquee-onstart" title="handler-marquee-onstart"><code>onstart</code></dfn> <td> <code title="event-start">start</code>
|
|
</table><hr><p>The <dfn id="dom-marquee-behavior" title="dom-marquee-behavior"><code>behavior</code></dfn>, <dfn id="dom-marquee-direction" title="dom-marquee-direction"><code>direction</code></dfn>, <dfn id="dom-marquee-height" title="dom-marquee-height"><code>height</code></dfn>, <dfn id="dom-marquee-hspace" title="dom-marquee-hspace"><code>hspace</code></dfn>, <dfn id="dom-marquee-vspace" title="dom-marquee-vspace"><code>vspace</code></dfn>, and <dfn id="dom-marquee-width" title="dom-marquee-width"><code>width</code></dfn> IDL attributes
|
|
must <a href="#reflect">reflect</a> the respective content attributes of the
|
|
same name.</p>
|
|
|
|
<p>The <dfn id="dom-marquee-bgcolor" title="dom-marquee-bgColor"><code>bgColor</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the <code title="attr-marquee-bgcolor">bgcolor</code> content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-marquee-scrollamount" title="dom-marquee-scrollAmount"><code>scrollAmount</code></dfn>
|
|
IDL attribute must <a href="#reflect">reflect</a> the <code title="attr-marquee-scrollamount">scrollamount</code> content
|
|
attribute. The default value is 6.</p>
|
|
|
|
<p>The <dfn id="dom-marquee-scrolldelay" title="dom-marquee-scrollDelay"><code>scrollDelay</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-marquee-scrolldelay">scrolldelay</code> content
|
|
attribute. The default value is 85.</p>
|
|
|
|
<p>The <dfn id="dom-marquee-truespeed" title="dom-marquee-trueSpeed"><code>trueSpeed</code></dfn> IDL
|
|
attribute must <a href="#reflect">reflect</a> the <code title="attr-marquee-truespeed"><a href="#attr-marquee-truespeed">truespeed</a></code> content
|
|
attribute.</p>
|
|
|
|
|
|
<h4 id="frames"><span class="secno">11.3.3 </span>Frames</h4>
|
|
|
|
<p>The <dfn id="frameset"><code>frameset</code></dfn> element acts as <a href="#the-body-element-0">the
|
|
body element</a> in documents that use frames.</p>
|
|
|
|
<p>The <code><a href="#frameset">frameset</a></code> element must implement the
|
|
<code><a href="#htmlframesetelement">HTMLFrameSetElement</a></code> interface.</p>
|
|
|
|
<pre class="idl">interface <dfn id="htmlframesetelement">HTMLFrameSetElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-frameset-cols" title="dom-frameset-cols">cols</a>;
|
|
attribute DOMString <a href="#dom-frameset-rows" title="dom-frameset-rows">rows</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onafterprint" title="handler-window-onafterprint">onafterprint</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onbeforeprint" title="handler-window-onbeforeprint">onbeforeprint</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onbeforeunload" title="handler-window-onbeforeunload">onbeforeunload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onblur" title="handler-window-onblur">onblur</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onerror" title="handler-window-onerror">onerror</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onfocus" title="handler-window-onfocus">onfocus</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onhashchange" title="handler-window-onhashchange">onhashchange</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onload" title="handler-window-onload">onload</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onmessage" title="handler-window-onmessage">onmessage</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onoffline" title="handler-window-onoffline">onoffline</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-ononline" title="handler-window-ononline">ononline</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpagehide" title="handler-window-onpagehide">onpagehide</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpageshow" title="handler-window-onpageshow">onpageshow</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onpopstate" title="handler-window-onpopstate">onpopstate</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onredo" title="handler-window-onredo">onredo</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onresize" title="handler-window-onresize">onresize</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onscroll" title="handler-window-onscroll">onscroll</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onstorage" title="handler-window-onstorage">onstorage</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onundo" title="handler-window-onundo">onundo</a>;
|
|
attribute <a href="#function">Function</a> <a href="#handler-window-onunload" title="handler-window-onunload">onunload</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-frameset-cols" title="dom-frameset-cols"><code>cols</code></dfn> and
|
|
<dfn id="dom-frameset-rows" title="dom-frameset-rows"><code>rows</code></dfn> IDL
|
|
attributes of the <code><a href="#frameset">frameset</a></code> element must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
<p>The <code><a href="#frameset">frameset</a></code> element must support the following
|
|
<a href="#event-handler-content-attributes">event handler content attributes</a> exposing the
|
|
<a href="#event-handlers">event handlers</a> of the <code><a href="#window">Window</a></code> object:</p>
|
|
|
|
<ul class="brief"><li><code title="handler-window-onafterprint"><a href="#handler-window-onafterprint">onafterprint</a></code></li>
|
|
<li><code title="handler-window-onbeforeprint"><a href="#handler-window-onbeforeprint">onbeforeprint</a></code></li>
|
|
<li><code title="handler-window-onbeforeunload"><a href="#handler-window-onbeforeunload">onbeforeunload</a></code></li>
|
|
<li><code title="handler-window-onblur"><a href="#handler-window-onblur">onblur</a></code></li>
|
|
<li><code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code></li>
|
|
<li><code title="handler-window-onfocus"><a href="#handler-window-onfocus">onfocus</a></code></li>
|
|
<li><code title="handler-window-onhashchange"><a href="#handler-window-onhashchange">onhashchange</a></code></li>
|
|
<li><code title="handler-window-onload"><a href="#handler-window-onload">onload</a></code></li>
|
|
<li><code title="handler-window-onmessage"><a href="#handler-window-onmessage">onmessage</a></code></li>
|
|
<li><code title="handler-window-onoffline"><a href="#handler-window-onoffline">onoffline</a></code></li>
|
|
<li><code title="handler-window-ononline"><a href="#handler-window-ononline">ononline</a></code></li>
|
|
<li><code title="handler-window-onpagehide"><a href="#handler-window-onpagehide">onpagehide</a></code></li>
|
|
<li><code title="handler-window-onpageshow"><a href="#handler-window-onpageshow">onpageshow</a></code></li>
|
|
<li><code title="handler-window-onpopstate"><a href="#handler-window-onpopstate">onpopstate</a></code></li>
|
|
<li><code title="handler-window-onredo"><a href="#handler-window-onredo">onredo</a></code></li>
|
|
<li><code title="handler-window-onresize"><a href="#handler-window-onresize">onresize</a></code></li>
|
|
<li><code title="handler-window-onscroll"><a href="#handler-window-onscroll">onscroll</a></code></li>
|
|
<li><code title="handler-window-onstorage"><a href="#handler-window-onstorage">onstorage</a></code></li>
|
|
<li><code title="handler-window-onundo"><a href="#handler-window-onundo">onundo</a></code></li>
|
|
<li><code title="handler-window-onunload"><a href="#handler-window-onunload">onunload</a></code></li>
|
|
</ul><p>The DOM interface also exposes <a href="#event-handler-idl-attributes">event handler IDL
|
|
attributes</a> that mirror those on the <code><a href="#window">Window</a></code>
|
|
element.</p>
|
|
|
|
<p>The <code title="handler-window-onblur"><a href="#handler-window-onblur">onblur</a></code>, <code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code>, <code title="handler-window-onfocus"><a href="#handler-window-onfocus">onfocus</a></code>, <code title="handler-window-onload"><a href="#handler-window-onload">onload</a></code>, and <code title="handler-window-onscroll"><a href="#handler-window-onscroll">onscroll</a></code> <a href="#event-handler-idl-attributes">event handler
|
|
IDL attributes</a> of the <code><a href="#window">Window</a></code> object, exposed on
|
|
the <code><a href="#frameset">frameset</a></code> element, shadow the generic <a href="#event-handler-idl-attributes">event
|
|
handler IDL attributes</a> with the same names normally supported
|
|
by <a href="#html-elements">HTML elements</a>.</p>
|
|
|
|
<hr><p>The <dfn id="frame"><code>frame</code></dfn> element defines a <a href="#nested-browsing-context">nested
|
|
browsing context</a> similar to the <code><a href="#the-iframe-element">iframe</a></code> element,
|
|
but rendered within a <code><a href="#frameset">frameset</a></code> element.</p>
|
|
|
|
<p>When the browsing context is created, if a <code title="attr-frame-src">src</code> attribute is present, the user
|
|
agent must <a href="#resolve-a-url" title="resolve a url">resolve</a> the value of
|
|
that attribute, relative to the element, and if that is successful,
|
|
must then <a href="#navigate">navigate</a> the element's
|
|
browsing context to the resulting <a href="#absolute-url">absolute URL</a>, with
|
|
<a href="#replacement-enabled">replacement enabled</a>, and with the <code><a href="#frame">frame</a></code>
|
|
element's document's <a href="#browsing-context">browsing context</a> as the
|
|
<a href="#source-browsing-context">source browsing context</a>.</p>
|
|
|
|
<p>Whenever the <code title="attr-frame-src">src</code> attribute is
|
|
set, the user agent must <a href="#resolve-a-url" title="resolve a url">resolve</a>
|
|
the value of that attribute, relative to the element, and if that is
|
|
successful, the nested <a href="#browsing-context">browsing context</a> must be <a href="#navigate" title="navigate">navigated</a> to the resulting
|
|
<a href="#absolute-url">absolute URL</a>, with the <code><a href="#frame">frame</a></code> element's
|
|
document's <a href="#browsing-context">browsing context</a> as the <a href="#source-browsing-context">source
|
|
browsing context</a>.</p>
|
|
|
|
<p>When the browsing context is created, if a <code title="attr-frame-name">name</code> attribute is present, the
|
|
<a href="#browsing-context-name">browsing context name</a> must be set to the value of this
|
|
attribute; otherwise, the <a href="#browsing-context-name">browsing context name</a> must be
|
|
set to the empty string.</p>
|
|
|
|
<p>Whenever the <code title="attr-frame-name">name</code> attribute
|
|
is set, the nested <a href="#browsing-context">browsing context</a>'s <a href="#browsing-context-name" title="browsing context name">name</a> must be changed to the new
|
|
value. If the attribute is removed, the <a href="#browsing-context-name">browsing context
|
|
name</a> must be set to the empty string.</p>
|
|
|
|
<p>When content loads in a <code><a href="#frame">frame</a></code>, after any <code title="event-load">load</code> events are fired within the content
|
|
itself, the user agent must <a href="#queue-a-task">queue a task</a> to <a href="#fire-a-simple-event">fire
|
|
a simple event</a> named <code title="event-load">load</code> at
|
|
the <code><a href="#frame">frame</a></code> element. When content fails to load (e.g. due
|
|
to a network error), then the user agent must <a href="#queue-a-task">queue a
|
|
task</a> to <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-error">error</code> at the element instead.</p>
|
|
|
|
<p>The <a href="#task-source">task source</a> for the <a href="#concept-task" title="concept-task">tasks</a> above is the <a href="#dom-manipulation-task-source">DOM
|
|
manipulation task source</a>.</p>
|
|
|
|
<p>When there is an <a href="#active-parser">active parser</a> in the
|
|
<code><a href="#frame">frame</a></code>, and when anything in the <code><a href="#frame">frame</a></code> is
|
|
<a href="#delay-the-load-event" title="delay the load event">delaying the load event</a> of
|
|
the <code><a href="#frame">frame</a></code>'s <a href="#browsing-context">browsing context</a>'s
|
|
<a href="#active-document">active document</a>, the <code><a href="#frame">frame</a></code> must
|
|
<a href="#delay-the-load-event">delay the load event</a> of its document.</p>
|
|
|
|
<p>The <code><a href="#frame">frame</a></code> element must implement the
|
|
<code><a href="#htmlframeelement">HTMLFrameElement</a></code> interface.</p>
|
|
|
|
<pre class="idl">interface <dfn id="htmlframeelement">HTMLFrameElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-frame-frameborder" title="dom-frame-frameBorder">frameBorder</a>;
|
|
attribute DOMString <a href="#dom-frame-longdesc" title="dom-frame-longDesc">longDesc</a>;
|
|
attribute DOMString <a href="#dom-frame-marginheight" title="dom-frame-marginHeight">marginHeight</a>;
|
|
attribute DOMString <a href="#dom-frame-marginwidth" title="dom-frame-marginWidth">marginWidth</a>;
|
|
attribute DOMString <a href="#dom-frame-name" title="dom-frame-name">name</a>;
|
|
attribute boolean <a href="#dom-frame-noresize" title="dom-frame-noResize">noResize</a>;
|
|
attribute DOMString <a href="#dom-frame-scrolling" title="dom-frame-scrolling">scrolling</a>;
|
|
attribute DOMString <a href="#dom-frame-src" title="dom-frame-src">src</a>;
|
|
readonly attribute Document <a href="#dom-frame-contentdocument" title="dom-frame-contentDocument">contentDocument</a>;
|
|
readonly attribute <a href="#windowproxy">WindowProxy</a> <a href="#dom-frame-contentwindow" title="dom-frame-contentWindow">contentWindow</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-frame-name" title="dom-frame-name"><code>name</code></dfn>, <dfn id="dom-frame-scrolling" title="dom-frame-scrolling"><code>scrolling</code></dfn>, and <dfn id="dom-frame-src" title="dom-frame-src"><code>src</code></dfn> IDL attributes of the
|
|
<code><a href="#frame">frame</a></code> element must <a href="#reflect">reflect</a> the respective
|
|
content attributes of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-frame-frameborder" title="dom-frame-frameBorder"><code>frameBorder</code></dfn> IDL
|
|
attribute of the <code><a href="#frame">frame</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-frame-frameborder">frameborder</code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-frame-longdesc" title="dom-frame-longDesc"><code>longDesc</code></dfn>
|
|
IDL attribute of the <code><a href="#frame">frame</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-frame-longdesc">longdesc</code> content attribute, which
|
|
for the purposes of reflection is defined as containing a
|
|
<a href="#url">URL</a>.</p>
|
|
|
|
<p>The <dfn id="dom-frame-marginheight" title="dom-frame-marginHeight"><code>marginHeight</code></dfn> IDL
|
|
attribute of the <code><a href="#frame">frame</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-frame-marginheight">marginheight</code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-frame-marginwidth" title="dom-frame-marginWidth"><code>marginWidth</code></dfn> IDL
|
|
attribute of the <code><a href="#frame">frame</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-frame-marginwidth">marginwidth</code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-frame-noresize" title="dom-frame-noResize"><code>noResize</code></dfn>
|
|
IDL attribute of the <code><a href="#frame">frame</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-frame-noresize">noresize</code> content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-frame-contentdocument" title="dom-frame-contentDocument"><code>contentDocument</code></dfn>
|
|
IDL attribute of the <code><a href="#frame">frame</a></code> element must return the
|
|
<code><a href="#document">Document</a></code> object of the <a href="#active-document">active document</a> of
|
|
the <code><a href="#frame">frame</a></code> element's <a href="#nested-browsing-context">nested browsing
|
|
context</a>.</p>
|
|
|
|
<p>The <dfn id="dom-frame-contentwindow" title="dom-frame-contentWindow"><code>contentWindow</code></dfn>
|
|
IDL attribute must return the <code><a href="#windowproxy">WindowProxy</a></code> object of the
|
|
<code><a href="#frame">frame</a></code> element's <a href="#nested-browsing-context">nested browsing
|
|
context</a>.</p>
|
|
|
|
|
|
|
|
<h4 id="other-elements-attributes-and-apis"><span class="secno">11.3.4 </span>Other elements, attributes and APIs</h4>
|
|
|
|
<p>User agents must treat <code><a href="#acronym">acronym</a></code> elements in a manner
|
|
equivalent to <code><a href="#the-abbr-element">abbr</a></code> elements in terms of semantics and
|
|
for purposes of rendering.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlanchorelement">HTMLAnchorElement</a> {
|
|
attribute DOMString <a href="#dom-a-coords" title="dom-a-coords">coords</a>;
|
|
attribute DOMString <a href="#dom-a-charset" title="dom-a-charset">charset</a>;
|
|
attribute DOMString <a href="#dom-a-name" title="dom-a-name">name</a>;
|
|
attribute DOMString <a href="#dom-a-rev" title="dom-a-rev">rev</a>;
|
|
attribute DOMString <a href="#dom-a-shape" title="dom-a-shape">shape</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-a-coords" title="dom-a-coords"><code>coords</code></dfn>, <dfn id="dom-a-charset" title="dom-a-charset"><code>charset</code></dfn>, <dfn id="dom-a-name" title="dom-a-name"><code>name</code></dfn>, <dfn id="dom-a-rev" title="dom-a-rev"><code>rev</code></dfn>, and <dfn id="dom-a-shape" title="dom-a-shape"><code>shape</code></dfn> IDL attributes of the
|
|
<code><a href="#the-a-element">a</a></code> element must <a href="#reflect">reflect</a> the respective
|
|
content attributes of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlareaelement">HTMLAreaElement</a> {
|
|
attribute boolean <a href="#dom-area-nohref" title="dom-area-noHref">noHref</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-area-nohref" title="dom-area-noHref"><code>noHref</code></dfn> IDL
|
|
attribute of the <code><a href="#the-area-element">area</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-area-nohref"><a href="#attr-area-nohref">nohref</a></code> content
|
|
attribute.</p>
|
|
|
|
<hr><p>The <code><a href="#basefont">basefont</a></code> element must implement the
|
|
<code><a href="#htmlbasefontelement">HTMLBaseFontElement</a></code> interface.</p>
|
|
|
|
<pre class="idl">interface <dfn id="htmlbasefontelement">HTMLBaseFontElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-basefont-color" title="dom-basefont-color">color</a>;
|
|
attribute DOMString <a href="#dom-basefont-face" title="dom-basefont-face">face</a>;
|
|
attribute long <a href="#dom-basefont-size" title="dom-basefont-size">size</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-basefont-color" title="dom-basefont-color"><code>color</code></dfn>,
|
|
<dfn id="dom-basefont-face" title="dom-basefont-face"><code>face</code></dfn>, and <dfn id="dom-basefont-size" title="dom-basefont-size"><code>size</code></dfn> IDL attributes of
|
|
the <code><a href="#basefont">basefont</a></code> element must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlbodyelement">HTMLBodyElement</a> {
|
|
attribute DOMString <a href="#dom-body-text" title="dom-body-text">text</a>;
|
|
attribute DOMString <a href="#dom-body-bgcolor" title="dom-body-bgColor">bgColor</a>;
|
|
attribute DOMString <a href="#dom-body-background" title="dom-body-background">background</a>;
|
|
attribute DOMString <a href="#dom-body-link" title="dom-body-link">link</a>;
|
|
attribute DOMString <a href="#dom-body-vlink" title="dom-body-vLink">vLink</a>;
|
|
attribute DOMString <a href="#dom-body-alink" title="dom-body-aLink">aLink</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-body-text" title="dom-body-text"><code>text</code></dfn> IDL
|
|
attribute of the <code><a href="#the-body-element">body</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-body-text"><a href="#attr-body-text">text</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-body-bgcolor" title="dom-body-bgColor"><code>bgColor</code></dfn> IDL
|
|
attribute of the <code><a href="#the-body-element">body</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-body-bgcolor"><a href="#attr-body-bgcolor">bgcolor</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-body-background" title="dom-body-background"><code>background</code></dfn> IDL
|
|
attribute of the <code><a href="#the-body-element">body</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-background"><a href="#attr-background">background</a></code>
|
|
content attribute. (The <code title="attr-background"><a href="#attr-background">background</a></code> content is <em>not</em>
|
|
defined to contain a <a href="#url">URL</a>, despite rules regarding its
|
|
handling in the rendering section above.)</p>
|
|
|
|
<p>The <dfn id="dom-body-link" title="dom-body-link"><code>link</code></dfn> IDL
|
|
attribute of the <code><a href="#the-body-element">body</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-body-link"><a href="#attr-body-link">link</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-body-alink" title="dom-body-aLink"><code>aLink</code></dfn> IDL
|
|
attribute of the <code><a href="#the-body-element">body</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-body-alink"><a href="#attr-body-alink">alink</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-body-vlink" title="dom-body-vLink"><code>vLink</code></dfn> IDL
|
|
attribute of the <code><a href="#the-body-element">body</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-body-vlink"><a href="#attr-body-vlink">vlink</a></code> content
|
|
attribute.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlbrelement">HTMLBRElement</a> {
|
|
attribute DOMString <a href="#dom-br-clear" title="dom-br-clear">clear</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-br-clear" title="dom-br-clear"><code>clear</code></dfn> IDL
|
|
attribute of the <code><a href="#the-br-element">br</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmltablecaptionelement">HTMLTableCaptionElement</a> {
|
|
attribute DOMString <a href="#dom-caption-align" title="dom-caption-align">align</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-caption-align" title="dom-caption-align"><code>align</code></dfn> IDL
|
|
attribute of the <code><a href="#the-caption-element">caption</a></code> element must
|
|
<a href="#reflect">reflect</a> the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmltablecolelement">HTMLTableColElement</a> {
|
|
attribute DOMString <a href="#dom-col-align" title="dom-col-align">align</a>;
|
|
attribute DOMString <a href="#dom-col-ch" title="dom-col-ch">ch</a>;
|
|
attribute DOMString <a href="#dom-col-choff" title="dom-col-chOff">chOff</a>;
|
|
attribute DOMString <a href="#dom-col-valign" title="dom-col-vAlign">vAlign</a>;
|
|
attribute DOMString <a href="#dom-col-width" title="dom-col-width">width</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-col-align" title="dom-col-align"><code>align</code></dfn> and <dfn id="dom-col-width" title="dom-col-width"><code>width</code></dfn> IDL attributes of
|
|
the <code><a href="#the-col-element">col</a></code> element must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-col-ch" title="dom-col-ch"><code>ch</code></dfn> IDL attribute
|
|
of the <code><a href="#the-col-element">col</a></code> element must <a href="#reflect">reflect</a> the
|
|
element's <code title="attr-col-char"><a href="#attr-col-char">char</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-col-choff" title="dom-col-chOff"><code>chOff</code></dfn> IDL
|
|
attribute of the <code><a href="#the-col-element">col</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-col-charoff"><a href="#attr-col-charoff">charoff</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-col-valign" title="dom-col-vAlign"><code>vAlign</code></dfn> IDL
|
|
attribute of the <code><a href="#the-col-element">col</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-col-valign"><a href="#attr-col-valign">valign</a></code> content
|
|
attribute.</p>
|
|
|
|
<hr><p>User agents must treat <code><a href="#dir">dir</a></code> elements in a manner
|
|
equivalent to <code><a href="#the-ul-element">ul</a></code> elements in terms of semantics and for
|
|
purposes of rendering.</p>
|
|
|
|
<p>The <code><a href="#dir">dir</a></code> element must implement the
|
|
<code><a href="#htmldirectoryelement">HTMLDirectoryElement</a></code> interface.</p>
|
|
|
|
<pre class="idl">interface <dfn id="htmldirectoryelement">HTMLDirectoryElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute boolean <a href="#dom-dir-compact" title="dom-dir-compact">compact</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-dir-compact" title="dom-dir-compact"><code>compact</code></dfn> IDL
|
|
attribute of the <code><a href="#dir">dir</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmldivelement">HTMLDivElement</a> {
|
|
attribute DOMString <a href="#dom-div-align" title="dom-div-align">align</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-div-align" title="dom-div-align"><code>align</code></dfn> IDL
|
|
attribute of the <code><a href="#the-div-element">div</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmldlistelement">HTMLDListElement</a> {
|
|
attribute boolean <a href="#dom-dl-compact" title="dom-dl-compact">compact</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-dl-compact" title="dom-dl-compact"><code>compact</code></dfn> IDL
|
|
attribute of the <code><a href="#the-dl-element">dl</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlembedelement">HTMLEmbedElement</a> {
|
|
attribute DOMString <a href="#dom-embed-align" title="dom-embed-align">align</a>;
|
|
attribute DOMString <a href="#dom-embed-name" title="dom-embed-name">name</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-embed-name" title="dom-embed-name"><code>name</code></dfn> and <dfn id="dom-embed-align" title="dom-embed-align"><code>align</code></dfn> IDL attributes of
|
|
the <code><a href="#the-embed-element">embed</a></code> element must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<hr><p>The <code><a href="#font">font</a></code> element must implement the
|
|
<code><a href="#htmlfontelement">HTMLFontElement</a></code> interface.</p>
|
|
|
|
<pre class="idl">interface <dfn id="htmlfontelement">HTMLFontElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
|
|
attribute DOMString <a href="#dom-font-color" title="dom-font-color">color</a>;
|
|
attribute DOMString <a href="#dom-font-face" title="dom-font-face">face</a>;
|
|
attribute DOMString <a href="#dom-font-size" title="dom-font-size">size</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-font-color" title="dom-font-color"><code>color</code></dfn>,
|
|
<dfn id="dom-font-face" title="dom-font-face"><code>face</code></dfn>, and <dfn id="dom-font-size" title="dom-font-size"><code>size</code></dfn> IDL attributes of
|
|
the <code><a href="#font">font</a></code> element must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlheadingelement">HTMLHeadingElement</a> {
|
|
attribute DOMString <a href="#dom-hx-align" title="dom-hx-align">align</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-hx-align" title="dom-hx-align"><code>align</code></dfn> IDL
|
|
attribute of the <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>–<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code> elements must
|
|
<a href="#reflect">reflect</a> the content attribute of the same name.</p>
|
|
|
|
<hr><p class="note">The <dfn id="dom-head-profile" title="dom-head-profile"><code>profile</code></dfn> IDL attribute on
|
|
<code><a href="#the-head-element">head</a></code> elements (with the <code><a href="#htmlheadelement">HTMLHeadElement</a></code>
|
|
interface) is intentionally omitted. Unless so required by <a href="#other-applicable-specifications" title="other applicable specifications">another applicable
|
|
specification</a>, implementations would therefore not support
|
|
this attribute. (It is mentioned here as it was defined in a
|
|
previous version of the DOM specifications.)</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlhrelement">HTMLHRElement</a> {
|
|
attribute DOMString <a href="#dom-hr-align" title="dom-hr-align">align</a>;
|
|
attribute DOMString <a href="#dom-hr-color" title="dom-hr-color">color</a>;
|
|
attribute boolean <a href="#dom-hr-noshade" title="dom-hr-noShade">noShade</a>;
|
|
attribute DOMString <a href="#dom-hr-size" title="dom-hr-size">size</a>;
|
|
attribute DOMString <a href="#dom-hr-width" title="dom-hr-width">width</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-hr-align" title="dom-hr-align"><code>align</code></dfn>, <dfn id="dom-hr-color" title="dom-hr-color"><code>color</code></dfn>, <dfn id="dom-hr-size" title="dom-hr-size"><code>size</code></dfn>, and <dfn id="dom-hr-width" title="dom-hr-width"><code>width</code></dfn> IDL attributes of the
|
|
<code><a href="#the-hr-element">hr</a></code> element must <a href="#reflect">reflect</a> the respective
|
|
content attributes of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-hr-noshade" title="dom-hr-noShade"><code>noShade</code></dfn> IDL
|
|
attribute of the <code><a href="#the-hr-element">hr</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-input-noshade">noshade</code>
|
|
content attribute.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlhtmlelement">HTMLHtmlElement</a> {
|
|
attribute DOMString <a href="#dom-html-version" title="dom-html-version">version</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-html-version" title="dom-html-version"><code>version</code></dfn> IDL
|
|
attribute of the <code><a href="#the-html-element">html</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmliframeelement">HTMLIFrameElement</a> {
|
|
attribute DOMString <a href="#dom-iframe-align" title="dom-iframe-align">align</a>;
|
|
attribute DOMString <a href="#dom-iframe-frameborder" title="dom-iframe-frameBorder">frameBorder</a>;
|
|
attribute DOMString <a href="#dom-iframe-longdesc" title="dom-iframe-longDesc">longDesc</a>;
|
|
attribute DOMString <a href="#dom-iframe-marginheight" title="dom-iframe-marginHeight">marginHeight</a>;
|
|
attribute DOMString <a href="#dom-iframe-marginwidth" title="dom-iframe-marginWidth">marginWidth</a>;
|
|
attribute DOMString <a href="#dom-iframe-scrolling" title="dom-iframe-scrolling">scrolling</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-iframe-align" title="dom-iframe-align"><code>align</code></dfn> and
|
|
<dfn id="dom-iframe-scrolling" title="dom-iframe-scrolling"><code>scrolling</code></dfn> IDL
|
|
attributes of the <code><a href="#the-iframe-element">iframe</a></code> element must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
<p>The <dfn id="dom-iframe-frameborder" title="dom-iframe-frameBorder"><code>frameBorder</code></dfn> IDL
|
|
attribute of the <code><a href="#the-iframe-element">iframe</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-iframe-frameborder"><a href="#attr-iframe-frameborder">frameborder</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-iframe-longdesc" title="dom-iframe-longDesc"><code>longDesc</code></dfn>
|
|
IDL attribute of the <code><a href="#the-iframe-element">iframe</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-iframe-longdesc"><a href="#attr-iframe-longdesc">longdesc</a></code> content attribute,
|
|
which for the purposes of reflection is defined as containing a
|
|
<a href="#url">URL</a>.</p>
|
|
|
|
<p>The <dfn id="dom-iframe-marginheight" title="dom-iframe-marginHeight"><code>marginHeight</code></dfn> IDL
|
|
attribute of the <code><a href="#the-iframe-element">iframe</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-iframe-marginheight"><a href="#attr-iframe-marginheight">marginheight</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-iframe-marginwidth" title="dom-iframe-marginWidth"><code>marginWidth</code></dfn> IDL
|
|
attribute of the <code><a href="#the-iframe-element">iframe</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-iframe-marginwidth"><a href="#attr-iframe-marginwidth">marginwidth</a></code> content
|
|
attribute.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlimageelement">HTMLImageElement</a> {
|
|
attribute DOMString <a href="#dom-img-name" title="dom-img-name">name</a>;
|
|
attribute DOMString <a href="#dom-img-align" title="dom-img-align">align</a>;
|
|
attribute DOMString <a href="#dom-img-border" title="dom-img-border">border</a>;
|
|
attribute unsigned long <a href="#dom-img-hspace" title="dom-img-hspace">hspace</a>;
|
|
attribute DOMString <a href="#dom-img-longdesc" title="dom-img-longDesc">longDesc</a>;
|
|
attribute unsigned long <a href="#dom-img-vspace" title="dom-img-vspace">vspace</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-img-name" title="dom-img-name"><code>name</code></dfn>, <dfn id="dom-img-align" title="dom-img-align"><code>align</code></dfn>, <dfn id="dom-img-border" title="dom-img-border"><code>border</code></dfn>, <dfn id="dom-img-hspace" title="dom-img-hspace"><code>hspace</code></dfn>, and <dfn id="dom-img-vspace" title="dom-img-vspace"><code>vspace</code></dfn> IDL attributes of
|
|
the <code><a href="#the-img-element">img</a></code> element must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-img-longdesc" title="dom-img-longDesc"><code>longDesc</code></dfn> IDL
|
|
attribute of the <code><a href="#the-img-element">img</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-img-longdesc"><a href="#attr-img-longdesc">longdesc</a></code>
|
|
content attribute, which for the purposes of reflection is defined
|
|
as containing a <a href="#url">URL</a>.</p>
|
|
|
|
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlinputelement">HTMLInputElement</a> {
|
|
attribute DOMString <a href="#dom-input-align" title="dom-input-align">align</a>;
|
|
attribute DOMString <a href="#dom-input-usemap" title="dom-input-useMap">useMap</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-input-align" title="dom-input-align"><code>align</code></dfn> IDL
|
|
attribute of the <code><a href="#the-input-element">input</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-input-usemap" title="dom-input-useMap"><code>useMap</code></dfn> IDL
|
|
attribute of the <code><a href="#the-input-element">input</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-input-usemap"><a href="#attr-input-usemap">usemap</a></code> content attribute.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmllegendelement">HTMLLegendElement</a> {
|
|
attribute DOMString <a href="#dom-legend-align" title="dom-legend-align">align</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-legend-align" title="dom-legend-align"><code>align</code></dfn> IDL
|
|
attribute of the <code><a href="#the-legend-element">legend</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmllielement">HTMLLIElement</a> {
|
|
attribute DOMString <a href="#dom-li-type" title="dom-li-type">type</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-li-type" title="dom-li-type"><code>type</code></dfn> IDL
|
|
attribute of the <code><a href="#the-li-element">li</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmllinkelement">HTMLLinkElement</a> {
|
|
attribute DOMString <a href="#dom-link-charset" title="dom-link-charset">charset</a>;
|
|
attribute DOMString <a href="#dom-link-rev" title="dom-link-rev">rev</a>;
|
|
attribute DOMString <a href="#dom-link-target" title="dom-link-target">target</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-link-charset" title="dom-link-charset"><code>charset</code></dfn>,
|
|
<dfn id="dom-link-rev" title="dom-link-rev"><code>rev</code></dfn>, and <dfn id="dom-link-target" title="dom-link-target"><code>target</code></dfn> IDL attributes of
|
|
the <code><a href="#the-link-element">link</a></code> element must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<hr><p>User agents must treat <code><a href="#listing">listing</a></code> elements in a manner
|
|
equivalent to <code><a href="#the-pre-element">pre</a></code> elements in terms of semantics and
|
|
for purposes of rendering.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlmenuelement">HTMLMenuElement</a> {
|
|
attribute boolean <a href="#dom-menu-compact" title="dom-menu-compact">compact</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-menu-compact" title="dom-menu-compact"><code>compact</code></dfn> IDL
|
|
attribute of the <code><a href="#the-menu-element">menu</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlmetaelement">HTMLMetaElement</a> {
|
|
attribute DOMString <a href="#dom-meta-scheme" title="dom-meta-scheme">scheme</a>;
|
|
};</pre>
|
|
|
|
<p>User agents may treat the <code title="attr-meta-scheme"><a href="#attr-meta-scheme">scheme</a></code> content attribute on the
|
|
<code><a href="#the-meta-element">meta</a></code> element as an extension of the element's <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> content attribute when processing
|
|
a <code><a href="#the-meta-element">meta</a></code> element with a <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute whose value is one that
|
|
the user agent recognizes as supporting the <code title="attr-meta-scheme"><a href="#attr-meta-scheme">scheme</a></code> attribute.</p>
|
|
|
|
<p>User agents are encouraged to ignore the <code title="attr-meta-scheme"><a href="#attr-meta-scheme">scheme</a></code> attribute and instead process
|
|
the value given to the metadata name as if it had been specified for
|
|
each expected value of the <code title="attr-meta-scheme"><a href="#attr-meta-scheme">scheme</a></code> attribute.</p>
|
|
|
|
<div class="example">
|
|
|
|
<p>For example, if the user agent acts on <code><a href="#the-meta-element">meta</a></code>
|
|
elements with <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attributes
|
|
having the value "eGMS.subject.keyword", and knows that the <code title="attr-meta-scheme"><a href="#attr-meta-scheme">scheme</a></code> attribute is used with this
|
|
metadata name, then it could take the <code title="attr-meta-scheme"><a href="#attr-meta-scheme">scheme</a></code> attribute into account,
|
|
acting as if it was an extension of the <code title="attr-meta-name"><a href="#attr-meta-name">name</a></code> attribute. Thus the following
|
|
two <code><a href="#the-meta-element">meta</a></code> elements could be treated as two elements
|
|
giving values for two different metadata names, one consisting of a
|
|
combination of "eGMS.subject.keyword" and "LGCL", and the other
|
|
consisting of a combination of "eGMS.subject.keyword" and
|
|
"ORLY":</p>
|
|
|
|
<pre class="bad"><!-- this markup is invalid -->
|
|
<meta name="eGMS.subject.keyword" scheme="LGCL" content="Abandoned vehicles">
|
|
<meta name="eGMS.subject.keyword" scheme="ORLY" content="Mah car: kthxbye"></pre>
|
|
|
|
<p>The recommended processing of this markup, however, would be
|
|
equivalent to the following:</p>
|
|
|
|
<pre><meta name="eGMS.subject.keyword" content="Abandoned vehicles">
|
|
<meta name="eGMS.subject.keyword" content="Mah car: kthxbye"></pre>
|
|
|
|
</div>
|
|
|
|
<p>The <dfn id="dom-meta-scheme" title="dom-meta-scheme"><code>scheme</code></dfn> IDL
|
|
attribute of the <code><a href="#the-meta-element">meta</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlobjectelement">HTMLObjectElement</a> {
|
|
attribute DOMString <a href="#dom-object-align" title="dom-object-align">align</a>;
|
|
attribute DOMString <a href="#dom-object-archive" title="dom-object-archive">archive</a>;
|
|
attribute DOMString <a href="#dom-object-border" title="dom-object-border">border</a>;
|
|
attribute DOMString <a href="#dom-object-code" title="dom-object-code">code</a>;
|
|
attribute DOMString <a href="#dom-object-codebase" title="dom-object-codeBase">codeBase</a>;
|
|
attribute DOMString <a href="#dom-object-codetype" title="dom-object-codeType">codeType</a>;
|
|
attribute boolean <a href="#dom-object-declare" title="dom-object-declare">declare</a>;
|
|
attribute unsigned long <a href="#dom-object-hspace" title="dom-object-hspace">hspace</a>;
|
|
attribute DOMString <a href="#dom-object-standby" title="dom-object-standby">standby</a>;
|
|
attribute unsigned long <a href="#dom-object-vspace" title="dom-object-vspace">vspace</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-object-align" title="dom-object-align"><code>align</code></dfn>, <dfn id="dom-object-archive" title="dom-object-archive"><code>archive</code></dfn>, <dfn id="dom-object-border" title="dom-object-border"><code>border</code></dfn>, <dfn id="dom-object-code" title="dom-object-code"><code>code</code></dfn>, <dfn id="dom-object-declare" title="dom-object-declare"><code>declare</code></dfn>, <dfn id="dom-object-hspace" title="dom-object-hspace"><code>hspace</code></dfn>, <dfn id="dom-object-standby" title="dom-object-standby"><code>standby</code></dfn>, and <dfn id="dom-object-vspace" title="dom-object-vspace"><code>vspace</code></dfn> IDL attributes
|
|
of the <code><a href="#the-object-element">object</a></code> element must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-object-codebase" title="dom-object-codeBase"><code>codeBase</code></dfn>
|
|
IDL attribute of the <code><a href="#the-object-element">object</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-object-codebase"><a href="#attr-object-codebase">codebase</a></code> content attribute,
|
|
which for the purposes of reflection is defined as containing a
|
|
<a href="#url">URL</a>.</p>
|
|
|
|
<p>The <dfn id="dom-object-codetype" title="dom-object-codeType"><code>codeType</code></dfn> IDL
|
|
attribute of the <code><a href="#the-object-element">object</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-object-codetype"><a href="#attr-object-codetype">codetype</a></code> content
|
|
attribute.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlolistelement">HTMLOListElement</a> {
|
|
attribute boolean <a href="#dom-ol-compact" title="dom-ol-compact">compact</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-ol-compact" title="dom-ol-compact"><code>compact</code></dfn> IDL
|
|
attribute of the <code><a href="#the-ol-element">ol</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlparagraphelement">HTMLParagraphElement</a> {
|
|
attribute DOMString <a href="#dom-p-align" title="dom-p-align">align</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-p-align" title="dom-p-align"><code>align</code></dfn> IDL
|
|
attribute of the <code><a href="#the-p-element">p</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlparamelement">HTMLParamElement</a> {
|
|
attribute DOMString <a href="#dom-param-type" title="dom-param-type">type</a>;
|
|
attribute DOMString <a href="#dom-param-valuetype" title="dom-param-valueType">valueType</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-param-type" title="dom-param-type"><code>type</code></dfn> IDL
|
|
attribute of the <code><a href="#the-param-element">param</a></code> element must
|
|
<a href="#reflect">reflect</a> the content attribute of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-param-valuetype" title="dom-param-valueType"><code>valueType</code></dfn>
|
|
IDL attribute of the <code><a href="#the-param-element">param</a></code> element must
|
|
<a href="#reflect">reflect</a> the element's <code title="attr-param-valuetype"><a href="#attr-param-valuetype">valuetype</a></code> content attribute.</p>
|
|
|
|
<hr><p>User agents must treat <code><a href="#plaintext">plaintext</a></code> elements in a
|
|
manner equivalent to <code><a href="#the-pre-element">pre</a></code> elements in terms of semantics
|
|
and for purposes of rendering. (The parser has special behavior for
|
|
this element, though.)</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlpreelement">HTMLPreElement</a> {
|
|
attribute unsigned long <a href="#dom-pre-width" title="dom-pre-width">width</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-pre-width" title="dom-pre-width"><code>width</code></dfn> IDL
|
|
attribute of the <code><a href="#the-pre-element">pre</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlscriptelement">HTMLScriptElement</a> {
|
|
attribute DOMString <a href="#dom-script-event" title="dom-script-event">event</a>;
|
|
attribute DOMString <a href="#dom-script-htmlfor" title="dom-script-htmlFor">htmlFor</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-script-event" title="dom-script-event"><code>event</code></dfn> and
|
|
<dfn id="dom-script-htmlfor" title="dom-script-htmlFor"><code>htmlFor</code></dfn> IDL
|
|
attributes of the <code><a href="#the-script-element">script</a></code> element must return the empty
|
|
string on getting, and do nothing on setting.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmltableelement">HTMLTableElement</a> {
|
|
attribute DOMString <a href="#dom-table-align" title="dom-table-align">align</a>;
|
|
attribute DOMString <a href="#dom-table-bgcolor" title="dom-table-bgColor">bgColor</a>;
|
|
attribute DOMString <a href="#dom-table-cellpadding" title="dom-table-cellPadding">cellPadding</a>;
|
|
attribute DOMString <a href="#dom-table-cellspacing" title="dom-table-cellSpacing">cellSpacing</a>;
|
|
attribute DOMString <a href="#dom-table-frame" title="dom-table-frame">frame</a>;
|
|
attribute DOMString <a href="#dom-table-rules" title="dom-table-rules">rules</a>;
|
|
attribute DOMString <a href="#dom-table-summary" title="dom-table-summary">summary</a>;
|
|
attribute DOMString <a href="#dom-table-width" title="dom-table-width">width</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-table-align" title="dom-table-align"><code>align</code></dfn>, <dfn id="dom-table-frame" title="dom-table-frame"><code>frame</code></dfn>, <dfn id="dom-table-summary" title="dom-table-summary"><code>summary</code></dfn>, <dfn id="dom-table-rules" title="dom-table-rules"><code>rules</code></dfn>, and <dfn id="dom-table-width" title="dom-table-width"><code>width</code></dfn>, IDL attributes of
|
|
the <code><a href="#the-table-element">table</a></code> element must <a href="#reflect">reflect</a> the
|
|
respective content attributes of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-table-bgcolor" title="dom-table-bgColor"><code>bgColor</code></dfn> IDL
|
|
attribute of the <code><a href="#the-table-element">table</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-table-bgcolor"><a href="#attr-table-bgcolor">bgcolor</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-table-cellpadding" title="dom-table-cellPadding"><code>cellPadding</code></dfn> IDL
|
|
attribute of the <code><a href="#the-table-element">table</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-table-cellpadding"><a href="#attr-table-cellpadding">cellpadding</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-table-cellspacing" title="dom-table-cellSpacing"><code>cellSpacing</code></dfn> IDL
|
|
attribute of the <code><a href="#the-table-element">table</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-table-cellspacing"><a href="#attr-table-cellspacing">cellspacing</a></code> content
|
|
attribute.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmltablesectionelement">HTMLTableSectionElement</a> {
|
|
attribute DOMString <a href="#dom-tbody-align" title="dom-tbody-align">align</a>;
|
|
attribute DOMString <a href="#dom-tbody-ch" title="dom-tbody-ch">ch</a>;
|
|
attribute DOMString <a href="#dom-tbody-choff" title="dom-tbody-chOff">chOff</a>;
|
|
attribute DOMString <a href="#dom-tbody-valign" title="dom-tbody-vAlign">vAlign</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-tbody-align" title="dom-tbody-align"><code>align</code></dfn> IDL
|
|
attribute of the <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> elements must <a href="#reflect">reflect</a> the content
|
|
attribute of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-tbody-ch" title="dom-tbody-ch"><code>ch</code></dfn> IDL attribute
|
|
of the <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> elements must <a href="#reflect">reflect</a> the elements'
|
|
<code title="attr-tbody-char"><a href="#attr-tbody-char">char</a></code> content attributes.</p>
|
|
|
|
<p>The <dfn id="dom-tbody-choff" title="dom-tbody-chOff"><code>chOff</code></dfn> IDL
|
|
attribute of the <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> elements must <a href="#reflect">reflect</a> the elements'
|
|
<code title="attr-tbody-charoff"><a href="#attr-tbody-charoff">charoff</a></code> content attributes.</p>
|
|
|
|
<p>The <dfn id="dom-tbody-valign" title="dom-tbody-vAlign"><code>vAlign</code></dfn> IDL
|
|
attribute of the <code><a href="#the-tbody-element">tbody</a></code>, <code><a href="#the-thead-element">thead</a></code>, and
|
|
<code><a href="#the-tfoot-element">tfoot</a></code> element must <a href="#reflect">reflect</a> the elements'
|
|
<code title="attr-tbody-valign"><a href="#attr-tbody-valign">valign</a></code> content
|
|
attributes.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmltablecellelement">HTMLTableCellElement</a> {
|
|
attribute DOMString <a href="#dom-tdth-abbr" title="dom-tdth-abbr">abbr</a>;
|
|
attribute DOMString <a href="#dom-tdth-align" title="dom-tdth-align">align</a>;
|
|
attribute DOMString <a href="#dom-tdth-axis" title="dom-tdth-axis">axis</a>;
|
|
attribute DOMString <a href="#dom-tdth-bgcolor" title="dom-tdth-bgColor">bgColor</a>;
|
|
attribute DOMString <a href="#dom-tdth-ch" title="dom-tdth-ch">ch</a>;
|
|
attribute DOMString <a href="#dom-tdth-choff" title="dom-tdth-chOff">chOff</a>;
|
|
attribute DOMString <a href="#dom-tdth-height" title="dom-tdth-height">height</a>;
|
|
attribute boolean <a href="#dom-tdth-nowrap" title="dom-tdth-noWrap">noWrap</a>;
|
|
attribute DOMString <a href="#dom-tdth-valign" title="dom-tdth-vAlign">vAlign</a>;
|
|
attribute DOMString <a href="#dom-tdth-width" title="dom-tdth-width">width</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-tdth-abbr" title="dom-tdth-abbr"><code>abbr</code></dfn>, <dfn id="dom-tdth-align" title="dom-tdth-align"><code>align</code></dfn>, <dfn id="dom-tdth-axis" title="dom-tdth-axis"><code>axis</code></dfn>, <dfn id="dom-tdth-height" title="dom-tdth-height"><code>height</code></dfn>, and <dfn id="dom-tdth-width" title="dom-tdth-width"><code>width</code></dfn> IDL attributes of
|
|
the <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements must
|
|
<a href="#reflect">reflect</a> the respective content attributes of the same
|
|
name.</p>
|
|
|
|
<p>The <dfn id="dom-tdth-bgcolor" title="dom-tdth-bgColor"><code>bgColor</code></dfn> IDL
|
|
attribute of the <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements must
|
|
<a href="#reflect">reflect</a> the elements' <code title="attr-tdth-bgcolor"><a href="#attr-tdth-bgcolor">bgcolor</a></code> content attributes.</p>
|
|
|
|
<p>The <dfn id="dom-tdth-ch" title="dom-tdth-ch"><code>ch</code></dfn> IDL
|
|
attribute of the <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements must
|
|
<a href="#reflect">reflect</a> the elements' <code title="attr-tdth-char"><a href="#attr-tdth-char">char</a></code> content attributes.</p>
|
|
|
|
<p>The <dfn id="dom-tdth-choff" title="dom-tdth-chOff"><code>chOff</code></dfn> IDL
|
|
attribute of the <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements must
|
|
<a href="#reflect">reflect</a> the elements' <code title="attr-tdth-charoff"><a href="#attr-tdth-charoff">charoff</a></code> content attributes.</p>
|
|
|
|
<p>The <dfn id="dom-tdth-nowrap" title="dom-tdth-noWrap"><code>noWrap</code></dfn> IDL
|
|
attribute of the <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> elements must
|
|
<a href="#reflect">reflect</a> the elements' <code title="attr-tdth-nowrap"><a href="#attr-tdth-nowrap">nowrap</a></code> content attributes.</p>
|
|
|
|
<p>The <dfn id="dom-tdth-valign" title="dom-tdth-vAlign"><code>vAlign</code></dfn> IDL
|
|
attribute of the <code><a href="#the-td-element">td</a></code> and <code><a href="#the-th-element">th</a></code> element must
|
|
<a href="#reflect">reflect</a> the elements' <code title="attr-tdth-valign"><a href="#attr-tdth-valign">valign</a></code> content attributes.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmltablerowelement">HTMLTableRowElement</a> {
|
|
attribute DOMString <a href="#dom-tr-align" title="dom-tr-align">align</a>;
|
|
attribute DOMString <a href="#dom-tr-bgcolor" title="dom-tr-bgColor">bgColor</a>;
|
|
attribute DOMString <a href="#dom-tr-ch" title="dom-tr-ch">ch</a>;
|
|
attribute DOMString <a href="#dom-tr-choff" title="dom-tr-chOff">chOff</a>;
|
|
attribute DOMString <a href="#dom-tr-valign" title="dom-tr-vAlign">vAlign</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-tr-align" title="dom-tr-align"><code>align</code></dfn> IDL
|
|
attribute of the <code><a href="#the-tr-element">tr</a></code> element must <a href="#reflect">reflect</a>
|
|
the content attribute of the same name.</p>
|
|
|
|
<p>The <dfn id="dom-tr-bgcolor" title="dom-tr-bgColor"><code>bgColor</code></dfn> IDL
|
|
attribute of the <code><a href="#the-tr-element">tr</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-tr-bgcolor"><a href="#attr-tr-bgcolor">bgcolor</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-tr-ch" title="dom-tr-ch"><code>ch</code></dfn> IDL attribute of
|
|
the <code><a href="#the-tr-element">tr</a></code> element must <a href="#reflect">reflect</a> the element's
|
|
<code title="attr-tr-char"><a href="#attr-tr-char">char</a></code> content attribute.</p>
|
|
|
|
<p>The <dfn id="dom-tr-choff" title="dom-tr-chOff"><code>chOff</code></dfn> IDL
|
|
attribute of the <code><a href="#the-tr-element">tr</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-tr-charoff"><a href="#attr-tr-charoff">charoff</a></code> content
|
|
attribute.</p>
|
|
|
|
<p>The <dfn id="dom-tr-valign" title="dom-tr-vAlign"><code>vAlign</code></dfn> IDL
|
|
attribute of the <code><a href="#the-tr-element">tr</a></code> element must <a href="#reflect">reflect</a>
|
|
the element's <code title="attr-tr-valign"><a href="#attr-tr-valign">valign</a></code> content
|
|
attribute.</p>
|
|
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmlulistelement">HTMLUListElement</a> {
|
|
attribute boolean <a href="#dom-ul-compact" title="dom-ul-compact">compact</a>;
|
|
attribute DOMString <a href="#dom-ul-type" title="dom-ul-type">type</a>;
|
|
};</pre>
|
|
|
|
<p>The <dfn id="dom-ul-compact" title="dom-ul-compact"><code>compact</code></dfn> and
|
|
<dfn id="dom-ul-type" title="dom-ul-type"><code>type</code></dfn> IDL attributes of
|
|
the <code><a href="#the-ul-element">ul</a></code> element must <a href="#reflect">reflect</a> the respective
|
|
content attributes of the same name.</p>
|
|
|
|
<hr><p>User agents must treat <code><a href="#xmp">xmp</a></code> elements in a manner
|
|
equivalent to <code><a href="#the-pre-element">pre</a></code> elements in terms of semantics and
|
|
for purposes of rendering. (The parser has special behavior for this
|
|
element though.)</p>
|
|
|
|
<hr><p>The <code><a href="#bgsound">bgsound</a></code>, <code><a href="#isindex-0">isindex</a></code>,
|
|
<code><a href="#multicol">multicol</a></code>, <code><a href="#nextid">nextid</a></code>, <code><a href="#rb">rb</a></code>, and
|
|
<code><a href="#spacer">spacer</a></code> elements must use the
|
|
<code><a href="#htmlunknownelement">HTMLUnknownElement</a></code> interface.</p>
|
|
<hr><pre class="idl">[Supplemental]
|
|
interface <a href="#htmldocument">HTMLDocument</a> {
|
|
attribute DOMString <a href="#dom-document-fgcolor" title="dom-document-fgColor">fgColor</a>;
|
|
attribute DOMString <a href="#dom-document-bgcolor" title="dom-document-bgColor">bgColor</a>;
|
|
attribute DOMString <a href="#dom-document-linkcolor" title="dom-document-linkColor">linkColor</a>;
|
|
attribute DOMString <a href="#dom-document-vlinkcolor" title="dom-document-vlinkColor">vlinkColor</a>;
|
|
attribute DOMString <a href="#dom-document-alinkcolor" title="dom-document-alinkColor">alinkColor</a>;
|
|
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-anchors" title="dom-document-anchors">anchors</a>;
|
|
readonly attribute <a href="#htmlcollection">HTMLCollection</a> <a href="#dom-document-applets" title="dom-document-applets">applets</a>;
|
|
|
|
void <a href="#dom-document-clear" title="dom-document-clear">clear</a>();
|
|
|
|
readonly attribute <a href="#htmlallcollection">HTMLAllCollection</a> <a href="#dom-document-all" title="dom-document-all">all</a>;
|
|
};</pre>
|
|
|
|
<p>The attributes of the <code><a href="#document">Document</a></code> object listed in the
|
|
first column of the following table must <a href="#reflect">reflect</a> the
|
|
content attribute on <a href="#the-body-element-0">the body element</a> with the name
|
|
given in the corresponding cell in the second column on the same
|
|
row, if <a href="#the-body-element-0">the body element</a> is a <code><a href="#the-body-element">body</a></code> element
|
|
(as opposed to a <code><a href="#frameset">frameset</a></code> element). When there is no
|
|
<a href="#the-body-element-0" title="the body element">body element</a> or if it is a
|
|
<code><a href="#frameset">frameset</a></code> element, the attributes must instead return
|
|
the empty string on getting and do nothing on setting.</p>
|
|
|
|
<table><thead><tr><th> IDL attribute
|
|
<th> Content attribute
|
|
<tbody><tr><td><dfn id="dom-document-fgcolor" title="dom-document-fgColor"><code>fgColor</code></dfn>
|
|
<td><code title="attr-body-text"><a href="#attr-body-text">text</a></code>
|
|
<tr><td><dfn id="dom-document-bgcolor" title="dom-document-bgColor"><code>bgColor</code></dfn>
|
|
<td><code title="attr-body-bgcolor"><a href="#attr-body-bgcolor">bgcolor</a></code>
|
|
<tr><td><dfn id="dom-document-linkcolor" title="dom-document-linkColor"><code>linkColor</code></dfn>
|
|
<td><code title="attr-body-link"><a href="#attr-body-link">link</a></code>
|
|
<tr><td><dfn id="dom-document-vlinkcolor" title="dom-document-vlinkColor"><code>vlinkColor</code></dfn>
|
|
<td><code title="attr-body-vlink"><a href="#attr-body-vlink">vlink</a></code>
|
|
<tr><td><dfn id="dom-document-alinkcolor" title="dom-document-alinkColor"><code>alinkColor</code></dfn>
|
|
<td><code title="attr-body-alink"><a href="#attr-body-alink">alink</a></code>
|
|
</table><hr><p>The <dfn id="dom-document-anchors" title="dom-document-anchors"><code>anchors</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only <code><a href="#the-a-element">a</a></code>
|
|
elements with <code title="attr-a-name"><a href="#attr-a-name">name</a></code>
|
|
attributes.</p>
|
|
|
|
<p>The <dfn id="dom-document-applets" title="dom-document-applets"><code>applets</code></dfn>
|
|
attribute must return an <code><a href="#htmlcollection">HTMLCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches only
|
|
<code><a href="#the-applet-element">applet</a></code> elements.</p>
|
|
|
|
<p>The <dfn id="dom-document-clear" title="dom-document-clear"><code>clear()</code></dfn>
|
|
method must do nothing.</p>
|
|
|
|
<hr><p>The <dfn id="dom-document-all" title="dom-document-all"><code>all</code></dfn>
|
|
attribute must return an <code><a href="#htmlallcollection">HTMLAllCollection</a></code> rooted at the
|
|
<code><a href="#document">Document</a></code> node, whose filter matches all elements.</p>
|
|
|
|
<p>The object returned for <code title="dom-document-all"><a href="#dom-document-all">all</a></code>
|
|
has several unusual behaviors:</p>
|
|
|
|
<ul><li><p>The user agent must act as if the ToBoolean() operator in
|
|
JavaScript converts the object returned for <code title="dom-document-all"><a href="#dom-document-all">all</a></code> to the false value.</li>
|
|
|
|
<li><p>The user agent must act as if, for the purposes of the <code title="">==</code> and <code title="">!=</code> operators in
|
|
JavaScript, the object returned for <code title="dom-document-all"><a href="#dom-document-all">all</a></code> is equal to the <code title="">undefined</code> value.</li>
|
|
|
|
<li><p>The user agent must act such that the <code title="">typeof</code> operator in JavaScript returns the string
|
|
<code title="">undefined</code> when applied to the object returned
|
|
for <code title="dom-document-all"><a href="#dom-document-all">all</a></code>.</li>
|
|
|
|
</ul><p class="note">These requirements are a <a href="#willful-violation">willful
|
|
violation</a> of the JavaScript specification current at the time
|
|
of writing (ECMAScript edition 3). The JavaScript specification
|
|
requires that the ToBoolean() operator convert all objects to the
|
|
true value, and does not have provisions for objects acting as if
|
|
they were <code title="">undefined</code> for the purposes of
|
|
certain operators. This violation is motivated by a desire for
|
|
compatibility with two classes of legacy content: one that uses the
|
|
presence of <code title="dom-document-all"><a href="#dom-document-all">document.all</a></code> as a
|
|
way to detect legacy user agents, and one that only supports those
|
|
legacy user agents and uses the <code title="dom-document-all"><a href="#dom-document-all">document.all</a></code> object without testing
|
|
for its presence first. <a href="#refsECMA262">[ECMA262]</a></p>
|
|
|
|
</div><h2 id="iana"><span class="secno">12 </span>IANA considerations</h2><h3 id="text-html"><span class="secno">12.1 </span><dfn><code>text/html</code></dfn></h3><p>This registration is for community review and will be submitted
|
|
to the IESG for review, approval, and registration with IANA.</p><dl><dt>Type name:</dt>
|
|
<dd>text</dd>
|
|
<dt>Subtype name:</dt>
|
|
<dd>html</dd>
|
|
<dt>Required parameters:</dt>
|
|
<dd>No required parameters</dd>
|
|
<dt>Optional parameters:</dt>
|
|
<dd>
|
|
<dl><dt><code title="">charset</code></dt>
|
|
<dd>
|
|
<p>The <code title="">charset</code> parameter may be provided
|
|
to definitively specify the <a href="#document-s-character-encoding">document's character
|
|
encoding</a>, overriding any <a href="#character-encoding-declaration" title="character encoding
|
|
declaration">character encoding declarations</a> in the
|
|
document. The parameter's value must be the name of the
|
|
character encoding used to serialize the file, must be a valid
|
|
character encoding name, and must be an <a href="#ascii-case-insensitive">ASCII
|
|
case-insensitive</a> match for the <a href="#preferred-mime-name">preferred MIME
|
|
name</a> for that encoding. <a href="#refsIANACHARSET">[IANACHARSET]</a></p>
|
|
</dd>
|
|
</dl></dd>
|
|
<dt>Encoding considerations:</dt>
|
|
<dd>See the section on <a href="#character-encoding-declaration" title="character encoding
|
|
declaration">character encoding declarations</a>.</dd>
|
|
<dt>Security considerations:</dt>
|
|
<dd>
|
|
|
|
<p>Entire novels have been written about the security
|
|
considerations that apply to HTML documents. Many are listed in
|
|
this document, to which the reader is referred for more
|
|
details. Some general concerns bear mentioning here, however:</p>
|
|
|
|
<p>HTML is scripted language, and has a large number of APIs (some
|
|
of which are described in this document). Script can expose the
|
|
user to potential risks of information leakage, credential
|
|
leakage, cross-site scripting attacks, cross-site request
|
|
forgeries, and a host of other problems. While the designs in this
|
|
specification are intended to be safe if implemented correctly, a
|
|
full implementation is a massive undertaking and, as with any
|
|
software, user agents are likely to have security bugs.</p>
|
|
|
|
<p>Even without scripting, there are specific features in HTML
|
|
which, for historical reasons, are required for broad
|
|
compatibility with legacy content but that expose the user to
|
|
unfortunate security problems. In particular, the <code><a href="#the-img-element">img</a></code>
|
|
element can be used in conjunction with some other features as a
|
|
way to effect a port scan from the user's location on the
|
|
Internet. This can expose local network topologies that the
|
|
attacker would otherwise not be able to determine.</p>
|
|
|
|
<p>HTML relies on a compartmentalization scheme sometimes known as
|
|
the <i>same-origin policy</i>. An <a href="#origin">origin</a> in most
|
|
cases consists of all the pages served from the same host, on the
|
|
same port, using the same protocol.</p>
|
|
|
|
<p>It is critical, therefore, to ensure that any untrusted content
|
|
that forms part of a site be hosted on a different
|
|
<a href="#origin">origin</a> than any sensitive content on that site.
|
|
Untrusted content can easily spoof any other page on the same
|
|
origin, read data from that origin, cause scripts in that origin
|
|
to execute, submit forms to and from that origin even if they are
|
|
protected from cross-site request forgery attacks by unique
|
|
tokens, and make use of any third-party resources exposed to or
|
|
rights granted to that origin.</p>
|
|
|
|
</dd>
|
|
<dt>Interoperability considerations:</dt>
|
|
<dd>
|
|
Rules for processing both conforming and non-conforming content
|
|
are defined in this specification.
|
|
</dd>
|
|
<dt>Published specification:</dt>
|
|
<dd id="authors-using-html">
|
|
This document is the relevant specification. Labeling a resource
|
|
with the <code><a href="#text-html">text/html</a></code> type asserts that the resource is
|
|
an <a href="#html-documents" title="HTML documents">HTML document</a> using
|
|
<a href="#syntax">the HTML syntax</a>.
|
|
</dd>
|
|
<dt>Applications that use this media type:</dt>
|
|
<dd>
|
|
Web browsers, tools for processing Web content, HTML authoring
|
|
tools, search engines, validators.
|
|
</dd>
|
|
<dt>Additional information:</dt>
|
|
<dd>
|
|
<dl><dt>Magic number(s):</dt>
|
|
<dd>No sequence of bytes can uniquely identify an HTML
|
|
document. More information on detecting HTML documents is
|
|
available in the Media Type Sniffing specification. <a href="#refsMIMESNIFF">[MIMESNIFF]</a></dd>
|
|
<dt>File extension(s):</dt>
|
|
<dd>"<code title="">html</code>" and "<code title="">htm</code>"
|
|
are commonly, but certainly not exclusively, used as the
|
|
extension for HTML documents.</dd>
|
|
<dt>Macintosh file type code(s):</dt>
|
|
<dd><code title="">TEXT</code></dd>
|
|
</dl></dd>
|
|
<dt>Person & email address to contact for further information:</dt>
|
|
<dd>Ian Hickson <ian@hixie.ch></dd>
|
|
<dt>Intended usage:</dt>
|
|
<dd>Common</dd>
|
|
<dt>Restrictions on usage:</dt>
|
|
<dd>No restrictions apply.</dd>
|
|
<dt>Author:</dt>
|
|
<dd>Ian Hickson <ian@hixie.ch></dd>
|
|
<dt>Change controller:</dt>
|
|
<dd>W3C</dd>
|
|
</dl><p>Fragment identifiers used with <code><a href="#text-html">text/html</a></code> resources
|
|
refer to <a href="#the-indicated-part-of-the-document">the indicated part of the document</a>.<h3 id="text-html-sandboxed"><span class="secno">12.2 </span><dfn><code>text/html-sandboxed</code></dfn></h3><p>This registration is for community review and will be submitted
|
|
to the IESG for review, approval, and registration with IANA.</p><dl><dt>Type name:</dt>
|
|
<dd>text</dd>
|
|
<dt>Subtype name:</dt>
|
|
<dd>html-sandboxed</dd>
|
|
<dt>Required parameters:</dt>
|
|
<dd>No required parameters</dd>
|
|
<dt>Optional parameters:</dt>
|
|
<dd>Same as for <code><a href="#text-html">text/html</a></code></dd>
|
|
<dt>Encoding considerations:</dt>
|
|
<dd>Same as for <code><a href="#text-html">text/html</a></code></dd>
|
|
<dt>Security considerations:</dt>
|
|
<dd>
|
|
<p>The purpose of the <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> MIME type
|
|
is to provide a way for content providers to indicate that they
|
|
want the file to be interpreted in a manner that does not give the
|
|
file's contents access to the rest of the site. This is achieved
|
|
by assigning the <code><a href="#document">Document</a></code> objects generated from
|
|
resources labeled as <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> unique
|
|
origins.</p>
|
|
<p>To avoid having legacy user agents treating resources labeled
|
|
as <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> as regular
|
|
<code><a href="#text-html">text/html</a></code> files, authors should avoid using the <code title="">.html</code> or <code title="">.htm</code> extensions for
|
|
resources labeled as <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code>.</p>
|
|
<p>Furthermore, since the <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> MIME
|
|
type impacts the origin security model, authors should be careful
|
|
to prevent tampering with the MIME type labeling mechanism itself
|
|
when documents are labeled as <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code>. If
|
|
an attacker can cause a file to be served as
|
|
<code><a href="#text-html">text/html</a></code> instead of
|
|
<code><a href="#text-html-sandboxed">text/html-sandboxed</a></code>, then the sandboxing will not
|
|
take effect and a cross-site scripting attack will become
|
|
possible.</p>
|
|
<p>Beyond this, the type is identical to <code><a href="#text-html">text/html</a></code>,
|
|
and the same considerations apply.</p>
|
|
</dd>
|
|
<dt>Interoperability considerations:</dt>
|
|
<dd>Same as for <code><a href="#text-html">text/html</a></code></dd>
|
|
<dt>Published specification:</dt>
|
|
<dd>
|
|
This document is the relevant specification. Labeling a resource
|
|
with the <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> type asserts that the
|
|
resource is an <a href="#html-documents" title="HTML documents">HTML document</a>
|
|
using <a href="#syntax">the HTML syntax</a>.
|
|
</dd>
|
|
<dt>Applications that use this media type:</dt>
|
|
<dd>Same as for <code><a href="#text-html">text/html</a></code></dd>
|
|
<dt>Additional information:</dt>
|
|
<dd>
|
|
<dl><dt>Magic number(s):</dt>
|
|
<dd>Documents labeled as <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code> are
|
|
heuristically indistinguishable from those labeled as
|
|
<code><a href="#text-html">text/html</a></code>.</dd>
|
|
<dt>File extension(s):</dt>
|
|
<dd>"<code title="">sandboxed</code>"</dd>
|
|
<dt>Macintosh file type code(s):</dt>
|
|
<dd><code title="">TEXT</code></dd>
|
|
</dl></dd>
|
|
<dt>Person & email address to contact for further information:</dt>
|
|
<dd>Ian Hickson <ian@hixie.ch></dd>
|
|
<dt>Intended usage:</dt>
|
|
<dd>Common</dd>
|
|
<dt>Restrictions on usage:</dt>
|
|
<dd>No restrictions apply.</dd>
|
|
<dt>Author:</dt>
|
|
<dd>Ian Hickson <ian@hixie.ch></dd>
|
|
<dt>Change controller:</dt>
|
|
<dd>W3C</dd>
|
|
</dl><p>Fragment identifiers used with <code><a href="#text-html-sandboxed">text/html-sandboxed</a></code>
|
|
resources refer to <a href="#the-indicated-part-of-the-document">the indicated part of the
|
|
document</a>.<h3 id="application-xhtml-xml"><span class="secno">12.3 </span><dfn><code>application/xhtml+xml</code></dfn></h3><p>This registration is for community review and will be submitted
|
|
to the IESG for review, approval, and registration with IANA.</p><dl><dt>Type name:</dt>
|
|
<dd>application</dd>
|
|
<dt>Subtype name:</dt>
|
|
<dd>xhtml+xml</dd>
|
|
<dt>Required parameters:</dt>
|
|
<dd>Same as for <code>application/xml</code> <a href="#refsRFC3023">[RFC3023]</a></dd>
|
|
<dt>Optional parameters:</dt>
|
|
<dd>Same as for <code>application/xml</code> <a href="#refsRFC3023">[RFC3023]</a></dd>
|
|
<dt>Encoding considerations:</dt>
|
|
<dd>Same as for <code>application/xml</code> <a href="#refsRFC3023">[RFC3023]</a></dd>
|
|
<dt>Security considerations:</dt>
|
|
<dd>Same as for <code>application/xml</code> <a href="#refsRFC3023">[RFC3023]</a></dd>
|
|
<dt>Interoperability considerations:</dt>
|
|
<dd>Same as for <code>application/xml</code> <a href="#refsRFC3023">[RFC3023]</a></dd>
|
|
<dt id="authors-using-xhtml">Published specification:</dt>
|
|
<dd>
|
|
Labeling a resource with the <code><a href="#application-xhtml-xml">application/xhtml+xml</a></code>
|
|
type asserts that the resource is an XML document that likely has
|
|
a root element from the <a href="#html-namespace-0">HTML namespace</a>. As such, the
|
|
relevant specifications are the XML specification, the Namespaces
|
|
in XML specification, and this specification. <a href="#refsXML">[XML]</a> <a href="#refsXMLNS">[XMLNS]</a>
|
|
</dd>
|
|
<dt>Applications that use this media type:</dt>
|
|
<dd>Same as for <code>application/xml</code> <a href="#refsRFC3023">[RFC3023]</a></dd>
|
|
<dt>Additional information:</dt>
|
|
<dd>
|
|
<dl><dt>Magic number(s):</dt>
|
|
<dd>Same as for <code>application/xml</code> <a href="#refsRFC3023">[RFC3023]</a></dd>
|
|
<dt>File extension(s):</dt>
|
|
<dd>"<code title="">xhtml</code>" and "<code title="">xht</code>"
|
|
are sometimes used as extensions for XML resources that have a
|
|
root element from the <a href="#html-namespace-0">HTML namespace</a>.</dd>
|
|
<dt>Macintosh file type code(s):</dt>
|
|
<dd><code title="">TEXT</code></dd>
|
|
</dl></dd>
|
|
<dt>Person & email address to contact for further information:</dt>
|
|
<dd>Ian Hickson <ian@hixie.ch></dd>
|
|
<dt>Intended usage:</dt>
|
|
<dd>Common</dd>
|
|
<dt>Restrictions on usage:</dt>
|
|
<dd>No restrictions apply.</dd>
|
|
<dt>Author:</dt>
|
|
<dd>Ian Hickson <ian@hixie.ch></dd>
|
|
<dt>Change controller:</dt>
|
|
<dd>W3C</dd>
|
|
</dl><p>Fragment identifiers used with <code><a href="#application-xhtml-xml">application/xhtml+xml</a></code>
|
|
resources have the same semantics as with any <a href="#xml-mime-type">XML MIME
|
|
type</a>. <a href="#refsRFC3023">[RFC3023]</a><h3 id="text-cache-manifest"><span class="secno">12.4 </span><dfn><code>text/cache-manifest</code></dfn></h3><p>This registration is for community review and will be submitted
|
|
to the IESG for review, approval, and registration with IANA.</p><dl><dt>Type name:</dt>
|
|
<dd>text</dd>
|
|
<dt>Subtype name:</dt>
|
|
<dd>cache-manifest</dd>
|
|
<dt>Required parameters:</dt>
|
|
<dd>No parameters</dd>
|
|
<dt>Optional parameters:</dt>
|
|
<dd>No parameters</dd>
|
|
<dt>Encoding considerations:</dt>
|
|
<dd>Always UTF-8.</dd>
|
|
<dt>Security considerations:</dt>
|
|
<dd>
|
|
<p>Cache manifests themselves pose no immediate risk unless
|
|
sensitive information is included within the
|
|
manifest. Implementations, however, are required to follow
|
|
specific rules when populating a cache based on a cache manifest,
|
|
to ensure that certain origin-based restrictions are
|
|
honored. Failure to correctly implement these rules can result in
|
|
information leakage, cross-site scripting attacks, and the
|
|
like.</p>
|
|
</dd>
|
|
<dt>Interoperability considerations:</dt>
|
|
<dd>
|
|
Rules for processing both conforming and non-conforming content
|
|
are defined in this specification.
|
|
</dd>
|
|
<dt>Published specification:</dt>
|
|
<dd>
|
|
This document is the relevant specification.
|
|
</dd>
|
|
<dt>Applications that use this media type:</dt>
|
|
<dd>
|
|
Web browsers.
|
|
</dd>
|
|
<dt>Additional information:</dt>
|
|
<dd>
|
|
<dl><dt>Magic number(s):</dt>
|
|
<dd>Cache manifests begin with the string "<code title="">CACHE
|
|
MANIFEST</code>", followed by either a U+0020 SPACE character, a
|
|
U+0009 CHARACTER TABULATION (tab) character, a U+000A LINE FEED
|
|
(LF) character, or a U+000D CARRIAGE RETURN (CR) character.</dd>
|
|
<dt>File extension(s):</dt>
|
|
<dd>"<code title="">appcache</code>"</dd>
|
|
<dt>Macintosh file type code(s):</dt>
|
|
<dd>No specific Macintosh file type codes are recommended for this type.</dd>
|
|
</dl></dd>
|
|
<dt>Person & email address to contact for further information:</dt>
|
|
<dd>Ian Hickson <ian@hixie.ch></dd>
|
|
<dt>Intended usage:</dt>
|
|
<dd>Common</dd>
|
|
<dt>Restrictions on usage:</dt>
|
|
<dd>No restrictions apply.</dd>
|
|
<dt>Author:</dt>
|
|
<dd>Ian Hickson <ian@hixie.ch></dd>
|
|
<dt>Change controller:</dt>
|
|
<dd>W3C</dd>
|
|
</dl><p>Fragment identifiers have no meaning with
|
|
<code><a href="#text-cache-manifest">text/cache-manifest</a></code> resources.<h2 class="no-num" id="index">Index</h2><div class="impl">
|
|
|
|
<p>The following sections only cover conforming elements and features.</p>
|
|
|
|
</div><h3 class="no-num" id="elements-1">Elements</h3><p><i>This section is non-normative.</i><table><caption>List of elements</caption>
|
|
<thead><tr><th> Element
|
|
<th> Description
|
|
<th> Categories
|
|
<th> Parents†
|
|
<th> Children
|
|
<th> Attributes
|
|
<th> Interface
|
|
<tbody><tr><th><code><a href="#the-a-element">a</a></code></th>
|
|
<td>Hyperlink</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>*;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#transparent">transparent</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>;
|
|
<code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code>;
|
|
<code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>;
|
|
<code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code>;
|
|
<code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code>;
|
|
<code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code></td>
|
|
<td><code><a href="#htmlanchorelement">HTMLAnchorElement</a></code></td>
|
|
<tr><th><code><a href="#the-abbr-element">abbr</a></code></th>
|
|
<td>Abbreviation</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-address-element">address</a></code></th>
|
|
<td>Contact information for a page or section</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-area-element">area</a></code></th>
|
|
<td>Hyperlink or dead area on an image map</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-area-alt"><a href="#attr-area-alt">alt</a></code>;
|
|
<code title="attr-area-coords"><a href="#attr-area-coords">coords</a></code>;
|
|
<code title="attr-area-shape"><a href="#attr-area-shape">shape</a></code>;
|
|
<code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">href</a></code>;
|
|
<code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">target</a></code>;
|
|
<code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">rel</a></code>;
|
|
<code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">media</a></code>;
|
|
<code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">hreflang</a></code>;
|
|
<code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">type</a></code></td>
|
|
<td><code><a href="#htmlareaelement">HTMLAreaElement</a></code></td>
|
|
<tr><th><code><a href="#the-article-element">article</a></code></th>
|
|
<td>Self-contained syndicatable or reusable composition</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#sectioning-content" title="Sectioning content">sectioning</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-aside-element">aside</a></code></th>
|
|
<td>Sidebar for tangentially related content</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#sectioning-content" title="Sectioning content">sectioning</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-audio-element">audio</a></code></th>
|
|
<td>Audio player</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#embedded-content" title="Embedded content">embedded</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><code><a href="#the-source-element">source</a></code>*;
|
|
<a href="#transparent">transparent</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-media-src"><a href="#attr-media-src">src</a></code>;
|
|
<code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code>;
|
|
<code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code>;
|
|
<code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code>;
|
|
<code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code>;
|
|
<code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code></td>
|
|
<td><code><a href="#htmlaudioelement">HTMLAudioElement</a></code></td>
|
|
<tr><th><code><a href="#the-b-element">b</a></code></th>
|
|
<td>Keywords</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-base-element">base</a></code></th>
|
|
<td>Base URL and default target <a href="#browsing-context">browsing context</a> for <a href="#attr-hyperlink-target" title="attr-hyperlink-target">hyperlinks</a> and <a href="#attr-fs-target" title="attr-fs-target">forms</a></td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata</a></td>
|
|
<td><code><a href="#the-head-element">head</a></code></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-base-href"><a href="#attr-base-href">href</a></code>;
|
|
<code title="attr-base-target"><a href="#attr-base-target">target</a></code></td>
|
|
<td><code><a href="#htmlbaseelement">HTMLBaseElement</a></code></td>
|
|
<tr><th><code><a href="#the-bdi-element">bdi</a></code></th>
|
|
<td>Text directionality isolation</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-bdo-element">bdo</a></code></th>
|
|
<td>Text directionality formatting</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-blockquote-element">blockquote</a></code></th>
|
|
<td>A section quoted from another source</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#sectioning-root" title="Sectioning root">sectioning root</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-blockquote-cite"><a href="#attr-blockquote-cite">cite</a></code></td>
|
|
<td><code><a href="#htmlquoteelement">HTMLQuoteElement</a></code></td>
|
|
<tr><th><code><a href="#the-body-element">body</a></code></th>
|
|
<td>Document body</td>
|
|
<td><a href="#sectioning-root" title="Sectioning root">sectioning root</a></td>
|
|
<td><code><a href="#the-html-element">html</a></code></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="handler-window-onafterprint"><a href="#handler-window-onafterprint">onafterprint</a></code>;
|
|
<code title="handler-window-onbeforeprint"><a href="#handler-window-onbeforeprint">onbeforeprint</a></code>;
|
|
<code title="handler-window-onbeforeunload"><a href="#handler-window-onbeforeunload">onbeforeunload</a></code>;
|
|
<code title="handler-window-onblur"><a href="#handler-window-onblur">onblur</a></code>;
|
|
<code title="handler-window-onerror"><a href="#handler-window-onerror">onerror</a></code>;
|
|
<code title="handler-window-onfocus"><a href="#handler-window-onfocus">onfocus</a></code>;
|
|
<code title="handler-window-onhashchange"><a href="#handler-window-onhashchange">onhashchange</a></code>;
|
|
<code title="handler-window-onload"><a href="#handler-window-onload">onload</a></code>;
|
|
<code title="handler-window-onmessage"><a href="#handler-window-onmessage">onmessage</a></code>;
|
|
<code title="handler-window-onoffline"><a href="#handler-window-onoffline">onoffline</a></code>;
|
|
<code title="handler-window-ononline"><a href="#handler-window-ononline">ononline</a></code>;
|
|
<code title="handler-window-onpagehide"><a href="#handler-window-onpagehide">onpagehide</a></code>;
|
|
<code title="handler-window-onpageshow"><a href="#handler-window-onpageshow">onpageshow</a></code>;
|
|
<code title="handler-window-onpopstate"><a href="#handler-window-onpopstate">onpopstate</a></code>;
|
|
<code title="handler-window-onredo"><a href="#handler-window-onredo">onredo</a></code>;
|
|
<code title="handler-window-onresize"><a href="#handler-window-onresize">onresize</a></code>;
|
|
<code title="handler-window-onscroll"><a href="#handler-window-onscroll">onscroll</a></code>;
|
|
<code title="handler-window-onstorage"><a href="#handler-window-onstorage">onstorage</a></code>;
|
|
<code title="handler-window-onundo"><a href="#handler-window-onundo">onundo</a></code>;
|
|
<code title="handler-window-onunload"><a href="#handler-window-onunload">onunload</a></code></td>
|
|
<td><code><a href="#htmlbodyelement">HTMLBodyElement</a></code></td>
|
|
<tr><th><code><a href="#the-br-element">br</a></code></th>
|
|
<td>Line break, e.g. in poem or postal address</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlbrelement">HTMLBRElement</a></code></td>
|
|
<tr><th><code><a href="#the-button-element">button</a></code></th>
|
|
<td>Button control</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>;
|
|
<a href="#category-listed" title="category-listed">listed</a>;
|
|
<a href="#category-label" title="category-label">labelable</a>;
|
|
<a href="#category-submit" title="category-submit">submittable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>;
|
|
<code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>;
|
|
<code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>;
|
|
<code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>;
|
|
<code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>;
|
|
<code title="attr-button-type"><a href="#attr-button-type">type</a></code>;
|
|
<code title="attr-button-value"><a href="#attr-button-value">value</a></code></td>
|
|
<td><code><a href="#htmlbuttonelement">HTMLButtonElement</a></code></td>
|
|
<tr><th><code><a href="#the-canvas-element">canvas</a></code></th>
|
|
<td>Scriptable bitmap canvas</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#embedded-content" title="Embedded content">embedded</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#transparent">transparent</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-canvas-width"><a href="#attr-canvas-width">width</a></code>;
|
|
<code title="attr-canvas-height"><a href="#attr-canvas-height">height</a></code></td>
|
|
<td><code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code></td>
|
|
<tr><th><code><a href="#the-caption-element">caption</a></code></th>
|
|
<td>Table caption</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-table-element">table</a></code></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmltablecaptionelement">HTMLTableCaptionElement</a></code></td>
|
|
<tr><th><code><a href="#the-cite-element">cite</a></code></th>
|
|
<td>Title of a work</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-code-element">code</a></code></th>
|
|
<td>Computer code</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-col-element">col</a></code></th>
|
|
<td>Table column</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-colgroup-element">colgroup</a></code></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-col-span"><a href="#attr-col-span">span</a></code></td>
|
|
<td><code><a href="#htmltablecolelement">HTMLTableColElement</a></code></td>
|
|
<tr><th><code><a href="#the-colgroup-element">colgroup</a></code></th>
|
|
<td>Group of columns in a table</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-table-element">table</a></code></td>
|
|
<td><code><a href="#the-col-element">col</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-colgroup-span"><a href="#attr-colgroup-span">span</a></code></td>
|
|
<td><code><a href="#htmltablecolelement">HTMLTableColElement</a></code></td>
|
|
<tr><th><code><a href="#the-command-element">command</a></code></th>
|
|
<td>Menu command</td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata</a>;
|
|
<a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><code><a href="#the-head-element">head</a></code>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-command-type"><a href="#attr-command-type">type</a></code>;
|
|
<code title="attr-command-label"><a href="#attr-command-label">label</a></code>;
|
|
<code title="attr-command-icon"><a href="#attr-command-icon">icon</a></code>;
|
|
<code title="attr-command-disabled"><a href="#attr-command-disabled">disabled</a></code>;
|
|
<code title="attr-command-checked"><a href="#attr-command-checked">checked</a></code>;
|
|
<code title="attr-command-radiogroup"><a href="#attr-command-radiogroup">radiogroup</a></code></td>
|
|
<td><code><a href="#htmlcommandelement">HTMLCommandElement</a></code></td>
|
|
<tr><th><code><a href="#the-datalist-element">datalist</a></code></th>
|
|
<td>Container for options for <a href="#attr-input-list" title="attr-input-list">combo box control</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<code><a href="#the-option-element">option</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmldatalistelement">HTMLDataListElement</a></code></td>
|
|
<tr><th><code><a href="#the-dd-element">dd</a></code></th>
|
|
<td>Content for corresponding <code><a href="#the-dt-element">dt</a></code> element(s)</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-dl-element">dl</a></code></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-del-element">del</a></code></th>
|
|
<td>A removal from the document</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#transparent">transparent</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-mod-cite"><a href="#attr-mod-cite">cite</a></code>;
|
|
<code title="attr-mod-datetime"><a href="#attr-mod-datetime">datetime</a></code></td>
|
|
<td><code><a href="#htmlmodelement">HTMLModElement</a></code></td>
|
|
<tr><th><code><a href="#the-details-element">details</a></code></th>
|
|
<td>Disclosure control for hiding details</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#sectioning-root" title="Sectioning root">sectioning root</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-summary-element">summary</a></code>*;
|
|
<a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-details-open"><a href="#attr-details-open">open</a></code></td>
|
|
<td><code><a href="#htmldetailselement">HTMLDetailsElement</a></code></td>
|
|
<tr><th><code><a href="#the-dfn-element">dfn</a></code></th>
|
|
<td>Defining instance</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-div-element">div</a></code></th>
|
|
<td>Generic flow container</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmldivelement">HTMLDivElement</a></code></td>
|
|
<tr><th><code><a href="#the-dl-element">dl</a></code></th>
|
|
<td>Association list consisting of zero or more name-value groups</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-dt-element">dt</a></code>*;
|
|
<code><a href="#the-dd-element">dd</a></code>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmldlistelement">HTMLDListElement</a></code></td>
|
|
<tr><th><code><a href="#the-dt-element">dt</a></code></th>
|
|
<td>Legend for corresponding <code><a href="#the-dd-element">dd</a></code> element(s)</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-dl-element">dl</a></code></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-em-element">em</a></code></th>
|
|
<td>Stress emphasis</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-embed-element">embed</a></code></th>
|
|
<td><a href="#plugin">Plugin</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#embedded-content" title="Embedded content">embedded</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-embed-src"><a href="#attr-embed-src">src</a></code>;
|
|
<code title="attr-embed-type"><a href="#attr-embed-type">type</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">width</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">height</a></code>;
|
|
any*</td>
|
|
<td><code><a href="#htmlembedelement">HTMLEmbedElement</a></code></td>
|
|
<tr><th><code><a href="#the-fieldset-element">fieldset</a></code></th>
|
|
<td>Group of form controls</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#sectioning-root" title="Sectioning root">sectioning root</a>;
|
|
<a href="#category-listed" title="category-listed">listed</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-legend-element">legend</a></code>*;
|
|
<a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-fieldset-disabled"><a href="#attr-fieldset-disabled">disabled</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></td>
|
|
<td><code><a href="#htmlfieldsetelement">HTMLFieldSetElement</a></code></td>
|
|
<tr><th><code><a href="#the-figcaption-element">figcaption</a></code></th>
|
|
<td>Caption for <code><a href="#the-figure-element">figure</a></code></td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-figure-element">figure</a></code></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-figure-element">figure</a></code></th>
|
|
<td>Figure with optional caption</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#sectioning-root" title="Sectioning root">sectioning root</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-figcaption-element">figcaption</a></code>*;
|
|
<a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-footer-element">footer</a></code></th>
|
|
<td>Footer for a page or section</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-form-element">form</a></code></th>
|
|
<td>User-submittable form</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">accept-charset</a></code>;
|
|
<code title="attr-fs-action"><a href="#attr-fs-action">action</a></code>;
|
|
<code title="attr-form-autocomplete"><a href="#attr-form-autocomplete">autocomplete</a></code>;
|
|
<code title="attr-fs-enctype"><a href="#attr-fs-enctype">enctype</a></code>;
|
|
<code title="attr-fs-method"><a href="#attr-fs-method">method</a></code>;
|
|
<code title="attr-form-name"><a href="#attr-form-name">name</a></code>;
|
|
<code title="attr-fs-novalidate"><a href="#attr-fs-novalidate">novalidate</a></code>;
|
|
<code title="attr-fs-target"><a href="#attr-fs-target">target</a></code></td>
|
|
<td><code><a href="#htmlformelement">HTMLFormElement</a></code></td>
|
|
<tr><th><code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code></th>
|
|
<td>Section heading</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#heading-content" title="Heading content">heading</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><code><a href="#the-hgroup-element">hgroup</a></code>;
|
|
<a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlheadingelement">HTMLHeadingElement</a></code></td>
|
|
<tr><th><code><a href="#the-head-element">head</a></code></th>
|
|
<td>Container for document metadata</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-html-element">html</a></code></td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata content</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlheadelement">HTMLHeadElement</a></code></td>
|
|
<tr><th><code><a href="#the-header-element">header</a></code></th>
|
|
<td>Introductory or navigational aids for a page or section</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-hgroup-element">hgroup</a></code></th>
|
|
<td>heading group</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#heading-content" title="Heading content">heading</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td>One or more <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>, <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>, and/or <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-hr-element">hr</a></code></th>
|
|
<td>Thematic break</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlhrelement">HTMLHRElement</a></code></td>
|
|
<tr><th><code><a href="#the-html-element">html</a></code></th>
|
|
<td>Root element</td>
|
|
<td>none</td>
|
|
<td>none*</td>
|
|
<td><code><a href="#the-head-element">head</a></code>*;
|
|
<code><a href="#the-body-element">body</a></code>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-html-manifest"><a href="#attr-html-manifest">manifest</a></code></td>
|
|
<td><code><a href="#htmlhtmlelement">HTMLHtmlElement</a></code></td>
|
|
<tr><th><code><a href="#the-i-element">i</a></code></th>
|
|
<td>Alternate voice</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-iframe-element">iframe</a></code></th>
|
|
<td><a href="#nested-browsing-context">Nested browsing context</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#embedded-content" title="Embedded content">embedded</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>text*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-iframe-src"><a href="#attr-iframe-src">src</a></code>;
|
|
<code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">srcdoc</a></code>;
|
|
<code title="attr-iframe-name"><a href="#attr-iframe-name">name</a></code>;
|
|
<code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">sandbox</a></code>;
|
|
<code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">seamless</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">width</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">height</a></code></td>
|
|
<td><code><a href="#htmliframeelement">HTMLIFrameElement</a></code></td>
|
|
<tr><th><code><a href="#the-img-element">img</a></code></th>
|
|
<td>Image</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#embedded-content" title="Embedded content">embedded</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>*</td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-img-alt"><a href="#attr-img-alt">alt</a></code>;
|
|
<code title="attr-img-src"><a href="#attr-img-src">src</a></code>;
|
|
<code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code>;
|
|
<code title="attr-img-ismap"><a href="#attr-img-ismap">ismap</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">width</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">height</a></code></td>
|
|
<td><code><a href="#htmlimageelement">HTMLImageElement</a></code></td>
|
|
<tr><th><code><a href="#the-input-element">input</a></code></th>
|
|
<td>Form control</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>*;
|
|
<a href="#category-listed" title="category-listed">listed</a>;
|
|
<a href="#category-label" title="category-label">labelable</a>;
|
|
<a href="#category-submit" title="category-submit">submittable</a>;
|
|
<a href="#category-reset" title="category-reset">resettable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-input-accept"><a href="#attr-input-accept">accept</a></code>;
|
|
<code title="attr-input-alt"><a href="#attr-input-alt">alt</a></code>;
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>;
|
|
<code title="attr-input-checked"><a href="#attr-input-checked">checked</a></code>;
|
|
<code title="attr-input-dirname"><a href="#attr-input-dirname">dirname</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-fs-formaction"><a href="#attr-fs-formaction">formaction</a></code>;
|
|
<code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">formenctype</a></code>;
|
|
<code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">formmethod</a></code>;
|
|
<code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">formnovalidate</a></code>;
|
|
<code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">formtarget</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">height</a></code>;
|
|
<code title="attr-input-list"><a href="#attr-input-list">list</a></code>;
|
|
<code title="attr-input-max"><a href="#attr-input-max">max</a></code>;
|
|
<code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code>;
|
|
<code title="attr-input-min"><a href="#attr-input-min">min</a></code>;
|
|
<code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>;
|
|
<code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>;
|
|
<code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>;
|
|
<code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code>;
|
|
<code title="attr-input-required"><a href="#attr-input-required">required</a></code>;
|
|
<code title="attr-input-size"><a href="#attr-input-size">size</a></code>;
|
|
<code title="attr-input-src"><a href="#attr-input-src">src</a></code>;
|
|
<code title="attr-input-step"><a href="#attr-input-step">step</a></code>;
|
|
<code title="attr-input-type"><a href="#attr-input-type">type</a></code>;
|
|
<code title="attr-input-value"><a href="#attr-input-value">value</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">width</a></code></td>
|
|
<td><code><a href="#htmlinputelement">HTMLInputElement</a></code></td>
|
|
<tr><th><code><a href="#the-ins-element">ins</a></code></th>
|
|
<td>An addition to the document</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#transparent">transparent</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-mod-cite"><a href="#attr-mod-cite">cite</a></code>;
|
|
<code title="attr-mod-datetime"><a href="#attr-mod-datetime">datetime</a></code></td>
|
|
<td><code><a href="#htmlmodelement">HTMLModElement</a></code></td>
|
|
<tr><th><code><a href="#the-kbd-element">kbd</a></code></th>
|
|
<td>User input</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-keygen-element">keygen</a></code></th>
|
|
<td>Cryptographic key-pair generator form control</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>;
|
|
<a href="#category-listed" title="category-listed">listed</a>;
|
|
<a href="#category-label" title="category-label">labelable</a>;
|
|
<a href="#category-submit" title="category-submit">submittable</a>;
|
|
<a href="#category-reset" title="category-reset">resettable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>;
|
|
<code title="attr-keygen-challenge"><a href="#attr-keygen-challenge">challenge</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-keygen-keytype"><a href="#attr-keygen-keytype">keytype</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></td>
|
|
<td><code><a href="#htmlkeygenelement">HTMLKeygenElement</a></code></td>
|
|
<tr><th><code><a href="#the-label-element">label</a></code></th>
|
|
<td>Caption for a form control</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-label-for"><a href="#attr-label-for">for</a></code></td>
|
|
<td><code><a href="#htmllabelelement">HTMLLabelElement</a></code></td>
|
|
<tr><th><code><a href="#the-legend-element">legend</a></code></th>
|
|
<td>Caption for <code><a href="#the-fieldset-element">fieldset</a></code></td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-fieldset-element">fieldset</a></code></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmllegendelement">HTMLLegendElement</a></code></td>
|
|
<tr><th><code><a href="#the-li-element">li</a></code></th>
|
|
<td>List item</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-ol-element">ol</a></code>; <code><a href="#the-ul-element">ul</a></code>; <code><a href="#the-menu-element">menu</a></code></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-li-value"><a href="#attr-li-value">value</a></code>*</td>
|
|
<td><code><a href="#htmllielement">HTMLLIElement</a></code></td>
|
|
<tr><th><code><a href="#the-link-element">link</a></code></th>
|
|
<td>Link metadata</td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata</a>;
|
|
<a href="#flow-content" title="Flow content">flow</a>*;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><code><a href="#the-head-element">head</a></code>;
|
|
<code><a href="#the-noscript-element">noscript</a></code>*;
|
|
<a href="#phrasing-content" title="phrasing content">phrasing</a>*</td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-link-href"><a href="#attr-link-href">href</a></code>;
|
|
<code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code>;
|
|
<code title="attr-link-media"><a href="#attr-link-media">media</a></code>;
|
|
<code title="attr-link-hreflang"><a href="#attr-link-hreflang">hreflang</a></code>;
|
|
<code title="attr-link-type"><a href="#attr-link-type">type</a></code>;
|
|
<code title="attr-link-sizes"><a href="#attr-link-sizes">sizes</a></code></td>
|
|
<td><code><a href="#htmllinkelement">HTMLLinkElement</a></code></td>
|
|
<tr><th><code><a href="#the-map-element">map</a></code></th>
|
|
<td><a href="#image-map">Image map</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#transparent">transparent</a>;
|
|
<code><a href="#the-area-element">area</a></code>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-map-name"><a href="#attr-map-name">name</a></code></td>
|
|
<td><code><a href="#htmlmapelement">HTMLMapElement</a></code></td>
|
|
<tr><th><code><a href="#the-mark-element">mark</a></code></th>
|
|
<td>Highlight</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-menu-element">menu</a></code></th>
|
|
<td>Menu of commands</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>*</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-li-element">li</a></code>*;
|
|
<a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-menu-type"><a href="#attr-menu-type">type</a></code>;
|
|
<code title="attr-menu-label"><a href="#attr-menu-label">label</a></code></td>
|
|
<td><code><a href="#htmlmenuelement">HTMLMenuElement</a></code></td>
|
|
<tr><th><code><a href="#the-meta-element">meta</a></code></th>
|
|
<td>Text metadata</td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata</a>;
|
|
<a href="#flow-content" title="Flow content">flow</a>*;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><code><a href="#the-head-element">head</a></code>;
|
|
<code><a href="#the-noscript-element">noscript</a></code>*;
|
|
<a href="#phrasing-content" title="phrasing content">phrasing</a>*</td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-meta-name"><a href="#attr-meta-name">name</a></code>;
|
|
<code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">http-equiv</a></code>;
|
|
<code title="attr-meta-content"><a href="#attr-meta-content">content</a></code>;
|
|
<code title="attr-meta-charset"><a href="#attr-meta-charset">charset</a></code></td>
|
|
<td><code><a href="#htmlmetaelement">HTMLMetaElement</a></code></td>
|
|
<tr><th><code><a href="#the-meter-element">meter</a></code></th>
|
|
<td>Gauge</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#category-label" title="category-label">labelable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-meter-value"><a href="#attr-meter-value">value</a></code>;
|
|
<code title="attr-meter-min"><a href="#attr-meter-min">min</a></code>;
|
|
<code title="attr-meter-max"><a href="#attr-meter-max">max</a></code>;
|
|
<code title="attr-meter-low"><a href="#attr-meter-low">low</a></code>;
|
|
<code title="attr-meter-high"><a href="#attr-meter-high">high</a></code>;
|
|
<code title="attr-meter-optimum"><a href="#attr-meter-optimum">optimum</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></td>
|
|
<td><code><a href="#htmlmeterelement">HTMLMeterElement</a></code></td>
|
|
<tr><th><code><a href="#the-nav-element">nav</a></code></th>
|
|
<td>Section with navigational links</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#sectioning-content" title="Sectioning content">sectioning</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-noscript-element">noscript</a></code></th>
|
|
<td>Fallback content for script</td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata</a>;
|
|
<a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><code><a href="#the-head-element">head</a></code>*;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td>varies*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-object-element">object</a></code></th>
|
|
<td>Image, <a href="#nested-browsing-context">nested browsing context</a>, or <a href="#plugin">plugin</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#embedded-content" title="Embedded content">embedded</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>*;
|
|
<a href="#category-listed" title="category-listed">listed</a>;
|
|
<a href="#category-submit" title="category-submit">submittable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><code><a href="#the-param-element">param</a></code>*;
|
|
<a href="#transparent">transparent</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-object-data"><a href="#attr-object-data">data</a></code>;
|
|
<code title="attr-object-type"><a href="#attr-object-type">type</a></code>;
|
|
<code title="attr-object-name"><a href="#attr-object-name">name</a></code>;
|
|
<code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">width</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">height</a></code></td>
|
|
<td><code><a href="#htmlobjectelement">HTMLObjectElement</a></code></td>
|
|
<tr><th><code><a href="#the-ol-element">ol</a></code></th>
|
|
<td>Ordered list</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-li-element">li</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-ol-reversed"><a href="#attr-ol-reversed">reversed</a></code>;
|
|
<code title="attr-ol-start"><a href="#attr-ol-start">start</a></code></td>
|
|
<td><code><a href="#htmlolistelement">HTMLOListElement</a></code></td>
|
|
<tr><th><code><a href="#the-optgroup-element">optgroup</a></code></th>
|
|
<td>Group of options in a list box</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-select-element">select</a></code></td>
|
|
<td><code><a href="#the-option-element">option</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-optgroup-disabled"><a href="#attr-optgroup-disabled">disabled</a></code>;
|
|
<code title="attr-optgroup-label"><a href="#attr-optgroup-label">label</a></code></td>
|
|
<td><code><a href="#htmloptgroupelement">HTMLOptGroupElement</a></code></td>
|
|
<tr><th><code><a href="#the-option-element">option</a></code></th>
|
|
<td>Option in a list box or combo box control</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-datalist-element">datalist</a></code>;
|
|
<code><a href="#the-optgroup-element">optgroup</a></code></td>
|
|
<td><a href="#text-content" title="text content">text</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-option-disabled"><a href="#attr-option-disabled">disabled</a></code>;
|
|
<code title="attr-option-label"><a href="#attr-option-label">label</a></code>;
|
|
<code title="attr-option-selected"><a href="#attr-option-selected">selected</a></code>;
|
|
<code title="attr-option-value"><a href="#attr-option-value">value</a></code></td>
|
|
<td><code><a href="#htmloptionelement">HTMLOptionElement</a></code></td>
|
|
<tr><th><code><a href="#the-output-element">output</a></code></th>
|
|
<td>Calculated output value</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#category-listed" title="category-listed">listed</a>;
|
|
<a href="#category-label" title="category-label">labelable</a>;
|
|
<a href="#category-reset" title="category-reset">resettable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-output-for"><a href="#attr-output-for">for</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code></td>
|
|
<td><code><a href="#htmloutputelement">HTMLOutputElement</a></code></td>
|
|
<tr><th><code><a href="#the-p-element">p</a></code></th>
|
|
<td>Paragraph</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlparagraphelement">HTMLParagraphElement</a></code></td>
|
|
<tr><th><code><a href="#the-param-element">param</a></code></th>
|
|
<td>Parameter for <code><a href="#the-object-element">object</a></code></td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-object-element">object</a></code></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-param-name"><a href="#attr-param-name">name</a></code>;
|
|
<code title="attr-param-value"><a href="#attr-param-value">value</a></code></td>
|
|
<td><code><a href="#htmlparamelement">HTMLParamElement</a></code></td>
|
|
<tr><th><code><a href="#the-pre-element">pre</a></code></th>
|
|
<td>Block of preformatted text</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlpreelement">HTMLPreElement</a></code></td>
|
|
<tr><th><code><a href="#the-progress-element">progress</a></code></th>
|
|
<td>Progress bar</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#category-label" title="category-label">labelable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-progress-value"><a href="#attr-progress-value">value</a></code>;
|
|
<code title="attr-progress-max"><a href="#attr-progress-max">max</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code></td>
|
|
<td><code><a href="#htmlprogresselement">HTMLProgressElement</a></code></td>
|
|
<tr><th><code><a href="#the-q-element">q</a></code></th>
|
|
<td>Quotation</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-q-cite"><a href="#attr-q-cite">cite</a></code></td>
|
|
<td><code><a href="#htmlquoteelement">HTMLQuoteElement</a></code></td>
|
|
<tr><th><code><a href="#the-rp-element">rp</a></code></th>
|
|
<td>Parenthesis for ruby annotation text</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-ruby-element">ruby</a></code></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-rt-element">rt</a></code></th>
|
|
<td>Ruby annotation text</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-ruby-element">ruby</a></code></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-ruby-element">ruby</a></code></th>
|
|
<td>Ruby annotation(s)</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<code><a href="#the-rt-element">rt</a></code>;
|
|
<code><a href="#the-rp-element">rp</a></code>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-s-element">s</a></code></th>
|
|
<td>Inaccurate text</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-samp-element">samp</a></code></th>
|
|
<td>Computer output</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-script-element">script</a></code></th>
|
|
<td>Embedded script</td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata</a>;
|
|
<a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><code><a href="#the-head-element">head</a></code>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>script, data, or script documentation*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-script-src"><a href="#attr-script-src">src</a></code>;
|
|
<code title="attr-script-async"><a href="#attr-script-async">async</a></code>;
|
|
<code title="attr-script-defer"><a href="#attr-script-defer">defer</a></code>;
|
|
<code title="attr-script-type"><a href="#attr-script-type">type</a></code>;
|
|
<code title="attr-script-charset"><a href="#attr-script-charset">charset</a></code></td>
|
|
<td><code><a href="#htmlscriptelement">HTMLScriptElement</a></code></td>
|
|
<tr><th><code><a href="#the-section-element">section</a></code></th>
|
|
<td>Generic document or application section</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#sectioning-content" title="Sectioning content">sectioning</a>;
|
|
<a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidate</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-select-element">select</a></code></th>
|
|
<td>List box control</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>;
|
|
<a href="#category-listed" title="category-listed">listed</a>;
|
|
<a href="#category-label" title="category-label">labelable</a>;
|
|
<a href="#category-submit" title="category-submit">submittable</a>;
|
|
<a href="#category-reset" title="category-reset">resettable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><code><a href="#the-option-element">option</a></code>, <code><a href="#the-optgroup-element">optgroup</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-select-multiple"><a href="#attr-select-multiple">multiple</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>;
|
|
<code title="attr-select-required"><a href="#attr-select-required">required</a></code>;
|
|
<code title="attr-select-size"><a href="#attr-select-size">size</a></code></td>
|
|
<td><code><a href="#htmlselectelement">HTMLSelectElement</a></code></td>
|
|
<tr><th><code><a href="#the-small-element">small</a></code></th>
|
|
<td>Side comment</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-source-element">source</a></code></th>
|
|
<td>Media source for <code><a href="#the-video-element">video</a></code> or <code><a href="#the-audio-element">audio</a></code></td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-video-element">video</a></code>;
|
|
<code><a href="#the-audio-element">audio</a></code></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-source-src"><a href="#attr-source-src">src</a></code>;
|
|
<code title="attr-source-type"><a href="#attr-source-type">type</a></code>;
|
|
<code title="attr-source-media"><a href="#attr-source-media">media</a></code></td>
|
|
<td><code><a href="#htmlsourceelement">HTMLSourceElement</a></code></td>
|
|
<tr><th><code><a href="#the-span-element">span</a></code></th>
|
|
<td>Generic phrasing container</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlspanelement">HTMLSpanElement</a></code></td>
|
|
<tr><th><code><a href="#the-strong-element">strong</a></code></th>
|
|
<td>Importance</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-style-element">style</a></code></th>
|
|
<td>Embedded styling information</td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata</a>;
|
|
<a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-head-element">head</a></code>;
|
|
<code><a href="#the-noscript-element">noscript</a></code>*;
|
|
<a href="#flow-content" title="flow content">flow</a>*</td>
|
|
<td>varies*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-style-media"><a href="#attr-style-media">media</a></code>;
|
|
<code title="attr-style-type"><a href="#attr-style-type">type</a></code>;
|
|
<code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code></td>
|
|
<td><code><a href="#htmlstyleelement">HTMLStyleElement</a></code></td>
|
|
<tr><th><code><a href="#the-sub-and-sup-elements">sub</a></code></th>
|
|
<td>Subscript</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-summary-element">summary</a></code></th>
|
|
<td>Caption for <code><a href="#the-details-element">details</a></code></td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-details-element">details</a></code></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-sub-and-sup-elements">sup</a></code></th>
|
|
<td>Superscript</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-table-element">table</a></code></th>
|
|
<td>Table</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-caption-element">caption</a></code>*;
|
|
<code><a href="#the-colgroup-element">colgroup</a></code>*;
|
|
<code><a href="#the-thead-element">thead</a></code>*;
|
|
<code><a href="#the-tbody-element">tbody</a></code>*;
|
|
<code><a href="#the-tfoot-element">tfoot</a></code>*;
|
|
<code><a href="#the-tr-element">tr</a></code>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-table-border"><a href="#attr-table-border">border</a></code></td>
|
|
<td><code><a href="#htmltableelement">HTMLTableElement</a></code></td>
|
|
<tr><th><code><a href="#the-tbody-element">tbody</a></code></th>
|
|
<td>Group of rows in a table</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-table-element">table</a></code></td>
|
|
<td><code><a href="#the-tr-element">tr</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmltablesectionelement">HTMLTableSectionElement</a></code></td>
|
|
<tr><th><code><a href="#the-td-element">td</a></code></th>
|
|
<td>Table cell</td>
|
|
<td><a href="#sectioning-root" title="Sectioning root">sectioning root</a></td>
|
|
<td><code><a href="#the-tr-element">tr</a></code></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code>;
|
|
<code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">rowspan</a></code>;
|
|
<code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code></td>
|
|
<td><code><a href="#htmltabledatacellelement">HTMLTableDataCellElement</a></code></td>
|
|
<tr><th><code><a href="#the-textarea-element">textarea</a></code></th>
|
|
<td>Multiline text field</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a>;
|
|
<a href="#category-listed" title="category-listed">listed</a>;
|
|
<a href="#category-label" title="category-label">labelable</a>;
|
|
<a href="#category-submit" title="category-submit">submittable</a>;
|
|
<a href="#category-reset" title="category-reset">resettable</a>;
|
|
<a href="#form-associated-element" title="Form-associated element">form-associated</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#text-content" title="text content">text</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">autofocus</a></code>;
|
|
<code title="attr-textarea-cols"><a href="#attr-textarea-cols">cols</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">disabled</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">form</a></code>;
|
|
<code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength">maxlength</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">name</a></code>;
|
|
<code title="attr-textarea-placeholder"><a href="#attr-textarea-placeholder">placeholder</a></code>;
|
|
<code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">readonly</a></code>;
|
|
<code title="attr-textarea-required"><a href="#attr-textarea-required">required</a></code>;
|
|
<code title="attr-textarea-rows"><a href="#attr-textarea-rows">rows</a></code>;
|
|
<code title="attr-textarea-wrap"><a href="#attr-textarea-wrap">wrap</a></code></td>
|
|
<td><code><a href="#htmltextareaelement">HTMLTextAreaElement</a></code></td>
|
|
<tr><th><code><a href="#the-tfoot-element">tfoot</a></code></th>
|
|
<td>Group of footer rows in a table</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-table-element">table</a></code></td>
|
|
<td><code><a href="#the-tr-element">tr</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmltablesectionelement">HTMLTableSectionElement</a></code></td>
|
|
<tr><th><code><a href="#the-th-element">th</a></code></th>
|
|
<td>Table header cell</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-tr-element">tr</a></code></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">colspan</a></code>;
|
|
<code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">rowspan</a></code>;
|
|
<code title="attr-tdth-headers"><a href="#attr-tdth-headers">headers</a></code>;
|
|
<code title="attr-th-scope"><a href="#attr-th-scope">scope</a></code></td>
|
|
<td><code><a href="#htmltableheadercellelement">HTMLTableHeaderCellElement</a></code></td>
|
|
<tr><th><code><a href="#the-thead-element">thead</a></code></th>
|
|
<td>Group of heading rows in a table</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-table-element">table</a></code></td>
|
|
<td><code><a href="#the-tr-element">tr</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmltablesectionelement">HTMLTableSectionElement</a></code></td>
|
|
<tr><th><code><a href="#the-time-element">time</a></code></th>
|
|
<td>Date and/or time</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-time-datetime"><a href="#attr-time-datetime">datetime</a></code>;
|
|
<code title="attr-time-pubdate"><a href="#attr-time-pubdate">pubdate</a></code></td>
|
|
<td><code><a href="#htmltimeelement">HTMLTimeElement</a></code></td>
|
|
<tr><th><code><a href="#the-title-element">title</a></code></th>
|
|
<td>Document title</td>
|
|
<td><a href="#metadata-content" title="Metadata content">metadata</a></td>
|
|
<td><code><a href="#the-head-element">head</a></code></td>
|
|
<td><a href="#text-content" title="text content">text</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmltitleelement">HTMLTitleElement</a></code></td>
|
|
<tr><th><code><a href="#the-tr-element">tr</a></code></th>
|
|
<td>Table row</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-table-element">table</a></code>;
|
|
<code><a href="#the-thead-element">thead</a></code>;
|
|
<code><a href="#the-tbody-element">tbody</a></code>;
|
|
<code><a href="#the-tfoot-element">tfoot</a></code></td>
|
|
<td><code><a href="#the-th-element">th</a></code>*;
|
|
<code><a href="#the-td-element">td</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmltablerowelement">HTMLTableRowElement</a></code></td>
|
|
<tr><th><code><a href="#the-track-element">track</a></code></th>
|
|
<td>Timed text track</td>
|
|
<td>none</td>
|
|
<td><code><a href="#the-audio-element">audio</a></code>;
|
|
<code><a href="#the-video-element">video</a></code></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-track-default"><a href="#attr-track-default">default</a></code>;
|
|
<code title="attr-track-kind"><a href="#attr-track-kind">kind</a></code>;
|
|
<code title="attr-track-label"><a href="#attr-track-label">label</a></code>;
|
|
<code title="attr-track-src"><a href="#attr-track-src">src</a></code>;
|
|
<code title="attr-track-srclang"><a href="#attr-track-srclang">srclang</a></code></td>
|
|
<td><code><a href="#htmltrackelement">HTMLTrackElement</a></code></td>
|
|
<tr><th><code><a href="#the-u-element">u</a></code></th>
|
|
<td>Keywords</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-ul-element">ul</a></code></th>
|
|
<td>List</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a></td>
|
|
<td><code><a href="#the-li-element">li</a></code></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlulistelement">HTMLUListElement</a></code></td>
|
|
<tr><th><code><a href="#the-var-element">var</a></code></th>
|
|
<td>Variable</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
<tr><th><code><a href="#the-video-element">video</a></code></th>
|
|
<td>Video player</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a>;
|
|
<a href="#embedded-content" title="Embedded content">embedded</a>;
|
|
<a href="#interactive-content" title="Interactive content">interactive</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><code><a href="#the-source-element">source</a></code>*;
|
|
<a href="#transparent">transparent</a>*</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a>;
|
|
<code title="attr-media-src"><a href="#attr-media-src">src</a></code>;
|
|
<code title="attr-video-poster"><a href="#attr-video-poster">poster</a></code>;
|
|
<code title="attr-media-preload"><a href="#attr-media-preload">preload</a></code>;
|
|
<code title="attr-media-autoplay"><a href="#attr-media-autoplay">autoplay</a></code>;
|
|
<code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">mediagroup</a></code>;
|
|
<code title="attr-media-loop"><a href="#attr-media-loop">loop</a></code>;
|
|
<code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">width</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">height</a></code></td>
|
|
<td><code><a href="#htmlvideoelement">HTMLVideoElement</a></code></td>
|
|
<tr><th><code><a href="#the-wbr-element">wbr</a></code></th>
|
|
<td>Line breaking opportunity</td>
|
|
<td><a href="#flow-content" title="Flow content">flow</a>;
|
|
<a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td><a href="#phrasing-content" title="Phrasing content">phrasing</a></td>
|
|
<td>empty</td>
|
|
<td><a href="#global-attributes" title="global attributes">globals</a></td>
|
|
<td><code><a href="#htmlelement">HTMLElement</a></code></td>
|
|
</table><p>An asterisk (*) in a cell indicates that the actual rules are more complicated than indicated in the table above.<p>† Categories in the "Parents" column refer to parents that
|
|
list the given categories in their content model, not to elements
|
|
that themselves are in those categories. For example, the
|
|
<code><a href="#the-a-element">a</a></code> element's "Parents" column says "phrasing", so any
|
|
element whose content model contains the "phrasing" category could
|
|
be a parent of an <code><a href="#the-a-element">a</a></code> element. Since the "flow" category
|
|
includes all the "phrasing" elements, that means the
|
|
<code><a href="#the-address-element">address</a></code> element could be a parent to an <code><a href="#the-a-element">a</a></code>
|
|
element.<h3 class="no-num" id="element-content-categories">Element content categories</h3><p><i>This section is non-normative.</i></p><table><caption>List of element content categories</caption>
|
|
<thead><tr><th> Category
|
|
<th> Elements
|
|
<th> Elements with exceptions
|
|
<tbody><tr><td> <a href="#metadata-content">Metadata content</a>
|
|
<td>
|
|
<code><a href="#the-base-element">base</a></code>;
|
|
<code><a href="#the-command-element">command</a></code>;
|
|
<code><a href="#the-link-element">link</a></code>;
|
|
<code><a href="#the-meta-element">meta</a></code>;
|
|
<code><a href="#the-noscript-element">noscript</a></code>;
|
|
<code><a href="#the-script-element">script</a></code>;
|
|
<code><a href="#the-style-element">style</a></code>;
|
|
<code><a href="#the-title-element">title</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#flow-content">Flow content</a>
|
|
<td>
|
|
<code><a href="#the-a-element">a</a></code>;
|
|
<code><a href="#the-abbr-element">abbr</a></code>;
|
|
<code><a href="#the-address-element">address</a></code>;
|
|
<code><a href="#the-article-element">article</a></code>;
|
|
<code><a href="#the-aside-element">aside</a></code>;
|
|
<code><a href="#the-audio-element">audio</a></code>;
|
|
<code><a href="#the-b-element">b</a></code>;
|
|
<code><a href="#the-bdi-element">bdi</a></code>;
|
|
<code><a href="#the-bdo-element">bdo</a></code>;
|
|
<code><a href="#the-blockquote-element">blockquote</a></code>;
|
|
<code><a href="#the-br-element">br</a></code>;
|
|
<code><a href="#the-button-element">button</a></code>;
|
|
<code><a href="#the-canvas-element">canvas</a></code>;
|
|
<code><a href="#the-cite-element">cite</a></code>;
|
|
<code><a href="#the-code-element">code</a></code>;
|
|
<code><a href="#the-command-element">command</a></code>;
|
|
<code><a href="#the-datalist-element">datalist</a></code>;
|
|
<code><a href="#the-del-element">del</a></code>;
|
|
<code><a href="#the-details-element">details</a></code>;
|
|
<code><a href="#the-dfn-element">dfn</a></code>;
|
|
<code><a href="#the-div-element">div</a></code>;
|
|
<code><a href="#the-dl-element">dl</a></code>;
|
|
<code><a href="#the-em-element">em</a></code>;
|
|
<code><a href="#the-embed-element">embed</a></code>;
|
|
<code><a href="#the-fieldset-element">fieldset</a></code>;
|
|
<code><a href="#the-figure-element">figure</a></code>;
|
|
<code><a href="#the-footer-element">footer</a></code>;
|
|
<code><a href="#the-form-element">form</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code>;
|
|
<code><a href="#the-header-element">header</a></code>;
|
|
<code><a href="#the-hgroup-element">hgroup</a></code>;
|
|
<code><a href="#the-hr-element">hr</a></code>;
|
|
<code><a href="#the-i-element">i</a></code>;
|
|
<code><a href="#the-iframe-element">iframe</a></code>;
|
|
<code><a href="#the-img-element">img</a></code>;
|
|
<code><a href="#the-input-element">input</a></code>;
|
|
<code><a href="#the-ins-element">ins</a></code>;
|
|
<code><a href="#the-kbd-element">kbd</a></code>;
|
|
<code><a href="#the-keygen-element">keygen</a></code>;
|
|
<code><a href="#the-label-element">label</a></code>;
|
|
<code><a href="#the-map-element">map</a></code>;
|
|
<code><a href="#the-mark-element">mark</a></code>;
|
|
<code><a href="#math">math</a></code>;
|
|
<code><a href="#the-menu-element">menu</a></code>;
|
|
<code><a href="#the-meter-element">meter</a></code>;
|
|
<code><a href="#the-nav-element">nav</a></code>;
|
|
<code><a href="#the-noscript-element">noscript</a></code>;
|
|
<code><a href="#the-object-element">object</a></code>;
|
|
<code><a href="#the-ol-element">ol</a></code>;
|
|
<code><a href="#the-output-element">output</a></code>;
|
|
<code><a href="#the-p-element">p</a></code>;
|
|
<code><a href="#the-pre-element">pre</a></code>;
|
|
<code><a href="#the-progress-element">progress</a></code>;
|
|
<code><a href="#the-q-element">q</a></code>;
|
|
<code><a href="#the-ruby-element">ruby</a></code>;
|
|
<code><a href="#the-s-element">s</a></code>;
|
|
<code><a href="#the-samp-element">samp</a></code>;
|
|
<code><a href="#the-script-element">script</a></code>;
|
|
<code><a href="#the-section-element">section</a></code>;
|
|
<code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-small-element">small</a></code>;
|
|
<code><a href="#the-span-element">span</a></code>;
|
|
<code><a href="#the-strong-element">strong</a></code>;
|
|
<code><a href="#the-sub-and-sup-elements">sub</a></code>;
|
|
<code><a href="#the-sub-and-sup-elements">sup</a></code>;
|
|
<code><a href="#svg">svg</a></code>;
|
|
<code><a href="#the-table-element">table</a></code>;
|
|
<code><a href="#the-textarea-element">textarea</a></code>;
|
|
<code><a href="#the-time-element">time</a></code>;
|
|
<code><a href="#the-u-element">u</a></code>;
|
|
<code><a href="#the-ul-element">ul</a></code>;
|
|
<code><a href="#the-var-element">var</a></code>;
|
|
<code><a href="#the-video-element">video</a></code>;
|
|
<code><a href="#the-wbr-element">wbr</a></code>;
|
|
<a href="#text-content" title="text content">Text</a>
|
|
<td>
|
|
<code><a href="#the-area-element">area</a></code> (if it is a descendant of a <code><a href="#the-map-element">map</a></code> element);
|
|
<code><a href="#the-style-element">style</a></code> (if the <code title="attr-style-scoped"><a href="#attr-style-scoped">scoped</a></code> attribute is present)
|
|
|
|
<tr><td> <a href="#sectioning-content">Sectioning content</a>
|
|
<td>
|
|
<code><a href="#the-article-element">article</a></code>;
|
|
<code><a href="#the-aside-element">aside</a></code>;
|
|
<code><a href="#the-nav-element">nav</a></code>;
|
|
<code><a href="#the-section-element">section</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#heading-content">Heading content</a>
|
|
<td>
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code>;
|
|
<code><a href="#the-hgroup-element">hgroup</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#phrasing-content">Phrasing content</a>
|
|
<td>
|
|
<code><a href="#the-abbr-element">abbr</a></code>;
|
|
<code><a href="#the-audio-element">audio</a></code>;
|
|
<code><a href="#the-b-element">b</a></code>;
|
|
<code><a href="#the-bdi-element">bdi</a></code>;
|
|
<code><a href="#the-bdo-element">bdo</a></code>;
|
|
<code><a href="#the-br-element">br</a></code>;
|
|
<code><a href="#the-button-element">button</a></code>;
|
|
<code><a href="#the-canvas-element">canvas</a></code>;
|
|
<code><a href="#the-cite-element">cite</a></code>;
|
|
<code><a href="#the-code-element">code</a></code>;
|
|
<code><a href="#the-command-element">command</a></code>;
|
|
<code><a href="#the-datalist-element">datalist</a></code>;
|
|
<code><a href="#the-dfn-element">dfn</a></code>;
|
|
<code><a href="#the-em-element">em</a></code>;
|
|
<code><a href="#the-embed-element">embed</a></code>;
|
|
<code><a href="#the-i-element">i</a></code>;
|
|
<code><a href="#the-iframe-element">iframe</a></code>;
|
|
<code><a href="#the-img-element">img</a></code>;
|
|
<code><a href="#the-input-element">input</a></code>;
|
|
<code><a href="#the-kbd-element">kbd</a></code>;
|
|
<code><a href="#the-keygen-element">keygen</a></code>;
|
|
<code><a href="#the-label-element">label</a></code>;
|
|
<code><a href="#the-mark-element">mark</a></code>;
|
|
<code><a href="#math">math</a></code>;
|
|
<code><a href="#the-meter-element">meter</a></code>;
|
|
<code><a href="#the-noscript-element">noscript</a></code>;
|
|
<code><a href="#the-object-element">object</a></code>;
|
|
<code><a href="#the-output-element">output</a></code>;
|
|
<code><a href="#the-progress-element">progress</a></code>;
|
|
<code><a href="#the-q-element">q</a></code>;
|
|
<code><a href="#the-ruby-element">ruby</a></code>;
|
|
<code><a href="#the-s-element">s</a></code>;
|
|
<code><a href="#the-samp-element">samp</a></code>;
|
|
<code><a href="#the-script-element">script</a></code>;
|
|
<code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-small-element">small</a></code>;
|
|
<code><a href="#the-span-element">span</a></code>;
|
|
<code><a href="#the-strong-element">strong</a></code>;
|
|
<code><a href="#the-sub-and-sup-elements">sub</a></code>;
|
|
<code><a href="#the-sub-and-sup-elements">sup</a></code>;
|
|
<code><a href="#svg">svg</a></code>;
|
|
<code><a href="#the-textarea-element">textarea</a></code>;
|
|
<code><a href="#the-time-element">time</a></code>;
|
|
<code><a href="#the-u-element">u</a></code>;
|
|
<code><a href="#the-var-element">var</a></code>;
|
|
<code><a href="#the-video-element">video</a></code>;
|
|
<code><a href="#the-wbr-element">wbr</a></code>;
|
|
<a href="#text-content" title="text content">Text</a>
|
|
<td>
|
|
<code><a href="#the-a-element">a</a></code> (if it contains only <a href="#phrasing-content">phrasing content</a>);
|
|
<code><a href="#the-area-element">area</a></code> (if it is a descendant of a <code><a href="#the-map-element">map</a></code> element);
|
|
<code><a href="#the-del-element">del</a></code> (if it contains only <a href="#phrasing-content">phrasing content</a>);
|
|
<code><a href="#the-ins-element">ins</a></code> (if it contains only <a href="#phrasing-content">phrasing content</a>);
|
|
<code><a href="#the-map-element">map</a></code> (if it contains only <a href="#phrasing-content">phrasing content</a>)
|
|
<tr><td> <a href="#embedded-content">Embedded content</a>
|
|
<td>
|
|
<code><a href="#the-audio-element">audio</a></code>
|
|
<code><a href="#the-canvas-element">canvas</a></code>
|
|
<code><a href="#the-embed-element">embed</a></code>
|
|
<code><a href="#the-iframe-element">iframe</a></code>
|
|
<code><a href="#the-img-element">img</a></code>
|
|
<code><a href="#math">math</a></code>
|
|
<code><a href="#the-object-element">object</a></code>
|
|
<code><a href="#svg">svg</a></code>
|
|
<code><a href="#the-video-element">video</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#interactive-content">Interactive content</a>
|
|
<td>
|
|
<code><a href="#the-a-element">a</a></code>;
|
|
<code><a href="#the-button-element">button</a></code>;
|
|
<code><a href="#the-details-element">details</a></code>;
|
|
<code><a href="#the-embed-element">embed</a></code>;
|
|
<code><a href="#the-iframe-element">iframe</a></code>;
|
|
<code><a href="#the-keygen-element">keygen</a></code>;
|
|
<code><a href="#the-label-element">label</a></code>;
|
|
<code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-textarea-element">textarea</a></code>;
|
|
<td>
|
|
<code><a href="#the-audio-element">audio</a></code> (if the <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code> attribute is present);
|
|
<code><a href="#the-img-element">img</a></code> (if the <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute is present);
|
|
<code><a href="#the-input-element">input</a></code> (if the <code title="attr-input-type"><a href="#attr-input-type">type</a></code> attribute is <em>not</em> in the <a href="#hidden-state" title="attr-input-type-hidden">Hidden</a> state);
|
|
<code><a href="#the-menu-element">menu</a></code> (if the <code title="attr-menu-type"><a href="#attr-menu-type">type</a></code> attribute is in the <a href="#toolbar-state" title="toolbar state">toolbar</a> state);
|
|
<code><a href="#the-object-element">object</a></code> (if the <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute is present);
|
|
<code><a href="#the-video-element">video</a></code> (if the <code title="attr-media-controls"><a href="#attr-media-controls">controls</a></code> attribute is present)
|
|
|
|
<tr><td> <a href="#sectioning-root" title="sectioning root">Sectioning roots</a>
|
|
<td>
|
|
<code><a href="#the-blockquote-element">blockquote</a></code>;
|
|
<code><a href="#the-body-element">body</a></code>;
|
|
<code><a href="#the-details-element">details</a></code>;
|
|
<code><a href="#the-fieldset-element">fieldset</a></code>;
|
|
<code><a href="#the-figure-element">figure</a></code>;
|
|
<code><a href="#the-td-element">td</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#form-associated-element" title="form-associated element">Form-associated elements</a>
|
|
<td>
|
|
<code><a href="#the-button-element">button</a></code>;
|
|
<code><a href="#the-fieldset-element">fieldset</a></code>;
|
|
<code><a href="#the-input-element">input</a></code>;
|
|
<code><a href="#the-keygen-element">keygen</a></code>;
|
|
<code><a href="#the-label-element">label</a></code>;
|
|
<code><a href="#the-meter-element">meter</a></code>;
|
|
<code><a href="#the-object-element">object</a></code>;
|
|
<code><a href="#the-output-element">output</a></code>;
|
|
<code><a href="#the-progress-element">progress</a></code>;
|
|
<code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-textarea-element">textarea</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#category-listed" title="category-listed">Listed elements</a>
|
|
<td>
|
|
<code><a href="#the-button-element">button</a></code>;
|
|
<code><a href="#the-fieldset-element">fieldset</a></code>;
|
|
<code><a href="#the-input-element">input</a></code>;
|
|
<code><a href="#the-keygen-element">keygen</a></code>;
|
|
<code><a href="#the-object-element">object</a></code>;
|
|
<code><a href="#the-output-element">output</a></code>;
|
|
<code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-textarea-element">textarea</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#category-label" title="category-label">Labelable elements</a>
|
|
<td>
|
|
<code><a href="#the-button-element">button</a></code>;
|
|
<code><a href="#the-input-element">input</a></code>;
|
|
<code><a href="#the-keygen-element">keygen</a></code>;
|
|
<code><a href="#the-meter-element">meter</a></code>;
|
|
<code><a href="#the-output-element">output</a></code>;
|
|
<code><a href="#the-progress-element">progress</a></code>;
|
|
<code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-textarea-element">textarea</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#category-submit" title="category-submit">Submittable elements</a>
|
|
<td>
|
|
<code><a href="#the-button-element">button</a></code>;
|
|
<code><a href="#the-input-element">input</a></code>;
|
|
<code><a href="#the-keygen-element">keygen</a></code>;
|
|
<code><a href="#the-object-element">object</a></code>;
|
|
<code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-textarea-element">textarea</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#category-reset" title="category-reset">Resettable elements</a>
|
|
<td>
|
|
<code><a href="#the-input-element">input</a></code>;
|
|
<code><a href="#the-keygen-element">keygen</a></code>;
|
|
<code><a href="#the-output-element">output</a></code>;
|
|
<code><a href="#the-select-element">select</a></code>;
|
|
<code><a href="#the-textarea-element">textarea</a></code>
|
|
<td>
|
|
—
|
|
|
|
<tr><td> <a href="#formatblock-candidate" title="formatBlock candidate"><code title="">formatBlock</code> candidates</a>
|
|
<td>
|
|
<code><a href="#the-section-element">section</a></code>;
|
|
<code><a href="#the-nav-element">nav</a></code>;
|
|
<code><a href="#the-article-element">article</a></code>;
|
|
<code><a href="#the-aside-element">aside</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>;
|
|
<code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code>;
|
|
<code><a href="#the-hgroup-element">hgroup</a></code>;
|
|
<code><a href="#the-header-element">header</a></code>;
|
|
<code><a href="#the-footer-element">footer</a></code>;
|
|
<code><a href="#the-address-element">address</a></code>;
|
|
<code><a href="#the-p-element">p</a></code>;
|
|
<code><a href="#the-pre-element">pre</a></code>;
|
|
<code><a href="#the-blockquote-element">blockquote</a></code>;
|
|
<code><a href="#the-div-element">div</a></code>
|
|
<td>
|
|
—
|
|
|
|
</table><h3 class="no-num" id="attributes-1">Attributes</h3><p><i>This section is non-normative.</i><table><caption>List of attributes (excluding event handler content attributes)</caption>
|
|
<thead><tr><th> Attribute
|
|
<th> Element(s)
|
|
<th> Description
|
|
<th> Value
|
|
<tbody><tr><th> <code title="">accept</code>
|
|
<td> <code title="attr-input-accept"><a href="#attr-input-accept">input</a></code>
|
|
<td> Hint for expected file type in <a href="#file-upload-state" title="attr-input-type-file">file upload controls</a>
|
|
<td> <a href="#set-of-comma-separated-tokens">Set of comma-separated tokens</a>* consisting of <a href="#valid-mime-type" title="valid MIME type">valid MIME types with no parameters</a> or <code title="">audio/*</code>, <code title="">video/*</code>, or <code title="">image/*</code>
|
|
<tr><th> <code title="">accept-charset</code>
|
|
<td> <code title="attr-form-accept-charset"><a href="#attr-form-accept-charset">form</a></code>
|
|
<td> Character encodings to use for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#ordered-set-of-unique-space-separated-tokens">Ordered set of unique space-separated tokens</a>, <a href="#ascii-case-insensitive">ASCII case-insensitive</a>, consisting of <a href="#preferred-mime-name" title="preferred MIME name">preferred MIME names</a> of <a href="#ascii-compatible-character-encoding" title="ASCII-compatible character encoding">ASCII-compatible character encodings</a>*
|
|
<tr><th> <code title="">accesskey</code>
|
|
<td> <a href="#the-accesskey-attribute" title="attr-accesskey">HTML elements</a>
|
|
<td> Keyboard shortcut to activate or focus element
|
|
<td> <a href="#ordered-set-of-unique-space-separated-tokens">Ordered set of unique space-separated tokens</a>, <a href="#case-sensitive">case-sensitive</a>, consisting of one Unicode code point in length
|
|
<tr><th> <code title="">action</code>
|
|
<td> <code title="attr-fs-action"><a href="#attr-fs-action">form</a></code>
|
|
<td> <a href="#url">URL</a> to use for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#valid-url-potentially-surrounded-by-spaces">Valid URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">alt</code>
|
|
<td> <code title="attr-area-alt"><a href="#attr-area-alt">area</a></code>;
|
|
<code title="attr-img-alt"><a href="#attr-img-alt">img</a></code>;
|
|
<code title="attr-input-alt"><a href="#attr-input-alt">input</a></code>
|
|
<td> Replacement text for use when images are not available
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">async</code>
|
|
<td> <code title="attr-script-async"><a href="#attr-script-async">script</a></code>
|
|
<td> Execute script asynchronously
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">autocomplete</code>
|
|
<td> <code title="attr-form-autocomplete"><a href="#attr-form-autocomplete">form</a></code>;
|
|
<code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">input</a></code>
|
|
<td> Prevent the user agent from providing autocompletions for the form control(s)
|
|
<td> "<code title="">on</code>"; "<code title="">off</code>"
|
|
<tr><th> <code title="">autofocus</code>
|
|
<td> <code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">button</a></code>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">input</a></code>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">keygen</a></code>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">select</a></code>;
|
|
<code title="attr-fe-autofocus"><a href="#attr-fe-autofocus">textarea</a></code>
|
|
<td> Automatically focus the form control when the page is loaded
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">autoplay</code>
|
|
<td> <code title="attr-media-autoplay"><a href="#attr-media-autoplay">audio</a></code>;
|
|
<code title="attr-media-autoplay"><a href="#attr-media-autoplay">video</a></code>
|
|
<td> Hint that the <a href="#media-resource">media resource</a> can be started automatically when the page is loaded
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">border</code>
|
|
<td> <code title="attr-table-border"><a href="#attr-table-border">border</a></code>
|
|
<td> Explicit indication that the <code><a href="#the-table-element">table</a></code> element is not being used for layout purposes
|
|
<td> The empty string, or "<code title="">1</code>"
|
|
<tr><th> <code title="">challenge</code>
|
|
<td> <code title="attr-keygen-challenge"><a href="#attr-keygen-challenge">keygen</a></code>
|
|
<td> String to package with the generated and signed public key
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">charset</code>
|
|
<td> <code title="attr-meta-charset"><a href="#attr-meta-charset">meta</a></code>
|
|
<td> <a href="#character-encoding-declaration">Character encoding declaration</a>
|
|
<td> <a href="#preferred-mime-name">Preferred MIME name</a> of an encoding*
|
|
<tr><th> <code title="">charset</code>
|
|
<td> <code title="attr-script-charset"><a href="#attr-script-charset">script</a></code>
|
|
<td> Character encoding of the external script resource
|
|
<td> <a href="#preferred-mime-name">Preferred MIME name</a> of an encoding*
|
|
<tr><th> <code title="">checked</code>
|
|
<td> <code title="attr-command-checked"><a href="#attr-command-checked">command</a></code>;
|
|
<code title="attr-input-checked"><a href="#attr-input-checked">input</a></code>
|
|
<td> Whether the command or control is checked
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">cite</code>
|
|
<td> <code title="attr-blockquote-cite"><a href="#attr-blockquote-cite">blockquote</a></code>;
|
|
<code title="attr-mod-cite"><a href="#attr-mod-cite">del</a></code>;
|
|
<code title="attr-mod-cite"><a href="#attr-mod-cite">ins</a></code>;
|
|
<code title="attr-q-cite"><a href="#attr-q-cite">q</a></code>
|
|
<td> Link to the source of the quotation or more information about the edit
|
|
<td> <a href="#valid-url-potentially-surrounded-by-spaces">Valid URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">class</code>
|
|
<td> <a href="#classes" title="attr-class">HTML elements</a>
|
|
<td> Classes to which the element belongs
|
|
<td> <a href="#set-of-space-separated-tokens">Set of space-separated tokens</a>
|
|
<tr><th> <code title="">cols</code>
|
|
<td> <code title="attr-textarea-cols"><a href="#attr-textarea-cols">textarea</a></code>
|
|
<td> Maximum number of characters per line
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a> greater than zero
|
|
<tr><th> <code title="">colspan</code>
|
|
<td> <code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">td</a></code>;
|
|
<code title="attr-tdth-colspan"><a href="#attr-tdth-colspan">th</a></code>
|
|
<td> Number of columns that the cell is to span
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a> greater than zero
|
|
<tr><th> <code title="">content</code>
|
|
<td> <code title="attr-meta-content"><a href="#attr-meta-content">meta</a></code>
|
|
<td> Value of the element
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">contenteditable</code>
|
|
<td> <a href="#attr-contenteditable" title="attr-contenteditable">HTML elements</a>
|
|
<td> Whether the element is <a href="#editable">editable</a>
|
|
<td> "<code title="">true</code>"; "<code title="">false</code>"
|
|
<tr><th> <code title="">contextmenu</code>
|
|
<td> <a href="#attr-contextmenu" title="attr-contextmenu">HTML elements</a>
|
|
<td> The element's context menu
|
|
<td> <a href="#concept-id" title="concept-id">ID</a>*
|
|
<tr><th> <code title="">controls</code>
|
|
<td> <code title="attr-media-controls"><a href="#attr-media-controls">audio</a></code>;
|
|
<code title="attr-media-controls"><a href="#attr-media-controls">video</a></code>
|
|
<td> Show user agent controls
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">coords</code>
|
|
<td> <code title="attr-area-coords"><a href="#attr-area-coords">area</a></code>
|
|
<td> Coordinates for the shape to be created in an <a href="#image-map">image map</a>
|
|
<td> <a href="#valid-list-of-integers">Valid list of integers</a>*
|
|
<tr><th> <code title="">data</code>
|
|
<td> <code title="attr-object-data"><a href="#attr-object-data">object</a></code>
|
|
<td> Address of the resource
|
|
<td> <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">Valid non-empty URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">datetime</code>
|
|
<td> <code title="attr-mod-datetime"><a href="#attr-mod-datetime">del</a></code>;
|
|
<code title="attr-mod-datetime"><a href="#attr-mod-datetime">ins</a></code>
|
|
<td> Date and (optionally) time of the change
|
|
<td> <a href="#valid-date-string-with-optional-time">Valid date string with optional time</a>
|
|
<tr><th> <code title="">datetime</code>
|
|
<td> <code title="attr-time-datetime"><a href="#attr-time-datetime">time</a></code>
|
|
<td> Value of the element
|
|
<td> <a href="#valid-date-or-time-string">Valid date or time string</a>*
|
|
<tr><th> <code title="">default</code>
|
|
<td> <code title="attr-track-default"><a href="#attr-track-default">track</a></code>
|
|
<td> Enable the track if no other <a href="#text-track">text track</a> is more suitable.
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">defer</code>
|
|
<td> <code title="attr-script-defer"><a href="#attr-script-defer">script</a></code>
|
|
<td> Defer script execution
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">dir</code>
|
|
<td> <a href="#the-dir-attribute" title="attr-dir">HTML elements</a>
|
|
<td> <a href="#the-directionality" title="the directionality">The text directionality</a> of the element
|
|
<td> "<code title="">ltr</code>"; "<code title="">rtl</code>"
|
|
<tr><th> <code title="">dirname</code>
|
|
<td> <code title="attr-input-dirname"><a href="#attr-input-dirname">input</a></code>;
|
|
<code title="attr-textarea-dirname"><a href="#attr-textarea-dirname">textarea</a></code>
|
|
<td> Name of form field to use for sending the element's <a href="#the-directionality" title="the directionality">directionality</a> in <a href="#form-submission">form submission</a>
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">disabled</code>
|
|
<td> <code title="attr-fe-disabled"><a href="#attr-fe-disabled">button</a></code>;
|
|
<code title="attr-command-disabled"><a href="#attr-command-disabled">command</a></code>;
|
|
<code title="attr-fieldset-disabled"><a href="#attr-fieldset-disabled">fieldset</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">input</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">keygen</a></code>;
|
|
<code title="attr-optgroup-disabled"><a href="#attr-optgroup-disabled">optgroup</a></code>;
|
|
<code title="attr-option-disabled"><a href="#attr-option-disabled">option</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">select</a></code>;
|
|
<code title="attr-fe-disabled"><a href="#attr-fe-disabled">textarea</a></code>
|
|
<td> Whether the form control is disabled
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">draggable</code>
|
|
<td> <a href="#the-draggable-attribute" title="attr-draggable">HTML elements</a>
|
|
<td> Whether the element is draggable
|
|
<td> "<code title="">true</code>"; "<code title="">false</code>"
|
|
<tr><th> <code title="">dropzone</code>
|
|
<td> <a href="#the-dropzone-attribute" title="attr-dropzone">HTML elements</a>
|
|
<td> Accepted item types for drag-and-drop
|
|
<td> <a href="#unordered-set-of-unique-space-separated-tokens">Unordered set of unique space-separated tokens</a>, <a href="#ascii-case-insensitive">ASCII case-insensitive</a>, consisting of accepted types and drag feedback*
|
|
<tr><th> <code title="">enctype</code>
|
|
<td> <code title="attr-fs-enctype"><a href="#attr-fs-enctype">form</a></code>
|
|
<td> Form data set encoding type to use for <a href="#form-submission">form submission</a>
|
|
<td> "<code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</a></code>"; "<code title="attr-fs-enctype-formdata"><a href="#attr-fs-enctype-formdata">multipart/form-data</a></code>"; "<code title="attr-fs-enctype-text"><a href="#attr-fs-enctype-text">text/plain</a></code>"
|
|
<tr><th> <code title="">for</code>
|
|
<td> <code title="attr-label-for"><a href="#attr-label-for">label</a></code>
|
|
<td> Associate the label with form control
|
|
<td> <a href="#concept-id" title="concept-id">ID</a>*
|
|
<tr><th> <code title="">for</code>
|
|
<td> <code title="attr-output-for"><a href="#attr-output-for">output</a></code>
|
|
<td> Specifies controls from which the output was calculated
|
|
<td> <a href="#unordered-set-of-unique-space-separated-tokens">Unordered set of unique space-separated tokens</a>, <a href="#case-sensitive">case-sensitive</a>, consisting of IDs*
|
|
<tr><th> <code title="">form</code>
|
|
<td> <code title="attr-fae-form"><a href="#attr-fae-form">button</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">fieldset</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">input</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">keygen</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">label</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">meter</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">object</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">output</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">progress</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">select</a></code>;
|
|
<code title="attr-fae-form"><a href="#attr-fae-form">textarea</a></code>
|
|
<td> Associates the control with a <code><a href="#the-form-element">form</a></code> element
|
|
<td> <a href="#concept-id" title="concept-id">ID</a>*
|
|
<tr><th> <code title="">formaction</code>
|
|
<td> <code title="attr-fs-formaction"><a href="#attr-fs-formaction">button</a></code>;
|
|
<code title="attr-fs-formaction"><a href="#attr-fs-formaction">input</a></code>
|
|
<td> <a href="#url">URL</a> to use for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#valid-url-potentially-surrounded-by-spaces">Valid URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">formenctype</code>
|
|
<td> <code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">button</a></code>;
|
|
<code title="attr-fs-formenctype"><a href="#attr-fs-formenctype">input</a></code>
|
|
<td> Form data set encoding type to use for <a href="#form-submission">form submission</a>
|
|
<td> "<code title="attr-fs-enctype-urlencoded"><a href="#attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</a></code>"; "<code title="attr-fs-enctype-formdata"><a href="#attr-fs-enctype-formdata">multipart/form-data</a></code>"; "<code title="attr-fs-enctype-text"><a href="#attr-fs-enctype-text">text/plain</a></code>"
|
|
<tr><th> <code title="">formmethod</code>
|
|
<td> <code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">button</a></code>;
|
|
<code title="attr-fs-formmethod"><a href="#attr-fs-formmethod">input</a></code>
|
|
<td> HTTP method to use for <a href="#form-submission">form submission</a>
|
|
<td> "<code title="">GET</code>"; "<code title="">POST</code>"
|
|
<tr><th> <code title="">formnovalidate</code>
|
|
<td> <code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">button</a></code>;
|
|
<code title="attr-fs-formnovalidate"><a href="#attr-fs-formnovalidate">input</a></code>
|
|
<td> Bypass form control validation for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">formtarget</code>
|
|
<td> <code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">button</a></code>;
|
|
<code title="attr-fs-formtarget"><a href="#attr-fs-formtarget">input</a></code>
|
|
<td> <a href="#browsing-context">Browsing context</a> for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#valid-browsing-context-name-or-keyword">Valid browsing context name or keyword</a>
|
|
<tr><th> <code title="">headers</code>
|
|
<td> <code title="attr-tdth-headers"><a href="#attr-tdth-headers">td</a></code>;
|
|
<code title="attr-tdth-headers"><a href="#attr-tdth-headers">th</a></code>
|
|
<td> The header cells for this cell
|
|
<td> <a href="#unordered-set-of-unique-space-separated-tokens">Unordered set of unique space-separated tokens</a>, <a href="#case-sensitive">case-sensitive</a>, consisting of IDs*
|
|
<tr><th> <code title="">height</code>
|
|
<td> <code title="attr-canvas-height"><a href="#attr-canvas-height">canvas</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">embed</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">iframe</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">img</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">input</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">object</a></code>;
|
|
<code title="attr-dim-height"><a href="#attr-dim-height">video</a></code>
|
|
<td> Vertical dimension
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a>
|
|
<tr><th> <code title="">hidden</code>
|
|
<td> <a href="#the-hidden-attribute" title="attr-hidden">HTML elements</a>
|
|
<td> Whether the element is relevant
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">high</code>
|
|
<td> <code title="attr-meter-high"><a href="#attr-meter-high">meter</a></code>
|
|
<td> Low limit of high range
|
|
<td> <a href="#valid-floating-point-number">Valid floating point number</a>*
|
|
<tr><th> <code title="">href</code>
|
|
<td> <code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">a</a></code>;
|
|
<code title="attr-hyperlink-href"><a href="#attr-hyperlink-href">area</a></code>
|
|
<td> Address of the <a href="#hyperlink">hyperlink</a>
|
|
<td> <a href="#valid-url-potentially-surrounded-by-spaces">Valid URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">href</code>
|
|
<td> <code title="attr-link-href"><a href="#attr-link-href">link</a></code>
|
|
<td> Address of the <a href="#hyperlink">hyperlink</a>
|
|
<td> <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">Valid non-empty URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">href</code>
|
|
<td> <code title="attr-base-href"><a href="#attr-base-href">base</a></code>
|
|
<td> <a href="#document-base-url">Document base URL</a>
|
|
<td> <a href="#valid-url-potentially-surrounded-by-spaces">Valid URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">hreflang</code>
|
|
<td> <code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">a</a></code>;
|
|
<code title="attr-hyperlink-hreflang"><a href="#attr-hyperlink-hreflang">area</a></code>;
|
|
<code title="attr-link-hreflang"><a href="#attr-link-hreflang">link</a></code>
|
|
<td> Language of the linked resource
|
|
<td> Valid BCP 47 language tag
|
|
<tr><th> <code title="">http-equiv</code>
|
|
<td> <code title="attr-meta-http-equiv"><a href="#attr-meta-http-equiv">meta</a></code>
|
|
<td> Pragma directive
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">icon</code>
|
|
<td> <code title="attr-command-icon"><a href="#attr-command-icon">command</a></code>
|
|
<td> Icon for the command
|
|
<td> <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">Valid non-empty URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">id</code>
|
|
<td> <a href="#the-id-attribute" title="attr-id">HTML elements</a>
|
|
<td> The element's <a href="#concept-id" title="concept-id">ID</a>
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">ismap</code>
|
|
<td> <code title="attr-img-ismap"><a href="#attr-img-ismap">img</a></code>
|
|
<td> Whether the image is a server-side image map
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">keytype</code>
|
|
<td> <code title="attr-keygen-keytype"><a href="#attr-keygen-keytype">keygen</a></code>
|
|
<td> The type of cryptographic key to generate
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">kind</code>
|
|
<td> <code title="attr-track-kind"><a href="#attr-track-kind">track</a></code>
|
|
<td> The type of text track
|
|
<td> "<code title="attr-track-kind-subtitles"><a href="#attr-track-kind-subtitles">subtitles</a></code>";
|
|
"<code title="attr-track-kind-captions"><a href="#attr-track-kind-captions">captions</a></code>";
|
|
"<code title="attr-track-kind-descriptions"><a href="#attr-track-kind-descriptions">descriptions</a></code>";
|
|
"<code title="attr-track-kind-chapters"><a href="#attr-track-kind-chapters">chapters</a></code>";
|
|
"<code title="attr-track-kind-metadata"><a href="#attr-track-kind-metadata">metadata</a></code>"
|
|
<tr><th> <code title="">label</code>
|
|
<td> <code title="attr-command-label"><a href="#attr-command-label">command</a></code>;
|
|
<code title="attr-menu-label"><a href="#attr-menu-label">menu</a></code>;
|
|
<code title="attr-optgroup-label"><a href="#attr-optgroup-label">optgroup</a></code>;
|
|
<code title="attr-option-label"><a href="#attr-option-label">option</a></code>;
|
|
<code title="attr-track-label"><a href="#attr-track-label">track</a></code>
|
|
<td> User-visible label
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">lang</code>
|
|
<td> <a href="#attr-lang" title="attr-lang">HTML elements</a>
|
|
<td> <a href="#language">Language</a> of the element
|
|
<td> Valid BCP 47 language tag or the empty string
|
|
<tr><th> <code title="">list</code>
|
|
<td> <code title="attr-input-list"><a href="#attr-input-list">input</a></code>
|
|
<td> List of autocomplete options
|
|
<td> <a href="#concept-id" title="concept-id">ID</a>*
|
|
<tr><th> <code title="">loop</code>
|
|
<td> <code title="attr-media-loop"><a href="#attr-media-loop">audio</a></code>;
|
|
<code title="attr-media-loop"><a href="#attr-media-loop">video</a></code>
|
|
<td> Whether to loop the <a href="#media-resource">media resource</a>
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">low</code>
|
|
<td> <code title="attr-meter-low"><a href="#attr-meter-low">meter</a></code>
|
|
<td> High limit of low range
|
|
<td> <a href="#valid-floating-point-number">Valid floating point number</a>*
|
|
<tr><th> <code title="">manifest</code>
|
|
<td> <code title="attr-html-manifest"><a href="#attr-html-manifest">html</a></code>
|
|
<td> <a href="#concept-appcache-manifest" title="concept-appcache-manifest">Application cache manifest</a>
|
|
<td> <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">Valid non-empty URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">max</code>
|
|
<td> <code title="attr-input-max"><a href="#attr-input-max">input</a></code>
|
|
<td> Maximum value
|
|
<td> varies*
|
|
<tr><th> <code title="">max</code>
|
|
<td> <code title="attr-meter-max"><a href="#attr-meter-max">meter</a></code>;
|
|
<code title="attr-progress-max"><a href="#attr-progress-max">progress</a></code>
|
|
<td> Upper bound of range
|
|
<td> <a href="#valid-floating-point-number">Valid floating point number</a>*
|
|
<tr><th> <code title="">maxlength</code>
|
|
<td> <code title="attr-input-maxlength"><a href="#attr-input-maxlength">input</a></code>;
|
|
<code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength">textarea</a></code>
|
|
<td> Maximum length of value
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a>
|
|
<tr><th> <code title="">media</code>
|
|
<td> <code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">a</a></code>;
|
|
<code title="attr-hyperlink-media"><a href="#attr-hyperlink-media">area</a></code>;
|
|
<code title="attr-link-media"><a href="#attr-link-media">link</a></code>;
|
|
<code title="attr-source-media"><a href="#attr-source-media">source</a></code>;
|
|
<code title="attr-style-media"><a href="#attr-style-media">style</a></code>
|
|
<td> Applicable media
|
|
<td> <a href="#valid-media-query">Valid media query</a>
|
|
<tr><th> <code title="">mediagroup</code>
|
|
<td> <code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">audio</a></code>;
|
|
<code title="attr-media-mediagroup"><a href="#attr-media-mediagroup">video</a></code>
|
|
<td> Groups <a href="#media-element" title="media element">media elements</a> together with an implicit <code><a href="#mediacontroller">MediaController</a></code>
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">method</code>
|
|
<td> <code title="attr-fs-method"><a href="#attr-fs-method">form</a></code>
|
|
<td> HTTP method to use for <a href="#form-submission">form submission</a>
|
|
<td> "<code title="">GET</code>"; "<code title="">POST</code>"
|
|
<tr><th> <code title="">min</code>
|
|
<td> <code title="attr-input-min"><a href="#attr-input-min">input</a></code>
|
|
<td> Minimum value
|
|
<td> varies*
|
|
<tr><th> <code title="">min</code>
|
|
<td> <code title="attr-meter-min"><a href="#attr-meter-min">meter</a></code>
|
|
<td> Lower bound of range
|
|
<td> <a href="#valid-floating-point-number">Valid floating point number</a>*
|
|
<tr><th> <code title="">multiple</code>
|
|
<td> <code title="attr-input-multiple"><a href="#attr-input-multiple">input</a></code>;
|
|
<code title="attr-select-multiple"><a href="#attr-select-multiple">select</a></code>
|
|
<td> Whether to allow multiple values
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">name</code>
|
|
<td> <code title="attr-fe-name"><a href="#attr-fe-name">button</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">fieldset</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">input</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">keygen</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">output</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">select</a></code>;
|
|
<code title="attr-fe-name"><a href="#attr-fe-name">textarea</a></code>
|
|
<td> Name of form control to use for <a href="#form-submission">form submission</a> and in the <code title="dom-form-elements"><a href="#dom-form-elements">form.elements</a></code> API
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">name</code>
|
|
<td> <code title="attr-form-name"><a href="#attr-form-name">form</a></code>
|
|
<td> Name of form to use in the <code title="dom-document-forms"><a href="#dom-document-forms">document.forms</a></code> API
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">name</code>
|
|
<td> <code title="attr-iframe-name"><a href="#attr-iframe-name">iframe</a></code>;
|
|
<code title="attr-object-name"><a href="#attr-object-name">object</a></code>
|
|
<td> Name of <a href="#nested-browsing-context">nested browsing context</a>
|
|
<td> <a href="#valid-browsing-context-name-or-keyword">Valid browsing context name or keyword</a>
|
|
<tr><th> <code title="">name</code>
|
|
<td> <code title="attr-map-name"><a href="#attr-map-name">map</a></code>
|
|
<td> Name of <a href="#image-map">image map</a> to reference from the <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">usemap</a></code> attribute
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">name</code>
|
|
<td> <code title="attr-meta-name"><a href="#attr-meta-name">meta</a></code>
|
|
<td> Metadata name
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">name</code>
|
|
<td> <code title="attr-param-name"><a href="#attr-param-name">param</a></code>
|
|
<td> Name of parameter
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">novalidate</code>
|
|
<td> <code title="attr-fs-novalidate"><a href="#attr-fs-novalidate">form</a></code>
|
|
<td> Bypass form control validation for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">open</code>
|
|
<td> <code title="attr-details-open"><a href="#attr-details-open">details</a></code>
|
|
<td> Whether the details are visible
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">optimum</code>
|
|
<td> <code title="attr-meter-optimum"><a href="#attr-meter-optimum">meter</a></code>
|
|
<td> Optimum value in gauge
|
|
<td> <a href="#valid-floating-point-number">Valid floating point number</a>*
|
|
<tr><th> <code title="">pattern</code>
|
|
<td> <code title="attr-input-pattern"><a href="#attr-input-pattern">input</a></code>
|
|
<td> Pattern to be matched by the form control's value
|
|
<td> Regular expression matching the JavaScript <i title="">Pattern</i> production
|
|
<tr><th> <code title="">placeholder</code>
|
|
<td> <code title="attr-input-placeholder"><a href="#attr-input-placeholder">input</a></code>;
|
|
<code title="attr-textarea-placeholder"><a href="#attr-textarea-placeholder">textarea</a></code>
|
|
<td> User-visible label to be placed within the form control
|
|
<td> <a href="#attribute-text">Text</a>*
|
|
<tr><th> <code title="">poster</code>
|
|
<td> <code title="attr-video-poster"><a href="#attr-video-poster">video</a></code>
|
|
<td> Poster frame to show prior to video playback
|
|
<td> <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">Valid non-empty URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">preload</code>
|
|
<td> <code title="attr-media-preload"><a href="#attr-media-preload">audio</a></code>;
|
|
<code title="attr-media-preload"><a href="#attr-media-preload">video</a></code>
|
|
<td> Hints how much buffering the <a href="#media-resource">media resource</a> will likely need
|
|
<td> "<code title="attr-media-preload-none"><a href="#attr-media-preload-none">none</a></code>";
|
|
"<code title="attr-media-preload-metadata"><a href="#attr-media-preload-metadata">metadata</a></code>";
|
|
"<code title="attr-media-preload-auto"><a href="#attr-media-preload-auto">auto</a></code>"
|
|
<tr><th> <code title="">pubdate</code>
|
|
<td> <code title="attr-time-pubdate"><a href="#attr-time-pubdate">time</a></code>
|
|
<td> Whether the element's value represents a publication time for the nearest <code><a href="#the-article-element">article</a></code> or <code><a href="#the-body-element">body</a></code>
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">radiogroup</code>
|
|
<td> <code title="attr-command-radiogroup"><a href="#attr-command-radiogroup">command</a></code>
|
|
<td> Name of group of commands to treat as a radio button group
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">readonly</code>
|
|
<td> <code title="attr-input-readonly"><a href="#attr-input-readonly">input</a></code>;
|
|
<code title="attr-textarea-readonly"><a href="#attr-textarea-readonly">textarea</a></code>
|
|
<td> Whether to allow the value to be edited by the user
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">rel</code>
|
|
<td> <code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">a</a></code>;
|
|
<code title="attr-hyperlink-rel"><a href="#attr-hyperlink-rel">area</a></code>;
|
|
<code title="attr-link-rel"><a href="#attr-link-rel">link</a></code>
|
|
<td> Relationship between the document containing the hyperlink and the destination resource
|
|
<td> <a href="#set-of-space-separated-tokens">Set of space-separated tokens</a>*
|
|
<tr><th> <code title="">required</code>
|
|
<td> <code title="attr-input-required"><a href="#attr-input-required">input</a></code>;
|
|
<code title="attr-select-required"><a href="#attr-select-required">select</a></code>;
|
|
<code title="attr-textarea-required"><a href="#attr-textarea-required">textarea</a></code>
|
|
<td> Whether the control is required for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">reversed</code>
|
|
<td> <code title="attr-ol-reversed"><a href="#attr-ol-reversed">ol</a></code>
|
|
<td> Number the list backwards
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">rows</code>
|
|
<td> <code title="attr-textarea-rows"><a href="#attr-textarea-rows">textarea</a></code>
|
|
<td> Number of lines to show
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a> greater than zero
|
|
<tr><th> <code title="">rowspan</code>
|
|
<td> <code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">td</a></code>;
|
|
<code title="attr-tdth-rowspan"><a href="#attr-tdth-rowspan">th</a></code>
|
|
<td> Number of rows that the cell is to span
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a>
|
|
<tr><th> <code title="">sandbox</code>
|
|
<td> <code title="attr-iframe-sandbox"><a href="#attr-iframe-sandbox">iframe</a></code>
|
|
<td> Security rules for nested content
|
|
<td> <a href="#unordered-set-of-unique-space-separated-tokens">Unordered set of unique space-separated tokens</a>, <a href="#ascii-case-insensitive">ASCII case-insensitive</a>, consisting of
|
|
"<code title="attr-iframe-sandbox-allow-same-origin"><a href="#attr-iframe-sandbox-allow-same-origin">allow-same-origin</a></code>",
|
|
"<code title="attr-iframe-sandbox-allow-forms"><a href="#attr-iframe-sandbox-allow-forms">allow-forms</a></code>", and
|
|
"<code title="attr-iframe-sandbox-allow-scripts"><a href="#attr-iframe-sandbox-allow-scripts">allow-scripts</a></code>"
|
|
<tr><th> <code title="">spellcheck</code>
|
|
<td> <a href="#attr-spellcheck" title="attr-spellcheck">HTML elements</a>
|
|
<td> Whether the element is to have its spelling and grammar checked
|
|
<td> "<code title="">true</code>"; "<code title="">false</code>"
|
|
<tr><th> <code title="">scope</code>
|
|
<td> <code title="attr-th-scope"><a href="#attr-th-scope">th</a></code>
|
|
<td> Specifies which cells the header cell applies to
|
|
<td> "<code title="attr-th-scope-row"><a href="#attr-th-scope-row">row</a></code>";
|
|
"<code title="attr-th-scope-col"><a href="#attr-th-scope-col">col</a></code>";
|
|
"<code title="attr-th-scope-rowgroup"><a href="#attr-th-scope-rowgroup">rowgroup</a></code>";
|
|
"<code title="attr-th-scope-colgroup"><a href="#attr-th-scope-colgroup">colgroup</a></code>"
|
|
<tr><th> <code title="">scoped</code>
|
|
<td> <code title="attr-style-scoped"><a href="#attr-style-scoped">style</a></code>
|
|
<td> Whether the styles apply to the entire document or just the parent subtree
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">seamless</code>
|
|
<td> <code title="attr-iframe-seamless"><a href="#attr-iframe-seamless">iframe</a></code>
|
|
<td> Whether to apply the document's styles to the nested content
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">selected</code>
|
|
<td> <code title="attr-option-selected"><a href="#attr-option-selected">option</a></code>
|
|
<td> Whether the option is selected by default
|
|
<td> <a href="#boolean-attribute">Boolean attribute</a>
|
|
<tr><th> <code title="">shape</code>
|
|
<td> <code title="attr-area-shape"><a href="#attr-area-shape">area</a></code>
|
|
<td> The kind of shape to be created in an <a href="#image-map">image map</a>
|
|
<td> "<code title="attr-area-shape-keyword-circle"><a href="#attr-area-shape-keyword-circle">circle</a></code>";
|
|
"<code title="attr-area-shape-keyword-default"><a href="#attr-area-shape-keyword-default">default</a></code>";
|
|
"<code title="attr-area-shape-keyword-poly"><a href="#attr-area-shape-keyword-poly">poly</a></code>";
|
|
"<code title="attr-area-shape-keyword-rect"><a href="#attr-area-shape-keyword-rect">rect</a></code>"
|
|
<tr><th> <code title="">size</code>
|
|
<td> <code title="attr-input-size"><a href="#attr-input-size">input</a></code>;
|
|
<code title="attr-select-size"><a href="#attr-select-size">select</a></code>
|
|
<td> Size of the control
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a> greater than zero
|
|
<tr><th> <code title="">sizes</code>
|
|
<td> <code title="attr-link-sizes"><a href="#attr-link-sizes">link</a></code>
|
|
<td> Sizes of the icons (for <code title="attr-link-rel"><a href="#attr-link-rel">rel</a></code>="<code title="rel-icon"><a href="#rel-icon">icon</a></code>")
|
|
<td> <a href="#unordered-set-of-unique-space-separated-tokens">Unordered set of unique space-separated tokens</a>, <a href="#ascii-case-insensitive">ASCII case-insensitive</a>, consisting of sizes*
|
|
<tr><th> <code title="">span</code>
|
|
<td> <code title="attr-col-span"><a href="#attr-col-span">col</a></code>;
|
|
<code title="attr-colgroup-span"><a href="#attr-colgroup-span">colgroup</a></code>
|
|
<td> Number of columns spanned by the element
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a> greater than zero
|
|
<tr><th> <code title="">src</code>
|
|
<td> <code title="attr-media-src"><a href="#attr-media-src">audio</a></code>;
|
|
<code title="attr-embed-src"><a href="#attr-embed-src">embed</a></code>;
|
|
<code title="attr-iframe-src"><a href="#attr-iframe-src">iframe</a></code>;
|
|
<code title="attr-img-src"><a href="#attr-img-src">img</a></code>;
|
|
<code title="attr-input-src"><a href="#attr-input-src">input</a></code>;
|
|
<code title="attr-script-src"><a href="#attr-script-src">script</a></code>;
|
|
<code title="attr-source-src"><a href="#attr-source-src">source</a></code>;
|
|
<code title="attr-track-src"><a href="#attr-track-src">track</a></code>;
|
|
<code title="attr-media-src"><a href="#attr-media-src">video</a></code>
|
|
<td> Address of the resource
|
|
<td> <a href="#valid-non-empty-url-potentially-surrounded-by-spaces">Valid non-empty URL potentially surrounded by spaces</a>
|
|
<tr><th> <code title="">srcdoc</code>
|
|
<td> <code title="attr-iframe-srcdoc"><a href="#attr-iframe-srcdoc">iframe</a></code>
|
|
<td> A document to render in the <code><a href="#the-iframe-element">iframe</a></code>
|
|
<td> The source of <a href="#an-iframe-srcdoc-document">an <code>iframe</code> <code title="attr-iframe-srcdoc">srcdoc</code> document</a>*
|
|
<tr><th> <code title="">srclang</code>
|
|
<td> <code title="attr-track-srclang"><a href="#attr-track-srclang">track</a></code>
|
|
<td> Language of the text track
|
|
<td> Valid BCP 47 language tag
|
|
<tr><th> <code title="">start</code>
|
|
<td> <code title="attr-ol-start"><a href="#attr-ol-start">ol</a></code>
|
|
<td> <a href="#ordinal-value">Ordinal value</a> of the first item
|
|
<td> <a href="#valid-integer">Valid integer</a>
|
|
<tr><th> <code title="">step</code>
|
|
<td> <code title="attr-input-step"><a href="#attr-input-step">input</a></code>
|
|
<td> Granularity to be matched by the form control's value
|
|
<td> <a href="#valid-floating-point-number">Valid floating point number</a> greater than zero, or "<code title="">any</code>"
|
|
<tr><th> <code title="">style</code>
|
|
<td> <a href="#the-style-attribute" title="attr-style">HTML elements</a>
|
|
<td> Presentational and formatting instructions
|
|
<td> CSS declarations*
|
|
<tr><th> <code title="">tabindex</code>
|
|
<td> <a href="#attr-tabindex" title="attr-tabindex">HTML elements</a>
|
|
<td> Whether the element is focusable, and the relative order of the element for the purposes of sequential focus navigation
|
|
<td> <a href="#valid-integer">Valid integer</a>
|
|
<tr><th> <code title="">target</code>
|
|
<td> <code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">a</a></code>;
|
|
<code title="attr-hyperlink-target"><a href="#attr-hyperlink-target">area</a></code>
|
|
<td> <a href="#browsing-context">Browsing context</a> for <a href="#hyperlink">hyperlink</a> <a href="#navigate" title="navigate">navigation</a>
|
|
<td> <a href="#valid-browsing-context-name-or-keyword">Valid browsing context name or keyword</a>
|
|
<tr><th> <code title="">target</code>
|
|
<td> <code title="attr-base-target"><a href="#attr-base-target">base</a></code>
|
|
<td> Default <a href="#browsing-context">browsing context</a> for <a href="#hyperlink">hyperlink</a> <a href="#navigate" title="navigate">navigation</a> and <a href="#form-submission">form submission</a>
|
|
<td> <a href="#valid-browsing-context-name-or-keyword">Valid browsing context name or keyword</a>
|
|
<tr><th> <code title="">target</code>
|
|
<td> <code title="attr-fs-target"><a href="#attr-fs-target">form</a></code>
|
|
<td> <a href="#browsing-context">Browsing context</a> for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#valid-browsing-context-name-or-keyword">Valid browsing context name or keyword</a>
|
|
<tr><th> <code title="">title</code>
|
|
<td> <a href="#the-title-attribute" title="attr-title">HTML elements</a>
|
|
<td> Advisory information for the element
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">title</code>
|
|
<td> <code title="attr-abbr-title"><a href="#attr-abbr-title">abbr</a></code>;
|
|
<code title="attr-dfn-title"><a href="#attr-dfn-title">dfn</a></code>
|
|
<td> Full term or expansion of abbreviation
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">title</code>
|
|
<td> <code title="attr-command-title"><a href="#attr-command-title">command</a></code>
|
|
<td> Hint describing the command
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">title</code>
|
|
<td> <code title="attr-link-title"><a href="#attr-link-title">link</a></code>
|
|
<td> Title of the link
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">title</code>
|
|
<td> <code title="attr-link-title"><a href="#attr-link-title">link</a></code>;
|
|
<code title="attr-style-title"><a href="#attr-style-title">style</a></code>
|
|
<td> Alternative style sheet set name
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">type</code>
|
|
<td> <code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">a</a></code>;
|
|
<code title="attr-hyperlink-type"><a href="#attr-hyperlink-type">area</a></code>;
|
|
<code title="attr-link-type"><a href="#attr-link-type">link</a></code>
|
|
<td> Hint for the type of the referenced resource
|
|
<td> <a href="#valid-mime-type">Valid MIME type</a>
|
|
<tr><th> <code title="">type</code>
|
|
<td> <code title="attr-button-type"><a href="#attr-button-type">button</a></code>
|
|
<td> Type of button
|
|
<td> "<code title="attr-button-type-submit"><a href="#attr-button-type-submit">submit</a></code>";
|
|
"<code title="attr-button-type-reset"><a href="#attr-button-type-reset">reset</a></code>";
|
|
"<code title="attr-button-type-button"><a href="#attr-button-type-button">button</a></code>"
|
|
<tr><th> <code title="">type</code>
|
|
<td> <code title="attr-button-type"><a href="#attr-button-type">button</a></code>;
|
|
<code title="attr-input-type"><a href="#attr-input-type">input</a></code>
|
|
<td> Type of form control
|
|
<td> <a href="#attr-input-type" title="attr-input-type"><code>input</code> type keyword</a>
|
|
<tr><th> <code title="">type</code>
|
|
<td> <code title="attr-command-type"><a href="#attr-command-type">command</a></code>
|
|
<td> Type of command
|
|
<td> "<code title="attr-command-type-keyword-command"><a href="#attr-command-type-keyword-command">command</a></code>";
|
|
"<code title="attr-command-type-keyword-checkbox"><a href="#attr-command-type-keyword-checkbox">checkbox</a></code>";
|
|
"<code title="attr-command-type-keyword-radio"><a href="#attr-command-type-keyword-radio">radio</a></code>"
|
|
<tr><th> <code title="">type</code>
|
|
<td> <code title="attr-embed-type"><a href="#attr-embed-type">embed</a></code>;
|
|
<code title="attr-object-type"><a href="#attr-object-type">object</a></code>;
|
|
<code title="attr-script-type"><a href="#attr-script-type">script</a></code>;
|
|
<code title="attr-source-type"><a href="#attr-source-type">source</a></code>;
|
|
<code title="attr-style-type"><a href="#attr-style-type">style</a></code>
|
|
<td> Type of embedded resource
|
|
<td> <a href="#valid-mime-type">Valid MIME type</a>
|
|
<tr><th> <code title="">type</code>
|
|
<td> <code title="attr-menu-type"><a href="#attr-menu-type">menu</a></code>
|
|
<td> Type of menu
|
|
<td> "<code title="context menu state"><a href="#context-menu-state">context</a></code>"; "<code title="toolbar state"><a href="#toolbar-state">toolbar</a></code>"
|
|
<tr><th> <code title="">usemap</code>
|
|
<td> <code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">img</a></code>;
|
|
<code title="attr-hyperlink-usemap"><a href="#attr-hyperlink-usemap">object</a></code>
|
|
<td> Name of <a href="#image-map">image map</a> to use
|
|
<td> <a href="#valid-hash-name-reference">Valid hash-name reference</a>*
|
|
<tr><th> <code title="">value</code>
|
|
<td> <code title="attr-button-value"><a href="#attr-button-value">button</a></code>;
|
|
<code title="attr-option-value"><a href="#attr-option-value">option</a></code>
|
|
<td> Value to be used for <a href="#form-submission">form submission</a>
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">value</code>
|
|
<td> <code title="attr-input-value"><a href="#attr-input-value">input</a></code>
|
|
<td> Value of the form control
|
|
<td> varies*
|
|
<tr><th> <code title="">value</code>
|
|
<td> <code title="attr-li-value"><a href="#attr-li-value">li</a></code>
|
|
<td> <a href="#ordinal-value">Ordinal value</a> of the list item
|
|
<td> <a href="#valid-integer">Valid integer</a>
|
|
<tr><th> <code title="">value</code>
|
|
<td> <code title="attr-meter-value"><a href="#attr-meter-value">meter</a></code>;
|
|
<code title="attr-progress-value"><a href="#attr-progress-value">progress</a></code>
|
|
<td> Current value of the element
|
|
<td> <a href="#valid-floating-point-number">Valid floating point number</a>
|
|
<tr><th> <code title="">value</code>
|
|
<td> <code title="attr-param-value"><a href="#attr-param-value">param</a></code>
|
|
<td> Value of parameter
|
|
<td> <a href="#attribute-text">Text</a>
|
|
<tr><th> <code title="">width</code>
|
|
<td> <code title="attr-canvas-width"><a href="#attr-canvas-width">canvas</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">embed</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">iframe</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">img</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">input</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">object</a></code>;
|
|
<code title="attr-dim-width"><a href="#attr-dim-width">video</a></code>
|
|
<td> Horizontal dimension
|
|
<td> <a href="#valid-non-negative-integer">Valid non-negative integer</a>
|
|
<tr><th> <code title="">wrap</code>
|
|
<td> <code title="attr-textarea-wrap"><a href="#attr-textarea-wrap">textarea</a></code>
|
|
<td> How the value of the form control is to be wrapped for <a href="#form-submission">form submission</a>
|
|
<td> "<code title="attr-textarea-wrap-soft"><a href="#attr-textarea-wrap-soft">soft</a></code>";
|
|
"<code title="attr-textarea-wrap-hard"><a href="#attr-textarea-wrap-hard">hard</a></code>"
|
|
</table><p>An asterisk (*) in a cell indicates that the actual rules are more complicated than indicated in the table above.<hr><table id="ix-event-handlers"><caption>List of event handler content attributes</caption>
|
|
<thead><tr><th> Attribute
|
|
<th> Element(s)
|
|
<th> Description
|
|
<th> Value
|
|
<tbody><tr><th id="ix-handler-onabort"> <code title="">onabort</code>
|
|
<td> <a href="#handler-onabort" title="handler-onabort">HTML elements</a>
|
|
<td> <code title="event-abort">abort</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onafterprint"> <code title="">onafterprint</code>
|
|
<td> <code title="handler-window-onafterprint"><a href="#handler-window-onafterprint">body</a></code>
|
|
<td> <code title="event-afterprint">afterprint</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onbeforeprint"> <code title="">onbeforeprint</code>
|
|
<td> <code title="handler-window-onbeforeprint"><a href="#handler-window-onbeforeprint">body</a></code>
|
|
<td> <code title="event-beforeprint">beforeprint</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onbeforeunload"> <code title="">onbeforeunload</code>
|
|
<td> <code title="handler-window-onbeforeunload"><a href="#handler-window-onbeforeunload">body</a></code>
|
|
<td> <code title="event-beforeunload">beforeunload</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onblur"> <code title="">onblur</code>
|
|
<td> <code title="handler-window-onblur"><a href="#handler-window-onblur">body</a></code>
|
|
<td> <code title="event-blur">blur</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onblur"> <code title="">onblur</code>
|
|
<td> <a href="#handler-onblur" title="handler-onblur">HTML elements</a>
|
|
<td> <code title="event-blur">blur</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-oncanplay"> <code title="">oncanplay</code>
|
|
<td> <a href="#handler-oncanplay" title="handler-oncanplay">HTML elements</a>
|
|
<td> <code title="event-media-canplay"><a href="#event-media-canplay">canplay</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-oncanplaythrough"> <code title="">oncanplaythrough</code>
|
|
<td> <a href="#handler-oncanplaythrough" title="handler-oncanplaythrough">HTML elements</a>
|
|
<td> <code title="event-media-canplaythrough"><a href="#event-media-canplaythrough">canplaythrough</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onchange"> <code title="">onchange</code>
|
|
<td> <a href="#handler-onchange" title="handler-onchange">HTML elements</a>
|
|
<td> <code title="event-change">change</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onclick"> <code title="">onclick</code>
|
|
<td> <a href="#handler-onclick" title="handler-onclick">HTML elements</a>
|
|
<td> <code title="event-click"><a href="#event-click">click</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-oncontextmenu"> <code title="">oncontextmenu</code>
|
|
<td> <a href="#handler-oncontextmenu" title="handler-oncontextmenu">HTML elements</a>
|
|
<td> <code title="event-contextmenu">contextmenu</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-oncuechange"> <code title="">oncuechange</code>
|
|
<td> <a href="#handler-oncuechange" title="handler-oncuechange">HTML elements</a>
|
|
<td> <code title="event-cuechange">cuechange</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondblclick"> <code title="">ondblclick</code>
|
|
<td> <a href="#handler-ondblclick" title="handler-ondblclick">HTML elements</a>
|
|
<td> <code title="event-dblclick">dblclick</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondrag"> <code title="">ondrag</code>
|
|
<td> <a href="#handler-ondrag" title="handler-ondrag">HTML elements</a>
|
|
<td> <code title="event-drag"><a href="#event-drag">drag</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondragend"> <code title="">ondragend</code>
|
|
<td> <a href="#handler-ondragend" title="handler-ondragend">HTML elements</a>
|
|
<td> <code title="event-dragend"><a href="#event-dragend">dragend</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondragenter"> <code title="">ondragenter</code>
|
|
<td> <a href="#handler-ondragenter" title="handler-ondragenter">HTML elements</a>
|
|
<td> <code title="event-dragenter"><a href="#event-dragenter">dragenter</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondragleave"> <code title="">ondragleave</code>
|
|
<td> <a href="#handler-ondragleave" title="handler-ondragleave">HTML elements</a>
|
|
<td> <code title="event-dragleave"><a href="#event-dragleave">dragleave</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondragover"> <code title="">ondragover</code>
|
|
<td> <a href="#handler-ondragover" title="handler-ondragover">HTML elements</a>
|
|
<td> <code title="event-dragover"><a href="#event-dragover">dragover</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondragstart"> <code title="">ondragstart</code>
|
|
<td> <a href="#handler-ondragstart" title="handler-ondragstart">HTML elements</a>
|
|
<td> <code title="event-dragstart"><a href="#event-dragstart">dragstart</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondrop"> <code title="">ondrop</code>
|
|
<td> <a href="#handler-ondrop" title="handler-ondrop">HTML elements</a>
|
|
<td> <code title="event-drop"><a href="#event-drop">drop</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ondurationchange"> <code title="">ondurationchange</code>
|
|
<td> <a href="#handler-ondurationchange" title="handler-ondurationchange">HTML elements</a>
|
|
<td> <code title="event-media-durationchange"><a href="#event-media-durationchange">durationchange</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onemptied"> <code title="">onemptied</code>
|
|
<td> <a href="#handler-onemptied" title="handler-onemptied">HTML elements</a>
|
|
<td> <code title="event-media-emptied"><a href="#event-media-emptied">emptied</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onended"> <code title="">onended</code>
|
|
<td> <a href="#handler-onended" title="handler-onended">HTML elements</a>
|
|
<td> <code title="event-media-ended"><a href="#event-media-ended">ended</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onerror"> <code title="">onerror</code>
|
|
<td> <code title="handler-window-onerror"><a href="#handler-window-onerror">body</a></code>
|
|
<td> <code title="event-error">error</code> event handler for <code><a href="#window">Window</a></code> object, and handler for <a href="#runtime-script-errors">script error notifications</a>
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onerror"> <code title="">onerror</code>
|
|
<td> <a href="#handler-onerror" title="handler-onerror">HTML elements</a>
|
|
<td> <code title="event-error">error</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onfocus"> <code title="">onfocus</code>
|
|
<td> <code title="handler-window-onfocus"><a href="#handler-window-onfocus">body</a></code>
|
|
<td> <code title="event-focus">focus</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onfocus"> <code title="">onfocus</code>
|
|
<td> <a href="#handler-onfocus" title="handler-onfocus">HTML elements</a>
|
|
<td> <code title="event-focus">focus</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onhashchange"> <code title="">onhashchange</code>
|
|
<td> <code title="handler-window-onhashchange"><a href="#handler-window-onhashchange">body</a></code>
|
|
<td> <code title="event-hashchange"><a href="#event-hashchange">hashchange</a></code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-oninput"> <code title="">oninput</code>
|
|
<td> <a href="#handler-oninput" title="handler-oninput">HTML elements</a>
|
|
<td> <code title="event-input">input</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-oninvalid"> <code title="">oninvalid</code>
|
|
<td> <a href="#handler-oninvalid" title="handler-oninvalid">HTML elements</a>
|
|
<td> <code title="event-invalid">invalid</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onkeydown"> <code title="">onkeydown</code>
|
|
<td> <a href="#handler-onkeydown" title="handler-onkeydown">HTML elements</a>
|
|
<td> <code title="event-keydown">keydown</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onkeypress"> <code title="">onkeypress</code>
|
|
<td> <a href="#handler-onkeypress" title="handler-onkeypress">HTML elements</a>
|
|
<td> <code title="event-keypress">keypress</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onkeyup"> <code title="">onkeyup</code>
|
|
<td> <a href="#handler-onkeyup" title="handler-onkeyup">HTML elements</a>
|
|
<td> <code title="event-keyup">keyup</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onload"> <code title="">onload</code>
|
|
<td> <code title="handler-window-onload"><a href="#handler-window-onload">body</a></code>
|
|
<td> <code title="event-load">load</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onload"> <code title="">onload</code>
|
|
<td> <a href="#handler-onload" title="handler-onload">HTML elements</a>
|
|
<td> <code title="event-load">load</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onloadeddata"> <code title="">onloadeddata</code>
|
|
<td> <a href="#handler-onloadeddata" title="handler-onloadeddata">HTML elements</a>
|
|
<td> <code title="event-media-loadeddata"><a href="#event-media-loadeddata">loadeddata</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onloadedmetadata"> <code title="">onloadedmetadata</code>
|
|
<td> <a href="#handler-onloadedmetadata" title="handler-onloadedmetadata">HTML elements</a>
|
|
<td> <code title="event-media-loadedmetadata"><a href="#event-media-loadedmetadata">loadedmetadata</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onloadstart"> <code title="">onloadstart</code>
|
|
<td> <a href="#handler-onloadstart" title="handler-onloadstart">HTML elements</a>
|
|
<td> <code title="event-media-loadstart"><a href="#event-media-loadstart">loadstart</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onmessage"> <code title="">onmessage</code>
|
|
<td> <code title="handler-window-onmessage"><a href="#handler-window-onmessage">body</a></code>
|
|
<td> <code title="event-message">message</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onmousedown"> <code title="">onmousedown</code>
|
|
<td> <a href="#handler-onmousedown" title="handler-onmousedown">HTML elements</a>
|
|
<td> <code title="event-mousedown">mousedown</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onmousemove"> <code title="">onmousemove</code>
|
|
<td> <a href="#handler-onmousemove" title="handler-onmousemove">HTML elements</a>
|
|
<td> <code title="event-mousemove">mousemove</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onmouseout"> <code title="">onmouseout</code>
|
|
<td> <a href="#handler-onmouseout" title="handler-onmouseout">HTML elements</a>
|
|
<td> <code title="event-mouseout">mouseout</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onmouseover"> <code title="">onmouseover</code>
|
|
<td> <a href="#handler-onmouseover" title="handler-onmouseover">HTML elements</a>
|
|
<td> <code title="event-mouseover">mouseover</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onmouseup"> <code title="">onmouseup</code>
|
|
<td> <a href="#handler-onmouseup" title="handler-onmouseup">HTML elements</a>
|
|
<td> <code title="event-mouseup">mouseup</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onmousewheel"> <code title="">onmousewheel</code>
|
|
<td> <a href="#handler-onmousewheel" title="handler-onmousewheel">HTML elements</a>
|
|
<td> <code title="event-mousewheel">mousewheel</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onoffline"> <code title="">onoffline</code>
|
|
<td> <code title="handler-window-onoffline"><a href="#handler-window-onoffline">body</a></code>
|
|
<td> <code title="event-offline"><a href="#event-offline">offline</a></code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-ononline"> <code title="">ononline</code>
|
|
<td> <code title="handler-window-ononline"><a href="#handler-window-ononline">body</a></code>
|
|
<td> <code title="event-online"><a href="#event-online">online</a></code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onpagehide"> <code title="">onpagehide</code>
|
|
<td> <code title="handler-window-onpagehide"><a href="#handler-window-onpagehide">body</a></code>
|
|
<td> <code title="event-pagehide"><a href="#event-pagehide">pagehide</a></code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onpageshow"> <code title="">onpageshow</code>
|
|
<td> <code title="handler-window-onpageshow"><a href="#handler-window-onpageshow">body</a></code>
|
|
<td> <code title="event-pageshow"><a href="#event-pageshow">pageshow</a></code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onpause"> <code title="">onpause</code>
|
|
<td> <a href="#handler-onpause" title="handler-onpause">HTML elements</a>
|
|
<td> <code title="event-media-pause"><a href="#event-media-pause">pause</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onplay"> <code title="">onplay</code>
|
|
<td> <a href="#handler-onplay" title="handler-onplay">HTML elements</a>
|
|
<td> <code title="event-media-play"><a href="#event-media-play">play</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onplaying"> <code title="">onplaying</code>
|
|
<td> <a href="#handler-onplaying" title="handler-onplaying">HTML elements</a>
|
|
<td> <code title="event-media-playing"><a href="#event-media-playing">playing</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onpopstate"> <code title="">onpopstate</code>
|
|
<td> <code title="handler-window-onpopstate"><a href="#handler-window-onpopstate">body</a></code>
|
|
<td> <code title="event-popstate"><a href="#event-popstate">popstate</a></code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onprogress"> <code title="">onprogress</code>
|
|
<td> <a href="#handler-onprogress" title="handler-onprogress">HTML elements</a>
|
|
<td> <code title="event-media-progress"><a href="#event-media-progress">progress</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onratechange"> <code title="">onratechange</code>
|
|
<td> <a href="#handler-onratechange" title="handler-onratechange">HTML elements</a>
|
|
<td> <code title="event-media-ratechange"><a href="#event-media-ratechange">ratechange</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onreadystatechange"> <code title="">onreadystatechange</code>
|
|
<td> <a href="#handler-onreadystatechange" title="handler-onreadystatechange">HTML elements</a>
|
|
<td> <code title="event-readystatechange"><a href="#event-readystatechange">readystatechange</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onredo"> <code title="">onredo</code>
|
|
<td> <code title="handler-window-onredo"><a href="#handler-window-onredo">body</a></code>
|
|
<td> <code title="event-redo">redo</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onreset"> <code title="">onreset</code>
|
|
<td> <a href="#handler-onreset" title="handler-onreset">HTML elements</a>
|
|
<td> <code title="event-reset">reset</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onresize"> <code title="">onresize</code>
|
|
<td> <code title="handler-window-onresize"><a href="#handler-window-onresize">body</a></code>
|
|
<td> <code title="event-resize">resize</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onscroll"> <code title="">onscroll</code>
|
|
<td> <code title="handler-window-onscroll"><a href="#handler-window-onscroll">body</a></code>
|
|
<td> <code title="event-scroll">scroll</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onscroll"> <code title="">onscroll</code>
|
|
<td> <a href="#handler-onscroll" title="handler-onscroll">HTML elements</a>
|
|
<td> <code title="event-scroll">scroll</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onseeked"> <code title="">onseeked</code>
|
|
<td> <a href="#handler-onseeked" title="handler-onseeked">HTML elements</a>
|
|
<td> <code title="event-media-seeked"><a href="#event-media-seeked">seeked</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onseeking"> <code title="">onseeking</code>
|
|
<td> <a href="#handler-onseeking" title="handler-onseeking">HTML elements</a>
|
|
<td> <code title="event-media-seeking"><a href="#event-media-seeking">seeking</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onselect"> <code title="">onselect</code>
|
|
<td> <a href="#handler-onselect" title="handler-onselect">HTML elements</a>
|
|
<td> <code title="event-select">select</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onshow"> <code title="">onshow</code>
|
|
<td> <a href="#handler-onshow" title="handler-onshow">HTML elements</a>
|
|
<td> <code title="event-show">show</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onstalled"> <code title="">onstalled</code>
|
|
<td> <a href="#handler-onstalled" title="handler-onstalled">HTML elements</a>
|
|
<td> <code title="event-media-stalled"><a href="#event-media-stalled">stalled</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onstorage"> <code title="">onstorage</code>
|
|
<td> <code title="handler-window-onstorage"><a href="#handler-window-onstorage">body</a></code>
|
|
<td> <code title="event-storage">storage</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onsubmit"> <code title="">onsubmit</code>
|
|
<td> <a href="#handler-onsubmit" title="handler-onsubmit">HTML elements</a>
|
|
<td> <code title="event-submit">submit</code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onsuspend"> <code title="">onsuspend</code>
|
|
<td> <a href="#handler-onsuspend" title="handler-onsuspend">HTML elements</a>
|
|
<td> <code title="event-media-suspend"><a href="#event-media-suspend">suspend</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-ontimeupdate"> <code title="">ontimeupdate</code>
|
|
<td> <a href="#handler-ontimeupdate" title="handler-ontimeupdate">HTML elements</a>
|
|
<td> <code title="event-media-timeupdate"><a href="#event-media-timeupdate">timeupdate</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onundo"> <code title="">onundo</code>
|
|
<td> <code title="handler-window-onundo"><a href="#handler-window-onundo">body</a></code>
|
|
<td> <code title="event-undo">undo</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-window-onunload"> <code title="">onunload</code>
|
|
<td> <code title="handler-window-onunload"><a href="#handler-window-onunload">body</a></code>
|
|
<td> <code title="event-unload">unload</code> event handler for <code><a href="#window">Window</a></code> object
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onvolumechange"> <code title="">onvolumechange</code>
|
|
<td> <a href="#handler-onvolumechange" title="handler-onvolumechange">HTML elements</a>
|
|
<td> <code title="event-media-volumechange"><a href="#event-media-volumechange">volumechange</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
<tr><th id="ix-handler-onwaiting"> <code title="">onwaiting</code>
|
|
<td> <a href="#handler-onwaiting" title="handler-onwaiting">HTML elements</a>
|
|
<td> <code title="event-media-waiting"><a href="#event-media-waiting">waiting</a></code> event handler
|
|
<td> <a href="#event-handler-content-attributes" title="event handler content attributes">Event handler content attribute</a>
|
|
|
|
</table><h3 class="no-num" id="interfaces">Interfaces</h3><p><i>This section is non-normative.</i><table><caption>List of interfaces for elements</caption>
|
|
<thead><tr><th> Element(s)
|
|
<th> Interface(s)
|
|
<tbody><tr><td> <code><a href="#the-a-element">a</a></code>
|
|
<td> <code><a href="#htmlanchorelement">HTMLAnchorElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-abbr-element">abbr</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-address-element">address</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-area-element">area</a></code>
|
|
<td> <code><a href="#htmlareaelement">HTMLAreaElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-article-element">article</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-aside-element">aside</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-audio-element">audio</a></code>
|
|
<td> <code><a href="#htmlaudioelement">HTMLAudioElement</a></code> : <code><a href="#htmlmediaelement">HTMLMediaElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-b-element">b</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-base-element">base</a></code>
|
|
<td> <code><a href="#htmlbaseelement">HTMLBaseElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-bdi-element">bdi</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-bdo-element">bdo</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-blockquote-element">blockquote</a></code>
|
|
<td> <code><a href="#htmlquoteelement">HTMLQuoteElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-body-element">body</a></code>
|
|
<td> <code><a href="#htmlbodyelement">HTMLBodyElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-br-element">br</a></code>
|
|
<td> <code><a href="#htmlbrelement">HTMLBRElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-button-element">button</a></code>
|
|
<td> <code><a href="#htmlbuttonelement">HTMLButtonElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-canvas-element">canvas</a></code>
|
|
<td> <code><a href="#htmlcanvaselement">HTMLCanvasElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-caption-element">caption</a></code>
|
|
<td> <code><a href="#htmltablecaptionelement">HTMLTableCaptionElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-cite-element">cite</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-code-element">code</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-col-element">col</a></code>
|
|
<td> <code><a href="#htmltablecolelement">HTMLTableColElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-colgroup-element">colgroup</a></code>
|
|
<td> <code><a href="#htmltablecolelement">HTMLTableColElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-command-element">command</a></code>
|
|
<td> <code><a href="#htmlcommandelement">HTMLCommandElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-datalist-element">datalist</a></code>
|
|
<td> <code><a href="#htmldatalistelement">HTMLDataListElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-dd-element">dd</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-del-element">del</a></code>
|
|
<td> <code><a href="#htmlmodelement">HTMLModElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-details-element">details</a></code>
|
|
<td> <code><a href="#htmldetailselement">HTMLDetailsElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-div-element">div</a></code>
|
|
<td> <code><a href="#htmldivelement">HTMLDivElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-dl-element">dl</a></code>
|
|
<td> <code><a href="#htmldlistelement">HTMLDListElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-dt-element">dt</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-em-element">em</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-embed-element">embed</a></code>
|
|
<td> <code><a href="#htmlembedelement">HTMLEmbedElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-fieldset-element">fieldset</a></code>
|
|
<td> <code><a href="#htmlfieldsetelement">HTMLFieldSetElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-figcaption-element">figcaption</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-figure-element">figure</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-footer-element">footer</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-form-element">form</a></code>
|
|
<td> <code><a href="#htmlformelement">HTMLFormElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-head-element">head</a></code>
|
|
<td> <code><a href="#htmlheadelement">HTMLHeadElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a></code>
|
|
<td> <code><a href="#htmlheadingelement">HTMLHeadingElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a></code>
|
|
<td> <code><a href="#htmlheadingelement">HTMLHeadingElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a></code>
|
|
<td> <code><a href="#htmlheadingelement">HTMLHeadingElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a></code>
|
|
<td> <code><a href="#htmlheadingelement">HTMLHeadingElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a></code>
|
|
<td> <code><a href="#htmlheadingelement">HTMLHeadingElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a></code>
|
|
<td> <code><a href="#htmlheadingelement">HTMLHeadingElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-header-element">header</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-hgroup-element">hgroup</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-hr-element">hr</a></code>
|
|
<td> <code><a href="#htmlhrelement">HTMLHRElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-html-element">html</a></code>
|
|
<td> <code><a href="#htmlhtmlelement">HTMLHtmlElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-i-element">i</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-iframe-element">iframe</a></code>
|
|
<td> <code><a href="#htmliframeelement">HTMLIFrameElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-img-element">img</a></code>
|
|
<td> <code><a href="#htmlimageelement">HTMLImageElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-input-element">input</a></code>
|
|
<td> <code><a href="#htmlinputelement">HTMLInputElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-ins-element">ins</a></code>
|
|
<td> <code><a href="#htmlmodelement">HTMLModElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-kbd-element">kbd</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-keygen-element">keygen</a></code>
|
|
<td> <code><a href="#htmlkeygenelement">HTMLKeygenElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-label-element">label</a></code>
|
|
<td> <code><a href="#htmllabelelement">HTMLLabelElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-legend-element">legend</a></code>
|
|
<td> <code><a href="#htmllegendelement">HTMLLegendElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-li-element">li</a></code>
|
|
<td> <code><a href="#htmllielement">HTMLLIElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-link-element">link</a></code>
|
|
<td> <code><a href="#htmllinkelement">HTMLLinkElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-map-element">map</a></code>
|
|
<td> <code><a href="#htmlmapelement">HTMLMapElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-mark-element">mark</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-meter-element">meter</a></code>
|
|
<td> <code><a href="#htmlmeterelement">HTMLMeterElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-nav-element">nav</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-noscript-element">noscript</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-object-element">object</a></code>
|
|
<td> <code><a href="#htmlobjectelement">HTMLObjectElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-ol-element">ol</a></code>
|
|
<td> <code><a href="#htmlolistelement">HTMLOListElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-optgroup-element">optgroup</a></code>
|
|
<td> <code><a href="#htmloptgroupelement">HTMLOptGroupElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-option-element">option</a></code>
|
|
<td> <code><a href="#htmloptionelement">HTMLOptionElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-output-element">output</a></code>
|
|
<td> <code><a href="#htmloutputelement">HTMLOutputElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-p-element">p</a></code>
|
|
<td> <code><a href="#htmlparagraphelement">HTMLParagraphElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-param-element">param</a></code>
|
|
<td> <code><a href="#htmlparamelement">HTMLParamElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-pre-element">pre</a></code>
|
|
<td> <code><a href="#htmlpreelement">HTMLPreElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-progress-element">progress</a></code>
|
|
<td> <code><a href="#htmlprogresselement">HTMLProgressElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-q-element">q</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-rp-element">rp</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-rt-element">rt</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-ruby-element">ruby</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-s-element">s</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-samp-element">samp</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-section-element">section</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-select-element">select</a></code>
|
|
<td> <code><a href="#htmlselectelement">HTMLSelectElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-small-element">small</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-source-element">source</a></code>
|
|
<td> <code><a href="#htmlsourceelement">HTMLSourceElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-span-element">span</a></code>
|
|
<td> <code><a href="#htmlspanelement">HTMLSpanElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-strong-element">strong</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-style-element">style</a></code>
|
|
<td> <code><a href="#htmlstyleelement">HTMLStyleElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-sub-and-sup-elements">sub</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-summary-element">summary</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-sub-and-sup-elements">sup</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-table-element">table</a></code>
|
|
<td> <code><a href="#htmltableelement">HTMLTableElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-tbody-element">tbody</a></code>
|
|
<td> <code><a href="#htmltablesectionelement">HTMLTableSectionElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-td-element">td</a></code>
|
|
<td> <code><a href="#htmltabledatacellelement">HTMLTableDataCellElement</a></code> : <code><a href="#htmltablecellelement">HTMLTableCellElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-textarea-element">textarea</a></code>
|
|
<td> <code><a href="#htmltextareaelement">HTMLTextAreaElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-tfoot-element">tfoot</a></code>
|
|
<td> <code><a href="#htmltablesectionelement">HTMLTableSectionElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-th-element">th</a></code>
|
|
<td> <code><a href="#htmltableheadercellelement">HTMLTableHeaderCellElement</a></code> : <code><a href="#htmltablecellelement">HTMLTableCellElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-thead-element">thead</a></code>
|
|
<td> <code><a href="#htmltablesectionelement">HTMLTableSectionElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-time-element">time</a></code>
|
|
<td> <code><a href="#htmltimeelement">HTMLTimeElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-title-element">title</a></code>
|
|
<td> <code><a href="#htmltitleelement">HTMLTitleElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-tr-element">tr</a></code>
|
|
<td> <code><a href="#htmltablerowelement">HTMLTableRowElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-track-element">track</a></code>
|
|
<td> <code><a href="#htmltrackelement">HTMLTrackElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-u-element">u</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-ul-element">ul</a></code>
|
|
<td> <code><a href="#htmlulistelement">HTMLUListElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-var-element">var</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-video-element">video</a></code>
|
|
<td> <code><a href="#htmlvideoelement">HTMLVideoElement</a></code> : <code><a href="#htmlmediaelement">HTMLMediaElement</a></code> : <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
<tr><td> <code><a href="#the-wbr-element">wbr</a></code>
|
|
<td> <code><a href="#htmlelement">HTMLElement</a></code>
|
|
|
|
</table><h3 class="no-num" id="events-0">Events</h3><p><i>This section is non-normative.</i><table><caption>List of events</caption>
|
|
<thead><tr><th> Event
|
|
<th> Interface
|
|
<th> Description
|
|
<tbody><tr><td> <code title="event-DOMContentLoaded">DOMContentLoaded</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#document">Document</a></code> once it and its scripts have loaded, without waiting for other subresources
|
|
|
|
<tr><td> <code title="event-abort">abort</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the download was aborted by the user
|
|
|
|
<tr><td> <code title="event-afterprint">afterprint</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> after printing
|
|
|
|
<tr><td> <code title="event-beforeprint">beforeprint</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> before printing
|
|
|
|
<tr><td> <code title="event-beforeunload">beforeunload</code>
|
|
<td> <code><a href="#beforeunloadevent">BeforeUnloadEvent</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the page is about to be unloaded, in case the page would like to show a warning prompt
|
|
|
|
<tr><td> <code title="event-blur">blur</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at nodes losing focus
|
|
|
|
<tr><td> <code title="event-change">change</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at controls when the user commits a value change
|
|
|
|
<tr><td> <code title="event-click"><a href="#event-click">click</a></code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at an element before its <a href="#activation-behavior">activation behavior</a> is run
|
|
|
|
<tr><td> <code title="event-contextmenu">contextmenu</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at elements when the user requests their context menu
|
|
|
|
<tr><td> <code title="event-error">error</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at elements when network and script errors occur
|
|
|
|
<tr><td> <code title="event-focus">focus</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at nodes gaining focus
|
|
|
|
<tr><td> <code title="event-hashchange"><a href="#event-hashchange">hashchange</a></code>
|
|
<td> <code><a href="#hashchangeevent">HashChangeEvent</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the fragment identifier part of <a href="#the-document-s-current-address">the document's current address</a> changes
|
|
|
|
<tr><td> <code title="event-input">input</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at controls when the user changes the value
|
|
|
|
<tr><td> <code title="event-invalid">invalid</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at controls during form validation if they do not satisfy their constraints
|
|
|
|
<tr><td> <code title="event-load">load</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the document has finished loading; fired at an element containing a resource (e.g. <code><a href="#the-img-element">img</a></code>, <code><a href="#the-embed-element">embed</a></code>) when its resource has finished loading
|
|
|
|
<tr><td> <code title="event-message">message</code>
|
|
<td> <code>MessageEvent</code>
|
|
<td> Fired at an object when the object receives a message
|
|
|
|
<tr><td> <code title="event-offline"><a href="#event-offline">offline</a></code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the network connections fails
|
|
|
|
<tr><td> <code title="event-online"><a href="#event-online">online</a></code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the network connections returns
|
|
|
|
<tr><td> <code title="event-pagehide"><a href="#event-pagehide">pagehide</a></code>
|
|
<td> <code><a href="#pagetransitionevent">PageTransitionEvent</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the page's entry in the <a href="#session-history">session history</a> stops being the <a href="#current-entry">current entry</a>
|
|
|
|
<tr><td> <code title="event-pageshow"><a href="#event-pageshow">pageshow</a></code>
|
|
<td> <code><a href="#pagetransitionevent">PageTransitionEvent</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the page's entry in the <a href="#session-history">session history</a> becomes the <a href="#current-entry">current entry</a>
|
|
|
|
<tr><td> <code title="event-popstate"><a href="#event-popstate">popstate</a></code>
|
|
<td> <code><a href="#popstateevent">PopStateEvent</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> when the user navigates the <a href="#session-history">session history</a>
|
|
|
|
<tr><td> <code title="event-readystatechange"><a href="#event-readystatechange">readystatechange</a></code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#document">Document</a></code> when it finishes parsing and again when all its subresources have finished loading
|
|
|
|
|
|
<tr><td> <code title="event-reset">reset</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at a <code><a href="#the-form-element">form</a></code> element when it is <a href="#concept-form-reset" title="concept-form-reset">reset</a>
|
|
|
|
<tr><td> <code title="event-show">show</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at a <code><a href="#the-menu-element">menu</a></code> element when it is shown as a context menu
|
|
|
|
<tr><td> <code title="event-submit">submit</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at a <code><a href="#the-form-element">form</a></code> element when it is <a href="#concept-form-submit" title="concept-form-submit">submitted</a>
|
|
|
|
|
|
<tr><td> <code title="event-unload">unload</code>
|
|
<td> <code><a href="#event">Event</a></code>
|
|
<td> Fired at the <code><a href="#window">Window</a></code> object when the page is going away
|
|
|
|
</table><p class="note">See also <a href="#mediaevents">media element
|
|
events</a>, <a href="#appcacheevents">application cache events</a>,
|
|
and <a href="#dndevents">drag-and-drop events</a>.<h2 class="no-num" id="references">References</h2><p>All references are normative unless marked "Non-normative".</p><dl><dt id="refsABNF">[ABNF]</dt>
|
|
<dd><cite><a href="http://www.ietf.org/rfc/std/std68.txt">Augmented
|
|
BNF for Syntax Specifications: ABNF</a></cite>, D. Crocker,
|
|
P. Overell. IETF.</dd>
|
|
|
|
<dt id="refsABOUT">[ABOUT]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/draft-holsten-about-uri-scheme">The
|
|
'about' URI scheme</a></cite>, J. Holsten, L. Hunt. IETF.</dd>
|
|
|
|
<dt id="refsARIA">[ARIA]</dt>
|
|
<dd><cite><a href="http://www.w3.org/WAI/PF/aria/">Accessible Rich
|
|
Internet Applications (WAI-ARIA)</a></cite>, J. Craig, M. Cooper, L. Pappas,
|
|
R. Schwerdtfeger, L. Seeman. W3C.</dd>
|
|
|
|
<dt id="refsARIAIMPL">[ARIAIMPL]</dt>
|
|
<dd><cite><a href="http://www.w3.org/WAI/PF/aria-implementation/">WAI-ARIA 1.0
|
|
User Agent Implementation Guide</a></cite>, A. Snow-Weaver,
|
|
M. Cooper. W3C.</dd>
|
|
|
|
<dt id="refsATAG">[ATAG]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.w3.org/TR/ATAG20/">Authoring Tool Accessibility
|
|
Guidelines (ATAG) 2.0</a></cite>, J. Richards, J. Spellman,
|
|
J. Treviranus. W3C.</dd>
|
|
|
|
<dt id="refsATOM">[ATOM]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://tools.ietf.org/html/rfc4287">The Atom Syndication
|
|
Format</a></cite>, M. Nottingham, R. Sayre. IETF.</dd>
|
|
|
|
<dt id="refsBCP47">[BCP47]</dt>
|
|
<dd><cite><a href="http://www.ietf.org/rfc/bcp/bcp47.txt">Tags for
|
|
Identifying Languages; Matching of Language Tags</a></cite>,
|
|
A. Phillips, M. Davis. IETF.</dd>
|
|
|
|
<dt id="refsBECSS">[BECSS]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/becss/">Behavioral
|
|
Extensions to CSS</a></cite>, I. Hickson. W3C.</dd>
|
|
|
|
<dt id="refsBIDI">[BIDI]</dt>
|
|
<dd><cite><a href="http://www.unicode.org/reports/tr9/">UAX #9: Unicode
|
|
Bidirectional Algorithm</a></cite>, M. Davis. Unicode Consortium.</dd>
|
|
|
|
<dt id="refsBOCU1">[BOCU1]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.unicode.org/notes/tn6/">UTN #6: BOCU-1:
|
|
MIME-Compatible Unicode Compression</a></cite>, M. Scherer,
|
|
M. Davis. Unicode Consortium.</dd>
|
|
|
|
<dt id="refsCESU8">[CESU8]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.unicode.org/reports/tr26/">UTR #26: Compatibility
|
|
Encoding Scheme For UTF-16: 8-BIT (CESU-8)</a></cite>,
|
|
T. Phipps. Unicode Consortium.</dd>
|
|
|
|
<dt id="refsCHARMOD">[CHARMOD]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.w3.org/TR/charmod/">Character Model for the World
|
|
Wide Web 1.0: Fundamentals</a></cite>, M. Dürst, F. Yergeau,
|
|
R. Ishida, M. Wolf, T. Texin. W3C.</dd>
|
|
|
|
<dt id="refsCOMPUTABLE">[COMPUTABLE]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.turingarchive.org/browse.php/B/12">On computable
|
|
numbers, with an application to the
|
|
Entscheidungsproblem</a></cite>, A. Turing. In <cite>Proceedings of
|
|
the London Mathematical Society</cite>, series 2, volume 42, pages
|
|
230-265. London Mathematical Society, 1937.</dd>
|
|
|
|
<dt id="refsCOOKIES">[COOKIES]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/draft-ietf-httpstate-cookie">HTTP State
|
|
Management Mechanism</a></cite>, A. Barth. IETF.</dd>
|
|
|
|
<dt id="refsCORS">[CORS]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/2006/waf/access-control/">Cross-Origin
|
|
Resource Sharing</a></cite>, A. van Kesteren. W3C.</dd>
|
|
|
|
<dt id="refsCP51932">[CP51932]</dt>
|
|
<dd><cite><a href="http://www.iana.org/assignments/charset-reg/CP51932">CP51932</a></cite>,
|
|
Y. Naruse. IANA.</dd>
|
|
<dt id="refsCSS">[CSS]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/CSS/">Cascading Style Sheets Level 2
|
|
Revision 1</a></cite>, B. Bos, T. Çelik, I.
|
|
Hickson, H. Lie. W3C.</dd>
|
|
|
|
<dt id="refsCSSATTR">[CSSATTR]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/csswg/css-style-attr/">CSS
|
|
Styling Attribute Syntax</a></cite>, E. Etemad. W3C.</dd>
|
|
|
|
<dt id="refsCSSCOLOR">[CSSCOLOR]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/csswg/css3-color/">CSS Color
|
|
Module Level 3</a></cite>, T. Çelik, C. Lilley, L.
|
|
Baron. W3C.</dd>
|
|
|
|
<dt id="refsCSSFONTS">[CSSFONTS]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/css3-fonts/">CSS Fonts
|
|
Module Level 3</a></cite>, J. Daggett. W3C.</dd>
|
|
|
|
<dt id="refsCSSOM">[CSSOM]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/csswg/cssom/">Cascading Style Sheets
|
|
Object Model (CSSOM)</a></cite>, A. van Kesteren. W3C.</dd>
|
|
|
|
<dt id="refsCSSOMVIEW">[CSSOMVIEW]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/csswg/cssom-view/">CSSOM View
|
|
Module</a></cite>, A. van Kesteren. W3C.</dd>
|
|
|
|
<dt id="refsCSSRUBY">[CSSRUBY]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/csswg/css3-ruby/">CSS3 Ruby
|
|
Module</a></cite>, R. Ishida. W3C.</dd>
|
|
|
|
<dt id="refsCSSUI">[CSSUI]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/csswg/css3-ui/">CSS3 Basic User
|
|
Interface Module</a></cite>, T. Çelik. W3C.</dd>
|
|
|
|
<dt id="refsCSSVALUES">[CSSVALUES]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/csswg/css3-values/">CSS3
|
|
Values and Units</a></cite>, H. Lie, C. Lilley. W3C.</dd>
|
|
|
|
<dt id="refsDOMCORE">[DOMCORE]</dt>
|
|
<dd><cite><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html">Web DOM Core</a></cite>, A. van Kesteren. W3C.</dd>
|
|
|
|
<dt id="refsDOMEVENTS">[DOMEVENTS]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html">Document
|
|
Object Model (DOM) Level 3 Events Specification</a></cite>,
|
|
D. Schepers. W3C.</dd>
|
|
|
|
<dt id="refsDOMPARSER">[DOMPARSER]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://html5.org/specs/dom-parsing.html">DOM Parsing and Serialization</a></cite>, Ms2ger. html5.org.</dd>
|
|
|
|
<dt id="refsECMA262">[ECMA262]</dt>
|
|
<dd><cite><a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMAScript
|
|
Language Specification</a></cite>. ECMA.</dd>
|
|
|
|
<dt id="refsECMA357">[ECMA357]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.ecma-international.org/publications/standards/Ecma-357.htm">ECMAScript
|
|
for XML (E4X) Specification</a></cite>. ECMA.</dd>
|
|
|
|
<dt id="refsEUCKR">[EUCKR]</dt>
|
|
<dd><cite>Hangul Unix Environment</cite>. Korea Industrial
|
|
Standards Association. Ref. No. KS C 5861-1992.</dd>
|
|
|
|
<dt id="refsEUCJP">[EUCJP]</dt>
|
|
<dd><cite>Definition and Notes of Japanese EUC</cite>. UI-OSF-USLP. In English in the abridged translation of the <a href="http://home.m05.itscom.net/numa/uocjleE.pdf">UI-OSF Application Platform Profile for Japanese Environment</a>, Appendix C.</dd>
|
|
|
|
<dt id="refsFILEAPI">[FILEAPI]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/2006/webapi/FileUpload/publish/FileAPI.html">File
|
|
API</a></cite>, A. Ranganathan. W3C.</dd>
|
|
|
|
<dt id="refsFILESYSTEMAPI">[FILESYSTEMAPI]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/2009/dap/file-system/file-dir-sys.html">File
|
|
API: Directories and System</a></cite>, E. Uhrhane. W3C.</dd>
|
|
|
|
<dt id="refsGBK">[GBK]</dt>
|
|
<dd><cite>Chinese Internal Code Specification</cite>. Chinese IT
|
|
Standardization Technical Committee.</dd>
|
|
|
|
|
|
<dt id="refsGRAPHICS">[GRAPHICS]</dt>
|
|
<dd>(Non-normative) <cite>Computer Graphics: Principles and
|
|
Practice in C</cite>, Second Edition, J. Foley, A. van Dam,
|
|
S. Feiner, J. Hughes. Addison-Wesley. ISBN
|
|
0-201-84840-6.</dd>
|
|
|
|
<dt id="refsGREGORIAN">[GREGORIAN]</dt>
|
|
<dd>(Non-normative) <cite>Inter Gravissimas</cite>, A. Lilius,
|
|
C. Clavius. Gregory XIII Papal Bulls, February 1582.</dd>
|
|
|
|
<dt id="refsHPAAIG">[HPAAIG]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/html5/html-api-map/overview.html">HTML to Platform Accessibility APIs Implementation Guide</a></cite>. W3C.</dd>
|
|
|
|
<dt id="refsHTMLALTTECHS">[HTMLALTTECHS]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://dev.w3.org/html5/alt-techniques/">HTML5: Techniques for providing useful text alternatives</a></cite>, S. Faulkner. W3C.</dd>
|
|
|
|
<dt id="refsHTMLDIFF">[HTMLDIFF]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://dev.w3.org/html5/html4-differences/">HTML5
|
|
differences from HTML4</a></cite>, A. van Kesteren. W3C.</dd>
|
|
|
|
<dt id="refsHTTP">[HTTP]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2616">Hypertext
|
|
Transfer Protocol — HTTP/1.1</a></cite>, R. Fielding, J. Gettys,
|
|
J. Mogul, H. Frystyk, L. Masinter, P. Leach, T. Berners-Lee. IETF.</dd>
|
|
|
|
<dt id="refsIANACHARSET">[IANACHARSET]</dt>
|
|
<dd><cite><a href="http://www.iana.org/assignments/character-sets">Character
|
|
Sets</a></cite>. IANA.</dd>
|
|
|
|
<dt id="refsIANAPERMHEADERS">[IANAPERMHEADERS]</dt>
|
|
<dd><cite><a href="http://www.iana.org/assignments/message-headers/perm-headers.html">Permanent
|
|
Message Header Field Names</a></cite>. IANA.</dd>
|
|
|
|
<dt id="refsISO8601">[ISO8601]</dt>
|
|
<dd><cite><a href="http://isotc.iso.org/livelink/livelink/4021199/ISO_8601_2004_E.zip?func=doc.Fetch&nodeid=4021199">ISO8601: Data elements and interchange formats — Information interchange — Representation of dates and times</a></cite>. ISO.</dd>
|
|
|
|
<dt id="refsISO885911">[ISO885911]</dt>
|
|
<dd><cite><a href="http://anubis.dkuug.dk/jtc1/sc2/open/02n3333.pdf">ISO-8859-11:
|
|
Information technology — 8-bit single-byte coded graphic
|
|
character sets — Part 11: Latin/Thai
|
|
alphabet</a></cite>. ISO.</dd>
|
|
|
|
<dt id="refsJPEG">[JPEG]</dt>
|
|
<dd><cite><a href="http://www.w3.org/Graphics/JPEG/jfif3.pdf">JPEG File Interchange Format</a></cite>, E. Hamilton.</dd>
|
|
|
|
<dt id="refsJSURL">[JSURL]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/draft-hoehrmann-javascript-scheme">The
|
|
'javascript' resource identifier scheme</a></cite>,
|
|
B. Höhrmann. IETF.</dd>
|
|
|
|
<dt id="refsMAILTO">[MAILTO]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2368">The mailto URL
|
|
scheme</a></cite>, P. Hoffman, L. Masinter, J. Zawinski.
|
|
IETF.</dd>
|
|
|
|
<dt id="refsMATHML">[MATHML]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/MathML/">Mathematical
|
|
Markup Language (MathML)</a></cite>, D. Carlisle, P. Ion, R. Miner,
|
|
N. Poppelier. W3C.</dd>
|
|
|
|
<dt id="refsMEDIAFRAG">[MEDIAFRAG]</dt>
|
|
<dd><cite><a href="http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/">Media
|
|
Fragments URI</a></cite>, R. Troncy, E. Mannens, S. Pfeiffer, D.
|
|
Van Deursen. W3C.</dd>
|
|
|
|
<dt id="refsMFREL">[MFREL]</dt>
|
|
<dd><cite><a href="http://microformats.org/wiki/existing-rel-values">Microformats Wiki: existing rel values</a></cite>. Microformats.</dd>
|
|
|
|
<dt id="refsMIMESNIFF">[MIMESNIFF]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/draft-abarth-mime-sniff">Media
|
|
Type Sniffing</a></cite>, A. Barth, I. Hickson. IETF.</dd>
|
|
|
|
<dt id="refsMQ">[MQ]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/csswg/css3-mediaqueries/">Media
|
|
Queries</a></cite>, H. Lie, T. Çelik, D. Glazman, A. van
|
|
Kesteren. W3C.</dd>
|
|
|
|
<dt id="refsNPAPI">[NPAPI]</dt>
|
|
<dd>(Non-normative) <cite><a href="https://developer.mozilla.org/en/Gecko_Plugin_API_Reference">Gecko
|
|
Plugin API Reference</a></cite>. Mozilla.</dd>
|
|
|
|
<dt id="refsOPENSEARCH">[OPENSEARCH]</dt>
|
|
<dd><cite><a href="http://www.opensearch.org/Specifications/OpenSearch/1.1#Autodiscovery_in_HTML.2FXHTML">Autodiscovery
|
|
in HTML/XHTML</a></cite>. In <cite>OpenSearch 1.1 Draft 4</cite>,
|
|
Section 4.6.2. OpenSearch.org.</dd>
|
|
|
|
<dt id="refsORIGIN">[ORIGIN]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/draft-ietf-websec-origin">The Web Origin Concept</a></cite>, A. Barth. IETF.</dd>
|
|
|
|
<dt id="refsPINGBACK">[PINGBACK]</dt>
|
|
<dd><cite><a href="http://www.hixie.ch/specs/pingback/pingback">Pingback
|
|
1.0</a></cite>, S. Langridge, I. Hickson.</dd>
|
|
|
|
<dt id="refsPNG">[PNG]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/PNG/">Portable Network
|
|
Graphics (PNG) Specification</a></cite>, D. Duce. W3C.</dd>
|
|
|
|
<dt id="refsPOLYGLOT">[POLYGLOT]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://dev.w3.org/html5/html-xhtml-author-guide/html-xhtml-authoring-guide.html">Polyglot
|
|
Markup: HTML-Compatible XHTML Documents</a></cite>, E. Graff.
|
|
W3C.</dd>
|
|
|
|
<dt id="refsPPUTF8">[PPUTF8]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.ifi.uzh.ch/mml/mduerst/papers/PDF/IUC11-UTF-8.pdf">The
|
|
Properties and Promises of
|
|
UTF-8</a></cite>, M. Dürst. University of Zürich. In <cite>Proceedings of the 11th International
|
|
Unicode Conference</cite>.</dd>
|
|
|
|
<dt id="refsPROGRESS">[PROGRESS]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/2006/webapi/progress/">Progress
|
|
Events</a></cite>, A. van Kesteren. W3C.</dd>
|
|
|
|
<dt id="refsPSL">[PSL]</dt>
|
|
<dd><cite><a href="http://publicsuffix.org/">Public Suffix List</a></cite>.
|
|
Mozilla Foundation.</dd>
|
|
|
|
<dt id="refsRFC1034">[RFC1034]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc1034">Domain
|
|
Names - Concepts and Facilities</a></cite>, P. Mockapetris. IETF,
|
|
November 1987.</dd>
|
|
|
|
<dt id="refsRFC1345">[RFC1345]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc1345">Character Mnemonics
|
|
and Character Sets</a></cite>, K. Simonsen. IETF.</dd>
|
|
|
|
<dt id="refsRFC1468">[RFC1468]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc1468">Japanese Character
|
|
Encoding for Internet Messages</a></cite>, J. Murai, M. Crispin, E. van der
|
|
Poel. IETF.</dd>
|
|
|
|
<dt id="refsRFC1554">[RFC1554]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc1554">ISO-2022-JP-2:
|
|
Multilingual Extension of ISO-2022-JP</a></cite>, M. Ohta, K. Handa. IETF.</dd>
|
|
|
|
<dt id="refsRFC1557">[RFC1557]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc1557">Korean Character
|
|
Encoding for Internet Messages</a></cite>, U. Choi, K. Chon, H. Park. IETF.</dd>
|
|
|
|
<dt id="refsRFC1842">[RFC1842]</dt>
|
|
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc1842">ASCII
|
|
Printable Characters-Based Chinese Character Encoding for Internet
|
|
Messages</a></cite>, Y. Wei, Y. Zhang, J. Li, J. Ding, Y. Jiang.
|
|
IETF.</dd>
|
|
|
|
<dt id="refsRFC1922">[RFC1922]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc1922">Chinese Character
|
|
Encoding for Internet Messages</a></cite>, HF. Zhu, DY. Hu, ZG. Wang, TC. Kao,
|
|
WCH. Chang, M. Crispin. IETF.</dd>
|
|
|
|
<dt id="refsRFC2046">[RFC2046]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2046">Multipurpose Internet
|
|
Mail Extensions (MIME) Part Two: Media Types</a></cite>, N. Freed,
|
|
N. Borenstein. IETF.</dd>
|
|
<dt id="refsRFC2119">[RFC2119]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2119">Key words for use in
|
|
RFCs to Indicate Requirement Levels</a></cite>, S. Bradner. IETF.</dd>
|
|
|
|
<dt id="refsRFC2237">[RFC2237]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2237">Japanese Character
|
|
Encoding for Internet Messages</a></cite>, K. Tamaru. IETF.</dd>
|
|
|
|
<dt id="refsRFC2313">[RFC2313]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2313">PKCS #1:
|
|
RSA Encryption</a></cite>, B. Kaliski. IETF.</dd>
|
|
|
|
<dt id="refsRFC2318">[RFC2318]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2318">The
|
|
text/css Media Type</a></cite>, H. Lie, B. Bos, C. Lilley. IETF.</dd>
|
|
|
|
<dt id="refsRFC2388">[RFC2388]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2388">Returning Values from
|
|
Forms: multipart/form-data</a></cite>, L. Masinter. IETF.</dd>
|
|
|
|
<dt id="refsRFC2397">[RFC2397]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2397">The "data"
|
|
URL scheme</a></cite>, L. Masinter. IETF.</dd>
|
|
|
|
<dt id="refsRFC2425">[RFC2425]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2425">A MIME
|
|
Content-Type for Directory Information</a></cite>, T. Howes,
|
|
M. Smith, F. Dawson. IETF.</dd>
|
|
|
|
<dt id="refsRFC2426">[RFC2426]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2426">vCard MIME Directory
|
|
Profile</a></cite>, F. Dawson, T. Howes. IETF.</dd>
|
|
|
|
<dt id="refsRFC2483">[RFC2483]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2483">URI Resolution
|
|
Services Necessary for URN Resolution</a></cite>, M. Mealling, R. Daniel.
|
|
IETF.</dd>
|
|
|
|
<dt id="refsRFC2781">[RFC2781]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2781">UTF-16, an
|
|
encoding of ISO 10646</a></cite>, P. Hoffman, F. Yergeau. IETF.</dd>
|
|
|
|
<dt id="refsRFC3676">[RFC3676]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc3676">The Text/Plain Format
|
|
and DelSp Parameters</a></cite>, R. Gellens. IETF.</dd>
|
|
|
|
<dt id="refsRFC3023">[RFC3023]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc3023">XML Media
|
|
Types</a></cite>, M. Murata, S. St. Laurent, D. Kohn. IETF.</dd>
|
|
|
|
<dt id="refsRFC3279">[RFC3279]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc3279">Algorithms
|
|
and Identifiers for the Internet X.509 Public Key Infrastructure
|
|
Certificate and Certificate Revocation List (CRL)
|
|
Profile</a></cite>, W. Polk, R. Housley, L. Bassham. IETF.</dd>
|
|
|
|
<dt id="refsRFC3490">[RFC3490]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc3490">Internationalizing
|
|
Domain Names in Applications (IDNA)</a></cite>, P. Faltstrom, P. Hoffman, A.
|
|
Costello. IETF.</dd>
|
|
|
|
<dt id="refsRFC3629">[RFC3629]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc3629">UTF-8, a
|
|
transformation format of ISO 10646</a></cite>, F. Yergeau. IETF.</dd>
|
|
|
|
<dt id="refsRFC3986">[RFC3986]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc3986">Uniform Resource
|
|
Identifier (URI): Generic Syntax</a></cite>, T. Berners-Lee, R. Fielding, L.
|
|
Masinter. IETF.</dd>
|
|
|
|
<dt id="refsRFC3987">[RFC3987]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc3987">Internationalized
|
|
Resource Identifiers (IRIs)</a></cite>, M. Dürst, M. Suignard. IETF.</dd>
|
|
|
|
<dt id="refsRFC4281">[RFC4281]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc4281">The Codecs Parameter
|
|
for "Bucket" Media Types</a></cite>, R. Gellens, D. Singer, P. Frojdh. IETF.</dd>
|
|
|
|
<dt id="refsRFC4329">[RFC4329]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://tools.ietf.org/html/rfc4329">Scripting Media
|
|
Types</a></cite>, B. Höhrmann. IETF.</dd>
|
|
|
|
<dt id="refsRFC4648">[RFC4648]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc4648">The Base16,
|
|
Base32, and Base64 Data Encodings</a></cite>, S. Josefsson.
|
|
IETF.</dd>
|
|
|
|
<dt id="refsRFC5280">[RFC5280]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc5280">Internet
|
|
X.509 Public Key Infrastructure Certificate and Certificate
|
|
Revocation List (CRL) Profile</a></cite>, D. Cooper, S. Santesson,
|
|
S. Farrell, S. Boeyen, R. Housley, W. Polk. IETF.</dd>
|
|
|
|
<dt id="refsRFC5322">[RFC5322]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc5322">Internet Message
|
|
Format</a></cite>, P. Resnick. IETF.</dd>
|
|
|
|
<dt id="refsRFC5724">[RFC5724]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc5724">URI Scheme
|
|
for Global System for Mobile Communications (GSM) Short Message
|
|
Service (SMS)</a></cite>, E. Wilde, A. Vaha-Sipila. IETF.</dd>
|
|
|
|
<dt id="refsSCSU">[SCSU]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.unicode.org/reports/tr6/">UTR #6: A Standard
|
|
Compression Scheme For Unicode</a></cite>, M. Wolf, K. Whistler,
|
|
C. Wicksteed, M. Davis, A. Freytag, M. Scherer. Unicode Consortium.</dd>
|
|
|
|
<dt id="refsSELECTORS">[SELECTORS]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/css3-selectors">Selectors</a></cite>,
|
|
T. Çelik, E. Etemad, D. Glazman, I. Hickson, P. Linss,
|
|
J. Williams. W3C.</dd>
|
|
|
|
<dt id="refsSHIFTJIS">[SHIFTJIS]</dt>
|
|
<dd><cite>JIS X0208: 7-bit and 8-bit double byte coded KANJI sets
|
|
for information interchange</cite>. Japanese Industrial Standards Committee.</dd>
|
|
|
|
<dt id="refsSRGB">[SRGB]</dt>
|
|
<dd><cite lang="en-GB"><a href="http://webstore.iec.ch/webstore/webstore.nsf/artnum/025408!OpenDocument&Click=">IEC
|
|
61966-2-1: Multimedia systems and equipment — Colour measurement
|
|
and management — Part 2-1: Colour management — Default RGB colour
|
|
space — sRGB</a></cite>. IEC.</dd>
|
|
|
|
<dt id="refsSVG">[SVG]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/SVGTiny12/">Scalable Vector
|
|
Graphics (SVG) Tiny 1.2 Specification</a></cite>, O. Andersson,
|
|
R. Berjon, E. Dahlström, A. Emmons, J. Ferraiolo, A. Grasso,
|
|
V. Hardy, S. Hayman, D. Jackson, C. Lilley, C. McCormack,
|
|
A. Neumann, C. Northway, A. Quint, N. Ramani, D. Schepers,
|
|
A. Shellshear. W3C.</dd>
|
|
|
|
<dt id="refsTIS620">[TIS620]</dt>
|
|
<dd><cite><a href="http://www.nectec.or.th/it-standards/std620/std620.htm">UDC
|
|
681.3.04:003.62</a></cite>. Thai Industrial Standards Institute,
|
|
Ministry of Industry, Royal Thai Government. ISBN
|
|
974-606-153-4.</dd>
|
|
|
|
<dt id="refsUAAG">[UAAG]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.w3.org/TR/UAAG20/">Web Content Accessibility
|
|
Guidelines (UAAG) 2.0</a></cite>, J. Allan, K. Ford, J. Richards,
|
|
J. Spellman. W3C.</dd>
|
|
|
|
<dt id="refsUNICODE">[UNICODE]</dt>
|
|
<dd><cite><a href="http://www.unicode.org/versions/">The Unicode Standard</a></cite>. Unicode Consortium.</dd>
|
|
|
|
<dt id="refsUNIVCHARDET">[UNIVCHARDET]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html">A
|
|
composite approach to language/encoding
|
|
detection</a></cite>, S. Li, K. Momoi. Netscape. In
|
|
<cite>Proceedings of the 19th International Unicode
|
|
Conference</cite>.</dd>
|
|
|
|
<dt id="refsUTF7">[UTF7]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc2152">UTF-7: A
|
|
Mail-Safe Transformation Format of Unicode</a></cite>,
|
|
D. Goldsmith, M. Davis. IETF.</dd>
|
|
|
|
<dt id="refsUTF8DET">[UTF8DET]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.w3.org/International/questions/qa-forms-utf-8">Multilingual
|
|
form encoding</a></cite>, M. Dürst. W3C.</dd>
|
|
|
|
<dt id="refsUTR36">[UTR36]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.unicode.org/reports/tr36/">UTR #36: Unicode
|
|
Security Considerations</a></cite>, M. Davis, M. Suignard. Unicode
|
|
Consortium.</dd>
|
|
|
|
<dt id="refsWCAG">[WCAG]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.w3.org/TR/WCAG20/">Web Content Accessibility
|
|
Guidelines (WCAG) 2.0</a></cite>, B. Caldwell, M. Cooper, L. Reid,
|
|
G. Vanderheiden. W3C.</dd>
|
|
|
|
<dt id="refsWEBIDL">[WEBIDL]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/2006/webapi/WebIDL/">Web
|
|
IDL</a></cite>, C. McCormack. W3C.</dd>
|
|
|
|
<dt id="refsWEBLINK">[WEBLINK]</dt>
|
|
<dd><cite><a href="http://tools.ietf.org/html/rfc5988">Web
|
|
Linking</a></cite>, M. Nottingham. IETF.</dd>
|
|
|
|
<dt id="refsWEBSOCKET">[WEBSOCKET]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/html5/websockets/">The WebSocket
|
|
API</a></cite>, I. Hickson. W3C.</dd>
|
|
|
|
<dt id="refsWEBSTORAGE">[WEBSTORAGE]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/html5/webstorage/">Web
|
|
Storage</a></cite>, I. Hickson. W3C.</dd>
|
|
|
|
<dt id="refsWEBWORKERS">[WEBWORKERS]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/html5/workers/">Web
|
|
Workers</a></cite>, I. Hickson. W3C.</dd>
|
|
|
|
<dt id="refsWHATWGWIKI">[WHATWGWIKI]</dt>
|
|
<dd><cite><a href="http://wiki.whatwg.org/">The WHATWG Wiki</a></cite>. WHATWG.</dd>
|
|
|
|
<dt id="refsWIN1252">[WIN1252]</dt>
|
|
<dd><cite><a href="http://www.microsoft.com/globaldev/reference/sbcs/1252.htm">Windows 1252</a></cite>. Microsoft.</dd>
|
|
|
|
<dt id="refsWIN1254">[WIN1254]</dt>
|
|
<dd><cite><a href="http://www.microsoft.com/globaldev/reference/sbcs/1254.htm">Windows 1254</a></cite>. Microsoft.</dd>
|
|
|
|
<dt id="refsWIN31J">[WIN31J]</dt>
|
|
<dd><cite><a href="http://www.microsoft.com/globaldev/reference/dbcs/932.mspx">Windows Codepage 932</a></cite>. Microsoft.</dd>
|
|
|
|
<dt id="refsWIN874">[WIN874]</dt>
|
|
<dd><cite><a href="http://www.microsoft.com/globaldev/reference/sbcs/874.mspx">Windows 874</a></cite>. Microsoft.</dd>
|
|
|
|
<dt id="refsWIN949">[WIN949]</dt>
|
|
<dd><cite><a href="http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP949.TXT">Windows Codepage 949</a></cite>. Microsoft.</dd>
|
|
|
|
<dt id="refsX690">[X690]</dt>
|
|
<dd><cite><a href="http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf">Recommendation
|
|
X.690 — Information Technology — ASN.1 Encoding Rules —
|
|
Specification of Basic Encoding Rules (BER), Canonical Encoding
|
|
Rules (CER), and Distinguished Encoding Rules
|
|
(DER)</a></cite>. International Telecommunication Union.</dd>
|
|
|
|
<dt id="refsXHR">[XHR]</dt>
|
|
<dd><cite><a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/"><code>XMLHttpRequest</code></a></cite>,
|
|
A. van Kesteren. W3C.</dd>
|
|
|
|
<dt id="refsXML">[XML]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/xml/">Extensible Markup
|
|
Language</a></cite>, T. Bray, J. Paoli, C. Sperberg-McQueen,
|
|
E. Maler, F. Yergeau. W3C.</dd>
|
|
|
|
<dt id="refsXMLBASE">[XMLBASE]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/xmlbase/">XML
|
|
Base</a></cite>, J. Marsh, R. Tobin. W3C.</dd>
|
|
|
|
<dt id="refsXMLNS">[XMLNS]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/xml-names/">Namespaces in
|
|
XML</a></cite>, T. Bray, D. Hollander, A. Layman, R. Tobin. W3C.</dd>
|
|
|
|
<dt id="refsXPATH10">[XPATH10]</dt>
|
|
<dd><cite><a href="http://www.w3.org/TR/1999/REC-xpath-19991116">XML Path
|
|
Language (XPath) Version 1.0</a></cite>, J. Clark, S. DeRose. W3C.</dd>
|
|
|
|
<dt id="refsXSLT10">[XSLT10]</dt>
|
|
<dd>(Non-normative) <cite><a href="http://www.w3.org/TR/1999/REC-xslt-19991116">XSL
|
|
Transformations (XSLT) Version 1.0</a></cite>, J. Clark. W3C.</dd>
|
|
|
|
|
|
|
|
|
|
</dl><h2 class="no-num" id="acknowledgements">Acknowledgements</h2><!-- ACKS --><p>Thanks to Tim Berners-Lee for inventing HTML, without which none
|
|
of this would exist.<p>Thanks to
|
|
|
|
Aankhen,
|
|
Aaron Boodman,
|
|
Aaron Leventhal,
|
|
Adam Barth,
|
|
Adam de Boor,
|
|
Adam Hepton,
|
|
Adam Roben,
|
|
Addison Phillips,
|
|
Adele Peterson,
|
|
Adrian Bateman,
|
|
Adrian Sutton,
|
|
Agustín Fernández,
|
|
Ajai Tirumali,
|
|
Akatsuki Kitamura,
|
|
Alan Plum,
|
|
Alastair Campbell,
|
|
Alejandro G. Castro,
|
|
Alex Bishop,
|
|
Alex Nicolaou,
|
|
Alex Rousskov,
|
|
Alexander J. Vincent,
|
|
Alexey Feldgendler,
|
|
Алексей Проскуряков (Alexey Proskuryakov),
|
|
Alexis Deveria,
|
|
Allan Clements,
|
|
Amos Jeffries,
|
|
Anders Carlsson,
|
|
Andreas,
|
|
Andreas Kling,
|
|
Andrei Popescu,
|
|
André E. Veltstra,
|
|
Andrew Barfield,
|
|
Andrew Clover,
|
|
Andrew Gove,
|
|
Andrew Grieve,
|
|
Andrew Oakley,
|
|
Andrew Sidwell,
|
|
Andrew Smith,
|
|
Andrew W. Hagen,
|
|
Andrey V. Lukyanov,
|
|
Andy Heydon,
|
|
Andy Palay,
|
|
Anne van Kesteren,
|
|
Anthony Boyd,
|
|
Anthony Bryan,
|
|
Anthony Hickson,
|
|
Anthony Ricaud,
|
|
Antti Koivisto,
|
|
Arne Thomassen,
|
|
Aron Spohr,
|
|
Arphen Lin,
|
|
Aryeh Gregor,
|
|
Asbjørn Ulsberg,
|
|
Ashley Sheridan,
|
|
Atsushi Takayama,
|
|
Aurelien Levy,
|
|
Ave Wrigley,
|
|
Ben Boyle,
|
|
Ben Godfrey,
|
|
Ben Lerner,
|
|
Ben Leslie,
|
|
Ben Meadowcroft,
|
|
Ben Millard,
|
|
Benjamin Carl Wiley Sittler,
|
|
Benjamin Hawkes-Lewis,
|
|
Bert Bos,
|
|
Bijan Parsia,
|
|
Bil Corry,
|
|
Bill Mason,
|
|
Bill McCoy,
|
|
Billy Wong,
|
|
Bjartur Thorlacius,
|
|
Björn Höhrmann,
|
|
Blake Frantz,
|
|
Boris Zbarsky,
|
|
Brad Fults,
|
|
Brad Neuberg,
|
|
Brad Spencer,
|
|
Brady Eidson,
|
|
Brendan Eich,
|
|
Brenton Simpson,
|
|
Brett Wilson,
|
|
Brett Zamir,
|
|
Brian Campbell,
|
|
Brian Korver,
|
|
Brian Kuhn,
|
|
Brian Ryner,
|
|
Brian Smith,
|
|
Brian Wilson,
|
|
Bryan Sullivan,
|
|
Bruce D'Arcus,
|
|
Bruce Lawson,
|
|
Bruce Miller,
|
|
C. Williams,
|
|
Cameron McCormack,
|
|
Cao Yipeng,
|
|
Carlos Gabriel Cardona,
|
|
Carlos Perelló Marín,
|
|
Chao Cai,
|
|
윤석찬 (Channy Yun),
|
|
Charl van Niekerk,
|
|
Charles Iliya Krempeaux,
|
|
Charles McCathieNevile,
|
|
Chris Apers,
|
|
Chris Cressman,
|
|
Chris Evans,
|
|
Chris Morris,
|
|
Chris Pearce,
|
|
Christian Biesinger,
|
|
Christian Johansen,
|
|
Christian Schmidt,
|
|
Christopher Aillon,
|
|
Chriswa,
|
|
Clark Buehler,
|
|
Cole Robison,
|
|
Colin Fine,
|
|
Collin Jackson,
|
|
Corprew Reed,
|
|
Craig Cockburn,
|
|
Csaba Gabor,
|
|
Csaba Marton,
|
|
Cynthia Shelly,
|
|
Dan Yoder,
|
|
Daniel Barclay,
|
|
Daniel Bratell,
|
|
Daniel Brooks,
|
|
Daniel Brumbaugh Keeney,
|
|
Daniel Cheng,
|
|
Daniel Davis,
|
|
Daniel Glazman,
|
|
Daniel Peng,
|
|
Daniel Schattenkirchner,
|
|
Daniel Spång,
|
|
Daniel Steinberg,
|
|
Danny Sullivan,
|
|
Darin Adler,
|
|
Darin Fisher,
|
|
Darxus,
|
|
Dave Camp,
|
|
Dave Hodder,
|
|
Dave Lampton,
|
|
Dave Singer,
|
|
Dave Townsend,
|
|
David Baron,
|
|
David Bloom,
|
|
David Bruant,
|
|
David Carlisle,
|
|
David E. Cleary,
|
|
David Egan Evans,
|
|
David Flanagan,
|
|
David Gerard,
|
|
David Håsäther,
|
|
David Hyatt,
|
|
David I. Lehn,
|
|
David John Burrowes,
|
|
David Matja,
|
|
David Remahl,
|
|
David Smith,
|
|
David Woolley,
|
|
DeWitt Clinton,
|
|
Dean Edridge,
|
|
Dean Edwards,
|
|
Debi Orton,
|
|
Derek Featherstone,
|
|
Devdatta,
|
|
Dimitri Glazkov,
|
|
Dimitry Golubovsky,
|
|
Dirk Pranke,
|
|
Divya Manian,
|
|
Dmitry Titov,
|
|
dolphinling,
|
|
Dominique Hazaël-Massieux,
|
|
Don Brutzman,
|
|
Doron Rosenberg,
|
|
Doug Kramer,
|
|
Doug Simpkinson,
|
|
Drew Wilson,
|
|
Edmund Lai,
|
|
Eduard Pascual,
|
|
Eduardo Vela,
|
|
Edward O'Connor,
|
|
Edward Welbourne,
|
|
Edward Z. Yang,
|
|
Eira Monstad,
|
|
Eitan Adler,
|
|
Eliot Graff,
|
|
Elizabeth Castro,
|
|
Elliott Sprehn,
|
|
Elliotte Harold,
|
|
Eric Carlson,
|
|
Eric Law,
|
|
Eric Rescorla,
|
|
Eric Semling,
|
|
Erik Arvidsson,
|
|
Erik Rose,
|
|
Evan Martin,
|
|
Evan Prodromou,
|
|
Evert,
|
|
fantasai,
|
|
Felix Sasaki,
|
|
Francesco Schwarz,
|
|
Francis Brosnan Blazquez,
|
|
Franck 'Shift' Quélain,
|
|
Frank Barchard,
|
|
鵜飼文敏 (Fumitoshi Ukai),
|
|
Futomi Hatano,
|
|
Gavin Carothers,
|
|
Gareth Rees,
|
|
Garrett Smith,
|
|
Geoffrey Garen,
|
|
Geoffrey Sneddon,
|
|
George Lund,
|
|
Gianmarco Armellin,
|
|
Giovanni Campagna,
|
|
Glenn Adams,
|
|
Glenn Maynard,
|
|
Graham Klyne,
|
|
Greg Botten,
|
|
Greg Houston,
|
|
Greg Wilkins,
|
|
Gregg Tavares,
|
|
Gregory J. Rosmaita,
|
|
Grey,
|
|
Guilherme Johansson Tramontina,
|
|
Gytis Jakutonis,
|
|
Håkon Wium Lie,
|
|
Hallvord Reiar Michaelsen Steen,
|
|
Hans S. Tømmerhalt,
|
|
Hans Stimer,
|
|
Harald Alvestrand,
|
|
Henri Sivonen,
|
|
Henrik Lied,
|
|
Henry Mason,
|
|
Hugh Winkler,
|
|
Ian Bicking,
|
|
Ian Davis,
|
|
Ignacio Javier,
|
|
Ivan Enderlin,
|
|
Ivo Emanuel Gonçalves,
|
|
J. King,
|
|
Jacques Distler,
|
|
James Craig,
|
|
James Graham,
|
|
James Justin Harrell,
|
|
James M Snell,
|
|
James Perrett,
|
|
James Robinson,
|
|
Jamie Lokier,
|
|
Jan-Klaas Kollhof,
|
|
Jason Kersey,
|
|
Jason Lustig,
|
|
Jason White,
|
|
Jasper Bryant-Greene,
|
|
Jatinder Mann,
|
|
Jed Hartman,
|
|
Jeff Balogh,
|
|
Jeff Cutsinger,
|
|
Jeff Schiller,
|
|
Jeff Walden,
|
|
Jeffrey Zeldman,
|
|
胡慧鋒 (Jennifer Braithwaite),
|
|
Jens Bannmann,
|
|
Jens Fendler,
|
|
Jens Lindström,
|
|
Jens Meiert,
|
|
Jeremy Keith,
|
|
Jeremy Orlow,
|
|
Jeroen van der Meer,
|
|
Jian Li,
|
|
Jim Jewett,
|
|
Jim Ley,
|
|
Jim Meehan,
|
|
Jjgod Jiang,
|
|
João Eiras,
|
|
Joe Clark,
|
|
Joe Gregorio,
|
|
Joel Spolsky,
|
|
Johan Herland,
|
|
John Boyer,
|
|
John Bussjaeger,
|
|
John Carpenter,
|
|
John Fallows,
|
|
John Foliot,
|
|
John Harding,
|
|
John Keiser,
|
|
John Snyders,
|
|
John-Mark Bell,
|
|
Johnny Stenback,
|
|
Jon Ferraiolo,
|
|
Jon Gibbins,
|
|
Jon Perlow,
|
|
Jonas Sicking,
|
|
Jonathan Cook,
|
|
Jonathan Rees,
|
|
Jonathan Worent,
|
|
Jonny Axelsson,
|
|
Jorgen Horstink,
|
|
Jorunn Danielsen Newth,
|
|
Joseph Kesselman,
|
|
Joseph Pecoraro,
|
|
Josh Aas,
|
|
Josh Levenberg,
|
|
Joshua Bell,
|
|
Joshua Randall,
|
|
Jukka K. Korpela,
|
|
Jules Clément-Ripoche,
|
|
Julian Reschke,
|
|
Jürgen Jeka,
|
|
Justin Lebar,
|
|
Justin Schuh,
|
|
Justin Sinclair,
|
|
Kai Hendry,
|
|
Kartikaya Gupta,
|
|
Kathy Walton,
|
|
Kelly Norton,
|
|
Kevin Benson,
|
|
Kornél Pál,
|
|
Kornel Lesinski,
|
|
Kris Northfield,
|
|
Kristof Zelechovski,
|
|
Krzysztof Maczyński,
|
|
黒澤剛志 (Kurosawa Takeshi),
|
|
Kyle Hofmann,
|
|
Kyle Huey,
|
|
Léonard Bouchet,
|
|
Lachlan Hunt,
|
|
Larry Masinter,
|
|
Larry Page,
|
|
Lars Gunther,
|
|
Lars Solberg,
|
|
Laura Carlson,
|
|
Laura Granka,
|
|
Laura L. Carlson,
|
|
Laura Wisewell,
|
|
Laurens Holst,
|
|
Lee Kowalkowski,
|
|
Leif Halvard Silli,
|
|
Lenny Domnitser,
|
|
Leons Petrazickis,
|
|
Lobotom Dysmon,
|
|
Logan,
|
|
Loune,
|
|
Luke Kenneth Casson Leighton,
|
|
Maciej Stachowiak,
|
|
Magnus Kristiansen,
|
|
Maik Merten,
|
|
Malcolm Rowe,
|
|
Mark Birbeck,
|
|
Mark Miller,
|
|
Mark Nottingham,
|
|
Mark Pilgrim,
|
|
Mark Rowe,
|
|
Mark Schenk,
|
|
Mark Wilton-Jones,
|
|
Martijn Wargers,
|
|
Martin Atkins,
|
|
Martin Dürst,
|
|
Martin Honnen,
|
|
Martin Janecke,
|
|
Martin Kutschker,
|
|
Martin Nilsson,
|
|
Martin Thomson,
|
|
Masataka Yakura,
|
|
Mathieu Henri,
|
|
Matias Larsson,
|
|
Matt Schmidt,
|
|
Matt Wright,
|
|
Matthew Gregan,
|
|
Matthew Mastracci,
|
|
Matthew Raymond,
|
|
Matthew Thomas,
|
|
Mattias Waldau,
|
|
Max Romantschuk,
|
|
Menno van Slooten,
|
|
Micah Dubinko,
|
|
Michael 'Ratt' Iannarelli,
|
|
Michael A. Nachbaur,
|
|
Michael A. Puls II,
|
|
Michael Carter,
|
|
Michael Daskalov,
|
|
Michael Enright,
|
|
Michael Gratton,
|
|
Michael Nordman,
|
|
Michael Powers,
|
|
Michael Rakowski,
|
|
Michael(tm) Smith,
|
|
Michal Zalewski,
|
|
Michel Fortin,
|
|
Michelangelo De Simone,
|
|
Michiel van der Blonk,
|
|
Mihai Şucan,
|
|
Mihai Parparita,
|
|
Mike Brown,
|
|
Mike Dierken,
|
|
Mike Dixon,
|
|
Mike Schinkel,
|
|
Mike Shaver,
|
|
Mikko Rantalainen,
|
|
Mohamed Zergaoui,
|
|
Mounir Lamouri,
|
|
Ms2ger,
|
|
NARUSE Yui,
|
|
Neil Deakin,
|
|
Neil Rashbrook,
|
|
Neil Soiffer,
|
|
Nicholas Shanks,
|
|
Nicholas Stimpson,
|
|
Nicholas Zakas,
|
|
Nickolay Ponomarev,
|
|
Nicolas Gallagher,
|
|
Noah Mendelsohn,
|
|
Noah Slater,
|
|
NoozNooz42,
|
|
Ojan Vafai,
|
|
Olaf Hoffmann,
|
|
Olav Junker Kjær,
|
|
Oldřich Vetešník,
|
|
Oli Studholme,
|
|
Oliver Hunt,
|
|
Oliver Rigby,
|
|
Olivier Gendrin,
|
|
Olli Pettay,
|
|
oSand,
|
|
Patrick H. Lauke,
|
|
Patrik Persson,
|
|
Paul Norman,
|
|
Per-Erik Brodin,
|
|
Perry Smith,
|
|
Peter Beverloo,
|
|
Peter Karlsson,
|
|
Peter Kasting,
|
|
Peter Stark,
|
|
Peter-Paul Koch,
|
|
Phil Pickering,
|
|
Philip Jägenstedt,
|
|
Philip Taylor,
|
|
Philip TAYLOR,
|
|
Prateek Rungta,
|
|
Pravir Gupta,
|
|
Rachid Finge,
|
|
Rajas Moonka,
|
|
Ralf Stoltze,
|
|
Ralph Giles,
|
|
Raphael Champeimont,
|
|
Remco,
|
|
Remy Sharp,
|
|
Rene Saarsoo,
|
|
Rene Stach,
|
|
Ric Hardacre,
|
|
Rich Doughty,
|
|
Richard Ishida,
|
|
Rigo Wenning,
|
|
Rikkert Koppes,
|
|
Rimantas Liubertas,
|
|
Riona Macnamara,
|
|
Rob Ennals,
|
|
Rob Jellinghaus,
|
|
Robert Blaut,
|
|
Robert Collins,
|
|
Robert O'Callahan,
|
|
Robert Sayre,
|
|
Robin Berjon,
|
|
Rodger Combs,
|
|
Roland Steiner,
|
|
Roman Ivanov,
|
|
Roy Fielding,
|
|
Ruud Steltenpool,
|
|
Ryan King,
|
|
Ryosuke Niwa,
|
|
S. Mike Dierken,
|
|
Salvatore Loreto,
|
|
Sam Dutton,
|
|
Sam Kuper,
|
|
Sam Ruby,
|
|
Sam Weinig,
|
|
Sander van Lambalgen,
|
|
Sarven Capadisli,
|
|
Scott González,
|
|
Scott Hess,
|
|
Sean Fraser,
|
|
Sean Hayes,
|
|
Sean Hogan,
|
|
Sean Knapp,
|
|
Sebastian Markbåge,
|
|
Sebastian Schnitzenbaumer,
|
|
Seth Call,
|
|
Shanti Rao,
|
|
Shaun Inman,
|
|
Shiki Okasaka,
|
|
Sierk Bornemann,
|
|
Sigbjørn Vik,
|
|
Silvia Pfeiffer,
|
|
Simon Montagu,
|
|
Simon Pieters,
|
|
Simon Spiegel,
|
|
skeww,
|
|
Stanton McCandlish,
|
|
Stefan Håkansson,
|
|
Stefan Haustein,
|
|
Stefan Santesson,
|
|
Stefan Weiss,
|
|
Steffen Meschkat,
|
|
Stephen Ma,
|
|
Steve Faulkner,
|
|
Steve Runyon,
|
|
Steven Bennett,
|
|
Steven Garrity,
|
|
Steven Tate,
|
|
Stewart Brodie,
|
|
Stuart Ballard,
|
|
Stuart Parmenter,
|
|
Subramanian Peruvemba,
|
|
Sunava Dutta,
|
|
Susan Borgrink,
|
|
Susan Lesch,
|
|
Sylvain Pasche,
|
|
T. J. Crowder,
|
|
Tab Atkins,
|
|
<span lang="tr" title="">Tantek Çelik</span>,
|
|
田村健人 (TAMURA Kent),
|
|
Ted Mielczarek,
|
|
Terrence Wood,
|
|
Thomas Broyer,
|
|
Thomas Koetter,
|
|
Thomas O'Connor,
|
|
Tim Altman,
|
|
Tim Johansson,
|
|
Toby Inkster,
|
|
Todd Moody,
|
|
Tom Baker,
|
|
Tom Pike,
|
|
Tommy Thorsen,
|
|
Travis Leithead,
|
|
Tyler Close,
|
|
Vladimir Katardjiev,
|
|
Vladimir Vukićević,
|
|
voracity,
|
|
Wakaba,
|
|
Wayne Carr,
|
|
Wayne Pollock,
|
|
Wellington Fernando de Macedo,
|
|
Weston Ruter,
|
|
Will Levine,
|
|
William Swanson,
|
|
Wladimir Palant,
|
|
Wojciech Mach,
|
|
Wolfram Kriesing,
|
|
Yang Chen,
|
|
Ye-Kui Wang,
|
|
Yehuda Katz,
|
|
Yi-An Huang,
|
|
Yngve Nysaeter Pettersen,
|
|
Yuzo Fujishima,
|
|
Zhenbin Xu,
|
|
Zoltan Herczeg,
|
|
and
|
|
Øistein E. Andersen,
|
|
|
|
for their useful comments, both large and small, that have led to
|
|
changes to this specification over the years.<p>Thanks also to everyone who has ever posted about HTML to their
|
|
blogs, public mailing lists, or forums, including all the
|
|
contributors to the <a href="http://www.w3.org/html/wg/lists/">various W3C HTML WG
|
|
lists</a> and the <a href="http://www.whatwg.org/mailing-list">various WHATWG lists</a>.
|
|
|
|
<p>Special thanks to Richard Williamson for creating the first
|
|
implementation of <code><a href="#the-canvas-element">canvas</a></code> in Safari, from which the
|
|
canvas feature was designed.<p>Special thanks also to the Microsoft employees who first
|
|
implemented the event-based drag-and-drop mechanism, <code title="attr-contenteditable"><a href="#attr-contenteditable">contenteditable</a></code>, and other
|
|
features first widely deployed by the Windows Internet Explorer
|
|
browser.<p>Thanks to the SubRip community, including in particular Zuggy and
|
|
ai4spam, for their work on the SubRip software program whose SRT
|
|
file format was used as the basis for the WebVTT text track file
|
|
format.<div class="impl">
|
|
|
|
<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>
|
|
|
|
</div><p>Thanks to the many sources that provided inspiration for the
|
|
examples used in the specification.<p>Thanks also to the Microsoft blogging community for some ideas,
|
|
to the attendees of the W3C Workshop on Web Applications and
|
|
Compound Documents for inspiration, to the #mrt crew, the #mrt.no
|
|
crew, and the #whatwg crew, and to Pillar and Hedral for their ideas
|
|
and support.</p>
|