Skip to content

Commit 6f2e8b7

Browse files
committed
[selectors-nonelement] Allow <namespace-attr> to be omitted, meaning *|*
1 parent dd54998 commit 6f2e8b7

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

selectors-nonelement/Overview.bs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Attribute node selector</h3>
4040
Its syntax is:
4141

4242
<pre class='prod'>
43-
<dfn selector>::attr()</dfn> = ::attr( <<namespace-attr>> )
43+
<dfn selector>::attr()</dfn> = ::attr( <<namespace-attr>>? )
4444
<dfn>&lt;namespace-attr></dfn> = [ [ <<ident>> | '*' ]? '|' ]? [ <<ident>> | '*' ]
4545
</pre>
4646

@@ -63,29 +63,27 @@ Attribute node selector</h3>
6363
If the attribute name is an <<ident>>,
6464
the selector matches attributes with that name.
6565
If the attribute name is a '*' character,
66-
it matches any attribute.
66+
the selector matches any attribute.
67+
68+
If the <<namespace-attr>> is omitted entirely,
69+
the selector matches any attribute in any namespace.
6770

6871
The selector matches an attribute node with the given namespace and name on the <a>originating element</a>,
6972
if such an attribute exists.
7073

7174
The selector uses <a>pseudo-element</a> syntax.
7275

73-
<div class="example">
74-
For example,
75-
the selector ''::attr(title)'' selects all the <code>title</code> attributes in the document.
76-
</div>
77-
7876
<div class="example">
7977
The following ITS rules use an attribute node selector
8078
to switch off translatability of <code>title</code> attribute on <code>abbr</code> elements.
79+
8180
<pre>
8281
&lt;rules xmlns="http://www.w3.org/2005/11/its"
8382
version="2.0"
8483
queryLanguage="css">
8584
&lt;translateRule selector="abbr::attr(title)" translate="no"/>
8685
&lt;/rules>
8786
</pre>
88-
8987
</div>
9088

9189
Although entirely valid in Selectors used in the scope of CSS,

selectors-nonelement/Overview.html

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
</p>
5555
<h1 class="p-name no-ref" id=title>Non-element Selectors</h1>
5656
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
57-
<span class=dt-updated><span class=value-title title=20140218>18 February 2014</span></span></span></h2>
57+
<span class=dt-updated><span class=value-title title=20140305>5 March 2014</span></span></span></h2>
5858
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/selectors-nonelement/>http://dev.w3.org/csswg/selectors-nonelement/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/selectors-nonelement/>http://dev.w3.org/csswg/selectors-nonelement/</a>
5959
<dt>Feedback:</dt>
6060
<dd><a href="mailto:www-style@w3.org?subject=%5Bselectors-nonelement%5D%20feedback">www-style@w3.org</a>
@@ -153,12 +153,12 @@ <h3 class="heading settled heading" data-level=2.1 id=attribute-node-selector><s
153153
<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

156-
<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-namespace-attr title="<namespace-attr>">&lt;namespace-attr&gt;</a> )
156+
<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-namespace-attr title="<namespace-attr>">&lt;namespace-attr&gt;</a>? )
157157
<dfn class=css-code data-dfn-type=type data-export="" id=typedef-namespace-attr>&lt;namespace-attr&gt;<a class=self-link href=#typedef-namespace-attr></a></dfn> = [ [ <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#ltident title="<ident>">&lt;ident&gt;</a> | '*' ]? '|' ]? [ <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#ltident title="<ident>">&lt;ident&gt;</a> | '*' ]
158158
</pre>
159159
<p> No whitespace is allowed between the tokens of <a class="production css-code" data-link-type=type href=#typedef-namespace-attr title="<namespace-attr>">&lt;namespace-attr&gt;</a>.
160160

161-
<a class="production css-code" data-link-type=type href=#typedef-namespace-attr title="<namespace-attr>">&lt;namespace-attr&gt;</a> is divided into two halves:
161+
<p> <a class="production css-code" data-link-type=type href=#typedef-namespace-attr title="<namespace-attr>">&lt;namespace-attr&gt;</a> is divided into two halves:
162162
an optional prefix preceding a '|' character,
163163
and an attribute name following it.
164164

@@ -175,28 +175,26 @@ <h3 class="heading settled heading" data-level=2.1 id=attribute-node-selector><s
175175
<p> If the attribute name is an <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#ltident title="<ident>">&lt;ident&gt;</a>,
176176
the selector matches attributes with that name.
177177
If the attribute name is a <a class=property data-link-type=propdesc title=*>*</a> character,
178-
it matches any attribute.
178+
the selector matches any attribute.
179+
180+
<p> If the <a class="production css-code" data-link-type=type href=#typedef-namespace-attr title="<namespace-attr>">&lt;namespace-attr&gt;</a> is omitted entirely,
181+
the selector matches any attribute in any namespace.
179182

180183
<p> The selector matches an attribute node with the given namespace and name on the <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#originating-element title="originating element">originating element</a>,
181184
if such an attribute exists.
182185

183186
<p> The selector uses <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#pseudo-element title=pseudo-element>pseudo-element</a> syntax.
184187

185-
<div class=example>
186-
For example,
187-
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.
188-
</div>
189-
190188
<div class=example>
191189
The following ITS rules use an attribute node selector
192190
to switch off translatability of <code>title</code> attribute on <code>abbr</code> elements.
191+
193192
<pre> &lt;rules xmlns="http://www.w3.org/2005/11/its"
194193
version="2.0"
195194
queryLanguage="css"&gt;
196195
&lt;translateRule selector="abbr::attr(title)" translate="no"/&gt;
197196
&lt;/rules&gt;
198-
</pre>
199-
</div>
197+
</pre> </div>
200198

201199
<p> Although entirely valid in Selectors used in the scope of CSS,
202200
<a data-link-type=dfn href=#attribute-node-selector0 title="attribute node selectors">attribute node selectors</a> never generate boxes.

0 commit comments

Comments
 (0)