Skip to content

Commit 31796cc

Browse files
committed
[css3-page] Clarify page selectors.
1 parent 6dfb796 commit 31796cc

2 files changed

Lines changed: 69 additions & 73 deletions

File tree

css3-page/Overview.html

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
rel=dcterms.rights>
1010
<meta content=" CSS Paged Media Module Level 3" name=dcterms.title>
1111
<meta content=text name=dcterms.type>
12-
<meta content=2013-03-07 name=dcterms.issued>
12+
<meta content=2013-03-08 name=dcterms.issued>
1313
<meta content="Melinda Grant" name=dcterms.creator>
1414
<meta content="Håkon Wium Lie" name=dcterms.creator>
1515
<meta content="Elika J. Etemad" name=dcterms.creator>
@@ -100,15 +100,15 @@
100100
<h1 class=p-name>CSS Paged Media Module Level 3</h1>
101101

102102
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft <span
103-
class=dt-updated><span class=value-title title=20130307> 7 March
103+
class=dt-updated><span class=value-title title=20130308> 8 March
104104
2013</span></span></h2>
105105

106106
<dl>
107107
<dt>This version:
108108

109109
<dd><a class=u-url
110110
href="http://dev.w3.org/csswg/css3-page/">http://dev.w3.org/csswg/css3-page/</a></dd>
111-
<!-- <dd><a class="u-url" href="http://dev.w3.org/csswg/css3-page/">http://www.w3.org/TR/2013/WD-css3-page-20130307</a></dd> -->
111+
<!-- <dd><a class="u-url" href="http://dev.w3.org/csswg/css3-page/">http://www.w3.org/TR/2013/WD-css3-page-20130308</a></dd> -->
112112

113113
<dt>Latest version:
114114

@@ -219,7 +219,7 @@ <h2 class="no-num no-toc" id=status>Status of this Document</h2>
219219
<p>This document contains the <abbr
220220
title="Cascading Style Sheets">CSS3</abbr> Paged Media Module W3C Last
221221
Call <a href="/2005/10/Process-20051014/tr.html#RecsWD">Working Draft</a>
222-
of 7 March 2013. The Last Call period ends on <span
222+
of 8 March 2013. The Last Call period ends on <span
223223
class=fudge>TBD</span>.
224224

225225
<p>Expected next revision to this document is another LCWD, due to the
@@ -536,7 +536,7 @@ <h2 id=page-terms><span class=secno>3. </span>Page Terminology</h2>
536536
binding edges of facing pages are vertical and adjacent when the pages
537537
are placed in their normal reading orientation.
538538

539-
<dt id=left-page>Left Page
539+
<dt><dfn id=left-page>Left Page</dfn>
540540

541541
<dd>A page that would be on the left if it is part of a pair of facing
542542
pages as typically laid out. Page layouts for documents using a
@@ -545,7 +545,7 @@ <h2 id=page-terms><span class=secno>3. </span>Page Terminology</h2>
545545
<span class=css><code class=css>:left</code></span> <a
546546
href="#page-selector"><i>page selector</i></a>.
547547

548-
<dt id=right-page>Right Page
548+
<dt><dfn id=right-page>Right Page</dfn>
549549

550550
<dd>A page that would be on the right if it is part of a pair of facing
551551
pages as typically laid out. Page layouts for documents using a
@@ -855,12 +855,13 @@ <h3 id=at-page-rule><span class=secno>5.1. </span>The @page Rule</h3>
855855
only allows <a href="#margin-at-rules">margin at-rules</a> inside
856856
<code class=css>@page</code>’.
857857

858-
<p><code class=css>@page</code>’ rules without a selector list are
859-
considered to have a single, empty selector. <code
860-
class=css>@page</code>’ rules apply to pages that <a
861-
href="#match"><i>match</i></a> at least one of their selectors.
858+
<p> <code class=css>@page</code>’ rules without a selector list apply
859+
to every page. Other <code class=css>@page</code>’ rules apply to
860+
pages that <a href="#match"><i>match</i></a> at least one of their
861+
selectors.
862862

