using-strings-004

using 'first-except' property of named strings

WeasyPrint

This browser

Flags
paged
Assertion
Test checks that if string is set to first-except, it is omitted on the page where the string is set, but appears on subsequent pages

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3 <meta charset="utf-8">
 4 <title>CSS Test: using 'first-except' 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-first-except" rel="help">
 7 <meta content="paged" name="flags">
 8 <meta content="Test checks that if string is set to first-except, it is omitted on the page where the string is set, but appears on subsequent pages" name="assert">
 9 <style>
10   @page {
11    @top-center {
12    content: string(title, first-except);
13    }
14   }
15 
16  h1 {
17  string-set: title content();
18  }
19 
20 #s2, #s3, #s4 { page-break-before: always; }
21 
22 </style>
23 </head>
24 <body>
25 <h1>Chapter Title</h1>
26 <p>Test passes if the running head is omitted on page one, and is “Chapter Title” on all other pages.</p>
27 <h2 id="s1">Section One</h2>
28 <h2 id="s2">Section Two</h2>
29 <h2 id="s3">Section Three</h2>
30 <h2 id="s4">Section Four</h2>
31 <h2 id="s5">Section Five</h2>
32 <h2 id="s6">Section Six</h2>
33 
34 
35 </body></html>