Skip to content

Commit fcb6b6b

Browse files
committed
revision based on comments from tab/fantasai
1 parent 86b1cb0 commit fcb6b6b

1 file changed

Lines changed: 51 additions & 73 deletions

File tree

css3-gcpm/Overview.src.html

Lines changed: 51 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ <h3>Named strings</h3>
125125
<p>Consider this code:
126126

127127
<pre>
128-
h1 { string-set: title content() }
128+
h1 { string-set: title contents }
129129
</pre>
130130

131131
<p>Whenever an <code>h1</code> element is encountered,
@@ -187,31 +187,29 @@ <h4>Setting named strings: the 'string-set' property</h4>
187187
<dt>&lt;counter&gt;
188188
<dd>the counter() or counters() function, as per <a href="http://www.w3.org/TR/CSS21/syndata.html#counter">CSS 2.1 section 4.3.5</a>
189189

190-
<dt>&lt;content&gt;
190+
<dt>contents
191191

192-
<dd>the ''content()'' function returns the content of elements and pseudo-elements. The functional notation accepts an optional argument:
193-
194-
<dl>
192+
<dd>The textual content of the element, including the content of its ::before and ::after pseudo-element. The content of the element's descendants, including their respective ::before and ::after pseudo-elements, are included in the returned content.
195193

196-
<dt>''content()''
194+
<dt>content-element
197195

198-
<dd>Without any arguments, the function returns the textual content of the element, not including the content of its ::before and ::after pseudo-element. The content of the element's descendants, including their respective ::before and ::after pseudo-elements, are included in the returned content.
196+
<dd>The textual content of the element, not including the content of its ::before and ::after pseudo-element. The content of the element's descendants, including their respective ::before and ::after pseudo-elements, are included in the returned content.
199197

200-
<dt>''content(before)''
198+
<dt>content-before
201199

202-
<dd>The function returns the textual content of the ::before pseudo-element the content of the element.
200+
<dd>The textual content of the ::before pseudo-element the content of the element.
203201

204-
<dt>''content(after)''
202+
<dt>content-after
205203

206-
<dd>The function returns the textual content of the ::after pseudo-element the content of the element.
204+
<dd>The textual content of the ::after pseudo-element the content of the element.
207205

208-
<dt>''content(first-letter)''
206+
<dt>content-first-letter
209207

210-
<dd>The function returns the first letter of the content of the element. The definition of a letter is the same as for :first-letter pseudo-elements.
208+
<dd>The first letter of the content of the element. The definition of a letter is the same as for :first-letter pseudo-elements.
211209

212-
<p class="note">The expected use for ''content(first-letter)'' is to create one-letter headers, e.g., in dictionaries.</p>
210+
<p class="note">The expected use for ''content-first-letter'' is to create one-letter headers, e.g., in dictionaries.</p>
213211

214-
<dt>''env()''
212+
<dt>env()
215213

216214
<dd>This function returns data from the local environment of the user at
217215
the time of formatting. The function accepts one of these keywords:
@@ -264,7 +262,7 @@ <h4>Setting named strings: the 'string-set' property</h4>
264262
<div class="example">
265263
<pre>
266264
h2 {
267-
string-set: header "Chapter " counter(header) ": " content();
265+
string-set: header "Chapter " counter(header) ": " contents;
268266
counter-increment: header;
269267
}
270268
</pre>
@@ -281,14 +279,14 @@ <h4>Setting named strings: the 'string-set' property</h4>
281279
<pre>
282280
h2:before { content: "Chapter " counter(header) }
283281
h2 {
284-
string-set: header content(before) content();
282+
string-set: header content-before content-element;
285283
counter-increment: header }
286284
</pre>
287285
</div>
288286

289287
<div class="example">
290288
<pre>
291-
dt { string-set: index content(first-letter) }
289+
dt { string-set: index content-first-letter }
292290
</pre>
293291
</div>
294292

@@ -298,7 +296,7 @@ <h4>Setting named strings: the 'string-set' property</h4>
298296
<pre>
299297
title {
300298
display: none;
301-
string-set: header content();
299+
string-set: header contents;
302300
}
303301
</div>
304302

