You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Abstract: Non-element Selectors extends [[!SELECTORS4]] and allow selecting other kinds of document nodes then elements. This is useful when selectors are used as a general document query language.
12
12
Abstract: Non-element Selectors are not intended to be used in CSS, but only as a separate query language in other host environments.
13
+
Link Defaults: css-namespaces (dfn) namespace prefix, selectors (dfn) originating element/pseudo-element
13
14
</pre>
14
15
15
16
<h2 id="intro">
@@ -38,43 +39,51 @@ Attribute node selector</h3>
38
39
An <dfn export>attribute node selector</dfn> represents an attribute node in a document tree.
<p> An <dfndata-dfn-type=dfndata-export="" id=attribute-node-selector0>attribute node selector<aclass=self-linkhref=#attribute-node-selector0></a></dfn> represents an attribute node in a document tree.
<p> Where <dfnclass=css-codedata-dfn-type=typedata-export="" id=typedef-qualified-name><qualified-name><aclass=self-linkhref=#typedef-qualified-name></a></dfn> is a <adata-link-spec=css-namespacesdata-link-type=dfnhref=http://dev.w3.org/csswg/css-namespaces-1/#css-qualified-nametitle="css qualified name">CSS qualified name</a> which allows
158
-
wildcard prefixes and must conform to <code>wqname</code>
159
-
production given in <adata-biblio-type=normativedata-link-type=bibliohref=#css3namespacetitle=css3namespace>[CSS3NAMESPACE]</a>. <dfnclass=css-codedata-dfn-type=typedata-export="" id=typedef-qname_prefix><qname_prefix><aclass=self-linkhref=#typedef-qname_prefix></a></dfn> must conform
160
-
to <code>qname_prefix</code> production given in <adata-biblio-type=normativedata-link-type=bibliohref=#css3namespacetitle=css3namespace>[CSS3NAMESPACE]</a>.
<p> No whitespace is allowed between the tokens of <aclass="production css-code" data-link-type=typehref=#typedef-namespace-attrtitle="<namespace-attr>"><namespace-attr></a>.
161
160
162
-
<p> The selector uses <adata-link-spec=selectorsdata-link-type=dfnhref=http://dev.w3.org/csswg/selectors-4/#pseudo-elementtitle=pseudo-element>pseudo-element</a> syntax.
161
+
<aclass="production css-code" data-link-type=typehref=#typedef-namespace-attrtitle="<namespace-attr>"><namespace-attr></a> is divided into two halves:
162
+
an optional prefix preceding a '|' character,
163
+
and an attribute name following it.
163
164
164
-
<p> The selector matches an attribute node with the given qualified name,
165
-
if such an attribute exists on the <adata-link-spec=selectorsdata-link-type=dfnhref=http://dev.w3.org/csswg/selectors-4/#originating-elementtitle="originating element">originating element</a>.
165
+
<p> If the prefix is provided as an <aclass="production css-code" data-link-type=typehref=http://dev.w3.org/csswg/css-values-3/#ltidenttitle="<ident>"><ident></a>,
166
+
it must match a declared <adata-link-type=dfnhref=http://dev.w3.org/csswg/css-namespaces-1/#namespace-prefixtitle="namespace prefix">namespace prefix</a>,
167
+
in which case the selector only matches attributes in that namespace;
168
+
if it doesn’t match a declared <adata-link-type=dfnhref=http://dev.w3.org/csswg/css-namespaces-1/#namespace-prefixtitle="namespace prefix">namespace prefix</a>,
169
+
the selector is invalid.
170
+
If the prefix is provided as a <aclass=propertydata-link-type=propdesctitle=*>*</a> character,
171
+
the selector matches attributes in any namespace.
172
+
If the prefix is omitted,
173
+
the selector only matches attributes in no namespace.
166
174
167
-
<p> If '<code>*</code>' is used inside <code>::attr()</code> the
168
-
selector matches all attribute nodes on the <adata-link-spec=selectorsdata-link-type=dfnhref=http://dev.w3.org/csswg/selectors-4/#originating-elementtitle="originating element">originating element</a>.
175
+
<p> If the attribute name is an <aclass="production css-code" data-link-type=typehref=http://dev.w3.org/csswg/css-values-3/#ltidenttitle="<ident>"><ident></a>,
176
+
the selector matches attributes with that name.
177
+
If the attribute name is a <aclass=propertydata-link-type=propdesctitle=*>*</a> character,
178
+
it matches any attribute.
169
179
170
-
<p> If '<code>prefix|*</code>' is used inside
171
-
<code>::attr()</code> the selector matches all attribute nodes
172
-
in a namespace bound to the <code>prefix on the <adata-link-spec=selectorsdata-link-type=dfnhref=http://dev.w3.org/csswg/selectors-4/#originating-elementtitle="originating element">originating element</a>.
180
+
<p> The selector matches an attribute node with the given namespace and name on the <adata-link-type=dfnhref=http://dev.w3.org/csswg/selectors-4/#originating-elementtitle="originating element">originating element</a>,
181
+
if such an attribute exists.
173
182
183
+
<p> The selector uses <adata-link-type=dfnhref=http://dev.w3.org/csswg/selectors-4/#pseudo-elementtitle=pseudo-element>pseudo-element</a> syntax.
174
184
175
-
</code><divclass=example><code>
185
+
<divclass=example>
176
186
For example,
177
187
the selector <spanclass=cssdata-link-type=maybetitle=::attr(title)>::attr(title)</span> selects all the <code>title</code> attributes in the document.
178
-
</code></div><code>
188
+
</div>
179
189
180
190
<divclass=example>
181
-
The following ITS rules use attribute node selector to switch off
182
-
translatability of <code>title</code> attribute on <code>abbr</code> elements.
<divdata-fill-with=normative-references><dl><dtid=css3namespacetitle=CSS3NAMESPACE><aclass=self-linkhref=#css3namespace></a>[CSS3NAMESPACE]<dd>Elika J. Etemad; Anne van Kesteren. <ahref=http://www.w3.org/TR/2011/REC-css3-namespace-20110929/>CSS Namespaces Module</a>. 29 September 2011. W3C Recommendation. URL: <ahref=http://www.w3.org/TR/2011/REC-css3-namespace-20110929/>http://www.w3.org/TR/2011/REC-css3-namespace-20110929/</a><dtid=selectors4title=SELECTORS4><aclass=self-linkhref=#selectors4></a>[SELECTORS4]<dd>Elika J. Etemad; Tab Atkins Jr.. <ahref=http://www.w3.org/TR/2013/WD-selectors4-20130502/>Selectors Level 4</a>. 2 May 2013. W3C Working Draft. (Work in progress.) URL: <ahref=http://www.w3.org/TR/2013/WD-selectors4-20130502/>http://www.w3.org/TR/2013/WD-selectors4-20130502/</a></dl></div>
329
+
<divdata-fill-with=normative-references><dl><dtid=rfc2119title=RFC2119><aclass=self-linkhref=#rfc2119></a>[RFC2119]<dd>S. Bradner. <ahref=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <ahref=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a><dtid=selectors4title=SELECTORS4><aclass=self-linkhref=#selectors4></a>[SELECTORS4]<dd>Elika J. Etemad; Tab Atkins Jr.. <ahref=http://www.w3.org/TR/2013/WD-selectors4-20130502/>Selectors Level 4</a>. 2 May 2013. W3C Working Draft. (Work in progress.) URL: <ahref=http://www.w3.org/TR/2013/WD-selectors4-20130502/>http://www.w3.org/TR/2013/WD-selectors4-20130502/</a></dl></div>
0 commit comments