Skip to content

Commit eb28cb1

Browse files
committed
Tweak the reference combinator section wording. Allow the host language to define other syntaxes than just idref and id selectors.
1 parent cdabbbf commit eb28cb1

2 files changed

Lines changed: 30 additions & 26 deletions

File tree

selectors4/Overview.html

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,9 +1994,10 @@ <h3 id=id-selectors><span class=secno>6.7. </span> ID selectors</h3>
19941994
attributes differently, but the same restriction applies.
19951995

19961996
<p>An ID-typed attribute of a document language allows authors to assign an
1997-
identifier to one element instance in the document tree. An ID selector
1998-
contains a &quot;number sign&quot; (U+0023, <code>#</code>) immediately
1999-
followed by the ID value, which must be an CSS <a
1997+
identifier to one element instance in the document tree. An <dfn
1998+
id=id-selector>ID selector</dfn> contains a &quot;number sign&quot;
1999+
(U+0023, <code>#</code>) immediately followed by the ID value, which must
2000+
be an CSS <a
20002001
href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers</a>.
20012002
An ID selector represents an element instance that has an identifier that
20022003
matches the identifier in the ID selector.
@@ -2228,8 +2229,8 @@ <h3 id=scope-pseudo><span class=secno>7.5. </span> The contextual reference
22282229
parent element of a <a
22292230
href="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-style-element">scoped
22302231
<code>&lt;style></code> element</a> in <a href="#HTML5"
2231-
rel=biblioentry>[HTML5]<!--{{HTML5}}--></a>, which is typically used to
2232-
"scope" a selector so that it only matches within a subtree.
2232+
rel=biblioentry>[HTML5]<!--{{HTML5}}--></a>, which is used to "scope" a
2233+
selector so that it only matches within a subtree.
22332234

22342235
<p> If no contextual reference element set is given, <code>:scope</code> is
22352236
equivalent to <code>:root</code>. Specifications intending for this
@@ -3285,16 +3286,17 @@ <h3 id=general-sibling-combinators><span class=secno>14.4. </span>
32853286
<h3 id=idref-combinators><span class=secno>14.5. </span> Reference
32863287
combinators</h3>
32873288

3288-
<p>The IDREF combinator consists of two slashes with an indetervening <a
3289+
<p> The <dfn id=reference-combinator>reference combinator</dfn> consists of
3290+
two slashes with an indetervening <a
32893291
href="http://www.w3.org/TR/css3-namespace/#css-qnames">CSS qualified
32903292
name</a>, and separates two compound selectors, e.g. <code>A /attr/
3291-
B</code>. The elements represented by the two compound seletors are
3292-
related in that an element represented by the first compound selector has
3293-
an ID-reference to the element represented by the second compound
3294-
selector. The ID reference can be given as either an IDREF or a fragment
3295-
URL: the reference is valid as long as the value of the attribute named in
3296-
the combinator consists of either the ID alone or a hash mark (#) followed
3297-
by the ID. Attribute matching for reference combinators follow the same
3293+
B</code>. The element represented by the first compound selector
3294+
explicitly references the element represented by the second compound
3295+
selector. Unless the host language defines a different syntax for
3296+
expressing this relationship, this relationship is considered to exist if
3297+
the value of the specified attribute on the first element is an IDREF or
3298+
an <a href="#id-selector"><i>ID selector</i></a> referencing the second
3299+
element. Attribute matching for reference combinators follow the same
32983300
rules as for <a
32993301
href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute
33003302
selectors</a>.

selectors4/Overview.src.html

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ <h3 id=id-selectors>
13231323

13241324
<p>An ID-typed attribute of a document language allows authors to
13251325
assign an identifier to one element instance in the document tree. An
1326-
ID selector contains a &quot;number sign&quot; (U+0023,
1326+
<dfn>ID selector</dfn> contains a &quot;number sign&quot; (U+0023,
13271327
<code>#</code>) immediately followed by the ID value, which must be an
13281328
CSS <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">identifiers</a>.
13291329
An ID selector represents an element instance that has an
@@ -2496,18 +2496,20 @@ <h3 id=general-sibling-combinators>
24962496
<h3 id=idref-combinators>
24972497
Reference combinators</h3>
24982498

2499-
<p>The IDREF combinator consists of two slashes with an indetervening
2500-
<a href="http://www.w3.org/TR/css3-namespace/#css-qnames">CSS qualified
2501-
name</a>, and separates two compound selectors, e.g. <code>A /attr/ B</code>.
2502-
The elements represented by the two compound seletors are related in
2503-
that an element represented by the first compound selector has an
2504-
ID-reference to the element represented by the second compound selector.
2505-
The ID reference can be given as either an IDREF or a fragment URL: the
2506-
reference is valid as long as the value of the attribute named in the
2507-
combinator consists of either the ID alone or a hash mark (#) followed
2508-
by the ID. Attribute matching for reference combinators follow the same rules
2509-
as for <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute
2510-
selectors</a>.
2499+
<p>
2500+
The <dfn>reference combinator</dfn> consists of two slashes
2501+
with an indetervening <a href="http://www.w3.org/TR/css3-namespace/#css-qnames">CSS qualified name</a>,
2502+
and separates two compound selectors,
2503+
e.g. <code>A /attr/ B</code>.
2504+
The element represented by the first compound selector
2505+
explicitly references
2506+
the element represented by the second compound selector.
2507+
Unless the host language defines a different syntax for expressing this relationship,
2508+
this relationship is considered to exist if
2509+
the value of the specified attribute on the first element is an IDREF or an <i>ID selector</i>
2510+
referencing the second element.
2511+
2512+
Attribute matching for reference combinators follow the same rules as for <a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors">attribute selectors</a>.
25112513

25122514
<div class="example">
25132515
<p>The following example highlights an <code>&lt;input&gt;</code> element

0 commit comments

Comments
 (0)