using-strings-005

using 'last' property of named strings

WeasyPrint

This browser

Flags
paged
Assertion
Test checks that if string is set to last, the last appearance of that element determines the content of the string

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3 <meta charset="utf-8">
 4 <title>CSS Test: using 'last' property of named strings</title>
 5 <link href="mailto:dauwhe@gmail.com" rel="author" title="Dave Cramer">
 6 <link href="http://www.w3.org/TR/css-gcpm-3/#string-last" rel="help">
 7 <meta content="paged" name="flags">
 8 <meta content="Test checks that if string is set to last, the last appearance of that element determines the content of the string" name="assert">
 9 <style>
10   @page {
11    @top-center {
12    content: string(title, last);
13    }
14   }
15 
16  h2 {
17  string-set: title content();
18  }
19 
20 #s2, #s4 { page-break-before: always; }
21 
22 </style>
23 </head>
24 <body>
25 <p>Note: test has three pages. Test passes if:</p>
26 <ol>
27 <li>
28 Running head on page one is “Section One”
29 </li>
30 <li>
31 Running head on page two is “Section Three”
32 </li>
33 <li>
34 Running head on page three is “Section Six”
35 </li>
36 </ol>
37 <h2 id="s1">Section One</h2>
38 <h2 id="s2">Section Two</h2>
39 <h2 id="s3">Section Three</h2>
40 <h2 id="s4">Section Four</h2>
41 <h2 id="s5">Section Five</h2>
42 <h2 id="s6">Section Six</h2>
43 
44 
45 </body></html>