Skip to content

Commit 483a3b6

Browse files
committed
[selectors] Add selector profiles.
1 parent b2b36a1 commit 483a3b6

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

selectors/Overview.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ <h2 class="no-num no-toc" id=contents>Table of Contents</h2>
181181

182182
<li><a href="#overview"><span class=secno>2. </span> Selectors
183183
Overview</a>
184+
<ul class=toc>
185+
<li><a href="#profiles"><span class=secno>2.1. </span> "Fast" and
186+
"Complete" Profiles</a>
187+
</ul>
184188

185189
<li><a href="#syntax"><span class=secno>3. </span> Selector Syntax and
186190
Structure</a>
@@ -1180,6 +1184,43 @@ <h2 id=overview><span class=secno>2. </span> Selectors Overview</h2>
11801184
introduced in <a href="#CSS3UI"
11811185
rel=biblioentry>[CSS3UI]<!--{{CSS3UI}}--></a>.
11821186

1187+
<h3 id=profiles><span class=secno>2.1. </span> "Fast" and "Complete"
1188+
Profiles</h3>
1189+
1190+
<p> Selectors are used in many different contexts, with wildly varying
1191+
performance characteristics. Some powerful selectors are unfortunately too
1192+
slow to realistically include in the more performance-sensitive contexts.
1193+
To accommodate this, two profiles of the Selectors spec are defined:
1194+
1195+
<dl>
1196+
<dt><dfn id=fast-profile>fast</dfn>
1197+
1198+
<dd> The ‘<a href="#fast-profile"><code class=css>fast</code></a>
1199+
profile is appropriate for use in any context, including dynamic browser
1200+
CSS selector matching. It includes every selector defined in this
1201+
document, except for:
1202+
<ul>
1203+
<li>The "complex selector" variants of ‘<a
1204+
href="#matches-pseudo"><code class=css>:matches()</code></a>’ and
1205+
<a href="#negation-pseudo"><code class=css>:not()</code></a>’.
1206+
1207+
<li>The <a href=idref-combinators>reference combinator</a>
1208+
1209+
<li>The <a href="#subject">subject indicator</a>
1210+
</ul>
1211+
1212+
<dt><dfn id=complete-profile>complete</dfn>
1213+
1214+
<dd> The ‘<a href="#complete-profile"><code
1215+
class=css>complete</code></a>’ profile is appropriate for contexts
1216+
which aren't extremely performance sensitive. For example,
1217+
implementations of the Selectors API specification <a
1218+
href="#SELECTORS-API"
1219+
rel=biblioentry>[SELECTORS-API]<!--{{SELECTORS-API}}--></a> should use
1220+
the ‘<a href="#complete-profile"><code class=css>complete</code></a>
1221+
profile. It includes all of the selectors defined in this document.
1222+
</dl>
1223+
11831224
<h2 id=syntax><span class=secno>3. </span> Selector Syntax and Structure</h2>
11841225

11851226
<h3 id=structure><span class=secno>3.1. </span> Structure and Terminology</h3>
@@ -4431,6 +4472,15 @@ <h3 id=informative-references><span class=secno>20.2. </span> Informative
44314472
</dd>
44324473
<!---->
44334474

4475+
<dt id=SELECTORS-API>[SELECTORS-API]
4476+
4477+
<dd>Anne van Kesteren; Lachlan Hunt. <a
4478+
href="http://www.w3.org/TR/2013/REC-selectors-api-20130221/"><cite>Selectors
4479+
API Level 1.</cite></a> 21 February 2013. W3C Recommendation. URL: <a
4480+
href="http://www.w3.org/TR/2013/REC-selectors-api-20130221/">http://www.w3.org/TR/2013/REC-selectors-api-20130221/</a>
4481+
</dd>
4482+
<!---->
4483+
44344484
<dt id=SELECTORS-API2>[SELECTORS-API2]
44354485

44364486
<dd>Lachlan Hunt. <a

selectors/Overview.src.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,38 @@ <h2 id="overview">
519519
<p class="note">Some Level 4 selectors (noted above as "3-UI") were
520520
introduced in [[CSS3UI]].
521521

522+
<h3 id="profiles">
523+
"Fast" and "Complete" Profiles</h3>
524+
525+
<p>
526+
Selectors are used in many different contexts,
527+
with wildly varying performance characteristics.
528+
Some powerful selectors are unfortunately too slow
529+
to realistically include in the more performance-sensitive contexts.
530+
To accommodate this, two profiles of the Selectors spec are defined:
531+
532+
<dl>
533+
<dt><dfn id='fast-profile'>fast</dfn>
534+
<dd>
535+
The ''fast'' profile is appropriate for use in any context,
536+
including dynamic browser CSS selector matching.
537+
It includes every selector defined in this document,
538+
except for:
539+
540+
<ul>
541+
<li>The "complex selector" variants of '':matches()'' and '':not()''.
542+
<li>The <a href="idref-combinators">reference combinator</a>
543+
<li>The <a href="#subject">subject indicator</a>
544+
</ul>
545+
546+
<dt><dfn id='complete-profile'>complete</dfn>
547+
<dd>
548+
The ''complete'' profile is appropriate for contexts which aren't extremely performance sensitive.
549+
For example, implementations of the Selectors API specification [[SELECTORS-API]] should use the ''complete'' profile.
550+
It includes all of the selectors defined in this document.
551+
</dl>
552+
553+
522554
<h2 id="syntax">
523555
Selector Syntax and Structure</h2>
524556

0 commit comments

Comments
 (0)