863863
<p>Properties declared within the page context apply to the page box.
864+
<!-- XXX except for background properties -->
864865

865866
<p>If an error is encountered during the processing of a declaration block
866867
within a page or a margin context, the <a
@@ -870,26 +871,18 @@ <h3 id=at-page-rule><span class=secno>5.1. </span>The @page Rule</h3>
870871

871872
<h3 id=page-selectors><span class=secno>5.2. </span>Page selectors</h3>
872873

873-
<p>A <dfn id=page-selector>page selector</dfn> is either:
874-
875-
<ul>
876-
<li>one or more <a
877-
href="http://www.w3.org/TR/CSS21/syndata.html#characters">ASCII
878-
case-insensitive</a> <a href="#pseudo-classes">pseudo-classes</a>,
879-
880-
<li>a <a href="#using-named-pages">page type</a> (a case-sensitive
881-
identifier) followed by zero or more pseudo-classes.
882-
</ul>
883-
884-
<p> No whitespace is allowed between components of a selector. The <a
885-
href="#page_selector"><i title="page_selector">page selector
886-
grammar</i></a> and examples can be found below.
874+
<p> A <dfn id=page-selector>page selector</dfn> is made of an optional <a
875+
href="#using-named-pages">page type</a> (a case-sensitive identifier)
876+
followed by zero or more <a
877+
href="http://www.w3.org/TR/CSS21/syndata.html#characters"> ASCII
878+
case-insensitive</a> <a href="#pseudo-classes">pseudo-classes</a>. At
879+
least a page type or one pseudo-class is required. No whitespace is
880+
allowed between components of a selector. The <a href="#page_selector"><i
881+
title="page_selector">page selector grammar</i></a> and examples can be
882+
found below.
887883

888884
<p>A selector is said to <dfn id=match>match</dfn> a given page if and
889-
only if all of its components match the page. Empty selectors (ie.
890-
<code class=css>@page</code>’ rules without a selector) match every
891-
page. <span class=note>Empty selectors have the weakest <a
892-
href="#specificity"><i>specificity</i></a>.</span>
885+
only if all of its components match the page.
893886

894887
<p><a href="#using-named-pages">Page type</a> selectors <a
895888
href="#match"><i>match</i></a> pages of the named type generated by the
@@ -915,8 +908,10 @@ <h4 id=pseudo-classes><span class=secno>5.2.1. </span> <a
915908
agents as either left pages or right pages, based on <a
916909
href="#progression">page progression</a>. The ‘<code
917910
class=css>:left</code>’ and ‘<code class=css>:right</code>
918-
pseudo-classes only <a href="#match"><i>match</i></a> left or right
919-
pages, respectively.
911+
pseudo-classes only <a href="#match"><i>match</i></a> <a
912+
href="#left-page"><i title="Left page">left</i></a> or <a
913+
href="#right-page"><i title="Right page">right pages</i></a>,
914+
respectively.
920915

921916
<div class=example> The following example creates left and right binding
922917
edges using these pseudo-classes:
@@ -1183,22 +1178,24 @@ <h3 id=cascading-and-page-context><span class=secno>5.4. </span>Cascading
11831178
class=css>:right</code>’ pseudo-classes (= <var>h</var>)
11841179
</ul>
11851180

1186-
<p> Specificities are compared by comparing the three components in order:
1187-
the specificity with <var>f</var> larger a value is more specific; if the
1188-
two <var>f</var> values are tied, then the specificity with a larger
1189-
<var>g</var> value is more specific; if the two <var>g</var> values are
1190-
also tied, then the specificity with a larger <var>h</var> value is more
1191-
specific; if all the values are tied, the two specifities are equal.
1181+
<p class=note> Note: Repeated occurrences of the same pseudo-classes are
1182+
allowed and do increase specificity.
11921183

11931184
<p> Due to storage limitations, implementations may have limitations on
11941185
the size of <var>f</var>, <var>g</var>, or <var>h</var>. If so, values
11951186
higher than the limit must be clamped to that limit, and not overflow.
11961187

