8000 [selectors] Some minor type-selector-related editorial cleanup of <ht… · w3c/csswg-drafts@fe99ff0 · GitHub
Skip to content

Commit fe99ff0

Browse files
committed
[selectors] Some minor type-selector-related editorial cleanup of <https://hg.csswg.org/drafts/diff/ee85b0656afd/selectors/Overview.bs>: qualified names have an *optional* prefix, so we don't need to split unprefixed names out separately, and the namespaces section forgot to mention universal selectors after merging the two independent sections.
1 parent 975116a commit fe99ff0

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

selectors/Overview.bs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ Characters and case sensitivity</h3>
968968

969969

970970
<h3 id="namespaces">
971-
Namespaces</h3>
971+
Declaring Namespace Prefixes</h3>
972972

973973
Certain selectors support namespace prefixes.
974974
The mechanism by which namespace prefixes are <dfn id="nsdecl">declared</dfn>
@@ -1170,30 +1170,29 @@ Elemental selectors</h2>
11701170
<h3 id="type-selectors">
11711171
Type (tag name) selector</h3>
11721172

1173-
A <dfn export>type selector</dfn> is the name of a document language element type
1174-
written as either an <a>identifier</a>
1175-
or, if interacting with namespaces,
1176-
a <a>CSS qualified name</a>
1177-
(see [[#type-nmsp]])
1178-
[[!CSS3NAMESPACE]].
1179-
1180-
A type selector represents an instance of the element type in the document tree.
1173+
A <dfn export>type selector</dfn> is the name of a document language element type,
1174+
and represents an instance of that element type in the document tree.
11811175

11821176
<div class="example">
11831177
For example, the selector ''h1'' represents an <a element>h1</a> element in the document.
11841178
</div>
11851179

1180+
A <a>type selector</a> is written as a <a>CSS qualified name</a>:
1181+
an <a>identifier</a> with an optional namespace prefix.
1182+
[[!CSS3NAMESPACE]]
1183+
(See [[#type-nmsp]].)
1184+
11861185
<h3 id="the-universal-selector">
11871186
Universal selector </h3>
11881187

11891188
The <dfn export>universal selector</dfn> is a special <a>type selector</a>,
1190-
written either as the asterisk character (<code>*</code> U+002A),
1191-
or as a <a>CSS qualified name</a>
1192-
with an asterisk as the local name (see [[#type-nmsp]]).
1193-
It represents an element with any name.
1189+
that represents an element of any element type.
11941190

1191+
It is written a <a>CSS qualified name</a>
1192+
with an asterisk (<code>*</code> U+002A) as the local name.
11951193
Like a <a>type selector</a>,
11961194
the <a>universal selector</a> can be qualified by a namespace,
1195+
restricting it to only elements belonging to that namespace,
11971196
and is affected by a default namespace as defined in [[#type-nmsp]].
11981197

11991198
Unless an element is <a>featureless</a>,
@@ -1220,9 +1219,9 @@ Universal selector </h3>
12201219
but writing the former as ''div *:first-child'' makes the difference obvious.
12211220

12221221
<h3 id='type-nmsp'>
1223-
Namespaces in Selectors</h3>
1222+
Namespaces in Elemental Selectors</h3>
12241223

1225-
<a>Type selectors</a> allow an optional namespace component:
1224+
<a>Type selectors</a> and <a>universal selectors</a> allow an optional namespace component:
12261225
a namespace prefix that has been previously <a href="#nsdecl">declared</a>
12271226
may be prepended to the element name separated by the namespace separator “vertical bar” (<code>|</code> U+007C).
12281227
(See, e.g., [[XML-NAMES]] for the use of namespaces in XML.)
@@ -1297,6 +1296,9 @@ Namespaces in Selectors</h3>
12971296
even though no reference to the type name (which is paired with the namespace in the DOM) appeared.
12981297
</div>
12991298

1299+
A <a>type selector</a> or <a>universal selector</a> containing a namespace prefix
1300+
that has not been previously <a href="#nsdecl">declared</a>
1301+
is an <a>invalid selector</a>.
13001302

13011303
<h2 id="attribute-selectors">
13021304
Attribute selectors</h2>

0 commit comments

Comments
 (0)