@@ -314,8 +312,8 @@ <h4>Using named strings</h4>
314312
@page { @top-center { content: string(header) }}
315313
@page { @right-middle { content: string(index) }}
316314
@page { @top-left { content: string(entry) }}
317-
h1 { string-set: header "Chapter " counter(chapter) content() }
318-
dt { string-set: index content(first-letter), entry content() }
315+
h1 { string-set: header "Chapter " counter(chapter) contents }
316+
dt { string-set: index content-first-letter, entry contents }
319317
</pre>
320318
</div>
321319

@@ -339,7 +337,7 @@ <h4>Using named strings</h4>
339337
@page { @top-left { content: string(term, first) }}
340338
@page { @top-right { content: string(term, last) }}
341339
@page { @top-center { content: string(index, first) }}
342-
dt { string-set: index content(first-letter), term content() }
340+
dt { string-set: index content-first-letter, term contents }
343341
</pre>
344342
</div>
345343

@@ -348,7 +346,7 @@ <h4>Using named strings</h4>
348346
<p>In this example, the header in the top center will be blank on pages where 'h1' elements appear. On other pages, the string of the previous 'h1' element will be shown.
349347
<pre>
350348
@page { @top-center { content: string(chapter, first-except) }}
351-
h1 { string-set: chapter content() }
349+
h1 { string-set: chapter contents }
352350
</pre>
353351
</div>
354352

@@ -724,29 +722,9 @@ <h3>The ''target-text'' value</h3>
724722
is copied; not style, structure, or replaced content.
725723
''target-text()'' has one required argument: the url of the link. An
726724
optional second argument specifies exactly which content is fetched.
727-
There are four possible values:
728-
729-
<dl>
730-
<dt>''content()''
731-
732-
<dd>refers to the textual content of
733-
the element, not including the content of its ::before and ::after
734-
pseudo-element. The content of the element's descendants, including their
735-
respective ::before and ::after pseudo-elements, are included in the returned content.
736-
737-
<dt>''content(before)''
738-
739-
<dd>refers to the content of the element's ::before pseudo-element. This is the default value.
740-
741-
<dt>''content(after)''
742-
743-
<dd>refers to the content of the element's ::after pseudo-element
744-
745-
<dt>''content(first-letter)''
746-
747-
<dd>refers to the first letter of the textual content of the element, not including the content of its ::before and ::after pseudo-element.
748-
749-
</dl>
725+
There are five possible values: ''contents'', ''content-element'',
726+
''content-before'', ''content-after'', ''content-first-letter''; these
727+
keywords are defined above.
750728

751729