1197-
<p class=note> Note: Each comma-separated selectors in the same ‘<code
1198-
class=css>@page</code>’ rule has its own specificity.
1188+
<p> Specificities are compared by comparing the three components in order:
1189+
the specificity with a larger <var>f</var> value is more specific; if the
1190+
two <var>f</var> values are tied, then the specificity with a larger
1191+
<var>g</var> value is more specific; if the two <var>g</var> values are
1192+
also tied, then the specificity with a larger <var>h</var> value is more
1193+
specific; if all the values are tied, the two specifities are equal.
11991194

1200-
<p class=note> Note: Repeated occurrances of the same pseudo-classes are
1201-
allowed and do increase specificity.
1195+
<p> The specificity of an ‘<code class=css>@page</code>’ rule without
1196+
a selector list is <var>f</var> = <var>g</var> = <var>h</var> = 0. Other
1197+
<code class=css>@page</code>’ rules have the largest specificity of
1198+
its selectors.
12021199

12031200
<div class=example>
12041201
<p>Some page specificity calculation examples follow:
@@ -1207,6 +1204,7 @@ <h3 id=cascading-and-page-context><span class=secno>5.4. </span>Cascading
12071204
@page { } /* specificity = (0,0,0) */
12081205
@page :left { } /* specificity = (0,0,1) */
12091206
@page :first { } /* specificity = (0,1,0) */
1207+
@page :first, :blank:left { } /* specificity = (0,1,1) */
12101208
@page artsy { } /* specificity = (1,0,0) */
12111209
@page artsy:left { } /* specificity = (1,0,1) */
12121210
@page artsy:first { } /* specificity = (1,1,0) */

css3-page/Overview.src.html

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ <h2 id="page-terms">Page Terminology</h2>
287287
are vertical and adjacent when the pages are placed in their normal reading
288288
orientation.</dd>
289289

290-
<dt id="left-page">Left Page</dt>
290+
<dt><dfn id="left-page">Left Page</dfn></dt>
291291
<dd>A page that would be on the left if it is part of a pair of facing pages as
292292
typically laid out. Page layouts for documents using a left-to-right page
293293
progression have the earlier of the facing pages on the left. Rules specific to
294294
the left page can be specified using the <span class="css">':left'</span>
295295
<i>page selector</i>.
296296
</dd>
297297

298-
<dt id="right-page">Right Page</dt>
298+
<dt><dfn id="right-page">Right Page</dfn></dt>
299299
<dd>A page that would be on the right if it is part of a pair of facing pages as
300300
typically laid out. Page layouts for documents using a right-to-left page
301301
progression have the earlier of the facing pages on the right. Rules specific
@@ -554,9 +554,9 @@ <h3 id="at-page-rule">The @page Rule</h3>
554554
The current level of this specification
555555
only allows <a href="#margin-at-rules">margin at-rules</a> inside ''@page''.
556556

557-
<p>''@page'' rules without a selector list
558-
are considered to have a single, empty selector.
559-
''@page'' rules apply to pages that <i>match</i>
557+
<p>
558+
''@page'' rules without a selector list apply to every page.
559+
Other ''@page'' rules apply to pages that <i>match</i>
560560
at least one of their selectors.
561561

562562
<p>Properties declared within the page context apply to the page box.
@@ -568,26 +568,21 @@ <h3 id="at-page-rule">The @page Rule</h3>
568568

569569
<h3 id="page-selectors">Page selectors</h3>
570570

571-
<p>A <dfn id="page-selector">page selector</dfn> is either:
572-
573-
<ul>
574-
<li>one or more
575-
<a href="http://www.w3.org/TR/CSS21/syndata.html#characters">ASCII case-insensitive</a>
576-
<a href="#pseudo-classes">pseudo-classes</a>,
577-
<li>a <a href="#using-named-pages">page type</a>
578-
(a case-sensitive identifier)
579-
followed by zero or more pseudo-classes.
580-
</ul>
581-
582571
<p>
572+
A <dfn id="page-selector">page selector</dfn> is made of
573+
an optional <a href="#using-named-pages">page type</a>
574+
(a case-sensitive identifier)
575+
followed by zero or more
576+
<a href="http://www.w3.org/TR/CSS21/syndata.html#characters">
577+
ASCII case-insensitive</a>
578+
<a href="#pseudo-classes">pseudo-classes</a>.
579+
At least a page type or one pseudo-class is required.
583580
No whitespace is allowed between components of a selector.
584581
The <i title="page_selector">page selector grammar</i>
585582
and examples can be found below.
586583

