string-set-011

GCPM string-set on element with display: none

WeasyPrint

This browser

Flags
paged
Assertion
Test checks that a string can be set to the value of an element even if display is set to none

Source

 1 <!DOCTYPE html>
 2 <html><head>
 3 <meta charset="utf-8">
 4 <title>CSS Test: GCPM string-set on element with display: none</title>
 5 <link href="mailto:dauwhe@gmail.com" rel="author" title="Dave Cramer">
 6 <link href="http://www.w3.org/TR/css-gcpm-3/#setting-named-strings-the-string-set-pro" rel="help">
 7 <meta content="paged" name="flags">
 8 <meta content="Test checks that a string can be set to the value of an element even if display is set to none" name="assert">
 9 <!--
10 Note this test exposes a known bug in PrinceXML 9.0 rev 2 (and all previous versions)
11 -->
12 <style>
13   @page {
14    @top-center {
15    content: string(title);
16    }
17   }
18 
19  h1 {
20  string-set: title content();
21  display: none;
22  }
23 
24 #d2 { page-break-before: always; }
25 
26 </style>
27 </head>
28 <body>
29 <h1>Chapter One Title</h1>
30 <p>Note: test has two pages</p>
31 <p>Test passes if:</p>
32 <ol>
33 <li>
34 “Chapter One Title” appears in the running head on page one.
35 </li>
36 <li>
37 “Chapter Two Title” appears in the running head on page two.
38 </li>
39 </ol>
40 
41 <div id="d2">
42 <h1>Chapter Two Title</h1>
43 <p>Second Page</p>
44 </div>
45 
46 
47 </body></html>