I'm writing some tests for GCPM, and, of course, am managing to confuse myself. Here's an example:
The first element on page two is the h2 "Section Two". But when using the start value for the running head, it uses "Section One."
If I change the document source so that there's a page-break-after on the last paragraph before Section Two (rather than page-break-before on Section Two), then the PDF is otherwise unchanged, except the running head becomes "Section Two."
It seems odd that the behaviour of "start" depends not only on how the elements lay out on the pages, but how they got there. Is this a bug? Does the spec need to be clearer? Or (most likely) am I misunderstanding something?
Thanks,
Dave
<!DOCTYPE html>
<html>
<head>
<title>CSS Test: using 'start' property of named strings</title>
<style>
@page {
size: A5;
margin: 1in;
@top-center {
content: string(section, start);
border: thin solid blue;
margin: .25in;
}
}
h2 {
string-set: section content();
}
#s2 { page-break-before: always; }
#s4 { page-break-after: always; }
</style>
</head>
<body>
<h1>Chapter Title</h1>
<p>Note: this test has three pages</p>
<p>Test passes if:</p>
<ol>
<li>
On page one, the running head is empty.
</li>
<li>
On page two, the running head is "Section Two"
</li>
<li>
On page three, the running head is "Section Four"
</li>
</ol>
<h2 id="s1">Section One</h2>
<p id="p1">Bacon ipsum dolor sit amet brisket sunt kielbasa, sed rump fatback shankle. Non exercitation aliquip culpa shankle. Sausage pork kevin, doner meatloaf venison cupidatat. Salami frankfurter spare ribs kielbasa culpa commodo incididunt. Tri-tip pork belly pig ut ground round est, turkey drumstick nisi quis. Occaecat nisi tempor cupidatat, ground round exercitation in turducken. Filet mignon cow pork bacon tri-tip fugiat mollit kevin et.</p>
<h2 id="s2">Section Two</h2>
<p>
Fatback excepteur ex ut shank do ham. Sausage sirloin turducken velit ex spare ribs quis. Quis in turkey, labore sirloin fatback exercitation proident. In rump reprehenderit voluptate aute ribeye excepteur pig venison. Culpa laboris in nostrud, kevin leberkas non tri-tip commodo qui tenderloin. Id non short ribs elit, ut excepteur cow venison duis do.
</p>
<h2 id="s3">Section Three</h2>
<p>
Ullamco strip steak aliqua bacon ut sirloin turkey pork chop, ball tip jowl. Commodo pancetta prosciutto, meatloaf eiusmod aliquip chicken occaecat pig. Ut in pork, short ribs chuck t-bone kielbasa irure jowl occaecat cupidatat nostrud officia. Dolore ball tip cupidatat labore esse ut, magna leberkas irure kevin nostrud aute eu pariatur eiusmod. Nostrud pancetta labore, eu est mollit jerky ham hock. Shoulder aliquip dolore eu corned beef strip steak commodo.
</p>
<h2 id="s4">Section Four</h2>
<p>
Frankfurter prosciutto fatback beef ribs brisket, flank consectetur proident cupidatat ham hock enim pig eu bresaola. Qui ball tip consequat short loin salami. Tri-tip tempor et, adipisicing commodo ground round ball tip andouille doner. Short loin officia ea ground round shank.
</p>
<h2 id="s5">Section Five</h2>
<p>Biltong in capicola commodo tenderloin irure, labore drumstick aute tri-tip veniam. Labore dolore doner ex, meatloaf tempor meatball id flank do turkey. Pig culpa ut prosciutto rump. Tongue chicken qui andouille, pork loin pork chop salami ut. Eu ea qui dolore pork chop ground round.</p>
<h2 id="s6">Section Six</h2>
<p>Ham hock jowl filet mignon pastrami beef turducken. Brisket pork chop pork loin drumstick capicola ground round shankle andouille leberkas tenderloin turducken chuck t-bone kevin turkey. Turkey brisket shank, cow pork belly strip steak bresaola chicken short ribs biltong. Kevin jowl meatloaf capicola t-bone ham brisket leberkas. Pork strip steak drumstick jerky, flank shankle capicola turkey spare ribs.</p>
</body>
</html>
The first element on page two is the h2 "Section Two". But when using the start value for the running head, it uses "Section One."
If I change the document source so that there's a page-break-after on the last paragraph before Section Two (rather than page-break-before on Section Two), then the PDF is otherwise unchanged, except the running head becomes "Section Two."
It seems odd that the behaviour of "start" depends not only on how the elements lay out on the pages, but how they got there. Is this a bug? Does the spec need to be clearer? Or (most likely) am I misunderstanding something?
Thanks,
Dave