a
4.5.1
If the a element has an href attribute,
then it represents a hyperlink (a hypertext anchor) labeled by its
contents.
If the a element has no href attribute,
then the element represents a placeholder for where a link might otherwise have been
placed, if it had been relevant, consisting of just the element's contents.
The target, download, ping,
rel, hreflang, type,
and referrerpolicy attributes must be omitted
if the href attribute is not present.
If the itemprop attribute is specified on an a element,
then the href attribute must also be specified.
The href, target, download, ping,
and referrerpolicy attributes affect what
happens when users follow hyperlinks or download hyperlinks created using the a
element. The rel, hreflang, and type
attributes may be used to indicate to the user the likely nature of the target resource before the
user follows the link.
The activation behavior of an a element element given an
event event is:
If element has no href attribute,
then return.Let hyperlinkSuffix be null.If event's target is an
img with an ismap attribute specified,
then:
Let x and y be 0.If event's isTrusted attribute is
initialized to true, then set x to the distance in CSS
pixels from the left edge of the image to the location of the click, and set
y to the distance in CSS pixels from the top edge of the
image to the location of the click.If x is negative, set x to 0.If y is negative, set y to 0.Set hyperlinkSuffix to the concatenation of U+003F (?), the value of
x expressed as a base-ten integer using ASCII digits, U+002C (,), and
the value of y expressed as a base-ten integer using ASCII
digits.
If element has a download
attribute, or if the user has expressed a preference to download the hyperlink, then download the hyperlink created by element given
hyperlinkSuffix.Otherwise, follow the hyperlink created by
element given hyperlinkSuffix.
The IDL attributes download, ping, target, rel, hreflang, and type, must reflect the respective content attributes
of the same name.
The IDL attribute relList must reflect the rel content attribute.
The IDL attribute referrerPolicy must reflect the referrerpolicy content attribute, limited to
only known values.
The text
attribute's getter must return this element's descendant text content.
The text attribute's setter must string replace
all with the given value within this element.
abbr
4.5.9
The abbr element represents an abbreviation or acronym, optionally
with its expansion. The title 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.
If an abbreviation is pluralized, the expansion's grammatical number (plural vs singular) must
match the grammatical number of the contents of the element.
Abbreviations do not have to be marked up using this element. It is expected to be useful in
the following cases:
Abbreviations for which the author wants to give expansions, where using the
abbr element with a title attribute is an
alternative to including the expansion inline (e.g. in parentheses).Abbreviations that are likely to be unfamiliar to the document's readers, for which authors
are encouraged to either mark up the abbreviation using an abbr element with a title attribute or include the expansion inline in the text the first
time the abbreviation is used.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 abbr element
can be used without a title attribute.
Providing an expansion in a title attribute once
will not necessarily cause other abbr elements in the same document with the same
contents but without a title attribute to behave as if they had
the same expansion. Every abbr element is independent.
address
4.3.10
The address element represents the contact information for its
nearest article or body element ancestor. If that is the body
element, then the contact information applies to the document as a whole.
The address element must not be used to represent arbitrary addresses (e.g. postal
addresses), unless those addresses are in fact the relevant contact information. (The
p element is the appropriate element for marking up postal addresses in general.)
The address element must not contain information other than contact
information.
Typically, the address element would be included along with other information in a
footer element.
The contact information for a node node is a collection of
address elements defined by the first applicable entry from the following list:
If node is an article elementIf node is a body element
The contact information consists of all the address elements that have node as an ancestor and do not have another body or
article element ancestor that is a descendant of node.
If node has an ancestor element that is an article elementIf node has an ancestor element that is a body element
The contact information of node is the same as the contact information of
the nearest article or body element ancestor, whichever is
nearest.
If node's node document has a body
element
The contact information of node is the same as the contact information of
the body element of the Document.
Otherwise
There is no contact information for node.
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.
area
4.8.13
The area element represents either a hyperlink with some text and a
corresponding area on an image map, or a dead area on an image map.
An area element with a parent node must have a map element
ancestor.
If the area element has an href
attribute, then the area element represents a hyperlink. In this case,
the alt 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 image map, 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 alt attribute may be left blank if there is another
area element in the same image map that points to the same resource and
has a non-blank alt attribute.
If the area element has no href
attribute, then the area represented by the element cannot be selected, and the alt attribute must be omitted.
In both cases, the shape and coords attributes specify the area.
The shape attribute is
an enumerated attribute. 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. Some of the keywords are non-conforming, as noted in the last
column.
State
Keywords
Notes
Circle state
circle
circ
Non-conforming
Default state
default
Polygon state
poly
polygon
Non-conforming
Rectangle state
rect
rectangle
Non-conforming
The attribute may be omitted. The missing value default
and invalid value default are the rectangle state.
The coords attribute
must, if specified, contain a valid list of floating-point numbers. This attribute
gives the coordinates for the shape described by the shape
attribute. The processing for this attribute is described as part of the image
map processing model.
In the circle state,
area elements must have a coords 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.
In the default state
state, area elements must not have a coords
attribute. (The area is the whole image.)
In the polygon state,
area elements must have a coords 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.
In the rectangle state,
area elements must have a coords 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.
When user agents allow users to follow hyperlinks or
download hyperlinks created using the
area element, as described in the next section, the href, target, download, and ping
attributes decide how the link is followed. The rel
attribute may be used to indicate to the user the likely nature of the target resource before the
user follows the link.
The target, download, ping,
rel, and referrerpolicy attributes must be omitted if the
href attribute is not present.
If the itemprop attribute is specified on an
area element, then the href attribute must
also be specified.
The activation behavior of an area element element is:
If element has no href attribute,
then return.If element has a download
attribute, or if the user has expressed a preference to download the hyperlink, then download the hyperlink created by
element.Otherwise, follow the hyperlink created by
element.
The IDL attributes alt, coords, target, download, ping, and rel, each must reflect the respective content
attributes of the same name.
The IDL attribute shape must reflect the shape content attribute.
The IDL attribute relList must reflect the rel content attribute.
The IDL attribute referrerPolicy must reflect the referrerpolicy content attribute, limited to
only known values.
article
4.3.2
The article element represents a complete, or 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.
When article elements are nested, the inner article 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 article elements nested within the article element for the blog
entry.
Author information associated with an article element (q.v. the
address element) does not apply to nested article elements.
When the main content of the page (i.e. excluding footers, headers, navigation blocks, and
sidebars) is all one single self-contained composition, that content may be marked with an
article, but it is technically redundant in that case (since it's self-evident that
the page is a single composition, as it is a single document).
aside
4.3.5
The aside element represents a section of a page that consists of
content that is tangentially related to the content around the aside element, and
which could be considered separate from that content. Such sections are often represented as
sidebars in printed typography.
The element can be used for typographical effects like pull quotes or sidebars, for
advertising, for groups of nav elements, and for other content that is considered
separate from the main content of the page.
audio
4.8.9
An audio element represents a sound or audio stream.
Content may be provided inside the audio element. User agents
should not show this content to the user; it is intended for older web browsers which do
not support audio, 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.
The audio element is a media element whose media data is
ostensibly audio data.
The src, crossorigin,
preload, autoplay,
loop, muted, and controls attributes are the attributes common to all media elements.
A legacy factory function is provided for creating HTMLAudioElement objects (in
addition to the factory methods from DOM such as createElement()): Audio(src). When invoked, the legacy factory function
must perform the following steps:
Let document be the current global object's associated Document.Let audio be the result of creating an
element given document, audio, and the HTML
namespace.Set an attribute value for
audio using "preload" and "auto".If src is given, then set
an attribute value for audio using "src"
and src. (This will cause the user
agent to invoke the object's resource selection
algorithm before returning.)Return audio.
b
4.5.21
The b element represents 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.
As with the i element, authors can use the class
attribute on the b 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.
The b element should be used as a last resort when no other element is more
appropriate. In particular, headings should use the h1 to h6 elements,
stress emphasis should use the em element, importance should be denoted with the
strong element, and text marked or highlighted should use the mark
element.
base
4.2.3
The base element allows authors to specify the document base URL for
the purposes of parsing URLs, and the name of the default
browsing context for the purposes of following hyperlinks. The element
does not represent any content beyond this information.
There must be no more than one base element per document.
A base element must have either an href
attribute, a target attribute, or both.
The href content
attribute, if specified, must contain a valid URL potentially surrounded by
spaces.
A base element, if it has an href attribute,
must come before any other elements in the tree that have attributes defined as taking URLs, except the html element (its manifest attribute isn't affected by base
elements).
The target attribute,
if specified, must contain a valid browsing context name or keyword, which specifies
which browsing context is to be used as the default when hyperlinks and forms in the
Document cause navigation.
A base element, if it has a target
attribute, must come before any elements in the tree that represent hyperlinks.
To get an element's target, given an a, area, or
form element element, run these steps:
If element has a target attribute, then return that
attribute's value.If element's node document contains a base element
with a target attribute, then return the value of the
target attribute of the first such base
element.Return the empty string.
A base element that is the first base element with an href content attribute in a document tree has a
frozen base URL. The frozen base URL must be immediately
set for an element whenever any of the following
situations occur:
The base element becomes the first base element in tree
order with an href content attribute in its
Document.The base element is the first base element in tree
order with an href content attribute in its
Document, and its href content attribute is
changed.
To set the frozen base URL for an element element:
Let document be element's node document.
Let urlRecord be the result of parsing the
value of element's href content attribute with
document's fallback base URL, and document's character encoding. (Thus, the base
element isn't affected by itself.)Set element's frozen base URL to document's
fallback base URL, if urlRecord is failure or running Is base
allowed for Document? on the resulting URL record and document
returns "Blocked", and to urlRecord otherwise.
The href IDL
attribute, on getting, must return the result of running the following algorithm:
Let document be element's node document.
Let url be the value of the href
attribute of this element, if it has one, and the empty string otherwise.Let urlRecord be the result of parsing
url with document's fallback base URL, and
document's character encoding.
(Thus, the base element isn't affected by other base elements or
itself.)If urlRecord is failure, return url.Return the serialization of
urlRecord.
The href IDL attribute, on setting, must set the href content attribute to the given new value.
The target IDL
attribute must reflect the content attribute of the same name.
bdi
4.5.24
The bdi element represents a span of text that is to be isolated from
its surroundings for the purposes of bidirectional text formatting. [BIDI]
bdo
4.5.25
The bdo element represents explicit text directionality formatting
control for its children. It allows authors to override the Unicode bidirectional algorithm by
explicitly specifying a direction override. [BIDI]
Authors must specify the dir attribute on this element, with the
value ltr to specify a left-to-right override and with the value rtl to
specify a right-to-left override. The auto value must not be specified.
blockquote
4.4.4
The blockquote element represents a section that is quoted from
another source.
Content inside a blockquote must be quoted from another source, whose address, if
it has one, may be cited in the cite attribute.
If the cite attribute is present, it must be a
valid URL potentially surrounded by spaces. To obtain the
corresponding citation link, the value of the attribute must be parsed relative to the element's node document. User agents may
allow users to follow such citation links, but they are primarily intended for private use (e.g.,
by server-side scripts collecting statistics about a site's use of quotations), not for
readers.
The content of a blockquote may be abbreviated or may have context added in the
conventional manner for the text's language.
Attribution for the quotation, if any, must be placed outside the blockquote
element.
The cite IDL
attribute must reflect the element's cite content
attribute.
body
4.3.1
The body element represents the contents of the document.
In conforming documents, there is only one body element. The document.body IDL attribute provides scripts with easy access to
a document's body element.
The body element exposes as event handler content attributes a number
of the event handlers of the Window object. It also mirrors their
event handler IDL attributes.
The event handlers of the Window object named by the
Window-reflecting body element event handler set, exposed on the
body element, replace the generic event handlers with the same names
normally supported by HTML elements.
Thus, for example, a bubbling error event
dispatched on a child of the body element of a Document would first
trigger the onerror event handler content
attributes of that element, then that of the root html element, and only
then would it trigger the onerror event handler content attribute on the
body element. This is because the event would bubble from the target, to the
body, to the html, to the Document, to the
Window, and the event handler on the
body is watching the Window not the body. A regular event
listener attached to the body using addEventListener(),
however, would be run when the event bubbled through the body and not when it reaches
the Window object.
br
4.5.27
The br element represents a line break.
br elements must be used only for line breaks that are actually part of the
content, as in poems or addresses.
br elements must not be used for separating thematic groups in a paragraph.
If a paragraph consists of nothing but a single br element, it
represents a placeholder blank line (e.g. as in a template). Such blank lines must not be used for
presentation purposes.
Any content inside br elements must not be considered part of the surrounding
text.
button
4.10.6
The button element represents a button labeled by its contents.
The element is a button.
The type attribute
controls the behavior of the button when it is activated. It is an enumerated
attribute. 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.
Keyword
State
Brief description
submit
Submit Button
Submits the form.
reset
Reset Button
Resets the form.
button
Button
Does nothing.
The missing value default and invalid value default are the Submit Button state.
If the type attribute is in the Submit Button state, the element is specifically a
submit button.
Constraint validation: If the type
attribute is in the Reset Button state or the
Button state, the element is barred from
constraint validation.
A button element element's activation behavior is:
If element is disabled, then
return.If element does not have a form owner, then return.If element's node document is not fully active, then
return.
Switch on element's type attribute's state:
Submit Button Submit element's form
owner from element. Reset Button Reset element's form
owner. Button
Do nothing.
The form attribute is used to explicitly associate the
button element with its form owner. The name attribute represents the element's name. The disabled attribute is used to make the control non-interactive and
to prevent its value from being submitted. The formaction,
formenctype, formmethod, formnovalidate, and formtarget attributes are attributes for form
submission.
The formaction, formenctype, formmethod, formnovalidate, and formtarget must not be specified if the element's type attribute is not in the Submit Button state.
The value
attribute gives the element's value for the purposes of form submission. The element's value is the value of the element's value attribute, if there is one, or the empty string
otherwise.
The value
IDL attribute must reflect the content attribute of the same name.
The type IDL
attribute must reflect the content attribute of the same name, limited to only
known values.
The willValidate, validity, and validationMessage IDL attributes, and the checkValidity(), reportValidity(), and setCustomValidity() methods, are part of the
constraint validation API. The labels IDL
attribute provides a list of the element's labels. The disabled, form, and
name IDL attributes are part of the element's forms API.
canvas
4.12.5
The canvas element provides scripts with a resolution-dependent bitmap canvas,
which can be used for rendering graphs, game graphics, art, or other visual images on the fly.
Authors should not use the canvas element in a document when a more suitable
element is available. For example, it is inappropriate to use a canvas 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 h1) and then styled using
CSS and supporting technologies such as shadow trees.
When authors use the canvas element, they must also provide content that, when
presented to the user, conveys essentially the same function or purpose as the
canvas's bitmap. This content may be placed as content of the canvas
element. The contents of the canvas element, if any, are the element's fallback
content.
In interactive visual media, if scripting is enabled for
the canvas element, and if support for canvas elements has been enabled,
then the canvas element represents embedded content
consisting of a dynamically created image, the element's bitmap.
In non-interactive, static, visual media, if the canvas element has been
previously associated with a rendering context (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 canvas element represents
embedded content with the element's current bitmap and size. Otherwise, the element
represents its fallback content instead.
In non-visual media, and in visual media if scripting is
disabled for the canvas element or if support for canvas elements
has been disabled, the canvas element represents its fallback
content instead.
When a canvas element represents embedded content, the
user can still focus descendants of the canvas element (in the fallback
content). 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 areas in the fallback content. (Focus has no
effect on mouse interaction events.) [UIEVENTS]
An element whose nearest canvas element ancestor is being rendered
and represents embedded content is an element that is being used as
relevant canvas fallback content.
The canvas element has two attributes to control the size of the element's bitmap:
width and height. These attributes,
when specified, must have values that are valid
non-negative integers. The rules for parsing non-negative
integers must be used to obtain their numeric
values. If an attribute is missing, or if parsing its value returns an error, then the
default value must be used instead. The width
attribute defaults to 300, and the height attribute
defaults to 150.
When setting the value of the width or height attribute, if the context mode of the canvas
element is set to placeholder, the
user agent must throw an "InvalidStateError" DOMException
and leave the attribute's value unchanged.
The intrinsic dimensions of the canvas element when it
represents embedded content are equal to the dimensions of the
element's bitmap.
The user agent must use a square pixel density consisting of one pixel of image data per
coordinate space unit for the bitmaps of a canvas and its rendering contexts.
The bitmaps of canvas elements, the bitmaps of ImageBitmap objects,
as well as some of the bitmaps of rendering contexts, such as those described in the sections on
the CanvasRenderingContext2D and ImageBitmapRenderingContext objects
below, have an origin-clean flag, which can be
set to true or false. Initially, when the canvas element or ImageBitmap
object is created, its bitmap's origin-clean
flag must be set to true.
A canvas element can have a rendering context bound to it. Initially, it does not
have a bound rendering context. To keep track of whether it has a rendering context or not, and
what kind of rendering context it is, a canvas also has a canvas context mode, which is initially none but can be changed to either placeholder, 2d, bitmaprenderer, webgl, webgl2, or webgpu by algorithms defined in this specification.
When its canvas context mode is none, a canvas element has no rendering context,
and its bitmap must be transparent black with an intrinsic width equal
to the numeric value of the element's width attribute and an intrinsic height equal to
the numeric value of the element's height attribute, those values being interpreted in CSS pixels, and being updated as the attributes are set, changed, or
removed.
When its canvas context mode is placeholder, a canvas element has no
rendering context. It serves as a placeholder for an OffscreenCanvas object, and
the content of the canvas element is updated by calling the commit() method of the OffscreenCanvas
object's rendering context.
When a canvas element represents embedded content, it provides a
paint source whose width is the element's intrinsic width, whose height
is the element's intrinsic height, and whose appearance is the element's bitmap.
Whenever the width and height content attributes are set, removed, changed, or
redundantly set to the value they already have, then the user agent must perform the action
from the row of the following table that corresponds to the canvas element's context mode.
Context Mode
Action
2d
Follow the steps to set bitmap
dimensions to the numeric values
of the width and height content attributes.
webgl or webgl2
Follow the behavior defined in the WebGL specifications. [WEBGL]
webgpu
Follow the behavior defined in WebGPU. [WEBGPU]
bitmaprenderer
If the context's bitmap
mode is set to blank,
run the steps to set an ImageBitmapRenderingContext's output bitmap,
passing the canvas element's rendering context.
placeholder
Do nothing.
none
Do nothing.
The width
and height
IDL attributes must reflect the respective content attributes of the same name, with
the same defaults.
The getContext(contextId, options)
method of the canvas element, when invoked, must run these steps:
If options is not an object, then set
options to null.Set options to the result of converting options to a JavaScript value.
Run the steps in the cell of the following table whose column header matches this
canvas element's canvas context
mode and whose row header matches contextId:
none
2d
bitmaprenderer
webgl or webgl2
webgpu
placeholder
"2d"
Follow the 2D context creation algorithm defined in the section below, passing
it this canvas element and options, to obtain a
CanvasRenderingContext2D object; if this does not throw an exception, then set
this canvas element's context
mode to 2d, and return the
CanvasRenderingContext2D object.
Return the same object as was returned the last time the method was invoked with this same
first argument.
Return null.
Return null.
Return null.
Throw an "InvalidStateError" DOMException.
"bitmaprenderer"
Follow the ImageBitmapRenderingContext creation algorithm defined
in the section below, passing it this canvas element and options, to
obtain an ImageBitmapRenderingContext object; then set this canvas
element's context mode to bitmaprenderer, and return the
ImageBitmapRenderingContext object.
Return null.
Return the same object as was returned the last time the method was invoked with this same
first argument.
Return null.
Return null.
Throw an "InvalidStateError" DOMException.
"webgl" or "webgl2", if the user agent supports the WebGL
feature in its current configuration
Follow the instructions given in the WebGL specifications' Context Creation sections
to obtain a WebGLRenderingContext, WebGL2RenderingContext, or
null; if the returned value is null, then return null; otherwise, set this
canvas element's context mode
to webgl or webgl2, and return the
WebGLRenderingContext or WebGL2RenderingContext object. [WEBGL]
Return null.
Return null.
Return the same object as was returned the last time the method was invoked with this same
first argument.
Return null.
Throw an "InvalidStateError" DOMException.
"webgpu", if the user
agent supports the WebGPU feature in its current configuration
Follow the instructions given in WebGPU's Canvas Rendering section to
obtain a GPUCanvasContext or null; if the returned value is null, then return
null; otherwise, set this canvas element's context mode to webgpu and return the
GPUCanvasContext object. [WEBGPU]
Return null.
Return null.
Return null.
Return the same object as was returned the last time the method was invoked with this same
first argument.
Throw an "InvalidStateError" DOMException.
An unsupported value*
Return null.
Return null.
Return null.
Return null.
Return null.
Throw an "InvalidStateError" DOMException.
* For example, the "webgl" or "webgl2" value in the case of a user agent having exhausted
the graphics hardware's abilities and having no software fallback implementation.
The toDataURL(type, quality) method,
when invoked, must run these steps:
If this canvas element's bitmap's origin-clean flag is set to false, then throw a
"SecurityError" DOMException.
If this canvas element's bitmap has no pixels (i.e. either its horizontal
dimension or its vertical dimension is zero) then return the string "data:,". (This is the shortest data: URL; it represents the empty string in a text/plain resource.)Let file be a
serialization of this canvas element's bitmap as a file, passing
type and quality if given.If file is null then return "data:,".Return a data: URL representing
file. [RFC2397]
The toBlob(callback, type,
quality) method, when invoked, must run these steps:
If this canvas element's bitmap's origin-clean flag is set to false, then throw a
"SecurityError" DOMException.Let result be null.If this canvas element's bitmap has pixels (i.e., neither its horizontal
dimension nor its vertical dimension is zero), then set result to a copy of this
canvas element's bitmap.
Run these steps in parallel:
If result is non-null, then set result to a serialization of result as a file
with type and quality if given.
Queue an element task on the
canvas blob serialization task
source given the canvas element to run these steps:
If result is non-null, then set result to a new
Blob object, created in the relevant
Realm of this canvas element, representing result. [FILEAPI]Invoke callback with
« result ».
The transferControlToOffscreen() method,
when invoked, must run these steps:
If this canvas element's context
mode is not set to none, throw an
"InvalidStateError" DOMException.Let offscreenCanvas be a new OffscreenCanvas object with its
width and height equal to the values of the width
and height content attributes of this
canvas element.Set the placeholder canvas
element of offscreenCanvas to a weak reference to this canvas
element.Set this canvas element's context
mode to placeholder.Return offscreenCanvas.
caption
4.9.2
The caption element represents the title of the table
that is its parent, if it has a parent and that is a table element.
The caption element takes part in the table model.
When a table element is the only content in a figure element other
than the figcaption, the caption element should be omitted in favor of
the figcaption.
A caption can introduce context for a table, making it significantly easier to understand.
cite
4.5.6
The cite element represents 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,
a computer program,
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.
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 b 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 really needed, the span element can be
used.)
code
4.5.15
The code element represents a fragment of computer code. This could
be an XML element name, a filename, a computer program, or any other string that a computer would
recognize.
There is no formal way to indicate the language of computer code being marked up. Authors who
wish to mark code elements with the language used, e.g. so that syntax highlighting
scripts can use the right rules, can use the class attribute, e.g.
by adding a class prefixed with "language-" to the element.
col
4.9.4
If a col element has a parent and that is a colgroup element that
itself has a parent that is a table element, then the col element
represents one or more columns in the column group represented by that colgroup.
The element may have a span content attribute specified, whose value must be a
valid non-negative integer greater than zero and less than or equal to 1000.
The col element and its span attribute take
part in the table model.
The span IDL
attribute must reflect the content attribute of the same name. It is clamped to
the range [1, 1000], and its default value is 1.
colgroup
4.9.3
The colgroup element represents a group of one or more columns in the table that is its parent, if it has a
parent and that is a table element.
If the colgroup element contains no col elements, then the element
may have a span
content attribute specified, whose value must be a valid non-negative integer greater
than zero and less than or equal to 1000.
The colgroup element and its span
attribute take part in the table model.
The span
IDL attribute must reflect the content attribute of the same name. It is
clamped to the range [1, 1000], and its default value is 1.
data
4.5.13
The data element represents its contents, along with a
machine-readable form of those contents in the value
attribute.
The value attribute
must be present. Its value must be a representation of the element's contents in a
machine-readable format.
The element can be used for several purposes.
When combined with microformats or the microdata attributes defined in
this specification, the element serves to provide both a machine-readable value for the purposes
of data processors, and a human-readable value for the purposes of rendering in a web browser. In
this case, the format to be used in the value attribute is
determined by the microformats or microdata vocabulary in use.
The element can also, however, be used in conjunction with scripts in the page, for when a
script has a literal value to store alongside a human-readable value. In such cases, the format to
be used depends only on the needs of the script. (The data-*
attributes can also be useful in such situations.)
The value IDL
attribute must reflect the content attribute of the same name.
datalist
4.10.8
The datalist element represents a set of option elements that
represent predefined options for other controls. In the rendering, the datalist
element represents nothing and it, along with its children, should
be hidden.
The datalist element can be used in two ways. In the simplest case, the
datalist element has just option element children.
In the more elaborate case, the datalist element can be given contents that are to
be displayed for down-level clients that don't support datalist. In this case, the
option elements are provided inside a select element inside the
datalist element.
The datalist element is hooked up to an input element using the list attribute on the input element.
Each option element that is a descendant of the datalist element,
that is not disabled, and whose value is a string that isn't the empty string, represents a
suggestion. Each suggestion has a value and a label.
The options IDL attribute must return an
HTMLCollection rooted at the datalist node, whose filter matches
option elements.
Constraint validation: If an element has a datalist element
ancestor, it is barred from constraint validation.
dd
4.4.11
The dd element represents the description, definition, or value, part
of a term-description group in a description list (dl element).
del
4.7.2
The del element represents a removal from the document.
del elements should not cross implied paragraph
boundaries.
details
4.11.1
The details element represents a disclosure widget from which the
user can obtain additional information or controls.
The first summary element child of the element, if any,
represents the summary or legend of the details. If there is no
child summary element, the user agent should provide its own legend (e.g.
"Details").
The rest of the element's contents represents the additional information or
controls.
The open content
attribute is a boolean attribute. If present, it indicates that both the summary and
the additional information is to be shown to the user. If the attribute is absent, only the
summary is to be shown.
When the element is created, if the attribute is absent, the additional information should be
hidden; if the attribute is present, that information should be shown. Subsequently, if the
attribute is removed, then the information should be hidden; if the attribute is added, the
information should be shown.
The user agent should allow the user to request that the additional information be shown or
hidden. To honor a request for the details to be shown, the user agent must set the open attribute on the element to the empty string. To honor a
request for the information to be hidden, the user agent must remove the open attribute from the element.
Whenever the open attribute is added to or removed from
a details element, the user agent must queue an element task on the
DOM manipulation task source given then details element that runs the
following steps, which are known as the details notification task steps, for this
details element:
If another task has been queued to run the details notification task steps for this
details element, then return.
Fire an event named toggle at the details element.
The open
IDL attribute must reflect the open content
attribute.
The ancestor details revealing algorithm is to run the following steps on
currentNode:
While currentNode has a parent node within the flat tree:
If currentNode is slotted into the second slot of a details
element:
Set currentNode to the details element which
currentNode is slotted into.If the open attribute is not set on
currentNode, then set
the open attribute on currentNode to the
empty string.
Otherwise, set currentNode to the parent node of
currentNode within the flat tree.
dfn
4.5.8
The dfn element represents the defining instance of a term. The paragraph, description list group, or section that is the nearest ancestor of the dfn
element must also contain the definition(s) for the term given
by the dfn element.
Defining term: if the dfn element has a title 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 Text nodes, and that child element is an abbr element with a
title attribute, then the exact value of that
attribute is the term being defined. Otherwise, it is the descendant text content of
the dfn element that gives the term being defined.
If the title attribute of the dfn element is
present, then it must contain only the term being defined.
An a element that links to a dfn element represents an instance of
the term defined by the dfn element.
dialog
4.11.4
The dialog element represents a part of an application that a user interacts with
to perform a task, for example a dialog box, inspector, or window.
The open attribute
is a boolean attribute. When specified, it indicates that the dialog
element is active and that the user can interact with it.
A dialog element without an open attribute
specified should not be shown to the user. This requirement may be implemented indirectly through
the style layer. For example, user agents that support the suggested
default rendering implement this requirement using the CSS rules described in the Rendering section.
Removing the open attribute will usually hide the
dialog. However, doing so has a number of strange additional consequences:
The close event will not be fired.The close() method, and any user-agent provided cancelation interface, will no longer be able
to close the dialog.If the dialog was shown using its showModal()
method, the Document will still be blocked.
For these reasons, it is generally better to never remove the open attribute manually. Instead, use the close() method to close the dialog, or the hidden attribute to hide it.
The tabindex attribute must not be specified on
dialog elements.
When the show()
method is invoked, the user agent must run the following steps:
If the element already has an open attribute, then
return.Add an open attribute to the dialog
element, whose value is the empty string.Set the dialog element's previously focused element to the
focused element.Run the dialog focusing steps for the dialog element.
When the showModal() method is invoked, the user agent must run
the following steps:
Let subject be the dialog element on which the method was
invoked.If subject already has an open
attribute, then throw an "InvalidStateError" DOMException.If subject is not connected, then throw an
"InvalidStateError" DOMException.Add an open attribute to subject, whose
value is the empty string.Set the is modal flag of subject to true.
Let subject's node document be blocked by the modal dialog subject.
If subject's node document's top layer does not
already contain subject, then add subject to subject's node
document's top layer.Set the subject's previously focused element to the
focused element.Run the dialog focusing steps for subject.
The dialog focusing steps for a dialog element subject are as follows:
Let control be the focus delegate of subject.If control is null, then set control to subject.
Run the focusing steps for control.
Let topDocument be the active document of control's
node document's browsing context's
top-level browsing context.If control's node document's origin is not the same
as the origin of topDocument, then
return.Empty topDocument's
autofocus candidates.Set topDocument's autofocus processed flag to true.
If at any time a dialog element is removed from a Document, then if that dialog is in that
Document's top layer, it must be removed from it. Also, set the dialog element's
is modal flag to false.
When the close(returnValue) method is invoked, the user
agent must close the dialog that the method was invoked on. If returnValue
was given, it must be used as the return value; otherwise, there is no return value.
When a dialog element subject is to be closed, optionally with a return value result, the user agent
must run the following steps:
If subject does not have an open
attribute, then return.Remove subject's open
attribute.Set the is modal flag of subject to false.If the argument result was provided, then set the returnValue attribute to the value of result.If subject is in its Document's top layer, then remove it.
If subject's previously focused element is not null, then:
Let element be subject's previously focused
element.Set subject's previously focused element to null.Run the focusing steps for element; the viewport should not be
scrolled by doing this step.
Queue an element task on the user interaction task source given the
subject element to fire an event named
close at subject.
The returnValue IDL attribute, on getting, must return
the last value to which it was set. On setting, it must be set to the new value. When the element
is created, it must be set to the empty string.
We use show/close as the verbs for dialog elements, as opposed to verb pairs that
are more commonly thought of as antonyms such as show/hide or open/close, due to the following
constraints:
Hiding a dialog is different from closing one. Closing a dialog gives it a return value,
fires an event, unblocks the page for other dialogs, and so on. Whereas hiding a dialog is a
purely visual property, and is something you can already do with the hidden attribute or by removing the open attribute. (See also the note above about removing the open attribute, and how hiding the dialog in that way is
generally not desired.)Showing a dialog is different from opening one. Opening a dialog consists of creating
and showing that dialog (similar to how window.open() both
creates and shows a new window). Whereas showing the dialog is the process of taking a
dialog element that is already in the DOM, and making it interactive and visible
to the user.If we were to have a dialog.open() method despite the above, it
would conflict with the dialog.open property.
Furthermore, a survey
of many other UI frameworks contemporary to the original design of the dialog
element made it clear that the show/close verb pair was reasonably common.
In summary, it turns out that the implications of certain verbs, and how they are used in
technology contexts, mean that paired actions such as showing and closing a dialog are not
always expressible as antonyms.
Canceling dialogs: When Document is
blocked by a modal dialog dialog, user agents may provide a user interface
that, upon activation, queues an element task on the
user interaction task source given the dialog element to run these steps:
Let close be the result of firing an
event named cancel at dialog, with the cancelable attribute initialized to true.If close is true and dialog has an open attribute, then close the dialog with no
return value.
Each dialog element has an is modal flag. When a dialog
element is created, this flag must be set to false.
Each dialog element has a previously focused element which is null or
an element, and it is initially null. When showModal()
and show() are called, this element is set to the currently
focused element before running the dialog focusing steps.
The open IDL
attribute must reflect the open content
attribute.
div
4.4.15
The div element has no special meaning at all. It represents its
children. It can be used with the class, lang, and title attributes to mark up
semantics common to a group of consecutive elements. It can also be used in a dl
element, wrapping groups of dt and dd elements.
dl
4.4.9
The dl element represents an association list consisting of zero or
more name-value groups (a description list). A name-value group consists of one or more names
(dt elements, possibly as children of a div element child) followed by
one or more values (dd elements, possibly as children of a div element
child), ignoring any nodes other than dt and dd element children, and
dt and dd elements that are children of div element
children. Within a single dl element, there should not be more than one
dt element for each name.
Name-value groups may be terms and definitions, metadata topics and values, questions and
answers, or any other groups of name-value data.
The values within a group are alternatives; multiple paragraphs forming part of the same value
must all be given within the same dd element.
The order of the list of groups, and of the names and values within each group, may be
significant.
In order to annotate groups with microdata attributes, or other global
attributes that apply to whole groups, or just for styling purposes, each group in a
dl element can be wrapped in a div element. This does not change the
semantics of the dl element.
The name-value groups of a dl element dl are determined using the
following algorithm. A name-value group has a name (a list of dt elements, initially
empty) and a value (a list of dd elements, initially empty).
Let groups be an empty list of name-value groups.Let current be a new name-value group.Let seenDd be false.Let child be dl's first child.Let grandchild be null.
While child is not null:
If child is a div element, then:
Let grandchild be child's first child.
While grandchild is not null:
Process dt or dd for
grandchild.Set grandchild to grandchild's next
sibling.
Otherwise, process dt or dd for
child.Set child to child's next sibling.
If current is not empty, then append current to
groups.Return groups.
To process dt or dd for a node node means to
follow these steps:
Let groups, current, and seenDd be the same variables as
those of the same name in the algorithm that invoked these steps.
If node is a dt element, then:
If seenDd is true, then append current to groups, set
current to a new name-value group, and set seenDd to false.Append node to current's name.
Otherwise, if node is a dd element, then append node to
current's value and set seenDd to true.
dt
4.4.10
The dt element represents the term, or name, part of a
term-description group in a description list (dl element).
em
4.5.2
The em element represents stress emphasis of its contents.
The level of stress that a particular piece of content has is given by its number of ancestor
em elements.
The placement of stress emphasis changes the meaning of the sentence. The element thus forms an
integral part of the content. The precise way in which stress is used in this way depends on the
language.
The em 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 i element is more appropriate.
The em element also isn't intended to convey importance; for that purpose, the
strong element is more appropriate.
embed
4.8.6
The embed element provides an integration point for an external (typically
non-HTML) application or interactive content.
The src attribute
gives the URL of the resource being embedded. The attribute, if present, must contain
a valid non-empty URL potentially surrounded by spaces.
Authors should avoid referencing untrusted resources, as such a resource can be
used to instantiate plugins or run scripts, even if the author has used features such as the Flash
"allowScriptAccess" parameter.
If the itemprop attribute is specified on an
embed element, then the src attribute must also
be specified.
The type attribute,
if present, gives the MIME type by which the plugin to instantiate is selected. The
value must be a valid MIME type string. If both the type attribute and the src
attribute are present, then the type attribute must specify
the same type as the explicit Content-Type metadata of the
resource given by the src attribute.
While any of the following conditions are occurring, any plugin instantiated for
the element must be removed, and the embed element represents
nothing:
The element has neither a src attribute nor a type attribute.The element has a media element ancestor.The element has an ancestor object element that is not showing its
fallback content.
An embed element is said to be potentially
active when the following conditions are all met simultaneously:
The element is in a document or was in a document the last time the
event loop reached step 1.The element's node document is fully active.The element has either a src attribute set or a type attribute set (or both).The element's src attribute is either absent or its value
is not the empty string.The element is not a descendant of a media element.The element is not a descendant of an object element that is not showing its
fallback content.The element is being rendered, or was being rendered the last time
the event loop reached step 1.
Whenever an embed element that was not potentially active becomes potentially active, and whenever a potentially active embed element that is
remaining potentially active and has its src attribute set, changed, or removed or its type attribute set, changed, or removed, the user agent must
queue an element task on the embed task source given the element
to run the embed element setup steps for that element.
The embed element setup steps for a given embed element
element are as follows:
If another task has since been queued to run the
embed element setup steps for element, then return.
If element has a src attribute set, then:
Let url be the result of parsing the value
of element's src attribute, relative to
element's node document.If url is failure, then return.Let request be a new request whose
URL is url, client is element's node
document's relevant settings object, destination is "embed",
credentials mode is "include", mode is "navigate", and whose use-URL-credentials flag is set.Let processResponseEndOfBody given response res be to finalize and report
timing with res, element's node document's
relevant global object, and "embed".
Fetch request, with processResponseEndOfBody set to
processResponseEndOfBody, and processResponse set
to the following steps given response
response:
If another task has since been queued to run
the embed element setup steps for element, then
return.If response is a network error, then fire an event named load at element, and return.Let type be the result of determining the type of content given element and
response.
Switch on type:
null
Display no plugin for element.
image/svg+xml
If element's nested browsing context is null, then
create a new nested browsing context for element.
Navigate element's nested browsing context to
response, with historyHandling set to
"replace" and the source browsing context
set to element's node document's browsing context.
element now represents its nested browsing
context.
Otherwise
Display a plugin for element, given type and
response.
Fetching the resource must delay the load event of element's
node document.
Otherwise:
Let type be the value of element's type attribute.If type is a type that a plugin supports, then display a
plugin for element given type.Otherwise, display no plugin for element.
To determine the type of the content given an
embed element element and a response response, run the following steps:
If element has a type attribute, and that
attribute's value is a type that a plugin supports, then return the value of the
type attribute.
If the path component of response's
url matches a pattern that a plugin
supports, then return the type that that plugin can handle.
For example, a plugin might say that it can handle URLs with path components that end with the four character string
".swf".
If response has explicit Content-Type
metadata, and that value is a type that a plugin supports, then return that
value.Return null.
To display a plugin for an embed element element, given a
string type and optionally a response
response:
If element's nested browsing context is not null, then:
Discard element's
nested browsing context.Set element's nested browsing context to null.
Find and instantiate an appropriate plugin based on type,
replacing any previously-instantiated plugin for element. If response was
given, forward it to the plugin.element now represents this plugin instance.Once the plugin, and response if given, are completely loaded, queue an
element task on the DOM manipulation task source give element to
fire an event named load at element.
To display no plugin for an embed element element:
If element's nested browsing context is not null, then:
Discard element's
nested browsing context.Set element's nested browsing context to null.
Display an indication that no plugin could be found for element,
replacing any previously-instantiated plugin for element.element now represents nothing.
Whenever an embed element that was potentially
active stops being potentially active, any
plugin that had been instantiated for that element must be unloaded.
When a plugin is to be instantiated but the
sandboxed plugins browsing context flag is set on the embed element's
node document's active sandboxing flag set, then the user agent must
not instantiate the plugin, and must instead render the embed element
in a manner that conveys that the plugin was disabled.
The embed element potentially delays the load event.
Any namespace-less attribute other than name, align, hspace, and vspace may be
specified on the embed element, so long as its name is XML-compatible
and contains no ASCII upper alphas. These attributes are
then passed as parameters to the plugin.
The user agent should pass the names and values of all the attributes of the embed
element that have no namespace to the plugin used, when one is instantiated.
The HTMLEmbedElement object representing the element must expose the scriptable
interface of the plugin instantiated for the embed element, if any.
The embed element supports dimension attributes.
The IDL attributes src and type each must reflect the respective content
attributes of the same name.
fieldset
4.10.15
The fieldset element represents a set of form controls (or other
content) grouped together, optionally with a caption. The caption is given by the first
legend element that is a child of the fieldset element, if any. The
remainder of the descendants form the group.
The disabled attribute, when specified, causes all the
form control descendants of the fieldset element, excluding those that are
descendants of the fieldset element's first legend element child, if
any, to be disabled.
A fieldset element is a disabled
fieldset if it matches any of the following conditions:
Its disabled attribute is specified
It is a descendant of another fieldset element whose disabled attribute is specified, and is not a
descendant of that fieldset element's first legend element child, if
any.
The form attribute is used to explicitly associate the
fieldset element with its form owner. The name attribute represents the element's name.
The disabled IDL attribute must reflect the
content attribute of the same name.
The type
IDL attribute must return the string "fieldset".
The elements IDL attribute must return an
HTMLCollection rooted at the fieldset element, whose filter matches
listed elements.
The willValidate, validity, and validationMessage attributes, and the checkValidity(), reportValidity(), and setCustomValidity() methods, are part of the
constraint validation API. The form and name IDL attributes are part of the element's forms API.
figcaption
4.4.13
The figcaption element represents a caption or legend for the rest of
the contents of the figcaption element's parent figure element, if any.
figure
4.4.12
The figure element represents some flow content,
optionally with a caption, that is self-contained (like a complete sentence) and is typically
referenced as a single unit from the main flow of the document.
The element can thus be used to annotate illustrations, diagrams, photos, code listings,
etc.
When a figure is referred to from the main content of the document by identifying
it by its caption (e.g., by figure number), it enables such content to be easily moved away from
that primary content, e.g., to the side of the page, to dedicated pages, or to an appendix,
without affecting the flow of the document.
If a figure element is referenced by its relative position, e.g.,
"in the photograph above" or "as the next figure shows", then moving the figure would disrupt the
page's meaning. Authors are encouraged to consider using labels to refer to figures, rather than
using such relative references, so that the page can easily be restyled without affecting the
page's meaning.
The first figcaption element child of the element, if any,
represents the caption of the figure element's contents. If there is no child
figcaption element, then there is no caption.
A figure element's contents are part of the surrounding flow. If the purpose of
the page is to display the figure, for example a photograph on an image sharing site, the
figure and figcaption elements can be used to explicitly provide a
caption for that figure. For content that is only tangentially related, or that serves a separate
purpose than the surrounding flow, the aside element should be used (and can itself
wrap a figure). For example, a pull quote that repeats content from an
article would be more appropriate in an aside than in a
figure, because it isn't part of the content, it's a repetition of the content for
the purposes of enticing readers or highlighting key topics.
footer
4.3.9
The footer element represents a footer for its nearest ancestor
sectioning content element, or for the body element if there is no such
ancestor. A footer typically contains information about its section such as who wrote it, links
to related documents, copyright data, and the like.
When the footer element contains entire sections, they represent appendices, indices, long colophons, verbose license
agreements, and other such content.
Footers don't necessarily have to appear at the end of a section, though they usually
do.
When there is no ancestor sectioning content element, then it applies to the whole
page.
form
4.10.3
The form element represents a hyperlink that can be
manipulated through a collection of form-associated
elements, some of which can represent editable values that can be submitted to a server for
processing.
The accept-charset attribute gives the character
encodings that are to be used for the submission. If specified, the value must be an ASCII
case-insensitive match for "UTF-8". [ENCODING]
The name attribute
represents the form's name within the forms
collection. The value must not be the empty string, and the value must be unique amongst the
form elements in the forms collection that
it is in, if any.
The autocomplete attribute is an enumerated
attribute. The attribute has two states. The on keyword maps to the on state, and the off keyword maps to the off state. The attribute may also be omitted. The
missing value default and the invalid value default are the on state. The off state indicates that by default, form
controls in the form will have their autofill field name set to "off"; the on state indicates that by default, form controls
in the form will have their autofill field name set to "on".
The action, enctype,
method, novalidate,
and target attributes are attributes for form
submission.
The rel attribute on
form elements controls what kinds of links the elements create. The attribute's value
must be a unordered set of unique space-separated tokens. The allowed keywords and their meanings are defined in an earlier section.
rel's supported
tokens are the keywords defined in HTML link types which are
allowed on form elements, impact the processing model, and are supported by the user
agent. The possible supported tokens are noreferrer, noopener, and opener. rel's supported tokens must only include the tokens from this
list that the user agent implements the processing model for.
The autocomplete IDL attribute must reflect
the content attribute of the same name, limited to only known values.
The name and
rel IDL attributes
must reflect the content attribute of the same name.
The acceptCharset IDL attribute must reflect
the accept-charset content attribute.
The relList
IDL attribute must reflect the rel content
attribute.
The elements
IDL attribute must return an HTMLFormControlsCollection rooted at the
form element's root, whose filter matches listed elements whose form owner is the
form element, with the exception of input elements whose type attribute is in the Image Button state, which must, for historical reasons, be
excluded from this particular collection.
The length IDL
attribute must return the number of nodes represented by the elements
collection.
The supported property indices at any instant are the indices supported by the
object returned by the elements attribute at that
instant.
To determine the value of an indexed property for a
form element, the user agent must return the value returned by the item method on the elements collection, when invoked with the given index as its
argument.
Each form element has a mapping of names to elements called the past names
map. It is used to persist names of controls even when they change names.
The supported property names consist of the names obtained from the following
algorithm, in the order obtained from this algorithm:
Let sourced names be an initially empty ordered list of tuples
consisting of a string, an element, a source, where the source is either id, name,
or past, and, if the source is past, an age.
For each listed element candidate
whose form owner is the form element, with the exception of any
input elements whose type attribute is in the
Image Button state:
If candidate has an id attribute, add
an entry to sourced names with that id
attribute's value as the string, candidate as the element, and id as
the source.If candidate has a name attribute,
add an entry to sourced names with that name attribute's value as the string, candidate
as the element, and name as the source.
For each img element candidate whose form owner is the
form element:
If candidate has an id attribute, add
an entry to sourced names with that id
attribute's value as the string, candidate as the element, and id as
the source.If candidate has a name attribute,
add an entry to sourced names with that name attribute's value as the string, candidate
as the element, and name as the source.
For each entry past entry in the past names map add an entry
to sourced names with the past entry's name as the
string, past entry's element as the element, past as the source, and
the length of time past entry has been in the past names map as
the age.
Sort sourced names by tree order of the element entry of
each tuple, sorting entries with the same element by putting entries whose source is id
first, then entries whose source is name, and finally entries whose source is past,
and sorting entries with the same element and source by their age, oldest first.Remove any entries in sourced names that have the empty string as
their name.Remove any entries in sourced names that have the same name as an
earlier entry in the map.Return the list of names from sourced names, maintaining their
relative order.
To determine the value of a named property name
for a form element, the user agent must run the following steps:
Let candidates be a live RadioNodeList object
containing all the listed elements, whose form
owner is the form element, that have either an id attribute or a name attribute equal
to name, with the exception of input elements whose type attribute is in the Image Button state, in tree order.If candidates is empty, let candidates be a live
RadioNodeList object containing all the img elements, whose form
owner is the form element, that have either an id attribute or a name attribute
equal to name, in tree order.If candidates is empty, name is the name of one of
the entries in the form element's past names map: return the object
associated with name in that map.If candidates contains more than one node, return candidates.Otherwise, candidates contains exactly one node. Add a mapping from
name to the node in candidates in the form
element's past names map, replacing the previous entry with the same name, if
any.Return the node in candidates.
If an element listed in a form element's past names map changes
form owner, then its entries must be removed from that map.
The submit()
method, when invoked, must submit the form
element from the form element itself, with the submitted from submit() method flag set.
The requestSubmit(submitter) method, when
invoked, must run the following steps:
If submitter is not null, then:
If submitter is not a submit
button, then throw a TypeError.If submitter's form owner is not this form element,
then throw a "NotFoundError" DOMException.
Otherwise, set submitter to this form element.Submit this form element, from
submitter.
The reset()
method, when invoked, must run the following steps:
If the form element is marked as locked for reset, then return.Mark the form element as locked for reset.Reset the form element.Unmark the form element as locked for reset.
If the checkValidity() method is invoked, the user agent
must statically validate the constraints of the form element, and return
true if the constraint validation return a positive result, and false if it returned a
negative result.
If the reportValidity() method is invoked, the user agent
must interactively validate the constraints of the form element, and
return true if the constraint validation return a positive result, and false if it returned
a negative result.
head
4.2.1
The head element represents a collection of metadata for the
Document.
header
4.3.8
The header element represents a group of introductory or navigational
aids.
hgroup
4.3.7
The hgroup element represents a heading and related content. The
element may be used to group an h1–h6 element with one or more
p elements containing content representing a subheading, alternative title, or
tagline.
hr
4.4.2
The hr element represents a paragraph-level thematic
break, e.g. a scene change in a story, or a transition to another topic within a section of a
reference book.
html
4.1.1
The html element represents the root of an HTML document.
Authors are encouraged to specify a lang attribute on the root
html element, giving the document's language. This aids speech synthesis tools to
determine what pronunciations to use, translation tools to determine what rules to use, and so
forth.
i
4.5.20
The i element represents 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, transliteration, a thought, or a ship name in Western texts.
Terms in languages different from the main text should be annotated with lang attributes (or, in XML, lang attributes in the XML namespace).
Authors can use the class attribute on the i
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.
Authors are encouraged to consider whether other elements might be more applicable than the
i element, for instance the em element for marking up stress emphasis,
or the dfn element to mark up the defining instance of a term.
iframe
4.8.5
The iframe element represents its nested browsing
context.
The src attribute
gives the URL of a page that the element's nested browsing context is to
contain. The attribute, if present, must be a valid non-empty URL potentially surrounded by
spaces. If the itemprop attribute is specified on an
iframe element, then the src attribute must
also be specified.
The srcdoc
attribute gives the content of the page that the element's nested browsing context is
to contain. The value of the attribute is the source of an iframe srcdoc document.
The srcdoc attribute, if present, must have a value
using the HTML syntax that consists of the following syntactic components, in the
given order:
Any number of comments and ASCII
whitespace.Optionally, a DOCTYPE.
Any number of comments and ASCII
whitespace.The document element, in the form of an html element.Any number of comments and ASCII
whitespace.
When an iframe element element is inserted into a document whose browsing
context is non-null, the user agent must run these steps:
Create a new nested browsing context for element.If element has a sandbox attribute,
then parse the sandboxing directive given the
attribute's value and element's iframe sandboxing flag
set.Process the iframe attributes for element, with initialInsertion set to true.
When an iframe element is removed
from a document, the user agent must discard the element's nested browsing context, if it is not null,
and then set the element's nested browsing context to null.
Whenever an iframe element with a non-null nested browsing context
has its srcdoc attribute set, changed, or removed, the
user agent must process the iframe attributes.
Similarly, whenever an iframe element with a non-null nested browsing
context but with no srcdoc attribute specified has
its src attribute set, changed, or removed, the user agent
must process the iframe attributes.
To process the iframe attributes for an element element,
with an optional boolean initialInsertion (default false):
If element's srcdoc attribute is
specified, then:
Set element's current navigation was lazy loaded boolean to
false.
If the will lazy load element steps given element return true,
then:
Set element's lazy load resumption steps to the rest of this
algorithm starting with the step labeled navigate to the srcdoc resource.Set element's current navigation was lazy loaded boolean to
true.Start intersection-observing a lazy loading element for
element.Return.
Navigate to the srcdoc resource: navigate an iframe or
frame given element and a new response whose URL
list is « about:srcdoc », header list is « (`Content-Type`, `text/html`) », and body is the value of element's srcdoc attribute.
The resulting Document must be considered an iframe srcdoc document.
Otherwise, run the shared attribute processing steps for iframe and
frame elements given element and
initialInsertion.
The shared attribute processing steps
for iframe and frame elements, given an element
element and a boolean initialInsertion, are:
Let url be the URL record about:blank.If element has a src attribute specified,
and its value is not the empty string, then parse the value of
that attribute relative to element's node document. If this is
successful, then set url to the resulting URL record.If there exists an ancestor browsing context of element's
nested browsing context whose active document's URL, ignoring fragments, is equal to url, then return.
If url matches about:blank and
initialInsertion is true, then:
Perform the URL and history update steps given element's
nested browsing context's active document and url.
Run the iframe load event steps given element.Return.
Let resource be a new request whose URL is url and whose referrer policy is the current state of
element's referrerpolicy content
attribute.If element is an iframe element, then set element's
current navigation was lazy loaded boolean to false.
If element is an iframe element, and the will lazy load element
steps given element return true, then:
Set element's lazy load resumption steps to the rest of this
algorithm starting with the step labeled navigate to the resource.Set element's current navigation was lazy loaded boolean to
true.Start intersection-observing a lazy loading element for
element.Return.
Navigate to the resource: navigate an iframe or
frame given element and resource.
To navigate an iframe or frame given an element
element and a resource resource:
Let historyHandling be "default".
If element's nested browsing context's active
document is not completely loaded, then set historyHandling to
"replace".Let reportFrameTiming be the following step given response response: queue an element
task on the networking task source given element's node
document's relevant global object to finalize and report timing
given response, element's node document's relevant
global object, and element's local
name.Navigate element's nested
browsing context to resource, with historyHandling set to historyHandling, the
source browsing context set to element's node document's
browsing context, and
processResponseEndOfBody set to
reportFrameTiming.
Each Document has an iframe load in progress flag and a mute
iframe load flag. When a Document is created, these flags must be unset for
that Document.
To run the iframe load event steps, given an iframe element
element:
Assert: element's nested browsing context is not null.Let childDocument be the active document of element's
nested browsing context.If childDocument has its mute iframe load flag set, then
return.Set childDocument's iframe load in progress flag.Fire an event named load at element.Unset childDocument's iframe load in progress flag.
This, in conjunction with scripting, can be used to probe the URL space of the
local network's HTTP servers. User agents may implement cross-origin
access control policies that are stricter than those described above to mitigate this attack, but
unfortunately such policies are typically not compatible with existing web content.
If an element type potentially delays the load event, then for each element
element of that type, the user agent must delay the load event of
element's node document if element's nested browsing
context is non-null and any of the following are true:
element's nested browsing context's active document
is not ready for post-load tasks.Anything is delaying the load event of
element's nested browsing context's active
document.element's nested browsing context is in the delaying load events mode.
Each iframe element has an associated current navigation was lazy
loaded boolean, initially false. It is set and unset in the process the
iframe attributes algorithm.
An iframe element whose current navigation was lazy loaded boolean is
false potentially delays the load event.
The name attribute,
if present, must be a valid browsing context name. The given value is used to name
the element's nested browsing context if present when that is created.
The sandbox
attribute, when specified, enables a set of extra restrictions on any content hosted by the
iframe. Its value must be an unordered set of unique space-separated
tokens that are ASCII case-insensitive. The allowed values are:
allow-downloadsallow-formsallow-modalsallow-orientation-lockallow-pointer-lockallow-popupsallow-popups-to-escape-sandboxallow-presentationallow-same-originallow-scriptsallow-top-navigationallow-top-navigation-by-user-activationallow-top-navigation-to-custom-protocols
When the attribute is set, the content is treated as being from a unique origin,
forms, scripts, and various potentially annoying APIs are disabled, links are prevented from
targeting other browsing contexts, and plugins are secured.
The allow-same-origin keyword causes
the content to be treated as being from its real origin instead of forcing it into a unique
origin; the allow-top-navigation
keyword allows the content to navigate its top-level browsing context;
the allow-top-navigation-by-user-activation
keyword behaves similarly but allows such navigation only when the
browsing context's active window has transient activation; the allow-top-navigation-to-custom-protocols
reenables navigations toward non fetch scheme to be handed off to external software; and the allow-forms, allow-modals, allow-orientation-lock, allow-pointer-lock, allow-popups, allow-presentation, allow-scripts, and allow-popups-to-escape-sandbox
keywords re-enable forms, modal dialogs, screen orientation lock, the pointer lock API, popups,
the presentation API, scripts, and the creation of unsandboxed auxiliary browsing contexts respectively. The allow-downloads keyword allows content to
perform downloads. [POINTERLOCK] [SCREENORIENTATION] [PRESENTATION]
The allow-top-navigation and allow-top-navigation-by-user-activation
keywords must not both be specified, as doing so is redundant; only allow-top-navigation will have an effect
in such non-conformant markup.
Similarly, the allow-top-navigation-to-custom-protocols
keyword must not be specified if either allow-top-navigation or allow-popups are specified, as doing so is
redundant.
Setting both the allow-scripts and allow-same-origin keywords together when the
embedded page has the same origin as the page containing the iframe
allows the embedded page to simply remove the sandbox
attribute and then reload itself, effectively breaking out of the sandbox altogether.
These flags only take effect when the nested browsing context of
the iframe element is navigated. Removing them, or
removing the entire sandbox attribute, has no effect on
an already-loaded page.
Potentially hostile files should not be served from the same server as the file
containing the iframe element. 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
iframe. To limit the damage that can be caused by hostile HTML content, it should be
served from a separate dedicated domain. Using a different domain ensures that scripts in the
files are unable to attack the site, even if the user is tricked into visiting those pages
directly, without the protection of the sandbox
attribute.
When an iframe element's sandbox
attribute is set or changed while it has a non-null nested browsing context, the user
agent must parse the sandboxing directive given
the attribute's value and the iframe element's iframe sandboxing
flag set.
When an iframe element's sandbox
attribute is removed while it has a non-null nested browsing context, the user agent
must empty the iframe element's iframe sandboxing flag
set.
The allow
attribute, when specified, determines the container
policy that will be used when the permissions policy for a Document
in the iframe's nested browsing context is initialized. Its value must
be a serialized permissions policy.
[PERMISSIONSPOLICY]
The allowfullscreen attribute is a boolean
attribute. When specified, it indicates that Document objects in the
iframe element's nested browsing context will be initialized with a
permissions policy which allows the
"fullscreen" feature to be used from any origin. This is
enforced by the process permissions policy
attributes algorithm. [PERMISSIONSPOLICY]
To determine whether a Document object document
is allowed to use the policy-controlled-feature feature, run these
steps:
If document's browsing context is
null, then return false.If document's browsing context's
active document is not document, then return false.If the result of running is feature enabled in document
for origin on feature, document, and document's origin is "Enabled", then return
true.Return false.
Because they only influence the permissions policy of the nested browsing
context's active document, the allow
and allowfullscreen attributes only take effect
when the nested browsing context of the iframe is navigated. Adding or removing them has no effect on an already-loaded
document.
The iframe element supports dimension attributes for cases where the
embedded content has specific dimensions (e.g. ad units have well-defined dimensions).
An iframe element never has fallback content, as it will always
create a new nested browsing context, regardless of whether the specified initial
contents are successfully used.
The referrerpolicy attribute is a
referrer policy attribute. Its purpose is to set the referrer policy
used when processing the iframe
attributes. [REFERRERPOLICY]
The loading attribute is a lazy
loading attribute. Its purpose is to indicate the policy for loading iframe
elements that are outside the viewport.
When the loading attribute's state is changed to the
Eager state, the user agent must run these
steps:
Let resumptionSteps be the iframe element's lazy load
resumption steps.If resumptionSteps is null, then return.Set the iframe's lazy load resumption steps to null.Invoke resumptionSteps.
Descendants of iframe elements represent nothing. (In legacy user agents that do
not support iframe elements, the contents would be parsed as markup that could act as
fallback content.)
The IDL attributes src, srcdoc, name, sandbox, and allow must reflect the respective content
attributes of the same name.
The supported tokens for sandbox's DOMTokenList are the allowed
values defined in the sandbox attribute and supported by
the user agent.
The allowFullscreen IDL attribute must
reflect the allowfullscreen content
attribute.
The referrerPolicy IDL attribute must
reflect the referrerpolicy content
attribute, limited to only known values.
The loading IDL attribute must reflect the loading content attribute, limited to only known
values.
The contentDocument IDL attribute, on getting, must
return the iframe element's content
document.
The contentWindow IDL attribute must return the
WindowProxy object of the iframe element's nested browsing
context, if its nested browsing context is non-null, or null otherwise.
img
4.8.3
An img element represents an image.
An img element has a dimension
attribute source, initially set to the element itself.
The image given by the src
and srcset attributes, and
any previous sibling source elements' srcset
attributes if the parent is a picture element, is the embedded content; the value of
the alt attribute provides
equivalent content for those who cannot process images or who have image loading disabled (i.e. it
is the img element's fallback content).
The requirements on the alt attribute's value are described
in a separate section.
The src attribute must be present, and must contain a
valid non-empty URL potentially surrounded by spaces referencing a non-interactive,
optionally animated, image resource that is neither paged nor scripted.
The srcset attribute may also be present, and is a
srcset attribute.
The srcset attribute and the src attribute (if width
descriptors are not used) contribute the image sources
to the source set (if no source element was selected).
If the srcset attribute is present and has any image candidate strings using a width
descriptor, the sizes attribute must also
be present, and is a sizes attribute. The sizes
attribute contributes the source size to the source set (if no
source element was selected).
The crossorigin
attribute is a CORS settings attribute. Its purpose is to allow images from
third-party sites that allow cross-origin access to be used with canvas.
The referrerpolicy attribute is a referrer
policy attribute. Its purpose is to set the referrer policy used when fetching the image. [REFERRERPOLICY]
The decoding
attribute indicates the preferred method to decode this
image. The attribute, if present, must be an image decoding hint. This attribute's missing value default and invalid value default are both the auto state.
The loading attribute is a lazy
loading attribute. Its purpose is to indicate the policy for loading images that are
outside the viewport.
When the loading attribute's state is changed to the
Eager state, the user agent must run these
steps:
Let resumptionSteps be the img element's lazy load
resumption steps.If resumptionSteps is null, then return.Set the img's lazy load resumption steps to null.Invoke resumptionSteps.
The img HTML element insertion
steps, given insertedNode, are:
If insertedNode's parent is a picture element, then, count this as
a relevant mutation for
insertedNode.
The img HTML element removing
steps, given removedNode and oldParent, are:
If oldParent is a picture element, then, count this as a
relevant mutation for removedNode.
The img element must not be used as a layout tool. In particular, img
elements should not be used to display transparent images, as such images rarely convey meaning and
rarely add anything useful to the document.
What an img element represents depends on the src attribute and the alt
attribute.
If the src attribute is set and the alt attribute is set to the empty string
The image is either decorative or supplemental to the rest of the content, redundant with
some other information in the document.
If the image is available and the user agent is configured
to display that image, then the element represents the element's image data.
Otherwise, the element represents 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.
If the src attribute is set and the alt attribute is set to a value that isn't empty
The image is a key part of the content; the alt attribute
gives a textual equivalent or replacement for the image.
If the image is available and the user agent is configured
to display that image, then the element represents the element's image data.
Otherwise, the element represents the text given by the alt attribute. User agents may provide the user with a notification
that an image is present but has been omitted from the rendering.
If the src attribute is set and the alt attribute is not
The image might be a key part of the content, and there is no textual equivalent of the image
available.
If the image is available and the user agent is configured
to display that image, then the element represents the element's image data.
If the image has a src attribute whose value is
the empty string, then the element represents nothing.
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:
If the image has a title attribute whose value is not
the empty string, then return the value of that attribute.If the image is a descendant of a figure element that has a child
figcaption element, and, ignoring the figcaption element and its
descendants, the figure element has no flow content descendants other
than inter-element whitespace and the img element, then return the
contents of the first such figcaption element.Return nothing. (There is no caption information.)
If the src attribute is not set and either the alt attribute is set to the empty string or the alt attribute is not set at all
The element represents nothing.
Otherwise
The element represents the text given by the alt attribute.
The alt attribute does not represent advisory information.
User agents must not present the contents of the alt attribute
in the same way as content of the title attribute.
User agents may always provide the user with the option to display any image, or to prevent any
image from being displayed. User agents may also apply heuristics to help the user make use of the
image when the user is unable to see it, e.g. due to a visual disability or because they are using
a text terminal with no graphics capabilities. Such heuristics could include, for instance,
optical character recognition (OCR) of text found within the image.
While user agents are encouraged to repair cases of missing alt attributes, authors must not rely on such behavior. Requirements for providing text to act as an alternative for images are described
in detail below.
The contents of img elements, if any, are ignored for the purposes of
rendering.
The usemap attribute,
if present, can indicate that the image has an associated
image map.
The ismap attribute,
when used on an element that is a descendant of an a element with an href 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 a element.
The ismap attribute is a
boolean attribute. The attribute must not be specified
on an element that does not have an ancestor a element
with an href attribute.
The img element supports dimension
attributes.
The alt, src, srcset and sizes IDL attributes must
reflect the respective content attributes of the same name.
The crossOrigin IDL attribute must
reflect the crossorigin content attribute,
limited to only known values.
The useMap IDL
attribute must reflect the usemap content
attribute.
The isMap IDL
attribute must reflect the ismap content
attribute.
The referrerPolicy IDL attribute must
reflect the referrerpolicy content
attribute, limited to only known values.
The decoding
IDL attribute must reflect the decoding
content attribute, limited to only known values.
The loading
IDL attribute must reflect the loading content
attribute, limited to only known values.
The IDL attributes width and height must return the rendered width and height of the
image, in CSS pixels, if the image is being rendered, and
is being rendered to a visual medium; or else the density-corrected intrinsic width and
height of the image, in CSS pixels, if the image has
intrinsic dimensions and is available but not being
rendered to a visual medium; or else 0, if the image is not available or does not have intrinsic dimensions. [CSS]
On setting, they must act as if they reflected the respective
content attributes of the same name.
The IDL attributes naturalWidth and naturalHeight must return
the density-corrected intrinsic width and height of the image, in CSS pixels, if the image has intrinsic dimensions and is available, or else 0. [CSS]
The IDL attribute complete must return true if any of the following
conditions is true:
Both the src attribute and the srcset attribute are omitted.
The srcset attribute is omitted and the src attribute's value is the empty string.
The img element's current request's state is completely available and its
pending request is null.
The img element's current request's state is broken and its
pending request is null.
Otherwise, the attribute must return false.
The currentSrc IDL attribute must return the
img element's current request's current
URL.
The decode()
method, when invoked, must perform the following steps:
Let promise be a new promise.
Queue a microtask to perform the following steps:
This is done because updating the image data
takes place in a microtask as well. Thus, to make code such as
img.src = "stars.jpg";
img.decode();
properly decode stars.jpg, we need to delay any processing by one
microtask.
If any of the following conditions are true about this img element:
its node document is not an active document;its current request's state is broken,
then reject promise with an "EncodingError"
DOMException.
Otherwise, in parallel, wait for one of the following cases to occur, and
perform the corresponding actions:
This img element's node document stops being an active
documentThis img element's current request changes or is mutatedThis img element's current request's state becomes broken
Reject promise with an "EncodingError"
DOMException.
This img element's current request's state becomes completely
available
Decode the image.
If decoding does not need to be performed for this image (for example because it is a
vector graphic), resolve promise with undefined.
If decoding fails (for example due to invalid image data), reject promise with
an "EncodingError" DOMException.
If the decoding process completes successfully, resolve promise with
undefined.
User agents should ensure that the decoded media data stays readily available until at
least the end of the next successful update the rendering step in the
event loop. This is an important part of the API contract, and should not be
broken if at all possible. (Typically, this would only be violated in low-memory situations
that require evicting decoded image data, or when the image is too large to keep in decoded
form for this period of time.)
Return promise.
A legacy factory function is provided for creating HTMLImageElement objects (in
addition to the factory methods from DOM such as createElement()): Image(width, height). When invoked,
the legacy factory function must perform the following steps:
Let document be the current global object's associated Document.Let img be the result of creating an
element given document, img, and the HTML
namespace.If width is given, then set
an attribute value for img using "width"
and width.If height is given, then set an attribute value for img
using "height" and height.Return img.
input
4.10.5
The input element represents a typed data field, usually with a form
control to allow the user to edit the data.
The type attribute
controls the data type (and associated control) of the element. It is an enumerated
attribute. 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.
Keyword
State
Data type
Control type
hidden
Hidden
An arbitrary string
n/a
text
Text
Text with no line breaks
A text control
search
Search
Text with no line breaks
Search control
tel
Telephone
Text with no line breaks
A text control
url
URL
An absolute URL
A text control
email
Email
An email address or list of email addresses
A text control
password
Password
Text with no line breaks (sensitive information)
A text control that obscures data entry
date
Date
A date (year, month, day) with no time zone
A date control
month
Month
A date consisting of a year and a month with no time zone
A month control
week
Week
A date consisting of a week-year number and a week number with no time zone
A week control
time
Time
A time (hour, minute, seconds, fractional seconds) with no time zone
A time control
datetime-local
Local Date and Time
A date and time (year, month, day, hour, minute, second, fraction of a second) with no time zone
A date and time control
number
Number
A numerical value
A text control or spinner control
range
Range
A numerical value, with the extra semantic that the exact value is not important
A slider control or similar
color
Color
An sRGB color with 8-bit red, green, and blue components
A color picker
checkbox
Checkbox
A set of zero or more values from a predefined list
A checkbox
radio
Radio Button
An enumerated value
A radio button
file
File Upload
Zero or more files each with a MIME type and optionally a filename
A label and a button
submit
Submit Button
An enumerated value, with the extra semantic that it must be the last value selected and initiates form submission
A button
image
Image Button
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
Either a clickable image, or a button
reset
Reset Button
n/a
A button
button
Button
n/a
A button
The missing value default and the invalid value default are the Text state.
Which of the
accept,
alt,
autocomplete,
checked,
dirname,
formaction,
formenctype,
formmethod,
formnovalidate,
formtarget,
height,
list,
max,
maxlength,
min,
minlength,
multiple,
pattern,
placeholder,
readonly,
required,
size,
src,
step, and
width content attributes, the
checked,
files,
valueAsDate,
valueAsNumber, and
list IDL attributes, the
select() method, the
selectionStart,
selectionEnd, and
selectionDirection, IDL attributes, the
setRangeText() and
setSelectionRange() methods, the
stepUp() and
stepDown() methods, and the
input and
change events apply to an
input element depends on the state of its
type attribute.
The subsections that define each type also clearly define in normative "bookkeeping" sections
which of these feature apply, and which do not apply, to each type. The behavior of
these features depends on whether they apply or not, as defined in their various sections (q.v.
for content attributes, for APIs, for events).
The following table is non-normative and summarizes which of those
content attributes, IDL attributes, methods, and events apply to each state:
Hidden
Text,
Search
URL,
Telephone
Email
Password
Date,
Month,
Week,
Time
Local Date and Time
Number
Range
Color
Checkbox,
Radio Button
File Upload
Submit Button
Image Button
Reset Button,
Button
Content attributes
accept
·
·
·
·
·
·
·
·
·
·
·
Yes
·
·
·
alt
·
·
·
·
·
·
·
·
·
·
·
·
·
Yes
·
autocomplete
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
·
·
·
·
·
checked
·
·
·
·
·
·
·
·
·
·
Yes
·
·
·
·
dirname
·
Yes
·
·
·
·
·
·
·
·
·
·
·
·
·
formaction
·
·
·
·
·
·
·
·
·
·
·
·
Yes
Yes
·
formenctype
·
·
·
·
·
·
·
·
·
·
·
·
Yes
Yes
·
formmethod
·
·
·
·
·
·
·
·
·
·
·
·
Yes
Yes
·
formnovalidate
·
·
·
·
·
·
·
·
·
·
·
·
Yes
Yes
·
formtarget
·
·
·
·
·
·
·
·
·
·
·
·
Yes
Yes
·
height
·
·
·
·
·
·
·
·
·
·
·
·
·
Yes
·
list
·
Yes
Yes
Yes
·
Yes
Yes
Yes
Yes
Yes
·
·
·
·
·
max
·
·
·
·
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
maxlength
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
·
·
·
·
min
·
·
·
·
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
minlength
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
·
·
·
·
multiple
·
·
·
Yes
·
·
·
·
·
·
·
Yes
·
·
·
pattern
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
·
·
·
·
placeholder
·
Yes
Yes
Yes
Yes
·
·
Yes
·
·
·
·
·
·
·
readonly
·
Yes
Yes
Yes
Yes
Yes
Yes
Yes
·
·
·
·
·
·
·
required
·
Yes
Yes
Yes
Yes
Yes
Yes
Yes
·
·
Yes
Yes
·
·
·
size
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
·
·
·
·
src
·
·
·
·
·
·
·
·
·
·
·
·
·
Yes
·
step
·
·
·
·
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
width
·
·
·
·
·
·
·
·
·
·
·
·
·
Yes
·
IDL attributes and methods
checked
·
·
·
·
·
·
·
·
·
·
Yes
·
·
·
·
files
·
·
·
·
·
·
·
·
·
·
·
Yes
·
·
·
value
default
value
value
value
value
value
value
value
value
value
default/on
filename
default
default
default
valueAsDate
·
·
·
·
·
Yes
·
·
·
·
·
·
·
·
·
valueAsNumber
·
·
·
·
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
list
·
Yes
Yes
Yes
·
Yes
Yes
Yes
Yes
Yes
·
·
·
·
·
select()
·
Yes
Yes
Yes†
Yes
Yes†
Yes†
Yes†
·
Yes†
·
Yes†
·
·
·
selectionStart
·
Yes
Yes
·
Yes
·
·
·
·
·
·
·
·
·
·
selectionEnd
·
Yes
Yes
·
Yes
·
·
·
·
·
·
·
·
·
·
selectionDirection
·
Yes
Yes
·
Yes
·
·
·
·
·
·
·
·
·
·
setRangeText()
·
Yes
Yes
·
Yes
·
·
·
·
·
·
·
·
·
·
setSelectionRange()
·
Yes
Yes
·
Yes
·
·
·
·
·
·
·
·
·
·
stepDown()
·
·
·
·
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
stepUp()
·
·
·
·
·
Yes
Yes
Yes
Yes
·
·
·
·
·
·
Events
input event
·
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
·
·
·
change event
·
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
·
·
·
† If the control has no selectable text, the select() method results in a no-op, with no
"InvalidStateError" DOMException.
Some states of the type attribute define a value
sanitization algorithm.
Each input element has a value, which is
exposed by the value IDL attribute. Some states define an
algorithm to convert a string to a number,
an algorithm to convert a number to a
string, an algorithm to convert a string to a
Date object, and an algorithm to
convert a Date object to a string, which are used by max, min, step, valueAsDate,
valueAsNumber, and stepUp().
An input element's dirty value flag must be
set to true whenever the user interacts with the control in a way that changes the value. (It is also set to true when the value is programmatically
changed, as described in the definition of the value IDL
attribute.)
The value content
attribute gives the default value of the input
element. When the value content attribute is
added, set, or removed, if the control's dirty value flag
is false, the user agent must set the value of the element
to the value of the value content attribute, if there is
one, or the empty string otherwise, and then run the current value sanitization
algorithm, if one is defined.
Each input element has a checkedness,
which is exposed by the checked IDL attribute.
Each input element has a boolean dirty checkedness flag. When it is true, the
element is said to have a dirty checkedness.
The dirty checkedness flag 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 checkedness.
The checked
content attribute is a boolean attribute that gives the default checkedness of the input element. When the checked content attribute is added, if
the control does not have dirty checkedness, the user
agent must set the checkedness of the element to true;
when the checked content attribute is removed, if the
control does not have dirty checkedness, the user
agent must set the checkedness of the element to
false.
The reset algorithm for input
elements is to set the dirty value flag and dirty checkedness flag back to false, set the
value of the element to the value of the value content attribute, if there is one, or the empty string
otherwise, set the checkedness of the element to true if
the element has a checked content attribute and false if
it does not, empty the list of selected
files, and then invoke the value sanitization algorithm, if the type attribute's current state defines one.
Each input element can be mutable. Except where
otherwise specified, an input element is always mutable. Similarly, except where otherwise specified, the user
agent should not allow the user to modify the element's value or checkedness.
When an input element is disabled, it is not mutable.
The cloning steps for input elements
must propagate the value, dirty value flag, checkedness, and dirty checkedness flag from the node being cloned
to the copy.
The activation behavior for input elements are these steps:
If this element is not mutable and is not in the Checkbox state and is not in the Radio state, then return.Run this element's input activation behavior, if any, and do nothing
otherwise.
The legacy-pre-activation behavior for input elements are these
steps:
If this element's type attribute is in the Checkbox state, then set this element's checkedness to its opposite value (i.e. true if it is false,
false if it is true) and set this element's indeterminate IDL attribute to false.If this element's type attribute is in the Radio Button state, then get a reference to the element in
this element's radio button group that has its checkedness set to true, if any, and then set this element's
checkedness to true.
The legacy-canceled-activation behavior for input elements are these
steps:
If the element's type attribute is in the Checkbox state, then set the element's checkedness and the element's indeterminate IDL attribute back to the values they had
before the legacy-pre-activation behavior was run.If this element's type attribute is in the Radio Button state, then if the element to which a
reference was obtained in the legacy-pre-activation behavior, if any, is still in
what is now this element's radio button group, if it still has one, and if so,
setting that element's checkedness to true; or else, if
there was no such element, or that element is no longer in this element's radio button
group, or if this element no longer has a radio button group, setting this
element's checkedness to false.
When an input element is first created, the element's rendering and behavior must
be set to the rendering and behavior defined for the type
attribute's state, and the value sanitization algorithm, if one is defined for the
type attribute's state, must be invoked.
When an input element's type attribute
changes state, the user agent must run the following steps:
If the previous state of the element's type attribute
put the value IDL attribute in the value mode, and the element's value is not the empty string, and the new state of the element's
type attribute puts the value IDL attribute in either the default mode or the default/on mode, then set the element's value content attribute to the element's value.Otherwise, if the previous state of the element's type attribute put the value
IDL attribute in any mode other than the value mode, and the
new state of the element's type attribute puts the value IDL attribute in the value mode, then set the value of the element to the value of the value content attribute, if there is one, or the empty string
otherwise, and then set the control's dirty value flag to
false.Otherwise, if the previous state of the element's type attribute put the value IDL attribute in any mode other than the filename mode, and the new state of the element's type attribute puts the value IDL attribute in the filename mode, then set the value of the element to the empty string.Update the element's rendering and behavior to the new state's.Signal a type change for the element. (The Radio Button state uses this, in particular.)Invoke the value sanitization algorithm, if one is defined for the type attribute's new state.Let previouslySelectable be true if setRangeText() previously applied to the element, and false otherwise.Let nowSelectable be true if setRangeText() now applies to the element, and false otherwise.If previouslySelectable is false and nowSelectable is true, set the
element's text entry cursor position to the
beginning of the text control, and set its selection
direction to "none".
The name attribute represents the element's name.
The dirname attribute controls how the element's directionality is submitted.
The disabled attribute is used to make the control non-interactive and to prevent its value from being submitted.
The form attribute is used to explicitly associate the input element with its form owner.
The autocomplete attribute controls how the user agent provides autofill behavior.
The indeterminate 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 checkbox controls.
The accept,
alt, max, min, multiple, pattern, placeholder, required, size, src, and step IDL attributes must
reflect the respective content attributes of the same name. The dirName IDL attribute must
reflect the dirname content attribute. The readOnly IDL
attribute must reflect the readonly content
attribute. The defaultChecked IDL attribute must
reflect the checked content attribute. The
defaultValue IDL attribute must reflect
the value content attribute.
The type IDL
attribute must reflect the respective content attribute of the same name,
limited to only known values. The maxLength IDL attribute must reflect the
maxlength content attribute, limited to only
non-negative numbers. The minLength IDL attribute must reflect the
minlength content attribute, limited to only
non-negative numbers.
The IDL attributes width and height must return the rendered width and height of the
image, in CSS pixels, if an image is being rendered, and
is being rendered to a visual medium; or else the intrinsic
width and height of the image, in CSS pixels, if an image is available but not being rendered to a visual medium; or else 0,
if no image is available. When the input
element's type attribute is not in the Image Button state, then no image is available. [CSS]
On setting, they must act as if they reflected the respective
content attributes of the same name.
The willValidate, validity, and validationMessage IDL attributes, and the checkValidity(), reportValidity(), and setCustomValidity() methods, are part of the
constraint validation API. The labels IDL
attribute provides a list of the element's labels. The select(), selectionStart, selectionEnd, selectionDirection, setRangeText(), and setSelectionRange() methods and IDL attributes
expose the element's text selection. The disabled,
form, and name IDL attributes
are part of the element's forms API.
ins
4.7.1
The ins element represents an addition to the document.
ins elements should not cross implied paragraph
boundaries.
kbd
4.5.18
The kbd element represents user input (typically keyboard input,
although it may also be used to represent other input, such as voice commands).
When the kbd element is nested inside a samp element, it represents
the input as it was echoed by the system.
When the kbd element contains a samp element, it represents
input based on system output, for example invoking a menu item.
When the kbd element is nested inside another kbd element, it
represents an actual key or other single unit of input as appropriate for the input mechanism.
label
4.10.4
The label element represents a caption in a user interface. The
caption can be associated with a specific form control, known as the
label element's labeled control, either using the for attribute, or by putting the form control inside the
label element itself.
Except where otherwise specified by the following rules, a label element has no
labeled control.
The for 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 ID of a
labelable element in the same tree as the
label element. If the attribute is specified and there is an element in
the tree whose ID is equal to the value of the for attribute, and the first such element in tree
order is a labelable element, then that element is the
label element's labeled control.
If the for attribute is not specified, but the
label element has a labelable element descendant,
then the first such descendant in tree order is the label element's
labeled control.
The label element's exact default presentation and behavior, in particular what
its activation behavior might be, if anything, should match the platform's label
behavior. The activation behavior of a label element for events targeted
at interactive content descendants of a label element, and any
descendants of those interactive content descendants, must be to do nothing.
The htmlFor
IDL attribute must reflect the for content
attribute.
The control
IDL attribute must return the label element's labeled control, if any,
or null if there isn't one.
The form IDL
attribute must run the following steps:
If the label element has no labeled control, then return
null.If the label element's labeled control is not a
form-associated element, then return null.Return the label element's labeled control's form
owner (which can still be null).
Labelable elements and all input elements
have a live NodeList object associated with them that represents the
list of label elements, in tree order, whose labeled
control is the element in question. The labels IDL attribute of labelable elements that are not form-associated custom elements, and the labels IDL attribute of input elements, on getting,
must return that NodeList object, and that same value must always be returned, unless
this element is an input element whose type
attribute is in the Hidden state, in which case it
must instead return null.
Form-associated custom elements don't have
a labels IDL attribute. Instead, their
ElementInternals object has a labels IDL attribute. On getting, it must throw
a "NotSupportedError" DOMException if the target element is not a form-associated custom
element. Otherwise, it must return that NodeList object, and that same value
must always be returned.
legend
4.10.16
The legend element represents a caption for the rest of the contents
of the legend element's parent fieldset element, if
any.
The form IDL
attribute's behavior depends on whether the legend element is in a
fieldset element or not. If the legend has a fieldset
element as its parent, then the form IDL attribute must
return the same value as the form IDL attribute on that
fieldset element. Otherwise, it must return null.
li
4.4.8
The li element represents a list item. If its parent element is an
ol, ul, or menu 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 li element.
The value attribute, if
present, must be a valid integer. It is used to determine the ordinal
value of the list item, when the li's list owner is an
ol element.
Any element whose computed value of 'display' is 'list-item' has a
list owner, which is determined as follows:
If the element is not being rendered, return null; the element has no
list owner.
Let ancestor be the element's parent.If the element has an ol, ul, or menu ancestor, set
ancestor to the closest such ancestor element.
Return the closest inclusive ancestor of ancestor that produces a CSS
box.
To determine the ordinal value of each element owned by a given list
owner owner, perform the following steps:
Let i be 1.If owner is an ol element, let numbering be
owner's starting value. Otherwise, let
numbering be 1.Loop: If i is greater than the number of list items that owner owns, then return; all
of owner's owned list items have been assigned ordinal values.Let item be the ith of owner's owned list items, in tree order.
If item is an li element that has a value attribute, then:
Let parsed be the result of parsing
the value of the attribute as an integer.If parsed is not an error, then set numbering to
parsed.
The ordinal value of item is numbering.If owner is an ol element, and owner has a reversed attribute, decrement numbering by 1;
otherwise, increment numbering by 1.Increment i by 1.Go to the step labeled loop.
The value IDL
attribute must reflect the value of the value
content attribute.
link
4.2.4
The link element allows authors to link their document to other resources.
The address of the link(s) is given by the href attribute. If the href attribute is present, then its value must be a valid
non-empty URL potentially surrounded by spaces. One or both of the href or imagesrcset
attributes must be present.
If both the href and imagesrcset attributes are absent, then the element does not
define a link.
The types of link indicated (the relationships) are given by the value of the rel attribute, which, if present, must have a
value that is a unordered set of unique space-separated tokens. The allowed keywords and their meanings are defined in a later section. If the rel 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.
rel's
supported tokens are the keywords defined in
HTML link types which are allowed on link elements, impact
the processing model, and are supported by the user agent. The possible supported tokens are
alternate,
dns-prefetch,
icon,
manifest,
modulepreload,
next,
pingback,
preconnect,
prefetch,
preload,
prerender,
search, and
stylesheet.
rel's supported
tokens must only include the tokens from this list that the user agent implements the
processing model for.
A link element must have either a rel
attribute or an itemprop attribute, but not both.
If a link element has an itemprop attribute,
or has a rel attribute that contains only keywords that are
body-ok, then the element is said to be allowed in the body. This means
that the element can be used where phrasing content is expected.
Two categories of links can be created using the link element: links to external resources and hyperlinks. The link types section defines
whether a particular link type is an external resource or a hyperlink. One link
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 rel attribute. User agents must process
the links on a per-link basis, not a per-element basis.
Hyperlinks created with the link element and its
rel attribute apply to the whole document. This contrasts with
the rel attribute of a and area
elements, which indicates the type of a link whose context is given by the link's location within
the document.
Unlike those created by a and area elements, hyperlinks created by link elements are not displayed as
part of the document by default, in user agents that support the suggested
default rendering. And even if they are force-displayed using CSS, they have no
activation behavior. Instead, they primarily provide semantic information which might
be used by the page or by other software that consumes the page's contents. Additionally, the user
agent can provide
its own UI for following such hyperlinks.
The exact behavior for links to external resources
depends on the exact relationship, as defined for the relevant link
type.
The crossorigin
attribute is a CORS settings attribute. It is intended for use with external resource links.
The media attribute
says which media the resource applies to. The value must be a valid media query
list.
The integrity
attribute represents the integrity
metadata for requests which this element is responsible for. The value is text. The
attribute must only be specified on link elements that have a rel attribute that contains the stylesheet, preload, or modulepreload keyword. [SRI]
The hreflang
attribute on the link element has the same semantics as the hreflang attribute on the a
element.
The type attribute
gives the MIME type of the linked resource. It is purely advisory. The value must be
a valid MIME type string.
For external resource links, the type attribute is used as a hint to user agents so that they can
avoid fetching resources they do not support.
The referrerpolicy attribute is a referrer policy
attribute. It is intended for use with external
resource links, where it helps set the referrer policy used when fetching and processing the linked resource.
[REFERRERPOLICY].
The title 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 that are in a document tree, for which the title attribute defines CSS
style sheet sets.
The imagesrcset
attribute may be present, and is a srcset attribute.
The imagesrcset and href attributes (if width
descriptors are not used) together contribute the image
sources to the source set.
If the imagesrcset attribute is present and has any
image candidate strings using a width
descriptor, the imagesizes attribute must also be present, and is a
sizes attribute. The imagesizes attribute
contributes the source size to the source set.
The imagesrcset and imagesizes attributes must only be specified on
link elements that have both a rel attribute that
specifies the preload keyword, as well as an as attribute in the "image" state.
The sizes attribute
gives the sizes of icons for visual media. Its value, if present, is merely advisory. User agents may use the value to decide which icon(s) to use if multiple icons are
available. If specified, the attribute must have a value that is an unordered set of
unique space-separated tokens which are ASCII case-insensitive. Each value
must be either an ASCII case-insensitive match for the string "any", or a value that consists of two valid non-negative integers 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. The attribute must only be specified on link elements
that have a rel attribute that specifies the icon keyword or the apple-touch-icon keyword.
The as attribute
specifies the potential destination for a
preload request for the resource given by the href attribute.
It is an enumerated attribute. Each potential destination is a keyword for this
attribute, mapping to a state of the same name. The attribute must be specified on
link elements that have a rel attribute that
contains the preload keyword. It may be specified on
link elements that have a rel attribute that
contains the modulepreload keyword; in such cases it must
have a value which is a script-like
destination. For other link elements, it must not be specified.
The processing model for how the as attribute is
used is given in an individual link type's fetch and process the linked resource
algorithm.
The blocking
attribute is a blocking attribute. It is used by link types modulepreload, preload and
stylesheet, and it must only be specified on link elements
that have a rel attribute containing one of those
keywords.
The color attribute is
used with the mask-icon link type. The attribute must only be specified on
link elements that have a rel attribute that
contains the mask-icon keyword. The value must be a string that matches the
CSS production, defining a suggested color that user agents can use to
customize the display of the icon that the user sees when they pin your site.
link elements have an associated explicitly enabled boolean. It is
initially false.
The disabled
attribute is a boolean attribute that is used with the stylesheet link type. The attribute must only be specified on
link elements that have a rel attribute that
contains the stylesheet keyword.
Whenever the disabled attribute is removed, set the
link element's explicitly enabled attribute to true.
The IDL attributes
href,
hreflang,
integrity,
media,
rel,
sizes,
type,
blocking and
disabled
each must reflect the respective content attributes of the same name.
The as IDL
attribute must reflect the as content attribute,
limited to only known values.
The crossOrigin IDL attribute must reflect the
crossorigin content attribute, limited to only
known values.
The referrerPolicy IDL attribute must
reflect the referrerpolicy content
attribute, limited to only known values.
The imageSrcset IDL attribute must reflect the
imagesrcset content attribute.
The imageSizes IDL attribute must reflect the
imagesizes content attribute.
The relList
IDL attribute must reflect the rel content attribute.
main
4.4.14
The main element represents the dominant contents of the
document.
A document must not have more than one main element that does not have the hidden attribute specified.
A hierarchically correct main element is one whose ancestor elements
are limited to html, body, div, form without
an accessible name, and autonomous custom elements. Each main element must be a
hierarchically correct main element.
map
4.8.12
The map element, in conjunction with an img element and any
area element descendants, defines an image map. The element
represents its children.
The name 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 ASCII whitespace. The value of the name attribute must not be equal to the value of the name attribute of another map element in the same
tree. If the id attribute is also specified, both
attributes must have the same value.
The areas
attribute must return an HTMLCollection rooted at the map element, whose
filter matches only area elements.
The IDL attribute name must reflect the content attribute of the
same name.
mark
4.5.23
The mark element represents 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.
menu
4.4.7
The menu element represents a toolbar consisting of its contents, in
the form of an unordered list of items (represented by li elements), each of
which represents a command that the user can perform or activate.
meta
4.2.5
The meta element represents various kinds of metadata that cannot be
expressed using the title, base, link, style,
and script elements.
The meta element can represent document-level metadata with the name attribute, pragma directives with the http-equiv attribute, and the file's character encoding
declaration when an HTML document is serialized to string form (e.g. for transmission over
the network or for disk storage) with the charset
attribute.
Exactly one of the name, http-equiv, charset,
and itemprop attributes must be specified.
If either name, http-equiv, or itemprop is
specified, then the content attribute must also be
specified. Otherwise, it must be omitted.
The charset
attribute specifies the character encoding used by the document.
This is a character encoding declaration. If the attribute is present, its value must
be an ASCII case-insensitive match for the string "utf-8".
There must not be more than one meta element with a charset attribute per document.
The content
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.
If a meta element has a name attribute, it sets document metadata. Document metadata
is expressed in terms of name-value pairs, the name attribute
on the meta element giving the name, and the content 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 meta element has no content attribute, then the value part of the metadata
name-value pair is the empty string.
The media attribute
says which media the metadata applies to. The value must be a valid media query list.
Unless the name is theme-color, the media
attribute has no effect on the processing model and must not be used by authors.
The name, content, and media IDL attributes
must reflect the respective content attributes of the same name. The IDL attribute
httpEquiv must
reflect the content attribute http-equiv.
meter
4.10.14
The meter element represents a scalar measurement within a known
range, or a fractional value; for example disk usage, the relevance of a query result, or the
fraction of a voting population to have selected a particular candidate.
This is also known as a gauge.
The meter element should not be used to indicate progress (as in a progress bar).
For that role, HTML provides a separate progress element.
There are six attributes that determine the semantics of the gauge represented by the
element.
The min attribute
specifies the lower bound of the range, and the max attribute specifies the upper bound. The value attribute specifies
the value to have the gauge indicate as the "measured" value.
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 low attribute specifies the range that is
considered to be the "low" part, and the high attribute specifies the range that is considered to be
the "high" part. The optimum 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.
Authoring requirements: The value attribute must be specified. The value, min, low, high, max, and optimum attributes,
when present, must have values that are valid
floating-point numbers.
In addition, the attributes' values are further constrained:
Let value be the value attribute's
number.
If the min attribute is specified, then let minimum be that attribute's value; otherwise, let it be zero.
If the max attribute is specified, then let maximum be that attribute's value; otherwise, let it be 1.0.
The following inequalities must hold, as applicable:
minimum ≤ value ≤ maximumminimum ≤ low ≤ maximum (if low is specified)minimum ≤ high ≤ maximum (if high is specified)minimum ≤ optimum ≤ maximum (if optimum is specified)low ≤ high (if
both low and high are
specified)
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 meter
element.
When used with microdata, the meter element's value attribute provides the element's machine-readable value.
There is no explicit way to specify units in the meter element, but the units may
be specified in the title attribute in free-form text.
User agent requirements: User agents must parse the min, max, value, low, high, and optimum
attributes using the rules for parsing floating-point number values.
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.)
The minimum value
If the min 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.
The maximum value
If the max attribute is specified and a value could be
parsed out of it, then the candidate maximum value is that value. Otherwise, the candidate
maximum value is 1.0.
If the candidate maximum value is greater than or equal to the minimum value, then the
maximum value is the candidate maximum value. Otherwise, the maximum value is the same as the
minimum value.
The actual value
If the value attribute is specified and a value could
be parsed out of it, then that value is the candidate actual value. Otherwise, the candidate
actual value is zero.
If the candidate actual value is less than the minimum value, then the actual value is the
minimum value.
Otherwise, if the candidate actual value is greater than the maximum value, then the actual
value is the maximum value.
Otherwise, the actual value is the candidate actual value.
The low boundary
If the low attribute is specified and a value could be
parsed out of it, then the candidate low boundary is that value. Otherwise, the candidate low
boundary is the same as the minimum value.
If the candidate low boundary is less than the minimum value, then the low boundary is the
minimum value.
Otherwise, if the candidate low boundary is greater than the maximum value, then the low
boundary is the maximum value.
Otherwise, the low boundary is the candidate low boundary.
The high boundary
If the high attribute is specified and a value could be
parsed out of it, then the candidate high boundary is that value. Otherwise, the candidate high
boundary is the same as the maximum value.
If the candidate high boundary is less than the low boundary, then the high boundary is the
low boundary.
Otherwise, if the candidate high boundary is greater than the maximum value, then the high
boundary is the maximum value.
Otherwise, the high boundary is the candidate high boundary.
The optimum point
If the optimum attribute is specified and a value
could be parsed out of it, then the candidate optimum point is that value. Otherwise, the
candidate optimum point is the midpoint between the minimum value and the maximum value.
If the candidate optimum point is less than the minimum value, then the optimum point is the
minimum value.
Otherwise, if the candidate optimum point is greater than the maximum value, then the optimum
point is the maximum value.
Otherwise, the optimum point is the candidate optimum point.
All of which will result in the following inequalities all being true:
minimum value ≤ actual value ≤ maximum valueminimum value ≤ low boundary ≤ high boundary ≤ maximum valueminimum value ≤ optimum point ≤ maximum value
UA requirements for regions of the gauge: 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 from the low boundary up to the high boundary must be treated as a
suboptimal region, and the remaining region 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
from the high boundary down to the low boundary must be treated as a suboptimal region, and the
remaining region must be treated as an even less good region.
UA requirements for showing the gauge: When representing a meter
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.
User agents may combine the value of the title attribute and the other attributes to provide context-sensitive
help or inline text detailing the actual values.
The value IDL
attribute, on getting, must return the actual value. On
setting, the given value must be converted to the best representation of the number as a
floating-point number and then the value content
attribute must be set to that string.
The min IDL
attribute, on getting, must return the minimum value.
On setting, the given value must be converted to the best representation of the number as a
floating-point number and then the min content
attribute must be set to that string.
The max IDL
attribute, on getting, must return the maximum value.
On setting, the given value must be converted to the best representation of the number as a
floating-point number and then the max content
attribute must be set to that string.
The low IDL
attribute, on getting, must return the low boundary. On
setting, the given value must be converted to the best representation of the number as a
floating-point number and then the low content
attribute must be set to that string.
The high IDL
attribute, on getting, must return the high boundary. On
setting, the given value must be converted to the best representation of the number as a
floating-point number and then the high content
attribute must be set to that string.
The optimum
IDL attribute, on getting, must return the optimum
value. On setting, the given value must be converted to the best representation of
the number as a floating-point number and then the optimum content attribute must be set to that string.
The labels IDL attribute provides a list of the element's
labels.
nav
4.3.4
The nav element represents a section of a page that links to other
pages or to parts within the page: a section with navigation links.
noscript
4.12.2
The noscript element represents nothing if scripting is enabled, and represents its children if
scripting is disabled. 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.
When used in HTML documents, the allowed content model is as follows:
In a head element, if scripting is
disabled for the noscript elementThe noscript element must contain only link, style,
and meta elements.In a head element, if scripting is enabled
for the noscript elementThe noscript element must contain only text, except that invoking the
HTML fragment parsing algorithm with
the noscript element as the context
element and the text contents as the input must result in a list of nodes
that consists only of link, style, and meta elements that
would be conforming if they were children of the noscript element, and no parse errors.Outside of head elements, if scripting is
disabled for the noscript elementThe noscript element's content model is transparent, with the
additional restriction that a noscript element must not have a noscript
element as an ancestor (that is, noscript can't be nested).Outside of head elements, if scripting is
enabled for the noscript element
The noscript element must contain only text, except that the text must be such
that running the following algorithm results in a conforming document with no
noscript elements and no script elements, and such that no step in the
algorithm throws an exception or causes an HTML parser to flag a parse
error:
Remove every script element from the document.Make a list of every noscript element in the document. For every
noscript element in that list, perform the following steps:
Let s be the child text content of the noscript
element.Set the outerHTML attribute of the
noscript element to the value of s. (This, as a
side-effect, causes the noscript element to be removed from the document.) [DOMPARSING]
The noscript element must not be used in XML documents.
The noscript element has no other requirements. In particular, children of the
noscript element are not exempt from form submission, scripting, and so
forth, even when scripting is enabled for the element.
object
4.8.7
The object element can represent an external resource, which, depending on the
type of the resource, will either be treated as an image, as a child browsing
context, or as an external resource to be processed by a plugin.
The data attribute
specifies the URL of the resource. It must be present, and must contain a
valid non-empty URL potentially surrounded by spaces.
Authors should avoid referencing untrusted resources, as such a resource can be
used to instantiate plugins or run scripts, even if the author has used features such as the Flash
"allowScriptAccess" parameter.
The type attribute,
if present, specifies the type of the resource. If present, the attribute must be a valid
MIME type string.
The name attribute,
if present, must be a valid browsing context name. The given value is used to name
the element's nested browsing context, if applicable, and if present when the
element's nested browsing context is created.
Whenever one of the following conditions occur:
the element is created,
the element is popped off the stack of open elements of an HTML
parser or XML parser,
the element is not on the stack of open elements of an HTML parser
or XML parser, and it is either inserted into a document or removed from a document,
the element's node document changes whether it is fully active,
one of the element's ancestor object elements changes to or from showing its
fallback content,
the element's classid attribute is set, changed, or
removed,
the element's classid attribute is not present, and
its data attribute is set, changed, or removed,
neither the element's classid attribute nor its
data attribute are present, and its type attribute is set, changed, or removed,
the element changes from being rendered to not being rendered, or vice versa,
...the user agent must queue an element task on the DOM manipulation task
source given the object element to run the following steps to (re)determine
what the object element represents. This task
being queued or actively running must delay the load
event of the element's node document.
If the user has indicated a preference that this object element's fallback
content be shown instead of the element's usual behavior, then jump to the step below
labeled fallback.
If the element has an ancestor media element, or has an ancestor
object element that is not showing its fallback content, or if
the element is not in a document whose browsing
context is non-null, or if the element's node document is not fully
active, or if the element is still in the stack of open elements of an
HTML parser or XML parser, or if the element is not being
rendered, then jump to the step below labeled fallback.
If the classid attribute is present, and has a
value that isn't the empty string, then: if the user agent can find a plugin
suitable according to the value of the classid
attribute, and plugins aren't being sandboxed, then that
plugin should be used, and the value of the data attribute, if any, should be passed to the
plugin. If no suitable plugin can be found, or if the
plugin reports an error, jump to the step below labeled fallback.
If the data attribute is present and its value is
not the empty string, then:
If the type 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
plugin for, then the user agent may jump to the step below labeled fallback
without fetching the content to examine its real type.Parse a URL given the data
attribute, relative to the element's node document.If that failed, fire an event named error at the element, then jump to the step below labeled
fallback.Let request be a new request whose
URL is the resulting URL record,
client is the element's node
document's relevant settings object, destination is "object",
credentials mode is "include", mode is "navigate", and whose use-URL-credentials flag is set.
Fetch request, with processResponseEndOfBody given response res set to finalize and report
timing with res, the element's node document's
relevant global object, and "object".
Fetching the resource must delay the load event of the element's node
document until the task that is queued by the networking task source once the resource has been
fetched (defined next) has been run.
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 step below labeled fallback. The task that is
queued by the networking task source 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.If the load failed (e.g. there was an HTTP 404 error, there was a DNS error), fire an event named error
at the element, then jump to the step below labeled fallback.
Determine the resource type, as follows:
Let the resource type be unknown.
If the user agent is configured to strictly obey Content-Type headers for this resource,
and the resource has associated Content-Type metadata,
then let the resource type be the type specified in the resource's Content-Type metadata, and jump to the step below
labeled handler.
This can introduce a vulnerability, wherein a site is trying to embed a
resource that uses a particular plugin, but the remote site overrides that and instead
furnishes the user agent with a resource that triggers a different plugin with different
security characteristics.
If there is a type attribute present on the
object element, and that attribute's value is not a type that the user agent
supports, but it is a type that a plugin supports, then let the resource type be the type specified in that type attribute, and jump to the step below labeled
handler.
Run the appropriate set of steps from the following
list:
If the resource has associated Content-Type
metadata
Let binary be false.
If the type specified in the resource's Content-Type
metadata is "text/plain", and the result of applying the rules for distinguishing if a resource is
text or binary to the resource is that the resource is not
text/plain, then set binary to true.
If the type specified in the resource's Content-Type
metadata is "application/octet-stream", then set binary to true.
If binary is false, then let the resource
type be the type specified in the resource's
Content-Type metadata, and jump to the step below labeled handler.
If there is a type attribute present on the
object element, and its value is not application/octet-stream,
then run the following steps:
If the attribute's value is a type that a plugin supports, or the
attribute's value is a type that starts with "image/" that is
not also an XML MIME type, then let the resource type be the
type specified in that type attribute.
Jump to the step below labeled handler.
Otherwise, if the resource does not have associated
Content-Type metadata
If there is a type attribute present on the
object element, then let the tentative type be the type
specified in that type attribute.
Otherwise, let tentative type be the computed type of the resource.
If tentative type is not
application/octet-stream, then let resource type be
tentative type and jump to the step below labeled
handler.
If applying the URL parser algorithm to the URL of the
specified resource (after any redirects) results in a URL record whose path component matches a pattern that a plugin
supports, then let resource type be the type that that plugin can
handle.
For example, a plugin might say that it can handle resources with path components that end with the four character string
".swf".
Handler: Handle the content as given by the first of the following cases that
matches:
If the resource type is not a type that the user agent supports, but
it is a type that a plugin supports
If the object element's nested browsing context is non-null,
then it must be discarded and then set
to null.
If plugins are being sandboxed, then jump to the step
below labeled fallback.
Otherwise, the user agent should use the plugin that supports
resource type and pass the content of the resource to that
plugin. If the plugin reports an error, then jump to the step
below labeled fallback.
If the resource type is an XML MIME type, or if the resource type
does not start with "image/"
If the object element's nested browsing context is null, then
create a new nested browsing context for the element.
If the URL of the given resource does not match about:blank, then navigate the element's nested browsing context to that resource, with historyHandling set to "replace" and the source browsing context set to the
object element's node document's browsing context. (The data attribute of the object element doesn't
get updated if the browsing context gets further navigated to other locations.)
The object element represents its nested browsing
context.
If the resource type starts with "image/", and support
for images has not been disabled
If the object element's nested browsing context is non-null,
then it must be discarded and then set
to null.
Apply the image sniffing rules to
determine the type of the image.
The object element represents the specified image.
If the image cannot be rendered, e.g. because it is malformed or in an unsupported
format, jump to the step below labeled fallback.
Otherwise
The given resource type is not supported. Jump to the step below
labeled fallback.
The element's contents are not part of what the object element
represents.
If the object element does not represent its nested browsing
context, then once the resource is completely loaded, queue an element
task on the DOM manipulation task source given the object
element to fire an event named load at the element.
Return.
If the data attribute is absent but the type attribute is present, and the user agent can find a
plugin suitable according to the value of the type attribute, and plugins
aren't being sandboxed, then that plugin should be
used. If these conditions cannot be met, or if the plugin reports an error,
jump to the step below labeled fallback. Otherwise return; once the plugin is completely
loaded, queue an element task on the DOM manipulation task source
given the object element to fire an event
named load at the element.Fallback: The object element represents the element's
children. This is the element's fallback content. If the element has an
instantiated plugin, then unload it. If the element's nested browsing
context is non-null, then it must be discarded and then set to null.
When the algorithm above instantiates a plugin, the user agent
should pass to the plugin 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. If the plugin supports a scriptable interface, the
HTMLObjectElement object representing the element should expose that interface. The
object element represents the plugin. The
plugin is not a nested browsing context.
Plugins are considered sandboxed for the purpose of an
object element if the sandboxed plugins browsing context flag is set on
the object element's node document's active sandboxing flag
set.
Due to the algorithm above, the contents of object elements act as fallback
content, used only when referenced resources can't be shown (e.g. because it returned a 404
error). This allows multiple object elements to be nested inside each other,
targeting multiple user agents with different capabilities, with the user agent picking the first
one it supports.
The object element potentially delays the load event.
The form attribute is used to explicitly associate the
object element with its form owner.
The object element supports dimension attributes.
The IDL attributes data, type, and name each must reflect the respective content
attributes of the same name.
The contentDocument IDL attribute, on getting, must
return the object element's content
document.
The contentWindow IDL attribute must return the
WindowProxy object of the object element's nested browsing
context, if its nested browsing context is non-null; otherwise, it must return
null.
The willValidate, validity, and validationMessage attributes, and the checkValidity(), reportValidity(), and setCustomValidity() methods, are part of the
constraint validation API. The form IDL attribute
is part of the element's forms API.
ol
4.4.5
The ol element represents a list of items, where the items have been
intentionally ordered, such that changing the order would change the meaning of the document.
The items of the list are the li element child nodes of the ol
element, in tree order.
The reversed attribute
is a boolean attribute. 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, ...).
The start attribute, if
present, must be a valid integer. It is used to determine the starting value of the list.
An ol element has a starting value, which is
an integer determined as follows:
If the ol element has a start attribute,
then:
Let parsed be the result of parsing
the value of the attribute as an integer.If parsed is not an error, then return parsed.
If the ol element has a reversed
attribute, then return the number of owned li
elements.Return 1.
The type 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 identical to one of the characters given in the
first cell of one of the rows of the following table. The type 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 decimal state.
Keyword
State
Description
Examples for values 1-3 and 3999-4001
1
(U+0031)
decimal
Decimal numbers
1. 2. 3. ... 3999. 4000. 4001. ...
a (U+0061)
lower-alpha
Lowercase latin alphabet
a. b. c. ... ewu. ewv. eww. ...
A (U+0041)
upper-alpha
Uppercase latin alphabet
A. B. C. ... EWU. EWV. EWW. ...
i (U+0069)
lower-roman
Lowercase roman numerals
i. ii. iii. ... mmmcmxcix. i̅v̅. i̅v̅i. ...
I (U+0049)
upper-roman
Uppercase roman numerals
I. II. III. ... MMMCMXCIX. I̅V̅. I̅V̅I. ...
User agents should render the items of the list in a manner consistent with the state of the
type attribute of the ol element. Numbers less than
or equal to zero should always use the decimal system regardless of the type attribute.
The reversed
and type IDL
attributes must reflect the respective content attributes of the same name.
The start IDL
attribute must reflect the content attribute of the same name, with a default value
of 1.
optgroup
4.10.9
The optgroup element represents a group of option
elements with a common label.
The element's group of option elements consists of the option
elements that are children of the optgroup element.
When showing option elements in select elements, user agents should
show the option elements of such groups as being related to each other and separate
from other option elements.
The disabled attribute is a boolean
attribute and can be used to disable a group
of option elements together.
The label
attribute must be specified. Its value gives the name of the group, for the purposes of the user
interface. User agents should use this attribute's value when labeling the group of
option elements in a select element.
The disabled and label attributes must
reflect the respective content attributes of the same name.
option
4.10.10
The option element represents an option in a select
element or as part of a list of suggestions in a datalist element.
In certain circumstances described in the definition of the select element, an
option element can be a select element's placeholder label
option. A placeholder label option does not represent an actual option, but
instead represents a label for the select control.
The disabled
attribute is a boolean attribute. An option element is disabled if its disabled attribute is present or if it is a child of an
optgroup element whose disabled
attribute is present.
An option element that is disabled must
prevent any click events that are queued on the user interaction task source from being dispatched on the
element.
The label
attribute provides a label for element. The label of an
option element is the value of the label
content attribute, if there is one and its value is not the empty string, or, otherwise, the value
of the element's text IDL attribute.
The label content attribute, if specified, must not be
empty.
The value
attribute provides a value for element. The value of an
option element is the value of the value
content attribute, if there is one, or, if there is not, the value of the element's text IDL attribute.
The selected
attribute is a boolean attribute. It represents the default selectedness of the element.
The dirtiness of an option element is
a boolean state, initially false. It controls whether adding or removing the selected content attribute has any effect.
The selectedness of an option
element is a boolean state, initially false. Except where otherwise specified, when the element is
created, its selectedness must be set to true if
the element has a selected attribute. Whenever an
option element's selected attribute is
added, if its dirtiness is false, its selectedness must be set to true. Whenever an
option element's selected attribute is
removed, if its dirtiness is false, its
selectedness must be set to false.
A select element whose multiple
attribute is not specified must not have more than one descendant option element with
its selected attribute set.
An option element's index is the number of
option elements that are in the same list of
options but that come before it in tree order. If the option
element is not in a list of options, then the
option element's index is zero.
The disabled IDL attribute must reflect the
content attribute of the same name. The defaultSelected IDL attribute must
reflect the selected content
attribute.
The label
IDL attribute, on getting, if there is a label content
attribute, must return that attribute's value; otherwise, it must return the element's label. On setting, the element's label content attribute must be set to the new value.
The value
IDL attribute, on getting, must return the element's value. On setting, the element's value content attribute must be set to the new value.
The selected IDL attribute, on getting, must return true if
the element's selectedness is true, and false
otherwise. On setting, it must set the element's selectedness to the new value, set its dirtiness to true, and then cause the element to
ask for a reset.
The index
IDL attribute must return the element's index.
The text IDL
attribute, on getting, must return the result of stripping and collapsing ASCII whitespace from the concatenation of data of all the Text node descendants of the
option element, in tree order, excluding any that are descendants of
descendants of the option element that are themselves script or
SVG script elements.
The text attribute's setter must string replace
all with the given value within this element.
The form IDL
attribute's behavior depends on whether the option element is in a
select element or not. If the option has a select element
as its parent, or has an optgroup element as its parent and that
optgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element. Otherwise, it
must return null.
A legacy factory function is provided for creating HTMLOptionElement objects (in
addition to the factory methods from DOM such as createElement()): Option(text, value,
defaultSelected, selected). When invoked, the legacy factory
function must perform the following steps:
Let document be the current global object's associated Document.Let option be the result of creating an
element given document, option, and the HTML
namespace.If text is not the empty string, then append to option a new
Text node whose data is text.If value is given, then set
an attribute value for option using "value" and value.If defaultSelected is true, then set an attribute value for option
using "selected" and the empty string.If selected is true, then set option's selectedness to true; otherwise set its selectedness to false (even if
defaultSelected is true).Return option.
output
4.10.12
The output element represents the result of a calculation performed
by the application, or the result of a user action.
The for 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 for attribute, if specified, must contain a
string consisting of an unordered set of unique space-separated tokens, none of which
are identical to another token and each of which must have the value of an ID of an element in the same tree.
The form attribute is used to explicitly associate the
output element with its form owner. The name attribute represents the element's name. The output
element is associated with a form so that it can be easily referenced from the event
handlers of form controls; the element's value itself is not submitted when the form is
submitted.
The element has a default value
override (null or a string). Initially it must be null.
The element's default value is determined by
the following steps:
If this element's default value
override is non-null, then return it.Return this element's descendant text content.
The reset algorithm for output
elements is to run these steps:
String replace all with this element's default value within this element.Set this element's default value
override to null.
The value
getter steps are to return this's descendant text content.
The value setter steps are:
Set this's default value
override to its default value.String replace all with the given value within this.
The defaultValue getter steps are to return the result
of running this's default
value.
The defaultValue setter steps are:
If this's default value
override is null, then string replace all with the given value within
this and return.Set this's default value
override to the given value.
The type
getter steps are to return "output".
The htmlFor IDL attribute must reflect the for content attribute.
The willValidate, validity, and validationMessage IDL attributes, and the checkValidity(), reportValidity(), and setCustomValidity() methods, are part of the
constraint validation API. The labels IDL
attribute provides a list of the element's labels. The form and name IDL attributes are
part of the element's forms API.
p
4.4.1
The p element represents a paragraph.
The p element should not be used when a more specific element is more
appropriate.
List elements (in particular, ol and ul elements) cannot be children
of p elements. When a sentence contains a bulleted list, therefore, one might wonder
how it should be marked up.
The solution is to realize that a paragraph, in HTML terms, is not a
logical concept, but a structural one. In the fantastic example above, there are actually
five paragraphs as defined by this specification: one
before the list, one for each bullet, and one after the list.
Authors wishing to conveniently style such "logical" paragraphs consisting of multiple
"structural" paragraphs can use the div element instead of the p
element.
picture
4.8.1
The picture element is a container
which provides multiple sources to its contained img element
to allow authors to declaratively control or give hints to the user agent about which image resource to use,
based on the screen pixel density, viewport size, image format, and other factors.
It represents its children.
pre
4.4.3
The pre element represents a block of preformatted text, in which
structure is represented by typographic conventions rather than by elements.
Some examples of cases where the pre element could be used:
Including an email, with paragraphs indicated by blank lines, lists indicated by lines
prefixed with a bullet, and so on.Including fragments of computer code, with structure indicated according to the conventions
of that language.Displaying ASCII art.
To represent a block of computer code, the pre element can be used with a
code element; to represent a block of computer output the pre element
can be used with a samp element. Similarly, the kbd element can be used
within a pre element to indicate text that the user is to enter.
progress
4.10.13
The progress element represents the completion progress of a task.
The progress is either indeterminate, indicating that progress is being made but that it is not
clear how much more work remains to be done before the task is complete (e.g. because the task is
waiting for a remote host to respond), or the progress is a number in the range zero to a maximum,
giving the fraction of work that has so far been completed.
There are two attributes that determine the current task completion represented by the element.
The value
attribute specifies how much of the task has been completed, and the max attribute specifies how much work
the task requires in total. The units are arbitrary and not specified.
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.
The value and max attributes, when present, must have values that are valid floating-point numbers. The value attribute, if present, must have a value equal to or
greater than zero, and less than or equal to the value of the max attribute, if present, or 1.0, otherwise. The max attribute, if present, must have a value greater than
zero.
User agent requirements: If the value
attribute is omitted, then the progress bar is an indeterminate progress bar. Otherwise, it is a
determinate progress bar.
If the progress bar is a determinate progress bar and the element has a max attribute, the user agent must parse the max attribute's value according to the rules for parsing
floating-point number values. If this does not result in an error, and if the parsed value
is greater than zero, then the maximum value of the
progress bar is that value. Otherwise, if the element has no max 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 maximum value of the progress bar is 1.0.
If the progress bar is a determinate progress bar, user agents must parse the value attribute's value according to the rules for
parsing floating-point number values. If this does not result in an error and the parsed
value is greater than zero, then the value of the
progress bar is that parsed value. Otherwise, if parsing the value attribute's value resulted in an error or a number less
than or equal to zero, then the value of the progress
bar is zero.
If the progress bar is a determinate progress bar, then the current value is the maximum value, if value is greater than the maximum value, and value otherwise.
UA requirements for showing the progress bar: When representing a
progress element to the user, the UA should indicate whether it is a determinate or
indeterminate progress bar, and in the former case, should indicate the relative position of the
current value relative to the maximum value.
If the progress bar is an indeterminate progress bar, then the position IDL attribute
must return −1. Otherwise, it must return the result of dividing the current value by the maximum value.
If the progress bar is an indeterminate progress bar, then the value IDL attribute, on
getting, must return 0. Otherwise, it must return the current value. On setting, the given value must be
converted to the best representation of the number as a floating-point number and
then the value content attribute must be set to that
string.
The max
IDL attribute must reflect the content attribute of the same name, limited to
numbers greater than zero. The default value for max
is 1.0.
The labels IDL attribute provides a list of the element's
labels.
q
4.5.7
The q element represents some phrasing
content quoted from another source.
Quotation punctuation (such as quotation marks) that is quoting the contents of the element
must not appear immediately before, after, or inside q elements; they will be
inserted into the rendering by the user agent.
Content inside a q element must be quoted from another source, whose address, if
it has one, may be cited in the cite attribute. The source may be fictional, as when quoting
characters in a novel or screenplay.
If the cite attribute is present, it must be a valid
URL potentially surrounded by spaces. To obtain the corresponding citation
link, the value of the attribute must be parsed relative to the
element's node document. User agents may allow users to follow such citation
links, but they are primarily intended for private use (e.g., by server-side scripts collecting
statistics about a site's use of quotations), not for readers.
The q element must not be used in place of quotation marks that do not represent
quotes; for example, it is inappropriate to use the q element for marking up
sarcastic statements.
The use of q elements to mark up quotations is entirely optional; using explicit
quotation punctuation without q elements is just as correct.
rp
4.5.12
The rp element can be used to provide parentheses or other content around a ruby
text component of a ruby annotation, to be shown by user agents that don't support ruby
annotations.
An rp element that is a child of a ruby
element represents nothing. An rp element
whose parent element is not a ruby element represents its
children.
rt
4.5.11
The rt element marks the ruby text component of a ruby annotation. When it is the
child of a ruby element, it doesn't represent
anything itself, but the ruby element uses it as part of determining what it
represents.
An rt element that is not a child of a ruby element
represents the same thing as its children.
ruby
4.5.10
The ruby 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 furigana.
The content model of ruby elements consists of one or more of the following
sequences:
One or the other of the following:
Phrasing content, but with no ruby elements and with no ruby element descendants
A single ruby element that itself has no ruby element descendants
One or the other of the following:
One or more rt elements
An rp element followed by one or more rt elements, each of which is itself followed by an rp element
The ruby and rt elements can be used for a variety of kinds of
annotations, including in particular (though by no means limited to) those described below. For
more details on Japanese Ruby in particular, and how to render Ruby for Japanese, see
Requirements for Japanese Text Layout. [JLREQ]
Mono-ruby for individual base characters in Japanese
One or more hiragana or katakana characters (the ruby annotation) are placed with each
ideographic character (the base text). This is used to provide readings of kanji characters.
Mono-ruby for compound words (jukugo)
This is similar to the previous case: each ideographic character in the compound word (the
base text) has its reading given in hiragana or katakana characters (the ruby annotation). The
difference is that the base text segments form a compound word rather than being separate from
each other.
Jukugo-ruby
This is semantically identical to the previous case (each individual ideographic character in
the base compound word has its reading given in an annotation in hiragana or katakana
characters), but the rendering is the more complicated Jukugo Ruby rendering.
Group ruby for describing meanings
The annotation describes the meaning of the base text, rather than (or in addition to) the
pronunciation. As such, both the base text and the annotation can be multiple characters long.
Group ruby for Jukuji readings
A phonetic reading that corresponds to multiple base characters, because a one-to-one mapping
would be difficult. (In English, the words "Colonel" and "Lieutenant" are examples of words
where a direct mapping of pronunciation to individual letters is, in some dialects, rather
unclear.)
Text with both phonetic and semantic annotations (double-sided ruby)
Sometimes, ruby styles described above are combined.
If this results in two annotations covering the same single base segment, then the
annotations can just be placed back to back.
In more complicated situations such as the following examples, a nested ruby
element is used to give the inner annotations, and then that whole ruby is then
given an annotation at the "outer" level.
Within a ruby element that does not have a ruby element ancestor,
content is segmented and segments are placed into three categories: base text segments, annotation
segments, and ignored segments. Ignored segments do not form part of the document's semantics
(they consist of some inter-element whitespace and rp elements, the
latter of which are used for legacy user agents that do not support ruby at all). Base text
segments can overlap (with a limit of two segments overlapping any one position in the DOM, and
with any segment having an earlier start point than an overlapping segment also having an equal or
later end point, and any segment have a later end point than an overlapping segment also having an
equal or earlier start point). Annotation segments correspond to rt elements. Each annotation
segment can be associated with a base text segment, and each base text segment can have annotation
segments associated with it. (In a conforming document, each base text segment is associated with
at least one annotation segment, and each annotation segment is associated with one base text
segment.) A ruby element represents the union of the segments of base
text it contains, along with the mapping from those base text segments to annotation segments.
Segments are described in terms of DOM ranges; annotation segment ranges always
consist of exactly one element. [DOM]
At any particular time, the segmentation and categorization of content of a ruby
element is the result that would be obtained from running the following algorithm:
Let base text segments be an empty list of base text segments, each
potentially with a list of base text subsegments.Let annotation segments be an empty list of annotation segments, each
potentially being associated with a base text segment or subsegment.Let root be the ruby element for which the algorithm is
being run.If root has a ruby element ancestor, then jump to the
step labeled end.Let current parent be root.Let index be 0.Let start index be null.Let parent start index be null.Let current base text be null.Start mode: If index is equal to or greater than the number of
child nodes in current parent, then jump to the step labeled end
mode.
If the indexth node in current parent is an
rt or rp element, jump to the step labeled annotation
mode.Set start index to the value of index.Base mode: If the indexth node in current
parent is a ruby element, and if current parent is the
same element as root, then push a ruby level and then jump to
the step labeled start mode.If the indexth node in current parent is an
rt or rp element, then set the current base text and then
jump to the step labeled annotation mode.Increment index by one.Base mode post-increment: If index is equal to or greater than
the number of child nodes in current parent, then jump to the step labeled
end mode.Jump back to the step labeled base mode.Annotation mode: If the indexth node in current
parent is an rt element, then push a ruby annotation and jump to
the step labeled annotation mode increment.If the indexth node in current parent is an
rp element, jump to the step labeled annotation mode increment.If the indexth node in current parent is not a
Text node, or is a Text node that is not inter-element
whitespace, then jump to the step labeled base mode.Annotation mode increment: Let lookahead index be index plus one.Annotation mode white-space skipper: If lookahead index is
equal to the number of child nodes in current parent then jump to the step
labeled end mode.If the lookahead indexth node in current parent is
an rt element or an rp element, then set index to
lookahead index and jump to the step labeled annotation mode.If the lookahead indexth node in current parent is
not a Text node, or is a Text node that is not inter-element
whitespace, then jump to the step labeled base mode (without further incrementing
index, so the inter-element whitespace seen so far becomes part
of the next base text segment).Increment lookahead index by one.Jump to the step labeled annotation mode white-space skipper.End mode: If current parent is not the same element as root, then pop a ruby level and jump to the step labeled base mode
post-increment.End: Return base text segments and annotation
segments. Any content of the ruby element not described by segments in either
of those lists is implicitly in an ignored segment.
When the steps above say to set the current base text, it means to run the following
steps at that point in the algorithm:
Let text range be a DOM range whose start is the boundary
point (current parent, start index) and whose
end is the boundary
point (current parent, index).Let new text segment be a base text segment described by the range
annotation range.
Add new text segment to base text
segments.Let current base text be new text
segment.Let start index be null.
When the steps above say to push a ruby level, it means to run the following steps
at that point in the algorithm:
Let current parent be the indexth node in current parent.Let index be 0.Set saved start index to the value of start
index.Let start index be null.
When the steps above say to pop a ruby level, it means to run the following steps at
that point in the algorithm:
Let index be the position of current parent in
root.Let current parent be root.Increment index by one.Set start index to the value of saved start
index.Let saved start index be null.
When the steps above say to push a ruby annotation, it means to run the following
steps at that point in the algorithm:
Let rt be the rt element that is the indexth node of current parent.Let annotation range be a DOM range whose start is the boundary
point (current parent, index) and whose end is the boundary point
(current parent, index plus one) (i.e. that contains only
rt).Let new annotation segment be an annotation segment described by the
range annotation range.If current base text is not null, associate new
annotation segment with current base text.Add new annotation segment to annotation
segments.
s
4.5.5
The s element represents contents that are no longer accurate or no
longer relevant.
samp
4.5.17
The samp element represents sample or quoted output from another
program or computing system.
script
4.12.1
The script element allows authors to include dynamic script and data blocks in
their documents. The element does not represent content for the
user.
The type attribute
allows customization of the type of script represented:
Omitting the attribute, setting it to the empty string, or setting it to a
JavaScript MIME type essence match, means that the script is a classic
script, to be interpreted according to the JavaScript Script top-level production. Classic scripts are affected by the
async and defer
attributes, but only when the src attribute is set.
Authors should omit the type attribute instead of
redundantly setting it.Setting the attribute to an ASCII case-insensitive match for the string
"module" means that the script is a JavaScript module
script, to be interpreted according to the JavaScript Module top-level production. Module scripts are not affected by the
defer attribute, but are affected by the async attribute (regardless of the state of the src attribute).Setting the attribute to any other value means that the script is a data
block, which is not processed. None of the script attributes (except type itself) have any effect on data blocks. Authors must use
a valid MIME type string that is not a JavaScript MIME type essence
match to denote data blocks.
Classic scripts and JavaScript module scripts can be embedded inline, or be
imported from an external file using the src attribute, which if specified gives the URL
of the external script resource to use. If src is specified,
it must be a valid non-empty URL potentially surrounded by spaces.
The contents of inline script elements, or the external script resource, must
conform with the requirements of the JavaScript specification's Script or Module productions, for classic scripts and JavaScript module scripts respectively. [JAVASCRIPT]
The contents of the external script resource for CSS module
scripts must conform to the requirements of the CSS specification. [CSS]
The contents of the external script resource for JSON module
scripts must conform to the requirements of the JSON specification [JSON].
When used to include data blocks, the data must be embedded
inline, the format of the data must be given using the type
attribute, and the contents of the script element must conform to the requirements
defined for the format used. The src, async, nomodule,
defer, crossorigin, integrity, and referrerpolicy attributes must not be specified.
The nomodule
attribute is a boolean attribute that prevents a script from being executed in user
agents that support module scripts. This allows selective
execution of module scripts in modern user agents and classic scripts in older user agents, as shown below. The nomodule attribute must not be specified on module scripts (and will be ignored if it is).
The async and
defer attributes are
boolean attributes that indicate how the script should be
evaluated. Classic scripts may specify defer or async, but must
not specify either unless the src attribute is present.
Module scripts may specify the async attribute, but must not specify the defer attribute.
There are several possible modes that can be selected using these attributes, and depending on
the script's type.
For classic scripts, if the async attribute is present, then the classic script will be
fetched in parallel to parsing and evaluated as soon as it is available (potentially
before parsing completes). If the async attribute is not
present but the defer attribute is present, then the
classic script will be fetched in parallel and evaluated when the page has finished
parsing. If neither attribute is present, then the script is fetched and evaluated immediately,
blocking parsing until these are both complete.
For module scripts, if the async attribute is present, then the module script and all its
dependencies will be fetched in parallel to parsing, and the module script will
be evaluated as soon as it is available (potentially before parsing completes). Otherwise, the
module script and its dependencies will be fetched in parallel to parsing and
evaluated when the page has finished parsing. (The defer
attribute has no effect on module scripts.)
This is all summarized in the following schematic diagram:
The defer attribute may be specified even if the async attribute is specified, to cause legacy web browsers that
only support defer (and not async) to fall back to the defer behavior instead of the blocking behavior that
is the default.
The crossorigin attribute is a CORS settings
attribute. For classic scripts, it controls whether
error information will be exposed, when the script is obtained from other origins. For module scripts, it
controls the credentials mode used for
cross-origin requests.
The integrity
attribute represents the integrity
metadata for requests which this element is responsible for. The value is text. The integrity attribute must not be specified when the src attribute is not specified. [SRI]
The referrerpolicy attribute is a referrer
policy attribute. Its purpose is to set the referrer policy used when fetching the script, as well as any scripts imported from it. [REFERRERPOLICY]
The blocking
attribute is a blocking attribute.
Changing the src, type, nomodule, async, defer, crossorigin, integrity, and referrerpolicy attributes dynamically has no direct effect; these
attributes are only used at specific times described below.
The IDL attributes src, type, defer, integrity, and blocking, must each
reflect the respective content attributes of the same name.
The referrerPolicy IDL attribute must
reflect the referrerpolicy content
attribute, limited to only known values.
The crossOrigin IDL attribute must reflect
the crossorigin content attribute, limited to
only known values.
The noModule IDL attribute must reflect the
nomodule content attribute.
The async
getter steps are:
If this's force async is true, then
return true.If this's async content attribute is
present, then return true.Return false.
The async setter steps are:
Set this's force async to
false.If the given value is true, then set this's async content attribute to the empty string.Otherwise, remove this's async
content attribute.
The text
attribute's getter must return this script element's child text
content.
The text attribute's setter must string replace
all with the given value within this script element.
The supports(type) method steps are:
If type is "classic", then return
true.If type is "module", then return
true.Return false.
section
4.3.3
The section element represents a generic section of a document or
application. A section, in this context, is a thematic grouping of content, typically with a
heading.
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.
select
4.10.7
The select element represents a control for selecting amongst a set of
options.
The multiple
attribute is a boolean attribute. If the attribute is present, then the
select element represents a control for selecting zero or more options
from the list of options. If the attribute is
absent, then the select element represents a control for selecting a
single option from the list of options.
The size attribute
gives the number of options to show to the user. The size
attribute, if specified, must have a value that is a valid non-negative integer
greater than zero.
The display size of a select element is the
result of applying the rules for parsing non-negative integers to the value of
element's size 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 size attribute is absent, then the element's display size is 4 if the element's multiple content attribute is present, and 1 otherwise.
The list of options for a select
element consists of all the option element children of the select
element, and all the option element children of all the optgroup element
children of the select element, in tree order.
The required
attribute is a boolean attribute. When specified, the user will be required to select
a value before submitting the form.
If a select element has a required
attribute specified, does not have a multiple attribute
specified, and has a display size of 1; and if the value of the first option element in the
select element's list of options (if
any) is the empty string, and that option element's parent node is the
select element (and not an optgroup element), then that
option is the select element's placeholder label option.
If a select element has a required
attribute specified, does not have a multiple attribute
specified, and has a display size of 1, then the
select element must have a placeholder label option.
Constraint validation: If the element has its required attribute specified, and either none of the
option elements in the select element's list of options have their selectedness set to true, or the only
option element in the select element's list of options with its selectedness set to true is the placeholder label
option, then the element is suffering from being missing.
If the multiple attribute is absent, and the element
is not disabled, then the user agent should allow the
user to pick an option element in its list
of options that is itself not disabled. Upon
this option element being picked (either
through a click, or through unfocusing the element after changing its value, or through a menu command, or through any other mechanism), and before the
relevant user interaction event is queued (e.g. before the
click event), the user agent must set the selectedness of the picked option element
to true, set its dirtiness to true, and then
send select update notifications.
If the multiple attribute is absent, whenever an
option element in the select element's list of options has its selectedness set to true, and whenever an
option element with its selectedness set to true is added to the
select element's list of options,
the user agent must set the selectedness of all
the other option elements in its list of
options to false.
If the multiple attribute is absent and the
element's display size is greater than 1, then the user
agent should also allow the user to request that the option whose selectedness 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 click event), the user agent must set the selectedness of that option element to
false, set its dirtiness to true, and then
send select update notifications.
The selectedness setting algorithm, given a select element
element, is to run the following steps:
If element's multiple attribute is
absent, and element's display size is 1,
and no option elements in the element's list of options have their selectedness set to true, then set the selectedness of the first option
element in the list of options in
tree order that is not disabled,
if any, to true, and return.If element's multiple attribute is
absent, and two or more option elements in element's list of options have their selectedness set to true, then set the selectedness of all but the last option
element with its selectedness set to true in
the list of options in tree order
to false.
The option HTML element insertion
steps, given insertedNode, are:
If insertedNode's parent is a select element, or
insertedNode's parent is an optgroup element whose parent is a
select element, then run that select element's selectedness
setting algorithm.
The option HTML element removing
steps, given removedNode and oldParent, are:
If oldParent is a select element, or oldParent is an
optgroup element whose parent is a select element, then run that
select element's selectedness setting algorithm.
If an option element in the list of
options asks for a reset, then run that
select element's selectedness setting algorithm.
If the multiple attribute is present, and the
element is not disabled, then the user agent should
allow the user to toggle the selectedness of the option elements in
its list of options that are themselves not disabled. Upon such an element being toggled (either through a click, or through a menu command, or any other mechanism), and before the relevant user
interaction event is queued (e.g. before a related click event), the selectedness of the option element must
be changed (from true to false or false to true), the dirtiness of the element must be set to true, and the
user agent must send select update notifications.
When the user agent is to send select update notifications, queue
an element task on the user interaction task source given the select
element to run these steps:
Fire an event named input at the select element, with the bubbles and composed
attributes initialized to true.Fire an event named change at the select element, with the bubbles attribute initialized to true.
The reset algorithm for select
elements is to go through all the option elements in the element's list of options, set their selectedness to true if the option
element has a selected attribute, and false otherwise,
set their dirtiness to false, and then have the
option elements ask for a reset.
The form attribute is used to explicitly associate the select element with its form owner.
The name attribute represents the element's name.
The disabled attribute is used to make the control non-interactive and to prevent its value from being submitted.
The autocomplete attribute controls how the user agent provides autofill behavior.
A select element that is not disabled is
mutable.
The type IDL
attribute, on getting, must return the string "select-one" if the multiple attribute is absent, and the string "select-multiple" if the multiple
attribute is present.
The options IDL attribute must return an
HTMLOptionsCollection rooted at the select node, whose filter matches
the elements in the list of options.
The options collection is also mirrored on the
HTMLSelectElement object. The supported property indices at any instant
are the indices supported by the object returned by the options attribute at that instant.
The length
IDL attribute must return the number of nodes represented by the options collection.
On setting, it must act like the attribute of the same name on the options collection.
The item(index) method must return the value returned
by the method of the same name on the options collection, when invoked with the same argument.
The namedItem(name) method must return the value
returned by the method of the same name on the
options collection, when invoked with the same
argument.
When the user agent is to set the value of a new indexed
property or set the value of an existing indexed property for a
select element, it must instead run the
corresponding algorithm on the select element's options collection.
Similarly, the add(element, before) method must act
like its namesake method on that same options
collection.
The remove()
method must act like its namesake method on that same options collection when it has arguments, and like its namesake
method on the ChildNode interface implemented by the HTMLSelectElement
ancestor interface Element when it has no arguments.
The selectedOptions IDL attribute must return an
HTMLCollection rooted at the select node, whose filter matches the
elements in the list of options that have their
selectedness set to true.
The selectedIndex IDL attribute, on getting, must
return the index of the first option
element in the list of options in tree
order that has its selectedness set to
true, if any. If there isn't one, then it must return −1.
On setting, the selectedIndex attribute must set
the selectedness of all the option
elements in the list of options to false, and
then the option element in the list of
options whose index is the given new value, if
any, must have its selectedness set to true and
its dirtiness set to true.
The value
IDL attribute, on getting, must return the value of the
first option element in the list of
options in tree order that has its selectedness set to true, if any. If there isn't one,
then it must return the empty string.
On setting, the value attribute must set the selectedness of all the option elements
in the list of options to false, and then the
first option element in the list of
options, in tree order, whose value
is equal to the given new value, if any, must have its selectedness set to true and its dirtiness set to true.
The multiple, required, and size IDL attributes must
reflect the respective content attributes of the same name. The size IDL attribute has a default value of zero.
The willValidate, validity, and validationMessage IDL attributes, and the checkValidity(), reportValidity(), and setCustomValidity() methods, are part of the
constraint validation API. The labels IDL
attribute provides a list of the element's labels. The disabled, form, and
name IDL attributes are part of the element's forms API.
slot
4.12.4
The slot element defines a slot. It is
typically used in a shadow tree. A slot element represents
its assigned nodes, if any, and its contents otherwise.
The name content
attribute may contain any string value. It represents a slot's
name.
The name IDL
attribute must reflect the content attribute of the same name.
The slot element has manually assigned
nodes, which is an ordered set of slottables set by assign().
This set is initially empty.
The assignedNodes(options) method steps
are:
If options["flatten"] is
false, then return this's assigned nodes.Return the result of finding flattened slottables with
this.
The assignedElements(options) method
steps are:
If options["flatten"] is
false, then return this's assigned nodes, filtered to contain only
Element nodes.Return the result of finding flattened slottables with this,
filtered to contain only Element nodes.
The assign(...nodes) method steps are:
For each node of this's
manually assigned nodes, set node's manual slot assignment
to null.Let nodesSet be a new ordered set.
For each node of nodes:
If node's manual slot assignment refers to a slot,
then remove node from that slot's
manually assigned nodes.Set node's manual slot assignment to this.Append node to nodesSet.
Set this's manually assigned nodes to
nodesSet.Run assign slottables for a tree for this's
root.
small
4.5.4
The small element represents side comments such as small print.
The small 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
small element: in such a case, the text is not a side comment, it is the main content
of the page.
The small element must not be used for subheadings; for that purpose, use the
hgroup element.
source
4.8.2
The source element allows authors to specify multiple alternative
source sets for img elements or multiple alternative
media resources for media
elements. It does not represent anything on its own.
The type attribute
may be present. If present, the value must be a valid MIME type string.
The remainder of the requirements depend on whether the parent is a picture
element or a media element:
The source element's parent is a picture element
The srcset
attribute must be present, and is a srcset attribute.
The srcset attribute contributes the image sources to the source set, if the
source element is selected.
If the srcset attribute has any image candidate strings using a width descriptor, the sizes attribute must
also be present, and is a sizes attribute. The sizes attribute contributes the source size to
the source set, if the source element is selected.
The media
attribute may also be present. If present, the value must contain a valid media query
list. The user agent will skip to the next source element if the value does
not match the environment.
The source element supports dimension attributes. The
img element can use the width and height attributes of a source element, instead of
those on the img element itself, to determine its rendered dimensions and
aspect-ratio, as defined in the Rendering section.
The type attribute gives the type of the images in the
source set, to allow the user agent to skip to the next source element
if it does not support the given type.
When a source element has a following sibling source element or
img element with a srcset attribute
specified, it must have at least one of the following:
A media attribute specified with a value that,
after stripping leading and trailing
ASCII whitespace, is not the empty string and is not an ASCII
case-insensitive match for the string "all".A type attribute specified.
The src attribute must not be present.
The source element's parent is a media element
The src attribute
gives the URL of the media resource. The value must be a valid
non-empty URL potentially surrounded by spaces. This attribute must be present.
The type attribute gives the type of the media
resource, to help the user agent determine if it can play this media
resource before fetching it. The codecs parameter, which certain
MIME types define, might be necessary to specify exactly how the resource is encoded. [RFC6381]
The srcset, sizes, and media
attributes must not be present.
The source HTML element insertion
steps, given insertedNode, are:
If insertedNode's parent is a media element that has no src attribute and whose networkState has the value NETWORK_EMPTY, then invoke that media
element's resource selection
algorithm.If insertedNode's next sibling is an img element and its parent is
a picture element, then, count this as a relevant
mutation for the img element.
The source HTML element removing
steps, given removedNode and oldParent, are:
If removedNode's next sibling was an img element and
oldParent is a picture element, then, count this as a relevant mutation for the img element.
The IDL attributes src, type, srcset, sizes and media must reflect the respective
content attributes of the same name.
span
4.5.26
The span element doesn't mean anything on its own, but can be useful when used
together with the global attributes, e.g. class,
lang, or dir. It
represents its children.
strong
4.5.3
The strong element represents strong importance, seriousness, or
urgency for its contents.
Importance: the strong element can be used in a heading, caption,
or paragraph to distinguish the part that really matters from other parts that might be more
detailed, more jovial, or merely boilerplate. (This is distinct from marking up subheadings, for
which the hgroup element is appropriate.)
For example, the first word of the previous paragraph is marked up with
strong to distinguish it from the more detailed text in the rest of the
paragraph.
Seriousness: the strong element can be used to mark up a warning
or caution notice.
Urgency: the strong element can be used to denote contents that
the user needs to see sooner than other parts of the document.
The relative level of importance of a piece of content is given by its number of ancestor
strong elements; each strong element increases the importance of its
contents.
Changing the importance of a piece of text with the strong element does not change
the meaning of the sentence.
style
4.2.6
The style element allows authors to embed CSS style sheets in their documents.
The style element is one of several inputs to the styling processing
model. The element does not represent content for the
user.
The disabled getter steps are:
If this does not have an associated CSS style sheet, return
false.If this's associated CSS style sheet's disabled flag is set, return true.Return false.
The disabled setter steps are:
If this does not have an associated CSS style sheet,
return.If the given value is true, set this's associated CSS style
sheet's disabled flag.
Otherwise, unset this's associated CSS style sheet's disabled flag.
The media attribute
says which media the styles apply to. The value must be a valid media query list.
The user agent must apply the styles when the media attribute's value matches the environment and
the other relevant conditions apply, and must not apply them otherwise.
The default, if the media
attribute is omitted, is "all", meaning that by default styles apply to all
media.
The blocking
attribute is a blocking attribute.
The title attribute on style elements defines
CSS style sheet sets. If the style element
has no title attribute, then it has no title; the title attribute of ancestors does not apply to the style
element. If the style element is not in a document tree, then the title attribute is ignored. [CSSOM]
The child text content of a style element must be that of a
conformant style sheet.
A style element is implicitly potentially render-blocking if the
element was created by its node document's parser.
The user agent must run the update a style block algorithm whenever
one of the following conditions occur:
The element is popped off the stack of open elements of an HTML
parser or XML parser.The element is not on the stack of open elements of an HTML
parser or XML parser, and it becomes connected or disconnected.The element's children changed steps run.
The update a style block algorithm is as follows:
Let element be the style element.If element has an associated CSS style sheet, remove the CSS style sheet in question.If element is not connected, then return.
If element's type attribute is present and
its value is neither the empty string nor an ASCII case-insensitive match for
"text/css", then return.
If the Should element's inline behavior be blocked by Content Security
Policy? algorithm returns "Blocked" when executed upon the
style element, "style", and the style
element's child text content, then return. [CSP]
Create a CSS style sheet with the following properties:
typetext/cssowner nodeelementmedia
The media attribute of element.
title
The title attribute of element, if
element is in a document tree, or the empty string otherwise.
alternate flagUnset.origin-clean flagSet.locationparent CSS style sheetowner CSS rulenulldisabled flagLeft at its default value.CSS rules
Left uninitialized.
This doesn't seem right. Presumably we should be using the element's
child text content? Tracked as issue #2997.
If element contributes a script-blocking style sheet, increment
element's node document's script-blocking style sheet
counter by 1.If element's media attribute's value
matches the environment and element is
potentially render-blocking, then block rendering on
element.
Once the attempts to obtain the style sheet's critical subresources, if any, are
complete, or, if the style sheet has no critical subresources, once the style sheet
has been parsed and processed, the user agent must run these steps:
Fetching the critical subresources is not well-defined; probably issue #968 is the best resolution for that.
In the meantime, any critical subresource request should have its render-blocking set to whether or not the
style element is currently render-blocking.
Let element be the style element associated with the style sheet
in question.Let success be true.
If the attempts to obtain any of the style sheet's critical subresources failed
for any reason (e.g., DNS error, HTTP 404 response, a connection being prematurely closed,
unsupported Content-Type), set success to false.
Queue an element task on the networking task source given
element and the following steps:
If success is true, fire an event
named load at element.Otherwise, fire an event named error at element.
If element contributes a script-blocking style sheet:
Assert: element's node document's script-blocking style
sheet counter is greater than 0.Decrement element's node document's script-blocking
style sheet counter by 1.
Unblock rendering on element.
The element must delay the load event of the element's node document until all the
attempts to obtain the style sheet's critical subresources, if any, are complete.
The media and
blocking IDL
attributes must each reflect the respective content attributes of the same name.
The LinkStyle interface is also implemented by this element. [CSSOM]
summary
4.11.2
The summary element represents a summary, caption, or legend for the
rest of the contents of the summary element's parent details
element, if any.
A summary element is a summary for its parent details if the following
algorithm returns true:
If this summary element has no parent, then return false.Let parent be this summary element's parent.If parent is not a details element, then return false.If parent's first summary element child is not this
summary element, then return false.Return true.
The activation behavior of summary elements is to run the following
steps:
If this summary element is not the summary for its parent
details, then return.Let parent be this summary element's parent.
If the open attribute is present on
parent, then remove it.
Otherwise, set parent's
open attribute to the empty string.
table
4.9.1
The table element represents data with more than one dimension, in
the form of a table.
The table element takes part in the table
model. 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.
Authors are encouraged to provide information describing how to interpret complex tables.
Guidance on how to provide such information is given
below.
Tables must not be used as layout aids. Historically, some web authors have misused tables in
HTML as a way to control their page layout. This usage is non-conforming, because tools attempting
to extract tabular data from such documents would obtain very confusing results. In particular,
users of accessibility tools like screen readers are likely to find it very difficult to navigate
pages with tables used for layout.
Tables can be complicated to understand and navigate. To help users with this, user agents
should clearly delineate cells in a table from each other, unless the user agent has classified
the table as a (non-conforming) layout table.
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:
Feature
Indication
The use of the role attribute with the value presentation
Probably a layout table
The use of the non-conforming border attribute with the non-conforming value 0
Probably a layout table
The use of the non-conforming cellspacing and
cellpadding attributes with the value 0
Probably a layout table
The use of caption, thead, or th elements
Probably a non-layout table
The use of the headers and scope attributes
Probably a non-layout table
The use of the non-conforming border attribute with a value other than 0
Probably a non-layout table
Explicit visible borders set using CSS
Probably a non-layout table
The use of the summary attribute
Not a good indicator (both layout and non-layout tables have historically been given this attribute)
If a table element has a (non-conforming) summary 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.
In all of the following attribute and method definitions, when an element is to be
table-created, that means to create an element given the
table element's node document, the given local name, and the HTML
namespace.
The caption
IDL attribute must return, on getting, the first caption element child of the
table element, if any, or null otherwise. On setting, the first caption
element child of the table element, if any, must be removed, and the new value, if
not null, must be inserted as the first node of the table element.
The createCaption() method must return the first
caption element child of the table element, if any; otherwise a new
caption element must be table-created, inserted as the first node of the
table element, and then returned.
The deleteCaption() method must remove the first
caption element child of the table element, if any.
The tHead IDL
attribute must return, on getting, the first thead element child of the
table element, if any, or null otherwise. On setting, if the new value is null or a
thead element, the first thead element child of the table
element, if any, must be removed, and the new value, if not null, must be inserted immediately
before the first element in the table element that is neither a caption
element nor a colgroup element, if any, or at the end of the table if there are no
such elements. If the new value is neither null nor a thead element, then a
"HierarchyRequestError" DOMException must be thrown
instead.
The createTHead() method must return the first
thead element child of the table element, if any; otherwise a new
thead element must be table-created and inserted immediately before the
first element in the table element that is neither a caption element nor
a colgroup element, if any, or at the end of the table if there are no such elements,
and then that new element must be returned.
The deleteTHead() method must remove the first
thead element child of the table element, if any.
The tFoot IDL
attribute must return, on getting, the first tfoot element child of the
table element, if any, or null otherwise. On setting, if the new value is null or a
tfoot element, the first tfoot element child of the table
element, if any, must be removed, and the new value, if not null, must be inserted at the end of
the table. If the new value is neither null nor a tfoot element, then a
"HierarchyRequestError" DOMException must be thrown
instead.
The createTFoot() method must return the first
tfoot element child of the table element, if any; otherwise a new
tfoot element must be table-created and inserted at the end of the
table, and then that new element must be returned.
The deleteTFoot() method must remove the first
tfoot element child of the table element, if any.
The tBodies
attribute must return an HTMLCollection rooted at the table node, whose
filter matches only tbody elements that are children of the table
element.
The createTBody() method must table-create a new tbody element, insert it immediately
after the last tbody element child in the table element, if any, or at
the end of the table element if the table element has no
tbody element children, and then must return the new tbody element.
The rows
attribute must return an HTMLCollection rooted at the table node, whose
filter matches only tr elements that are either children of the table
element, or children of thead, tbody, or tfoot elements
that are themselves children of the table element. The elements in the collection
must be ordered such that those elements whose parent is a thead are included first,
in tree order, followed by those elements whose parent is either a table
or tbody element, again in tree order, followed finally by those
elements whose parent is a tfoot element, still in tree order.
The behavior of the insertRow(index) 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 index
argument:
If index is less than −1 or greater than the number of elements
in rows collection:The method must throw an "IndexSizeError"
DOMException.If the rows collection has zero elements in it, and the
table has no tbody elements in it:The method must table-create a tbody
element, then table-create a tr element, then
append the tr element to the tbody element, then append the
tbody element to the table element, and finally return the
tr element.If the rows collection has zero elements in it:The method must table-create a tr element,
append it to the last tbody element in the table, and return the tr
element.If index is −1 or equal to the number of items in rows collection:The method must table-create a tr element,
and append it to the parent of the last tr element in the rows collection. Then, the newly created tr element
must be returned.Otherwise:The method must table-create a tr element,
insert it immediately before the indexth tr element in the rows collection, in the same parent, and finally must return the
newly created tr element.
When the deleteRow(index) method is called, the user
agent must run the following steps:
If index is less than −1 or greater than or equal to the number of
elements in the rows collection, then throw an
"IndexSizeError" DOMException.If index is −1, then remove
the last element in the rows collection from its parent, or
do nothing if the rows collection is empty.Otherwise, remove the indexth element
in the rows collection from its parent.
tbody
4.9.5
The tbody element represents a block of rows that consist of a
body of data for the parent table element, if the tbody element has a
parent and it is a table.
The tbody element takes part in the table model.
The rows attribute must return an HTMLCollection
rooted at this element, whose filter matches only tr elements that are children of
this element.
The insertRow(index) method must act as
follows:
If index is less than −1 or greater than the number of elements in the
rows collection, throw an
"IndexSizeError" DOMException.Let table row be the result of creating an
element given this element's node document, tr, and the
HTML namespace.If index is −1 or equal to the number of items in the rows collection, then append table row to this element.Otherwise, insert table row as a
child of this element, immediately before the indexth tr element in the
rows collection.Return table row.
The deleteRow(index) method must, when invoked,
act as follows:
If index is less than −1 or greater than or equal to the number of
elements in the rows collection, then throw an
"IndexSizeError" DOMException.If index is −1, then remove
the last element in the rows collection from this
element, or do nothing if the rows collection is
empty.Otherwise, remove the indexth element
in the rows collection from this element.
td
4.9.9
The td element represents a data cell in a table.
The td element and its colspan, rowspan, and headers
attributes take part in the table model.
User agents, especially in non-visual environments or where displaying the table as a 2D grid
is impractical, may give the user context for the cell when rendering the contents of a cell; for
instance, giving its position in the table model, or listing the cell's header cells
(as determined by the algorithm for assigning header cells). When a cell's header
cells are being listed, user agents may use the value of abbr
attributes on those header cells, if any, instead of the contents of the header cells
themselves.
template
4.12.3
The template element is used to declare fragments of HTML that can be cloned and
inserted in the document by script.
In a rendering, the template element represents nothing.
The template contents of a template element are not children of the element itself.
Each template element has an associated DocumentFragment object that
is its template contents. The template contents have no conformance requirements. When a template element
is created, the user agent must run the following steps to establish the template
contents:
Let doc be the template element's node document's appropriate template contents owner
document.Create a DocumentFragment object whose node document is
doc and host is the
template element.Set the template element's template contents to the newly
created DocumentFragment object.
A Document doc's appropriate template contents owner
document is the Document returned by the following algorithm:
If doc is not a Document created by this algorithm, then:
If doc does not yet have an associated inert template document,
then:
Let new doc be a new Document (whose browsing context is null). This is "a
Document created by this algorithm" for the purposes of the step above.If doc is an HTML document, mark
new doc as an HTML document
also.Let doc's associated inert template document be new doc.
Set doc to doc's associated inert
template document.
Return doc.
The adopting steps
(with node and oldDocument as parameters) for template elements
are the following:
Let doc be node's node document's
appropriate template contents owner document.
Adopt node's
template contents (a DocumentFragment object) into doc.
The content IDL attribute must return the
template element's template contents.
The cloning steps for a template
element node being cloned to a copy copy must run the
following steps:
If the clone children flag is not set in the calling clone algorithm, return.Let copied contents be the result of cloning all the children of node's
template contents, with document set to copy's template contents's node
document, and with the clone children
flag set.Append copied contents to copy's template
contents.
textarea
4.10.11
The textarea element represents a multiline plain text edit
control for the element's raw
value. The contents of the control represent the control's default value.
The raw value of a textarea
control must be initially the empty string.
The readonly attribute is a boolean
attribute used to control whether the text can be edited by the user or not.
Constraint validation: If the readonly attribute is specified on a textarea
element, the element is barred from constraint validation.
A textarea element is mutable if it is
neither disabled nor has a readonly attribute specified.
When a textarea is mutable, its raw value 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 raw value to change, the user agent must queue an
element task on the user interaction task source given the
textarea element to fire an event named
input at the textarea element, with the bubbles and composed
attributes initialized to true. 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.
A textarea element's dirty value flag must
be set to true whenever the user interacts with the control in a way that changes the raw value.
The cloning steps for textarea
elements must propagate the raw value and dirty value flag from the node being cloned to the copy.
The children changed steps for textarea elements must, if the
element's dirty value flag is false, set the element's
raw value to its child text
content.
The reset algorithm for textarea
elements is to set the dirty value flag back to false, and
set the raw value of element to its child
text content.
When a textarea element is popped off the stack of open elements of
an HTML parser or XML parser, then the user agent must invoke the
element's reset algorithm.
If the element is mutable, 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:
Set the element's dir attribute to "ltr" if the user selected a left-to-right writing direction, and
"rtl" if the user selected a right-to-left writing
direction.Queue an element task on the user interaction task source given
the textarea element to fire an event named
input at the textarea element, with the bubbles and composed
attributes initialized to true.
The cols
attribute specifies the expected maximum number of characters per line. If the cols attribute is specified, its value must be a valid
non-negative integer greater than zero. If applying the rules for
parsing non-negative integers to the attribute's value results in a number greater than
zero, then the element's character width is that
value; otherwise, it is 20.
The user agent may use the textarea element's character width 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.
The rows
attribute specifies the number of lines to show. If the rows attribute is specified, its value must be a valid
non-negative integer greater than zero. If applying the rules for
parsing non-negative integers to the attribute's value results in a number greater than
zero, then the element's character height is that
value; otherwise, it is 2.
Visual user agents should set the height of the control to the number of lines given by character height.
The wrap
attribute is an enumerated attribute with two keywords and states: the soft keyword
which maps to the Soft state, and the hard keyword
which maps to the Hard state. The missing value default and invalid value default are the Soft state.
The Soft state indicates that the text in the
textarea is not to be wrapped when it is submitted (though it can still be wrapped in
the rendering).
The Hard state indicates that the text in the
textarea is to have newlines added by the user agent so that the text is wrapped when
it is submitted.
If the element's wrap attribute is in the Hard state, the cols attribute must be specified.
For historical reasons, the element's value is normalized in three different ways for three
different purposes. The raw value is the value as
it was originally set. It is not normalized. The API
value is the value used in the value IDL
attribute, textLength IDL attribute, and by the
maxlength and minlength content attributes. It is normalized so that line
breaks use U+000A LINE FEED (LF) characters. Finally, there is the value, as used in form submission and other processing models in
this specification. It is normalized as for the API
value, and in addition, if necessary given the element's wrap attribute, additional line breaks are inserted to wrap the
text at the given width.
The algorithm for obtaining
the element's API value is to return the element's
raw value, with newlines normalized.
The element's value is defined to be the element's API value with the textarea wrapping
transformation applied. The textarea wrapping transformation is the following
algorithm, as applied to a string:
If the element's wrap attribute is in the Hard state, insert U+000A LINE FEED (LF) characters
into the string using an implementation-defined algorithm so that each line has no
more than character width characters. For the
purposes of this requirement, lines are delimited by the start of the string, the end of the
string, and U+000A LINE FEED (LF) characters.
The maxlength attribute is a form control maxlength attribute.
If the textarea element has a maximum allowed value length, then the
element's children must be such that the length of the value of the element's
descendant text content with newlines
normalized is equal to or less than the element's maximum allowed value
length.
The minlength attribute is a form control minlength attribute.
The required attribute is a boolean
attribute. When specified, the user will be required to enter a value before submitting the
form.
Constraint validation: If the element has its required attribute specified, and the element is mutable, and the element's value is the empty string, then the element is suffering
from being missing.
The placeholder attribute represents a short
hint (a word or short phrase) intended to aid the user with data entry when the control has no
value. A hint could be a sample value or a brief description of the expected format.
The placeholder attribute should not be used as
an alternative to a label. For a longer hint or other advisory text, the title attribute is more appropriate.
User agents should present this hint to the user when the element's value is the empty string and the control is not
focused (e.g. by displaying it inside a blank unfocused control). All U+000D CARRIAGE
RETURN U+000A LINE FEED character pairs (CRLF) in the hint, as well as all other U+000D CARRIAGE
RETURN (CR) and U+000A LINE FEED (LF) characters in the hint, must be treated as line breaks when
rendering the hint.
If a user agent normally doesn't show this hint to the user when the control is
focused, then the user agent should nonetheless show the hint for the control if it
was focused as a result of the autofocus attribute, since
in that case the user will not have had an opportunity to examine the control before focusing
it.
The name attribute represents the element's name.
The dirname attribute controls how the element's directionality is submitted.
The disabled attribute is used to make the control
non-interactive and to prevent its value from being submitted.
The form attribute is used to explicitly associate the
textarea element with its form owner.
The autocomplete attribute controls how the user agent
provides autofill behavior.
The cols, placeholder, required, rows, and wrap IDL
attributes must reflect the respective content attributes of the same name. The cols and rows attributes
are limited to only non-negative numbers greater than zero with fallback. The cols IDL attribute's default value is 20. The rows IDL attribute's default value is 2. The dirName IDL attribute
must reflect the dirname content attribute. The
maxLength IDL attribute must reflect the
maxlength content attribute, limited to only
non-negative numbers. The minLength IDL attribute must reflect the
minlength content attribute, limited to only
non-negative numbers. The readOnly IDL attribute must reflect the
readonly content attribute.
The type
IDL attribute must return the value "textarea".
The defaultValue attribute's getter must return the
element's child text content.
The defaultValue attribute's setter must
string replace all with the given value within this element.
The value IDL attribute must, on getting, return the
element's API value. On setting, it must perform the
following steps:
Let oldAPIValue be this element's API value.Set this element's raw value to the new
value.Set this element's dirty value flag to
true.If the new API value is different from
oldAPIValue, then move the text entry
cursor position to the end of the text control, unselecting any selected text and resetting the selection direction to "none".
The textLength IDL attribute must return the
length of the element's API value.
The willValidate, validity, and validationMessage IDL attributes, and the checkValidity(), reportValidity(), and setCustomValidity() methods, are part of the
constraint validation API. The labels IDL
attribute provides a list of the element's labels. The select(), selectionStart, selectionEnd, selectionDirection, setRangeText(), and setSelectionRange() methods and IDL attributes
expose the element's text selection. The disabled,
form, and name IDL attributes
are part of the element's forms API.
tfoot
4.9.7
The tfoot element represents the block of rows that consist of
the column summaries (footers) for the parent table element, if the
tfoot element has a parent and it is a table.
The tfoot element takes part in the table
model.
th
4.9.10
The th element represents a header cell in a table.
The th element may have a scope content attribute specified. The scope attribute is an enumerated attribute with five
states, four of which have explicit keywords:
The row keyword,
which maps to the row stateThe row state means the header cell applies to some of the subsequent cells in the
same row(s).The col keyword,
which maps to the column stateThe column state means the header cell applies to some of the subsequent cells in the
same column(s).The rowgroup keyword, which maps to the row group
stateThe row group state means the header cell applies to all the remaining cells in the
row group. A th element's scope attribute must
not be in the row group state if the element is not
anchored in a row group.The colgroup keyword, which maps to the column
group stateThe column group state means the header cell applies to all the remaining cells in the
column group. A th element's scope attribute must
not be in the column group state if the element is
not anchored in a column group.The auto stateThe auto state makes the header cell apply to a set of cells selected based on
context.
The scope attribute's missing value default and invalid value default
are the auto state.
The th element may have an abbr content attribute specified. Its value must be an
alternative label for the header cell, to be used when referencing the cell in other contexts
(e.g. when describing the header cells that apply to a data cell). It is typically an abbreviated
form of the full header cell, but can also be an expansion, or merely a different phrasing.
The th element and its colspan, rowspan, headers, and
scope attributes take part in the table model.
thead
4.9.6
The thead element represents the block of rows that consist of
the column labels (headers) for the parent table element, if the thead
element has a parent and it is a table.
The thead element takes part in the table model.
time
4.5.14
The time element represents its contents, along with a
machine-readable form of those contents in the datetime
attribute. The kind of content is limited to various kinds of dates, times, time-zone offsets, and
durations, as described below.
The datetime
attribute may be present. If present, its value must be a representation of the element's contents
in a machine-readable format.
A time element that does not have a datetime content attribute must not have any element
descendants.
The datetime value of a time element is the value of the element's
datetime content attribute, if it has one, otherwise the
child text content of the time element.
The datetime value of a time element must match one of the following
syntaxes.
A valid month string
2011-11
A valid date string
2011-11-18
A valid yearless date string
11-18
A valid time string
14:54
14:54:39
14:54:39.929
A valid local date and time string
2011-11-18T14:54
2011-11-18T14:54:39
2011-11-18T14:54:39.929
2011-11-18 14:54
2011-11-18 14:54:39
2011-11-18 14:54:39.929
A valid time-zone offset string
Z
+0000
+00:00
-0800
-08:00
A valid global date and time string
2011-11-18T14:54Z
2011-11-18T14:54:39Z
2011-11-18T14:54:39.929Z
2011-11-18T14:54+0000
2011-11-18T14:54:39+0000
2011-11-18T14:54:39.929+0000
2011-11-18T14:54+00:00
2011-11-18T14:54:39+00:00
2011-11-18T14:54:39.929+00:00
2011-11-18T06:54-0800
2011-11-18T06:54:39-0800
2011-11-18T06:54:39.929-0800
2011-11-18T06:54-08:00
2011-11-18T06:54:39-08:00
2011-11-18T06:54:39.929-08:00
2011-11-18 14:54Z
2011-11-18 14:54:39Z
2011-11-18 14:54:39.929Z
2011-11-18 14:54+0000
2011-11-18 14:54:39+0000
2011-11-18 14:54:39.929+0000
2011-11-18 14:54+00:00
2011-11-18 14:54:39+00:00
2011-11-18 14:54:39.929+00:00
2011-11-18 06:54-0800
2011-11-18 06:54:39-0800
2011-11-18 06:54:39.929-0800
2011-11-18 06:54-08:00
2011-11-18 06:54:39-08:00
2011-11-18 06:54:39.929-08:00
A valid week string
2011-W47
Four or more ASCII digits, at least one of which is not U+0030 DIGIT ZERO (0)
2011
0001
A valid duration string
PT4H18M3S
4h 18m 3s
The machine-readable equivalent of the element's contents must be obtained from the
element's datetime value by using the following algorithm:
If parsing a month string from the element's
datetime value returns a month, that is the
machine-readable equivalent; return.If parsing a date string from the element's
datetime value returns a date, that is the
machine-readable equivalent; return.If parsing a yearless date string from
the element's datetime value returns a yearless
date, that is the machine-readable equivalent; return.If parsing a time string from the element's
datetime value returns a time, that is the
machine-readable equivalent; return.If parsing a local date and time
string from the element's datetime value returns a local date and time, that is the machine-readable
equivalent; return.If parsing a time-zone offset string
from the element's datetime value returns a time-zone
offset, that is the machine-readable equivalent; return.If parsing a global date and time
string from the element's datetime value returns a global date and time, that is the machine-readable equivalent;
return.If parsing a week string from the element's
datetime value returns a week, that is the
machine-readable equivalent; return.If the element's datetime value consists of only ASCII digits,
at least one of which is not U+0030 DIGIT ZERO (0), then the machine-readable equivalent is the
base-ten interpretation of those digits, representing a year; return.If parsing a duration string from the
element's datetime value returns a duration,
that is the machine-readable equivalent; return.There is no machine-readable equivalent.
The dateTime
IDL attribute must reflect the element's datetime content attribute.
title
4.2.2
The title element represents the document's title or name. Authors
should use titles that identify their documents even when they are used out of context, for
example in a user's history or bookmarks, or in search results. The document's title is often
different from its first heading, since the first heading does not have to stand alone when taken
out of context.
There must be no more than one title element per document.
The text
attribute's getter must return this title element's child text
content.
The text attribute's setter must string replace
all with the given value within this title element.
The string to use as the document's title is given by the document.title IDL attribute.
User agents should use the document's title when referring to the document in their user
interface. When the contents of a title element are used in this way, the
directionality of that title element should be used to set the directionality
of the document's title in the user interface.
tr
4.9.8
The tr element represents a row of
cells in a table.
The tr element takes part in the table model.
The rowIndex attribute must, if this element has a parent
table element, or a parent tbody, thead, or
tfoot element and a grandparent table element, return the index
of this tr element in that table element's rows collection. If there is no such table element,
then the attribute must return −1.
The sectionRowIndex attribute must, if this element has a
parent table, tbody, thead, or tfoot element,
return the index of the tr element in the parent element's rows collection (for tables, that's HTMLTableElement's rows collection; for table sections, that's
HTMLTableSectionElement's rows
collection). If there is no such parent element, then the attribute must return −1.
The cells
attribute must return an HTMLCollection rooted at this tr element, whose
filter matches only td and th elements that are children of the
tr element.
The insertCell(index) method must act as
follows:
If index is less than −1 or greater than the number of elements in
the cells collection, then throw an
"IndexSizeError" DOMException.Let table cell be the result of creating an
element given this tr element's node document, td,
and the HTML namespace.If index is equal to −1 or equal to the number of items in cells collection, then append table cell to this tr
element.Otherwise, insert table cell as a
child of this tr element, immediately before the indexth td
or th element in the cells collection.Return table cell.
The deleteCell(index) method must act as
follows:
If index is less than −1 or greater than or equal to the number of
elements in the cells collection, then throw an
"IndexSizeError" DOMException.If index is −1, then remove
the last element in the cells collection from its
parent, or do nothing if the cells collection is
empty.Otherwise, remove the indexth element
in the cells collection from its parent.
track
4.8.10
The track element allows authors to specify explicit external timed text tracks for media elements. It
does not represent anything on its own.
The kind attribute is
an enumerated attribute. 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.
Keyword
State
Brief description
subtitles
Subtitles
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 media resource's audio track).
Overlaid on the video.
captions
Captions
Transcription or translation of the dialogue, sound effects, relevant musical cues, and other relevant audio information, suitable for when sound is unavailable or not clearly audible (e.g. because it is muted, drowned-out by ambient noise, or because the user is deaf).
Overlaid on the video; labeled as appropriate for the hard-of-hearing.
descriptions
Descriptions
Textual descriptions of the video component of the media resource, intended for audio synthesis when the visual component is obscured, unavailable, or not usable (e.g. because the user is interacting with the application without a screen while driving, or because the user is blind).
Synthesized as audio.
chapters
Chapters metadata
Tracks intended for use from script.
Not displayed by the user agent.
metadata
Metadata
The attribute may be omitted. The missing value default
is the subtitles state. The invalid value default is the metadata state.
The src attribute
gives the URL of the text track data. The value must be a valid non-empty URL
potentially surrounded by spaces. This attribute must be present.
If the element has a src attribute whose value is not the
empty string and whose value, when the attribute was set, could be successfully parsed relative to the element's node document, then the
element's track URL is the resulting URL string. Otherwise, the element's
track URL is the empty string.
If the element's track URL identifies a WebVTT resource, and the element's kind attribute is not in the chapters metadata or metadata state, then the WebVTT file must be a
WebVTT file using cue text. [WEBVTT]
The srclang
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 kind
attribute is in the subtitles state. [BCP47]
If the element has a srclang attribute whose value is
not the empty string, then the element's track language is the value of the attribute.
Otherwise, the element has no track language.
The label attribute
gives a user-readable title for the track. This title is used by user agents when listing subtitle, caption, and audio description tracks in their user interface.
The value of the label attribute, if the attribute is
present, must not be the empty string. Furthermore, there must not be two track
element children of the same media element whose kind attributes are in the same state, whose srclang attributes are both missing or have values that
represent the same language, and whose label attributes are
again both missing or both have the same value.
If the element has a label attribute whose value is not
the empty string, then the element's track label is the value of the attribute.
Otherwise, the element's track label is an empty string.
The default
attribute is a boolean attribute, which, 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.
Each media element must have no more than one track element child
whose kind attribute is in the subtitles or captions state and whose default attribute is specified.
Each media element must have no more than one track element child
whose kind attribute is in the description state and whose default attribute is specified.
Each media element must have no more than one track element child
whose kind attribute is in the chapters metadata state and whose default attribute is specified.
The readyState attribute must return the numeric value
corresponding to the text track readiness state of the track element's
text track, as defined by the following list:
NONE (numeric value 0)The text track not loaded state.LOADING (numeric value 1)The text track loading state.LOADED (numeric value 2)The text track loaded state.ERROR (numeric value 3)The text track failed to load state.
The track IDL
attribute must, on getting, return the track element's text track's
corresponding TextTrack object.
The src, srclang, label, and default IDL
attributes must reflect the respective content attributes of the same name. The kind IDL attribute
must reflect the content attribute of the same name, limited to only known
values.
u
4.5.22
The u element represents 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.
In most cases, another element is likely to be more appropriate: for marking stress emphasis,
the em element should be used; for marking key words or phrases either the
b element or the mark element should be used, depending on the context;
for marking book titles, the cite element should be used; for labeling text with explicit textual annotations, the
ruby element should be used; for technical terms, taxonomic designation,
transliteration, a thought, or for labeling ship names in Western texts, the i
element should be used.
ul
4.4.6
The ul element represents 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.
The items of the list are the li element child nodes of the ul
element.
var
4.5.16
The var element represents a variable. This could be an actual
variable in a mathematical expression or programming context, an identifier representing a
constant, a symbol identifying a physical quantity, a function parameter, or just be a term used
as a placeholder in prose.
For mathematics, in particular for anything beyond the simplest of expressions, MathML is more
appropriate. However, the var element can still be used to refer to specific
variables that are then mentioned in MathML expressions.
video
4.8.8
A video element is used for playing videos or movies, and audio files with
captions.
Content may be provided inside the video element. User agents
should not show this content to the user; it is intended for older web browsers which do
not support video, 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.
The video element is a media element whose media data is
ostensibly video data, possibly with associated audio data.
The src, crossorigin,
preload, autoplay,
loop, muted, and controls attributes are the attributes common to all media elements.
The poster
attribute gives the URL of an image file that the user agent can show while no video
data is available. The attribute, if present, must contain a valid non-empty URL
potentially surrounded by spaces.
If the specified resource is to be used, then, when the element is created or when the poster attribute is set, changed, or removed, the user agent must
run the following steps to determine the element's poster frame (regardless of the
value of the element's show poster flag):
If there is an existing instance of this algorithm running for this video
element, abort that instance of this algorithm without changing the poster
frame.If the poster attribute's value is the empty string
or if the attribute is absent, then there is no poster frame; return.Parse the poster attribute's value relative to the element's node
document. If this fails, then there is no poster frame; return.Let request be a new request whose
URL is the resulting URL record,
client is the element's node document's
relevant settings object, destination is "image", credentials mode is "include", and whose use-URL-credentials flag is set.
Fetch request, with
processResponseEndOfBody given
response res set to
finalize and report timing with res, the element's
node document's relevant global object, and
"video". This must delay the load event of the element's
node document.If an image is thus obtained, the poster frame is that image. Otherwise,
there is no poster frame.
The playsinline attribute is a boolean
attribute. If present, it serves as a hint to the user agent that the video ought to be
displayed "inline" in the document by default, constrained to the element's playback area, instead
of being displayed fullscreen or in an independent resizable window.
A video element represents what is given for the first matching condition in the
list below:
When no video data is available (the element's readyState attribute is either HAVE_NOTHING, or HAVE_METADATA but no video data has yet been obtained at
all, or the element's readyState attribute is any
subsequent value but the media resource does not have a video channel)The video element represents its poster frame, if any,
or else transparent black with no intrinsic dimensions.When the video element is paused, the current playback position is the first frame of video,
and the element's show poster flag is setThe video element represents its poster frame, if any,
or else the first frame of the video.When the video element is paused, and the
frame of video corresponding to the current playback
position is not available (e.g. because the video is seeking or buffering)When the video element is neither potentially playing nor paused (e.g. when seeking or stalled)The video element represents the last frame of the video to have
been rendered.When the video element is pausedThe video element represents the frame of video corresponding to
the current playback position.Otherwise (the video element has a video channel and is potentially
playing)The video element represents the frame of video at the continuously
increasing "current" position. When the
current playback position changes such that the last frame rendered is no longer the
frame corresponding to the current playback position in the video, the new frame
must be rendered.
Frames of video must be obtained from the video track that was selected when the event loop last reached
step 1.
The video element also represents any text track cues whose text track cue active flag is set and whose
text track is in the showing mode, and any
audio from the media resource, at the current playback position.
Any audio associated with the media resource must, if played, be played
synchronized with the current playback position, at the element's effective
media volume. The user agent must play the audio from audio tracks that were enabled when the event loop last reached step
1.
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.
User agents that cannot render the video may instead make the element represent a link to an external video playback utility or to the video
data itself.
When a video element's media resource has a video channel, the
element provides a paint source whose width is the media resource's
intrinsic width, whose height is the
media resource's intrinsic
height, and whose appearance is the frame of video corresponding to the current playback position, if that is available, or else
(e.g. when the video is seeking or buffering) its previous appearance, if any, or else (e.g.
because the video is still loading the first frame) blackness.
The intrinsic width and intrinsic height of the media resource
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.
The videoWidth IDL attribute must return the intrinsic width of the video in CSS pixels. The videoHeight IDL attribute must return the intrinsic height of the video in CSS pixels. If the element's readyState attribute is HAVE_NOTHING, then the attributes must return 0.
Whenever the intrinsic width
or intrinsic height of the video changes
(including, for example, because the selected video
track was changed), if the element's readyState
attribute is not HAVE_NOTHING, the user agent must
queue a media element task given the media element to fire an event named resize at the media element.
The video element supports dimension attributes.
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.
The intrinsic width of a video element's playback area is the
intrinsic width of the poster frame, if that is available and the
element currently represents its poster frame; otherwise, it is the intrinsic width of the video resource, if that is
available; otherwise the intrinsic width is missing.
The intrinsic height of a video element's playback area is the
intrinsic height of the poster frame, if that is available and the
element currently represents its poster frame; otherwise it is the intrinsic height of the video resource, if that is
available; otherwise the intrinsic height is missing.
The default object size is a width of 300 CSS pixels
and a height of 150 CSS pixels. [CSSIMAGES]
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.
User agents may allow users to view the video content in manners more suitable to the user,
such as fullscreen or in an independent resizable window. User agents may even trigger such a
viewing mode by default upon playing a video, although they should not do so when the playsinline attribute is specified. As with the other user
interface features, controls to enable this should not interfere with the page's normal rendering
unless the user agent is exposing a user
interface. In such an independent viewing mode, however, user agents may make full user
interfaces visible, even if the controls attribute is
absent.
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.
The poster
IDL attribute must reflect the poster content
attribute.
The playsInline IDL attribute must reflect
the playsinline content attribute.
wbr
4.5.28
The wbr element represents a line break opportunity.
Any content inside wbr elements must not be considered part of the surrounding
text.
var wbr = document.createElement("wbr");
wbr.textContent = "This is wrong";
document.body.appendChild(wbr);