587584
<p>A selector is said to <dfn>match</dfn> a given page if and only if
588585
all of its components match the page.
589-
Empty selectors (ie. ''@page'' rules without a selector) match every page.
590-
<span class="note">Empty selectors have the weakest <i>specificity</i>.</span>
591586

592587
<p><a href="#using-named-pages">Page type</a> selectors <i>match</i>
593588
pages of the named type generated by the 'page' property.
@@ -616,7 +611,8 @@ <h4 id="pseudo-classes">
616611
as either left pages or right pages,
617612
based on <a href="#progression">page progression</a>.
618613
The '':left'' and '':right'' pseudo-classes only <i>match</i>
619-
left or right pages, respectively.
614+
<i title="Left page">left</i> or <i title="Right page">right pages</i>,
615+
respectively.
620616

621617
<div class="example">
622618
The following example creates left and right binding edges using these pseudo-classes:
@@ -851,14 +847,9 @@ <h3 id="cascading-and-page-context">Cascading in the page context</h3>
851847
<li>Count the number of ':left' or ':right' pseudo-classes (= <var>h</var>)
852848
</ul>
853849

854-
<p>
855-
Specificities are compared by comparing the three components in order:
856-
the specificity with <var>f</var> larger a value is more specific;
857-
if the two <var>f</var> values are tied,
858-
then the specificity with a larger <var>g</var> value is more specific;
859-
if the two <var>g</var> values are also tied,
860-
then the specificity with a larger <var>h</var> value is more specific;
861-
if all the values are tied, the two specifities are equal.
850+
<p class="note">
851+
Note: Repeated occurrences of the same pseudo-classes are allowed
852+
and do increase specificity.
862853

863854
<p>
864855
Due to storage limitations,
@@ -867,13 +858,19 @@ <h3 id="cascading-and-page-context">Cascading in the page context</h3>
867858
If so, values higher than the limit must be clamped to that limit,
868859
and not overflow.
869860

870-
<p class="note">
871-
Note: Each comma-separated selectors in the same ''@page'' rule
872-
has its own specificity.
861+
<p>
862+
Specificities are compared by comparing the three components in order:
863+
the specificity with a larger <var>f</var> value is more specific;
864+
if the two <var>f</var> values are tied,
865+
then the specificity with a larger <var>g</var> value is more specific;
866+
if the two <var>g</var> values are also tied,
867+
then the specificity with a larger <var>h</var> value is more specific;
868+
if all the values are tied, the two specifities are equal.
873869

874-
<p class="note">
875-
Note: Repeated occurrances of the same pseudo-classes are allowed
876-
and do increase specificity.
870+
<p>
871+
The specificity of an ''@page'' rule without a selector list is
872+
<var>f</var> = <var>g</var> = <var>h</var> = 0.
873+
Other ''@page'' rules have the largest specificity of its selectors.
877874

878875
<div class="example">
879876

@@ -882,6 +879,7 @@ <h3 id="cascading-and-page-context">Cascading in the page context</h3>
882879
@page { } /* specificity = (0,0,0) */
883880
@page :left { } /* specificity = (0,0,1) */
884881
@page :first { } /* specificity = (0,1,0) */
882+
@page :first, :blank:left { } /* specificity = (0,1,1) */
885883
@page artsy { } /* specificity = (1,0,0) */
886884
@page artsy:left { } /* specificity = (1,0,1) */
887885
@page artsy:first { } /* specificity = (1,1,0) */

0 commit comments

Comments
 (0)