using-strings-002

using the 'last' property of named strings

WeasyPrint

This browser

Flags
paged
Assertion
Test checks that the last instance of a named string is used, when the 'last' property is applied to the string.

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3 <meta charset="utf-8">
 4 <title>CSS Test: using the '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 the last instance of a named string is used, when the 'last' property is applied to the string." name="assert">
 9 <style>
10   @page {
11    @top-center {
12    content: string(section, last);
13    }
14   }
15 
16  h2 {
17  string-set: section content();
18  }
19 
20 </style>
21 </head>
22 <body>
23 <p>Test passes if the text "Section Six" is in the running head at the top of the page.</p>
24 <h2 id="s1">Section One</h2>
25 <h2 id="s2">Section Two</h2>
26 <h2 id="s3">Section Three</h2>
27 <h2 id="s4">Section Four</h2>
28 <h2 id="s5">Section Five</h2>
29 <h2 id="s6">Section Six</h2>
30 
31 
32 </body></html>