Вообще, когда спецификация утверждает, что некая возможность применяется для синтаксиса HTML или синтаксиса XHTML, она также имеет в виду и второй вариант. Когда возможность применяется именно только к одному из этих двух языков, то это обговаривается явно, утверждая, что это не относится к другому формату, как например в "для HTML, ... (это не относится к XHMTL)".
Данная спецификация использует термин документ для обозначения любого использования HTML, начиная от коротких статичных документов и заканчивая длинными эссе или докладами с мультимедиа, а также для полноценного интерактивных приложений. Этот термин используется для обозначения как объектов
Document и их потомков-DOM-деревьев, так и сериализованных байтовых потоков, использующих синтаксис HTML или синтаксис XHTML, в зависимости от контекста.
В контексте DOM-структур термины HTML-документ и XML-докумет используются так, как они определены в спецификации DOM Core, и они конкретно касаются двух различных режимов, в которых могут находится объекты
Document. [DOMCORE] (Подобные использования всегда содержат гиперссылку на их определение.)
В контексте байтовых потоков термин HTML-документ подразумевает ресурс, помеченный как
text/html, а термин XML-документ - как тип XML MIME.
Термин XHTML-документ используется для обозначения как
Documentов в режиме XML-документов, которые содержат елементы-узлы в HTML-пространстве, так и байтовых потоков, помеченных типом XML MIME и содержащих элементы из HTML-пространства, в зависимости от контекста.
Для простоты термины, такие как показан, отображен и видим могут иногда быть использованы для обозначения способа, которым документ отображен для пользователя. Эти термины не подразумевают задействование визуальной среды; они могут быть использованы для применения и в другой среде, эквивалентным образом.
Когда алгоритм B говорит перейти к другому алгоритму A, то это означает, что A вызывает B. После возврата к A реализация должна продолжить выполнение после места вызова B.
Термин "прозрачный черный" обозначает цвет с нулевыми красным, зеленым, синим и альфа-каналами.
Данная спецификация использует термин поддерживается для обозначения того, реализует ли агент пользователя декодирование семантики внешнего ресурса. Говорят, что формат или тип поддерживается, когда реализация может обработать внешний ресурс этого формата или типа без игнорирования критических аспектов ресурса. Поддерживается ли конкретный ресурс зависит от того, какие возможности формата ресурса задействованы.
Например, изображение PNG можно считать поддержанным, если его пиксель-данные могут быть раскодированы и отображены, даже если изображение также содержит анимацию, не поддерживаемую реализацией.
Видеофайл MPEG-4 нельзя считать поддержанным форматом, если использованный формат сжатия не поддерживается, даже если реализация может определить размеры фильма из метаданных файла.
То, что некоторые спецификации, в частности HTTP- и URI-спецификации, обозначают как представление обозначается в данной спецификации как ресурс. [HTTP] [RFC3986]
Термин MIME-тип используется для обозначения того, что иногда называется Internet media type в документации по протоколам. Термин медиа-тип в данной спецификации используется для обозначения типа медиа, предназначенного для представления, так как это используется в спецификациях по CSS. [RFC2046] [MQ]
Строка есть правильный MIME-тип, если она удовлетворяет правилу
media-type, определенному в разделе 3.7 "Media Types" из RFC 2616. В частности, правильный MIME-тип может содержать MIME-тип-параметры.
Строка есть правильный MIME-тип без параметров, если она удовлетворяет правилу
media-type, определенному в разделе 3.7 "Media Types" из RFC 2616, но не содержит знака U+003B SEMICOLON (;). Другими словами, если она состоит только из типа и подтипа, без MIME-тип-параметров. [HTTP]
Термин MIME-тип HTML используется для обозначения MIME-типа
критичные подресурсы ресурса есть такие подресурсы, что ресурс требует для корректной обработки. Считать ли ресурсы критичными или нет определяется той спецификацией, что определяет формат ресурса.
URL обозначает URLы, что используют схему
Чтобы упростить миграцию с HTML на XHTML, ПА, соответствующие данной спецификации, должны поместить элементы HTML в пространство
http://www.w3.org/1999/xhtml, по крайней мере ради DOM и CSS. Термин "HTML-элементы", при использовании в этой спецификации, обозначает любой элемент в этом пространстве, и таким образом это относится и к HTML-, и к XHTML-элементам.
Если не сказано иначе, все элементы, определенные или упомянутые в этой спецификации находятся в HTML-пространстве ("
http://www.w3.org/1999/xhtml"), и все атрибуты, определенные или упомянутые в этой спецификации не имеют пространства.
Термин тип элемента используется для обозначения класса элементов, которые имеют заданное локальное имя и пространство. Например, элементы
button - элементы с типом
button, что подразумевает, что они имеют локальное имя "
button" и (неявно, как определено выше) HTML-пространство.
Attribute names are said to be XML-compatible if they
Name production defined in XML, they contain no
U+003A COLON characters (:), and their first three characters are
not an ASCII case-insensitive match for the string
The term XML MIME type is used to refer to the MIME types
application/xml, and any MIME
type whose subtype ends with the four characters "
The root element of a
Document object is
Document's first element child, if any. If it does
not have one then the
Document has no root element.
The term root element, when not referring to a
Document object's root element, means the furthest
ancestor element node of whatever node is being discussed, or the
node itself if it has no ancestors. When the node is a part of the
document, then the node's root element is indeed the
document's root element; however, if the node is not currently part
of the document tree, the root element will be an orphaned node.
When an element's root element is the root
element of a
Document object, it is said to be
Document. An element is said to have
been inserted into a
document when its root element changes and is now
the document's root element. Analogously, an element is
said to have been removed from a document when its root
element changes from being the document's root
element to being another element.
A node's home subtree is the subtree rooted at that
node's root element. When a node is in a
Document, its home subtree is that
Document of a
Node (such as an
element) is the
Document that the
attribute returns. When a
Node is in a
Document then that
Document, and the
ownerDocument IDL attribute
thus always returns that
Document of a content attribute is the
Document of the attribute's element.
The term tree order means a pre-order, depth-first
traversal of DOM nodes involved (through the
When it is stated that some element or attribute is ignored, or treated as some other value, or handled as if it was something else, this refers only to the processing of the node after it is in the DOM. A user agent must not mutate the DOM in such situations.
A content attribute is said to change value only if its new value is different than its previous value; setting an attribute to a value it already has does not change it.
The term empty, when used of an attribute
Text node, or string, means that the length of
the text is zero (i.e. not even containing spaces or control
The construction "a
Foo object", where
Foo is actually an interface, is sometimes used instead
of the more accurate "an object implementing the interface
An IDL attribute is said to be getting when its value is being retrieved (e.g. by author script), and is said to be setting when a new value is assigned to it.
If a DOM object is said to be live, then the attributes and methods on that object must operate on the actual underlying data, not a snapshot of the data.
In the contexts of events, the terms fire and
dispatch are used as
defined in the DOM Core specification: firing an event means to
create and dispatch it, and dispatching an event means to follow the
steps that propagate the event through the tree. The term trusted event is used to refer
to events whose
attribute is initialized to true. [DOMCORE]
The term plugin refers to a user-agent defined set of
content handlers used by the user agent that can take part in the
user agent's rendering of a
Document object, but that
neither act as child browsing
contexts of the
Document nor introduce any
Node objects to the
Typically such content handlers are provided by third parties, though a user agent can also designate built-in content handlers as plugins.
A user agent must not consider the types
application/octet-stream as having a registered
One example of a plugin would be a PDF viewer that is instantiated in a browsing context when the user navigates to a PDF file. This would count as a plugin regardless of whether the party that implemented the PDF viewer component was the same as that which implemented the user agent itself. However, a PDF viewer application that launches separate from the user agent (as opposed to using the same interface) is not a plugin by this definition.
This specification does not define a mechanism for interacting with plugins, as it is expected to be user-agent- and platform-specific. Some UAs might opt to support a plugin mechanism such as the Netscape Plugin API; others might use remote content converters or have built-in support for certain types. Indeed, this specification doesn't require user agents to support plugins at all. [NPAPI]
A plugin can be secured
if it honors the semantics of the
For example, a secured plugin would prevent its
contents from creating pop-up windows when the plugin is
instantiated inside a sandboxed
Browsers should take extreme care when interacting with external content intended for plugins. When third-party software is run with the same privileges as the user agent itself, vulnerabilities in the third-party software become as dangerous as those in the user agent.
The preferred MIME name of a character encoding is the name or alias labeled as "preferred MIME name" in the IANA Character Sets registry, if there is one, or the encoding's name, if none of the aliases are so labeled. [IANACHARSET]
An ASCII-compatible character encoding is a single-byte or variable-length encoding in which the bytes 0x09, 0x0A, 0x0C, 0x0D, 0x20 - 0x22, 0x26, 0x27, 0x2C - 0x3F, 0x41 - 0x5A, and 0x61 - 0x7A, ignoring bytes that are the second and later bytes of multibyte sequences, all correspond to single-byte sequences that map to the same Unicode characters as those bytes in ANSI_X3.4-1968 (US-ASCII). [RFC1345]
This includes such encodings as Shift_JIS, HZ-GB-2312, and variants of ISO-2022, even though it is possible in these encodings for bytes like 0x70 to be part of longer sequences that are unrelated to their interpretation as ASCII. It excludes such encodings as UTF-7, UTF-16, GSM03.38, and EBCDIC variants.
The term a UTF-16 encoding refers to any variant of UTF-16: self-describing UTF-16 with a BOM, ambiguous UTF-16 without a BOM, raw UTF-16LE, and raw UTF-16BE. [RFC2781]
The term code unit is used as defined in the Web IDL
specification: a 16 bit unsigned integer, the smallest atomic
component of a
DOMString. (This is a narrower
definition than the one used in Unicode.) [WEBIDL]
The term Unicode code point means a Unicode scalar value where possible, and an isolated surrogate code point when not. When a conformance requirement is defined in terms of characters or Unicode code points, a pair of code units consisting of a high surrogate followed by a low surrogate must be treated as the single code point represented by the surrogate pair, but isolated surrogates must each be treated as the single code point with the value of the surrogate. [UNICODE]
In this specification, the term character, when not qualified as Unicode character, is synonymous with the term Unicode code point.
The term Unicode character is used to mean a Unicode scalar value (i.e. any Unicode code point that is not a surrogate code point). [UNICODE]
The code-unit length of a string is the number of code units in that string.
This complexity results from the historical decision to define the DOM API in terms of 16 bit (UTF-16) code units, rather than in terms of Unicode characters.
All diagrams, examples, and notes in this specification are non-normative, as are all sections explicitly marked non-normative. Everything else in this specification is normative.
The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this document are to be interpreted as described in RFC2119. The key word "OPTIONALLY" in the normative parts of this document is to be interpreted with the same normative meaning as "MAY" and "OPTIONAL". For readability, these words do not appear in all uppercase letters in this specification. [RFC2119]
Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.
For example, were the spec to say:
To eat a kiwi, the user must: 1. Peel the kiwi. 2. Eat the kiwi flesh.
...it would be equivalent to the following:
To eat a kiwi: 1. The user must peel the kiwi. 2. The user must eat the kiwi flesh.
Here the key word is "must".
The former (imperative) style is generally preferred in this specification for stylistic reasons.
Conformance requirements phrased as algorithms or specific steps may be implemented in any manner, so long as the end result is equivalent. (In particular, the algorithms defined in this specification are intended to be easy to follow, and not intended to be performant.)
This specification describes the conformance criteria for user agents (relevant to implementors) and documents (relevant to authors and authoring tool implementors).
Conforming documents are those that comply with all the conformance criteria for documents. For readability, some of these conformance requirements are phrased as conformance requirements on authors; such requirements are implicitly requirements on documents: by definition, all documents are assumed to have had an author. (In some cases, that author may itself be a user agent — such user agents are subject to additional rules, as explained below.)
For example, if a requirement states that
"authors must not use the
foobar element", it
would imply that documents are not allowed to contain elements named
There is no implied relationship between document conformance requirements and implementation conformance requirements. User agents are not free to handle non-conformant documents as they please; the processing model described in this specification applies to implementations regardless of the conformity of the input documents.
User agents fall into several (overlapping) categories with different conformance requirements.
Web browsers that support the XHTML syntax must process elements and attributes from the HTML namespace found in XML documents as described in this specification, so that users can interact with them, unless the semantics of those elements have been overridden by other specifications.
A conforming XHTML processor would, upon
finding an XHTML
script element in an XML document,
execute the script contained in that element. However, if the
element is found within a transformation expressed in XSLT
(assuming the user agent also supports XSLT), then the processor
would instead treat the
script element as an opaque
element that forms part of the transform.
Web browsers that support the HTML syntax must process documents labeled with an HTML MIME type as described in this specification, so that users can interact with them.
User agents that support scripting must also be conforming implementations of the IDL fragments in this specification, as described in the Web IDL specification. [WEBIDL]
Unless explicitly stated, specifications that
override the semantics of HTML elements do not override the
requirements on DOM objects representing those elements. For
script element in the example above
would still implement the
User agents that process HTML and XHTML documents purely to render non-interactive versions of them must comply to the same conformance criteria as Web browsers, except that they are exempt from requirements regarding user interaction.
Typical examples of non-interactive presentation user agents are printers (static UAs) and overhead displays (dynamic UAs). It is expected that most static non-interactive presentation user agents will also opt to lack scripting support.
A non-interactive but dynamic presentation UA would still execute scripts, allowing forms to be dynamically submitted, and so forth. However, since the concept of "focus" is irrelevant when the user cannot interact with the document, the UA would not need to support any of the focus-related DOM APIs.
User agents, whether interactive or not, may be designated (possibly as a user option) as supporting the suggested default rendering defined by this specification.
This is not required. In particular, even user agents that do implement the suggested default rendering are encouraged to offer settings that override this default to improve the experience for the user, e.g. changing the color contrast, using different focus styles, or otherwise making the experience more accessible and usable to the user.
User agents that are designated as supporting the suggested default rendering must, while so designated, implement the rules in the rendering section that that section defines as the behavior that user agents are expected to implement.
Implementations that do not support scripting (or which have their scripting features disabled entirely) are exempt from supporting the events and DOM interfaces mentioned in this specification. For the parts of this specification that are defined in terms of an events model or in terms of the DOM, such user agents must still act as if events and the DOM were supported.
Scripting can form an integral part of an application. Web browsers that do not support scripting, or that have scripting disabled, might be unable to fully convey the author's intent.
Conformance checkers must verify that a document conforms to
the applicable conformance criteria described in this
specification. Automated conformance checkers are exempt from
detecting errors that require interpretation of the author's
intent (for example, while a document is non-conforming if the
content of a
blockquote element is not a quote,
conformance checkers running without the input of human judgement
do not have to check that
blockquote elements only
contain quoted material).
Conformance checkers must check that the input document conforms when parsed without a browsing context (meaning that no scripts are run, and that the parser's scripting flag is disabled), and should also check that the input document conforms when parsed with a browsing context in which scripts execute, and that the scripts never cause non-conforming states to occur other than transiently during script execution itself. (This is only a "SHOULD" and not a "MUST" requirement because it has been proven to be impossible. [COMPUTABLE])
The term "HTML validator" can be used to refer to a conformance checker that itself conforms to the applicable requirements of this specification.
XML DTDs cannot express all the conformance requirements of this specification. Therefore, a validating XML processor and a DTD cannot constitute a conformance checker. Also, since neither of the two authoring formats defined in this specification are applications of SGML, a validating SGML system cannot constitute a conformance checker either.
To put it another way, there are three types of conformance criteria:
A conformance checker must check for the first two. A simple DTD-based validator only checks for the first class of errors and is therefore not a conforming conformance checker according to this specification.
Applications and tools that process HTML and XHTML documents for reasons other than to either render the documents or check them for conformance should act in accordance with the semantics of the documents that they process.
A tool that generates document outlines but increases the nesting level for each paragraph and does not increase the nesting level for each section would not be conforming.
Authoring tools and markup generators must generate conforming documents. Conformance criteria that apply to authors also apply to authoring tools, where appropriate.
Authoring tools are exempt from the strict requirements of using elements only for their specified purpose, but only to the extent that authoring tools are not yet able to determine author intent. However, authoring tools must not automatically misuse elements or encourage their users to do so.
For example, it is not conforming to use an
address element for arbitrary contact information;
that element can only be used for marking up contact information
for the author of the document or section. However, since an
authoring tool is likely unable to determine the difference, an
authoring tool is exempt from that requirement. This does not
mean, though, that authoring tools can use
elements for any block of italics text (for instance); it just
means that the authoring tool doesn't have to verify that when the
user uses a tool for inserting contact information for a section,
that the user really is doing that and not inserting something
In terms of conformance checking, an editor has to output documents that conform to the same extent that a conformance checker will verify.
When an authoring tool is used to edit a non-conforming document, it may preserve the conformance errors in sections of the document that were not edited during the editing session (i.e. an editing tool is allowed to round-trip erroneous content). However, an authoring tool must not claim that the output is conformant if errors have been so preserved.
Authoring tools are expected to come in two broad varieties: tools that work from structure or semantic data, and tools that work on a What-You-See-Is-What-You-Get media-specific editing basis (WYSIWYG).
The former is the preferred mechanism for tools that author HTML, since the structure in the source information can be used to make informed choices regarding which HTML elements and attributes are most appropriate.
However, WYSIWYG tools are legitimate. WYSIWYG tools should use
elements they know are appropriate, and should not use elements
that they do not know to be appropriate. This might in certain
extreme cases mean limiting the use of flow elements to just a few
span and making liberal use of the
All authoring tools, whether WYSIWYG or not, should make a best effort attempt at enabling users to create well-structured, semantically rich, media-independent content.
User agents may impose implementation-specific limits on otherwise unconstrained inputs, e.g. to prevent denial of service attacks, to guard against running out of memory, or to work around platform-specific limitations.
For compatibility with existing content and prior specifications, this specification describes two authoring formats: one based on XML (referred to as the XHTML syntax), and one using a custom format inspired by SGML (referred to as the HTML syntax). Implementations must support at least one of these two formats, although supporting both is encouraged.
Some conformance requirements are phrased as requirements on elements, attributes, methods or objects. Such requirements fall into two categories: those describing content model restrictions, and those describing implementation behavior. Those in the former category are requirements on documents and authoring tools. Those in the second category are requirements on user agents. Similarly, some conformance requirements are phrased as requirements on authors; such requirements are to be interpreted as conformance requirements on the documents that authors produce. (In other words, this specification does not distinguish between conformance criteria on authors and conformance criteria on documents.)
This specification relies on several other underlying specifications.
Implementations that support the XHTML syntax must support some version of XML, as well as its corresponding namespaces specification, because that syntax uses an XML serialization with namespaces. [XML] [XMLNS]
The Document Object Model (DOM) is a representation — a model — of a document and its content. The DOM is not just an API; the conformance criteria of HTML implementations are defined, in this specification, in terms of operations on the DOM. [DOMCORE]
Implementations must support DOM Core and the events defined in DOM Events, because this specification is defined in terms of the DOM, and some of the features are defined as extensions to the DOM Core interfaces. [DOMCORE] [DOMEVENTS]
In particular, the following features are defined in the DOM Core specification: [DOMCORE]
HTMLCollectioninterface, and the terms collections and represented by the collection
Node, and the concept of cloning steps used by that algorithm
MutationObserverscripting environment concept
For example, to throw a
TimeoutError exception, a user agent would
DOMException object whose type was the
TimeoutError" (and whose code was
the number 23, for legacy reasons) and actually throw that object
as an exception.
The following features are defined in the DOM Events specification: [DOMEVENTS]
This specification sometimes uses the term name to refer to the event's
type; as in, "an event named
click" or "if the event name is
keypress". The terms "name" and "type" for events
In addition, user agents must implement the features defined in the DOM Parsing and Serialization specification, HTML Editing APIs, and UndoManager and DOM Transaction specifications that apply to their conformance class. [DOMPARSING] [EDITING] [UNDO]
The following features are defined in the DOM Parsing and Serialization specification: [DOMPARSING]
This specification uses the following interfaces defined in the File API specification: [FILEAPI]
It also uses the following interface defined in the File System API specification: [FILESYSTEMAPI]
The IDL fragments in this specification must be interpreted as required for conforming IDL fragments, as described in the Web IDL specification. [WEBIDL]
The terms expose, supported property indices, determine the value of an indexed property, support named properties, supported property names, determine the value of a named property, platform array objects, and read only (when applied to arrays) are used as defined in the Web IDL specification. The algorithm to convert a DOMString to a sequence of Unicode characters is similarly that defined in the Web IDL specification.
When this specification requires a user agent to create a
Date object representing a particular time, the
milliseconds component of that time, if any, must be truncated to
an integer and the time value of the newly created
Date object must represent the time after that
For instance, given the time 23045 millionths
of a second after 01:00 UTC on January 1st 2000, i.e. the time
2000-01-01T00:00:00.023045Z, then the
created representing that time would represent the same time as
that created representing the time 2000-01-01T00:00:00.023Z, 45
The ArrayBuffer and ArrayBufferView
interfaces and underlying concepts from the Typed Array
Specification are used for several features in this specification.
The Uint8ClampedArray interface type is specifically
used in the definition of the
canvas element's 2D
rather than the official term ECMAScript, since the term
commonly used type, despite it
being an officially obsoleted type according to RFC
Implementations must support the Media Queries language. [MQ]
Implementations may support WebVTT as a text track format for subtitles, captions, chapter titles, metadata, etc, for media resources. [WEBVTT]
The following terms, used in this specification, are defined in the WebVTT specification:
Implementations must support the semantics of URLs defined in the URI and IRI specifications, as well as the semantics of IDNA domain names defined in the Internationalizing Domain Names in Applications (IDNA) specification. [RFC3986] [RFC3987] [RFC3490]
The following terms are defined in the Cookie specification: [COOKIES]
The following terms are defined in the CORS specification: [CORS]
While support for CSS as a whole is not required of implementations of this specification (though it is encouraged, at least for Web browsers), some features are defined in terms of specific CSS requirements.
In particular, some features require that a string be parsed as a CSS <color> value. When parsing a CSS value, user agents are required by the CSS specifications to apply some error handling rules. These apply to this specification also. [CSSCOLOR] [CSS]
For example, user agents are required to close
all open constructs upon finding the end of a style sheet
unexpectedly. Thus, when parsing the string "
rgb(0,0,0" (with a missing close-parenthesis) for
a color value, the close parenthesis is implied by this error
handling rule, and a value is obtained (the color 'black').
However, the similar construct "
(with both a missing parenthesis and a missing "blue" value)
cannot be parsed, as closing the open construct does not result
in a viable value.
The term CSS element reference identifier is used as defined in the CSS Image Values and Replaced Content specification to define the API that declares identifiers for use with the CSS 'element()' function. [CSSIMAGES]
Similarly, the term provides a paint source is used as defined in the CSS Image Values and Replaced Content specification to define the interaction of certain HTML elements with the CSS 'element()' function. [CSSIMAGES]
The following terms are defined in the WebSocket protocol specification: [WSP]
The following interface is defined in the SVG specification: [SVG]
This specification might have certain additional requirements on character encodings, image formats, audio formats, and video formats in the respective sections.
HTML has a wide number of extensibility mechanisms that can be used for adding semantics in a safe manner:
classattribute to extend elements, effectively creating their own elements, while using the most applicable existing "real" HTML element, so that browsers and other tools that don't know of the extension can still support it somewhat well. This is the tack used by microformats, for example.
data-*=""attributes. These are guaranteed to never be touched by browsers, and allow scripts to include data on HTML elements that scripts can then look for and process.
<meta name="" content="">mechanism to include page-wide metadata by registering extensions to the predefined set of metadata names.
rel=""mechanism to annotate links with specific meanings by registering extensions to the predefined set of link types. This is also used by microformats.
<script type="">mechanism with a custom type, for further handling by inline or server-side scripts.
embedelement. This is how Flash works.
itemprop=""attributes) to embed nested name-value pairs of data to be shared with other applications and sites.
Vendor-specific proprietary user agent extensions to this specification are strongly discouraged. Documents must not use such extensions, as doing so reduces interoperability and fragments the user base, allowing only users of specific user agents to access the content in question.
If such extensions are nonetheless needed, e.g. for experimental purposes, then vendors are strongly urged to use one of the following extension mechanisms:
For markup-level features that can be limited to the XML serialization and need not be supported in the HTML serialization, vendors should use the namespace mechanism to define custom namespaces in which the non-standard elements and attributes are supported.
For markup-level features that are intended for use with
the HTML syntax, extensions should be limited to new
attributes of the form "
vendor is a short string that identifies the
vendor responsible for the extension, and feature is the name of the feature. New element names
should not be created. Using attributes for such extensions
exclusively allows extensions from multiple vendors to co-exist on
the same element, which would not be possible with elements. Using
x-vendor-feature" form allows extensions to be made
without risk of conflicting with future additions to the
For instance, a browser named "FerretBrowser" could use "ferret" as a vendor prefix, while a browser named "Mellblom Browser" could use "mb". If both of these browsers invented extensions that turned elements into scratch-and-sniff areas, an author experimenting with these features could write:
<p>This smells of lemons! <span x-ferret-smellovision x-ferret-smellcode="LEM01" x-mb-outputsmell x-mb-smell="lemon juice"></span></p>
Attribute names beginning with the two characters "
x-" are reserved for user agent use and are
guaranteed to never be formally added to the HTML language. For
flexibility, attributes names containing underscores (the U+005F LOW
LINE character) are also reserved for experimental purposes and are
guaranteed to never be formally added to the HTML language.
Pages that use such attributes are by definition non-conforming.
For DOM extensions, e.g. new methods and IDL attributes, the new members should be prefixed by vendor-specific strings to prevent clashes with future versions of this specification.
For events, experimental event types should be prefixed with vendor-specific strings.
For example, if a user agent called "Pleasold" were to
add an event to indicate when the user is going up in an elevator,
it could use the prefix "
pleasold" and thus
name the event "
with an event handler attribute named "
All extensions must be defined so that the use of extensions neither contradicts nor causes the non-conformance of functionality defined in the specification.
For example, while strongly discouraged from doing so, an
implementation "Foo Browser" could add a new IDL attribute "
fooTypeTime" to a control's DOM interface that
returned the time it took the user to select the current value of a
control (say). On the other hand, defining a new control that
appears in a form's
array would be in violation of the above requirement, as it would
violate the definition of
elements given in this
When adding new reflecting IDL
attributes corresponding to content attributes of the form "
x-vendor-feature", the IDL attribute should be named
vendorFeature" (i.e. the "
is dropped from the IDL attribute's name).
When vendor-neutral extensions to this specification are needed, either this specification can be updated accordingly, or an extension specification can be written that overrides the requirements in this specification. When someone applying this specification to their activities decides that they will recognize the requirements of such an extension specification, it becomes an applicable specification for the purposes of conformance requirements in this specification.
Someone could write a specification that defines any arbitrary byte stream as conforming, and then claim that their random junk is conforming. However, that does not mean that their random junk actually is conforming for everyone's purposes: if someone else decides that that specification does not apply to their work, then they can quite legitimately say that the aforementioned random junk is just that, junk, and not conforming at all. As far as conformance goes, what matters in a particular community is what that community agrees is applicable.
User agents must treat elements and attributes that they do not understand as semantically neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS processors), but not inferring any meaning from them.
When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid in development, or for performance reasons), user agents must act as if they had no support for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a particular feature is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted from the objects that implement that interface — leaving the attribute on the object but making it return null or throw an exception is insufficient.
Comparing two strings in a case-sensitive manner means comparing them exactly, code point for code point.
Comparing two strings in an ASCII case-insensitive manner means comparing them exactly, code point for code point, except that the characters in the range U+0041 to U+005A (i.e. LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z) and the corresponding characters in the range U+0061 to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z) are considered to also match.
Comparing two strings in a compatibility caseless manner means using the Unicode compatibility caseless match operation to compare the two strings. [UNICODE]
Except where otherwise stated, string comparisons must be performed in a case-sensitive manner.
Converting a string to ASCII uppercase means replacing all characters in the range U+0061 to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z) with the corresponding characters in the range U+0041 to U+005A (i.e. LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z).
Converting a string to ASCII lowercase means replacing all characters in the range U+0041 to U+005A (i.e. LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z) with the corresponding characters in the range U+0061 to U+007A (i.e. LATIN SMALL LETTER A to LATIN SMALL LETTER Z).
A string pattern is a prefix match for a string s when pattern is not longer than s and truncating s to pattern's length leaves the two strings as matches of each other.
When a user agent is required to decode a byte string as UTF-8, with error handling, it means that the byte stream must be converted to a Unicode string by interpreting it as UTF-8, except that any errors must be handled as described in the following list. Bytes in the following list are represented in hexadecimal. [RFC3629]
For the purposes of the above requirements, an overlong form in UTF-8 is a sequence that encodes a code point using more bytes than the minimum needed to encode that code point in UTF-8.
For example, the byte string "41 98 BA 42 E2 98 43 E2 98 BA E2 98" would be converted to the string "A��B�C☺�".