Skip to content

Commit dbce9d3

Browse files
author
Jirka Kosek
committed
[selectors-nonelement] Unified terminology around selector/pseudo-element
1 parent 22ba7d5 commit dbce9d3

2 files changed

Lines changed: 33 additions & 21 deletions

File tree

selectors-nonelement/Overview.bs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,34 @@ Non-element Selectors</h2>
3535
<h3 id="attribute-node-selector">
3636
Attribute node selector</h3>
3737

38-
An <dfn export>attribute node pseudo-element</dfn> represents an attribute node in a document tree.
38+
An <dfn export>attribute node selector</dfn> represents an attribute node in a document tree.
3939
Its syntax is:
4040

4141
<pre class='prod'><dfn selector>::attr()</dfn> = ::attr( <<qualified-name>> )</pre>
4242

4343
Where <dfn>&lt;qualified-name></dfn> is a <a spec=css-namespaces>CSS qualified name</a>.
4444

45-
The pseudo-element matches an attribute node with the given qualified name,
45+
The selector uses <a spec=selectors>pseudo-element</a> syntax.
46+
47+
The selector matches an attribute node with the given qualified name,
4648
if such an attribute exists on the <a spec=selectors>originating element</a>.
4749

4850
<div class="example">
49-
The following ITS rules use an attribute node selector to switch off translatability of <code>title</code> attributes on <code>abbr</code> elements.
51+
For example,
52+
the selector ''::attr(title)'' selects all the <code>title</code> attributes in the document.
53+
</div>
5054

55+
<div class="example">
56+
The following ITS rules use attribute node selector to switch off
57+
translatability of <code>title</code> attribute on <code>abbr</code> elements.
5158
<pre>
52-
&lt;rules xmlns="http://www.w3.org/2005/11/its"
53-
version="2.0"
54-
queryLanguage="css">
55-
&lt;translateRule selector="abbr::attr(title)" translate="no"/>
56-
&lt;/rules>
59+
&lt;rules xmlns="http://www.w3.org/2005/11/its"
60+
version="2.0"
61+
queryLanguage="css">
62+
&lt;translateRule selector="abbr::attr(title)" translate="no"/>
63+
&lt;/rules>
5764
</pre>
5865

5966
</div>
6067

61-
Although entirely valid in Selectors used in the scope of CSS,
62-
attribute node pseudo-elements never generate boxes.
68+
In CSS, <a>attribute node selectors</a> never generate boxes.

selectors-nonelement/Overview.html

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,28 +150,34 @@ <h2 class="heading settled heading" data-level=2 id=non-element-selectors><span
150150
<h3 class="heading settled heading" data-level=2.1 id=attribute-node-selector><span class=secno>2.1 </span><span class=content>
151151
Attribute node selector</span><a class=self-link href=#attribute-node-selector></a></h3>
152152

153-
<p> An <dfn data-dfn-type=dfn data-export="" id=attribute-node-pseudo-element>attribute node pseudo-element<a class=self-link href=#attribute-node-pseudo-element></a></dfn> represents an attribute node in a document tree.
153+
<p> An <dfn data-dfn-type=dfn data-export="" id=attribute-node-selector0>attribute node selector<a class=self-link href=#attribute-node-selector0></a></dfn> represents an attribute node in a document tree.
154154
Its syntax is:
155155

156156
<pre class=prod><dfn class=css-code data-dfn-type=selector data-export="" id=selectordef-attr>::attr()<a class=self-link href=#selectordef-attr></a></dfn> = ::attr( <a class="production css-code" data-link-type=type href=#typedef-qualified-name title="<qualified-name>">&lt;qualified-name&gt;</a> )</pre>
157157
<p> Where <dfn class=css-code data-dfn-type=type data-export="" id=typedef-qualified-name>&lt;qualified-name&gt;<a class=self-link href=#typedef-qualified-name></a></dfn> is a <a data-link-spec=css-namespaces data-link-type=dfn href=http://dev.w3.org/csswg/css-namespaces-1/#css-qualified-name title="css qualified name">CSS qualified name</a>.
158158

159-
<p> The pseudo-element matches an attribute node with the given qualified name,
159+
<p> The selector uses <a data-link-spec=selectors data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#pseudo-element title=pseudo-element>pseudo-element</a> syntax.
160+
161+
<p> The selector matches an attribute node with the given qualified name,
160162
if such an attribute exists on the <a data-link-spec=selectors data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#originating-element title="originating element">originating element</a>.
161163

162164
<div class=example>
163-
The following ITS rules use an attribute node selector to switch off translatability of <code>title</code> attributes on <code>abbr</code> elements.
165+
For example,
166+
the selector <span class=css data-link-type=maybe title=::attr(title)>::attr(title)</span> selects all the <code>title</code> attributes in the document.
167+
</div>
164168

165-
<pre> &lt;rules xmlns="http://www.w3.org/2005/11/its"
166-
version="2.0"
167-
queryLanguage="css"&gt;
168-
&lt;translateRule selector="abbr::attr(title)" translate="no"/&gt;
169-
&lt;/rules&gt;
169+
<div class=example>
170+
The following ITS rules use attribute node selector to switch off
171+
translatability of <code>title</code> attribute on <code>abbr</code> elements.
172+
<pre>&lt;rules xmlns="http://www.w3.org/2005/11/its"
173+
version="2.0"
174+
queryLanguage="css"&gt;
175+
&lt;translateRule selector="abbr::attr(title)" translate="no"/&gt;
176+
&lt;/rules&gt;
170177
</pre>
171178
</div>
172179

173-
<p> Although entirely valid in Selectors used in the scope of CSS,
174-
attribute node pseudo-elements never generate boxes.
180+
<p> In CSS, <a data-link-type=dfn href=#attribute-node-selector0 title="attribute node selectors">attribute node selectors</a> never generate boxes.
175181

176182
<h2 class="no-ref no-num heading settled heading" id=conformance><span class=content>
177183
Conformance</span><a class=self-link href=#conformance></a></h2>
@@ -308,7 +314,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
308314
Index</span><a class=self-link href=#index></a></h2>
309315
<div data-fill-with=index><ul class=indexlist>
310316
<li>::attr(), <a href=#selectordef-attr title="section 2.1">2.1</a>
311-
<li>attribute node pseudo-element, <a href=#attribute-node-pseudo-element title="section 2.1">2.1</a>
317+
<li>attribute node selector, <a href=#attribute-node-selector0 title="section 2.1">2.1</a>
312318
<li>&lt;qualified-name&gt;, <a href=#typedef-qualified-name title="section 2.1">2.1</a>
313319
</ul></div>
314320

0 commit comments

Comments
 (0)