752730
<div class="example">
@@ -769,7 +747,7 @@ <h3>The ''target-text'' value</h3>
769747
<pre>
770748
h2 { counter-increment: chapter }
771749
a { content: "Chapter " target-counter(attr(href, url), chapter)
772-
' ("' target-text(attr(href), content()) '") on page '
750+
' ("' target-text(attr(href), content-element) '") on page '
773751
target-counter(attr(href, url), page);
774752
</pre>
775753
</div>
@@ -843,6 +821,8 @@ <h2>Footnotes</h2>
843821
&lt;p id=words>&lt;span class="call">[3]&lt;/span> Most often.
844822
</pre>
845823

824+
<p class=issue>define ''target-pull''
825+
846826
<p>When shown in a legacy browser, the content of the element will be
847827
shown as a clickable link to an endnote. When printed according to
848828
this specification, there will be a footnote:
@@ -2155,10 +2135,10 @@ <h2>Bookmarks</h2>
21552135
<td><dfn>bookmark-label</dfn>
21562136
<tr>
21572137
<td><em>Value:</em>
2158-
<td>content() | &lt;string>
2138+
<td>none | contents | content-before | content-element | content-after | &lt;string>
21592139
<tr>
21602140
<td><em>Initial:</em>
2161-
<td>content()
2141+
<td>none
21622142
<tr>
21632143
<td><em>Applies to:</em>
21642144
<td>all elements
@@ -2182,8 +2162,8 @@ <h2>Bookmarks</h2>
21822162
<div class="example">
21832163
<pre>
21842164
a { bookmark-label: attr(title, string) }
2185-
h1 { bookmark-label: content() }
2186-
h2 { bookmark-label: content(before) }
2165+
h1 { bookmark-label: contents }
2166+
h2 { bookmark-label: content-before }
21872167
#frog { bookmark-label: "The green frog" }
21882168
</pre>
21892169
</div>
@@ -2429,7 +2409,7 @@ <h2>Navigation between pages</h2>
24292409

24302410
<dl>
24312411

2432-
<dt>link-rel()
2412+
<dt>go()
24332413

24342414
<dd>the function takes one argument, which refers to the <tt>rel</tt> attribute of the <tt>link</tt> element
24352415

@@ -2439,57 +2419,52 @@ <h2>Navigation between pages</h2>
24392419
&lt;link rel=previous href=g3.html>
24402420
&lt;link rel=next href=g1.html>
24412421
...
2442-
@-o-navigation {
2443-
nav-up: link-rel(index);
2444-
nav-left: link-rel(previous);
2445-
nav-right: link-rel(next);
2422+
@navigation {
2423+
nav-up: go(index);
2424+
nav-left: go(previous);
2425+
nav-right: go(next);
24462426
}
24472427
</pre>
24482428
</div>
24492429

24502430
<p class=issue>This functionality relies on semantics in HTML and CSS. Other languages may have other other ways to describe such semantics. One possible solution for other languages is "link[rel=index] { nav-up: attr(href) }"
24512431

2452-
<p class=issue>The "link-rel" name is a bit academic, perhaps the "go()" name can be used instead?
2453-
2454-
<dt>go()
2432+
<dt>''back''
24552433

2456-
<dd>The function takes one argument: <tt>back</tt>, which takes the user one step back in history.
2434+
<dd>The keyword takes the user one step back in the history of browsed pages.
24572435

24582436
<div class=example>
24592437
<pre>
24602438
@navigation {
2461-
nav-left: go(back);
2439+
nav-left: back;
24622440
}
24632441
</pre>
24642442
</div>
24652443

2466-
2467-
<dt>
2468-
2469-
<dt>url-doc()
2444+
<dt>url()
24702445

24712446
<dd>The funcation takes one argument: a URL. Relative URLs are
2472-
relative to the document, not to the style sheet.
2447+
relative to the style sheet.
24732448

24742449
<div class=example>
24752450
<pre>
24762451
@navigation {
2477-
nav-up: url-doc(..);
2478-
nav-down: url-doc(a1.html);
2452+
nav-up: url(..);
2453+
nav-down: url(a1.html);
24792454
}
24802455
</pre>
24812456
</div>
24822457

2483-
<dt>url()
2458+
<dt>url-doc()
24842459

2485-
<dd>The funcation takes one argument: a URL. Relative URLs are
2486-
relative to the style sheet.
2460+
<dd>The function is identical to url(), except that relative URLs are
2461+
relative to the document, not to the style sheet.
24872462

24882463
<div class=example>
24892464
<pre>
24902465
@navigation {
2491-
nav-up: url(..);
2492-
nav-down: url(a1.html);
2466+
nav-up: url-doc(..);
2467+
nav-down: url-doc(a1.html);
24932468
}
24942469
</pre>
24952470
</div>
@@ -2498,6 +2473,8 @@ <h2>Navigation between pages</h2>
24982473

24992474

25002475

2476+
2477+
25012478
<div class=example>
25022479

25032480
<p>Combined with the <a href="http://www.w3.org/TR/2011/WD-css3-conditional-20110901/#at-document">@document-rule</a>, navigation maps can be described:
@@ -3489,6 +3466,7 @@ <h2>Appendix A: Default style sheet</h2>
34893466
h6 { bookmark-level: 6 }
34903467
</pre>
34913468

3469+
<p class=issue>Add grammar for functions defined in this spec.
34923470

34933471
<h2 class=no-num id=acknowledgments>Acknowledgments</h2>
34943472

0 commit comments

Comments
 (0)