diff --git a/source b/source index 0d9624488bd..0cd9a04487a 100644 --- a/source +++ b/source @@ -677,11 +677,11 @@ interface Example {
<a href="demo.html">simple</a>
- Attributes are placed inside the start tag, and consist
- of a name and a value, separated by an " For example, this is why the U+0060 GRAVE ACCENT character (`) is not allowed in unquoted
- attributes. In certain legacy user agents, it is sometimes treated as a
- quote character. For example, "attributes" in end tags are ignored currently, but they are invalid, in case a
- future change to the language makes use of that syntax feature without conflicting with
- already-deployed (and valid!) content. For example, attribute declarations in end tags are ignored currently, but they are invalid,
+ in case a future change to the language makes use of that syntax feature without conflicting
+ with already-deployed (and valid!) content. Some authors find it helpful to be in the practice of always quoting all attributes and always
- including all optional tags, preferring the consistency derived from such custom over the minor
- benefits of terseness afforded by making use of the flexibility of the HTML syntax. To aid such
- authors, conformance checkers can provide modes of operation wherein such conventions are
+ Some authors find it helpful to be in the practice of always quoting all attribute values and
+ always including all optional tags, preferring the consistency derived from such custom over the
+ minor benefits of terseness afforded by making use of the flexibility of the HTML syntax. To aid
+ such authors, conformance checkers can provide modes of operation wherein such conventions are
enforced. There is no particular significance to the way some of the attributes have their
values quoted and others don't. The HTML syntax allows a variety of equally valid ways to specify
- attributes, as discussed in the syntax section.=
" character.
- The attribute value can remain unquoted if it doesn't contain ASCII
- whitespace or any of "
'
Attribute declarations are placed inside
+ the start tag, and consist of a name and a value, separated by an "
=
"
+ character. The attribute value can remain unquoted if it doesn't contain
+ ASCII whitespace or any of "
'
`
=
<
or >
. Otherwise, it has to be quoted using either single or double quotes. The
value, along with the "=
" character, can be omitted altogether if the value
@@ -1174,8 +1174,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
For example, if the customer entered "Denise Lawrence" as their name, "555-321-8642" as their telephone number, did not specify an email address, asked for a medium-sized pizza, selected the @@ -122895,17 +122896,17 @@ dictionary StorageEventInit : EventInit {
Attributes for an element are expressed inside the - element's start tag.
+Attribute declarations for an element are + expressed inside the element's start tag.
Attributes have a name and a value. Attribute names must consist of one or more characters other than controls, @@ -122955,7 +122956,7 @@ dictionary StorageEventInit : EventInit { except with the additional restriction that the text cannot contain an ambiguous ampersand.
-Attributes can be specified in four different ways:
+Attributes can be declared in four different ways:
If an attribute using the empty attribute syntax is to be followed by another attribute, then - there must be ASCII whitespace separating the two.
+If an attribute declaration using the empty attribute syntax is to be followed by another + attribute declaration, then there must be ASCII whitespace separating the two.
If an attribute using the unquoted attribute syntax is to be followed by another attribute or
- by the optional U+002F SOLIDUS character (/) allowed in step 6 of the start tag syntax above, then there must be ASCII
+ If an attribute declaration using the unquoted attribute syntax is to be followed by another
+ attribute declaration or by the optional U+002F SOLIDUS character (/) allowed in step 6 of the
+ start tag syntax above, then there must be ASCII
whitespace separating the two. If an attribute using the single-quoted attribute syntax is to be followed by another
- attribute, then there must be ASCII whitespace separating the two. If an attribute declaration using the single-quoted attribute syntax is to be followed by
+ another attribute declaration, then there must be ASCII whitespace separating the
+ two. If an attribute using the double-quoted attribute syntax is to be followed by another
- attribute, then there must be ASCII whitespace separating the two. If an attribute declaration using the double-quoted attribute syntax is to be followed by
+ another attribute declaration, then there must be ASCII whitespace separating the
+ two.
There must never be two or more attributes on the same start tag whose names are an ASCII - case-insensitive match for each other.
+There must never be two or more attribute declarations in the same start tag whose names are an + ASCII case-insensitive match for each other.
This error occurs if the parser encounters an attribute in a tag that already has an attribute with the - same name. The parser ignores all such duplicate occurrences of the attribute. + data-x="syntax-attribute-declarations">attribute declaration in a tag that already has + an attribute with the same name. The parser ignores all such duplicate occurrences of the + attribute.
This error occurs if the parser encounters an end - tag with attributes. Attributes in end tags are - ignored and do not make their way into the DOM.
+ tag with attribute declarations. + Attribute declarations in end tags are ignored and do not result in attributes in the DOM.This error occurs if the parser encounters a U+003E (>) code point where an
- attribute value is expected (e.g., attribute value is expected (e.g.,
<div id=>
). The parser treats the attribute as having an empty value.
This error occurs if the parser encounters attributes that are not separated by ASCII
+ data-x="syntax-attribute-declarations">attributes that are not separated by ASCII
whitespace (e.g., <div id="foo"class="bar">
). In this case the
parser behaves as if ASCII whitespace is present.
This error occurs if the parser encounters a U+002F (/) code point that is
- not a part of a quoted attribute value and not
+ not a part of a quoted attribute value and not
immediately followed by a U+003E (>) code point in a tag (e.g., <div /
id="foo">
). In this case the parser behaves as if it encountered ASCII
whitespace.