Skip to content

Commit 70b8f3d

Browse files
committed
Rewrite the intro to be a bit simpler and clearer.
1 parent 5b26007 commit 70b8f3d

2 files changed

Lines changed: 20 additions & 34 deletions

File tree

selectors4/Overview.html

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -463,20 +463,16 @@ <h2 id=context><span class=secno>1. </span> Introduction</h2>
463463

464464
<p><em>This section is not normative.</em>
465465

466-
<p>Selectors define the following function for elements in a tree
467-
structure:
466+
<p> A selector is a boolean predicate that takes an element in a tree
467+
structure and answers whether the element matches the selector or not.
468468

469-
<pre>expression ∗ element → boolean</pre>
470-
471-
<p>That is, given an element and a selector, this specification defines
472-
whether that element matches the selector.
473-
474-
<p>These expressions can also be used, for instance, to select a set of
475-
elements, or a single element from a set of elements, by evaluating the
476-
expression across all the elements in a subtree. <abbr
477-
title="Simple Tree Transformation Sheets">STTS</abbr> (Simple Tree
478-
Transformation Sheets), a language for transforming XML trees, uses this
479-
mechanism. <a href="#STTS3" rel=biblioentry>[STTS3]<!--{{STTS3}}--></a>
469+
<p> These expressions can be used directly on an element to test whether it
470+
matches some criteria, such as in the <code>Element.matches()</code>
471+
function defined in <a href="#SELECTORS-API2"
472+
rel=biblioentry>[SELECTORS-API2]<!--{{SELECTORS-API2}}--></a>, or
473+
alternately, can be applied to an entire tree of elements to filter it
474+
into a set of elements that match the criteria, such as in the selector in
475+
a CSS style rule.
480476

481477
<p>Selectors Levels 1, 2, and 3 are defined as the subsets of selector
482478
functionality defined in the <a
@@ -4149,15 +4145,6 @@ <h3 id=informative-references><span class=secno>20.2. </span> Informative
41494145
</dd>
41504146
<!---->
41514147

4152-
<dt id=STTS3>[STTS3]
4153-
4154-
<dd>Daniel Glazman. <a href="http://www.w3.org/TR/NOTE-STTS3"><cite>Simple
4155-
Tree Transformation Sheets 3.</cite></a> Electricité de France. 11
4156-
November 1998. Submission to the W3C. URL: <a
4157-
href="http://www.w3.org/TR/NOTE-STTS3">http://www.w3.org/TR/NOTE-STTS3</a>
4158-
</dd>
4159-
<!---->
4160-
41614148
<dt id=SVG11>[SVG11]
41624149

41634150
<dd>Erik Dahlström; et al. <a

selectors4/Overview.src.html

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,18 @@ <h2 id="context">
9595

9696
<p><em>This section is not normative.</em>
9797

98-
<p>Selectors define the following function for elements in a tree structure:</p>
99-
100-
<pre>expression &#x2217; element &rarr; boolean</pre>
101-
102-
<p>That is, given an element and a selector, this specification
103-
defines whether that element matches the selector.</p>
98+
<p>
99+
A selector is a boolean predicate
100+
that takes an element in a tree structure
101+
and answers whether the element matches the selector or not.
104102

105-
<p>These expressions can also be used, for instance, to select a set
106-
of elements, or a single element from a set of elements, by
107-
evaluating the expression across all the elements in a
108-
subtree. <abbr title="Simple Tree Transformation
109-
Sheets">STTS</abbr> (Simple Tree Transformation Sheets), a
110-
language for transforming XML trees, uses this mechanism. [[STTS3]]</p>
103+
<p>
104+
These expressions can be used directly on an element to test whether it matches some criteria,
105+
such as in the <code>Element.matches()</code> function defined in [[SELECTORS-API2]],
106+
or alternately,
107+
can be applied to an entire tree of elements
108+
to filter it into a set of elements that match the criteria,
109+
such as in the selector in a CSS style rule.
111110

112111
<p>Selectors Levels 1, 2, and 3 are defined as the subsets of selector
113112
functionality defined in the <a href="http://www.w3.org/TR/REC-CSS1">CSS1</a>,

0 commit comments

Comments
 (0)