๐ New
- Page-margin boxes:
@page { @top-center { content: ... } }and the
other fifteen boxes of CSS Paged Media write headers and footers in the
page's margin, withcounter(page),counter(pages)in any counter
style, and their own font, colour, alignment, background, border, padding
and opacity -- no static@frameor<pdf:pagenumber>needed. @page :firstbuilds on its@pageand is used for the first page,
so@page :first { @top-center { content: none } }leaves the cover
without a header.string-setandstring():h1 { string-set: chapter content() }
with@top-left { content: string(chapter) }is a running header, with
thefirst,start,lastandfirst-exceptchoices.text-decoration: overline, alone or withunderlineand
line-through.border-style: groove,ridge,insetandoutsetare drawn in
two shades of the border colour, as Chrome draws them, on blocks,
paragraphs, tables and table cells. They used to come out solid.opacity. A block, a table, a flex container or item, an
inline-block, a positioned box or an image is painted with what is in it
as one PDF transparency group, so overlapping parts do not show through
each other, and links inside keep working. An inline element fades its
text, background and images.list-style-type: circledraws a hollow ring, the default of a list
inside a list. It used to draw the same filled bullet asdisc.
๐ช๐ผ Improvements
- Text sits in its line as a browser puts it: the leading is shared above
and below the text, as CSS does, rather than left below it. A paragraph
takes the same height as before, and its text is drawn lower inside it,
by about 0.29 em at the defaultline-height: 150%-- 2.2 pt at 7.5 pt.
Compared with Chrome on the 105 fixtures ofmake test-browser, 66 come
closer and the average SSIM goes from 0.900 to 0.907. A document laid out
to the point over a background or a form should be checked. line-heightis inherited as CSS says. A percentage or anem
length is worked out on the element that declares it and its descendants
take that length, sobody { line-height: 150% }gives a heading the
body's leading, as a browser does, rather than 150% of the heading's own
size; a number such as1.5still follows each element's size. The
default is now the number1.5, which lays out exactly as the
150%it replaces did.- A list (
ul,ol,dl) has an em of space above and below it, as
in a browser, and a list inside a list has none; the last item's bottom
margin collapses into the list's. Lists used to have no vertical margin.
ul, ol, dl { margin-top: 0; margin-bottom: 0 }keeps the old spacing.
๐ Bug-Fixes
- An
@pagebleedthat is not a length, such asbleed: wide, is
reported once as the page's bleed, wheregetSizeused to report "Not a
float" in its own words and the bleed's warning only came for a negative
value. - A table row too tall for any page that a
rowspancrosses no longer
stops the conversion withLayoutError: ... too large on page. Such a
row cannot be cut, nor can the table between the rows the span joins, so
those rows are shrunk to fit the page, with a warning naming them; the
rest of the table goes on as before. - A box whose content fits at the foot of a page, with no room for the
bottom padding under it, no longer leaves a slice of empty box -- its
padding, background and border -- at the top of the next page. The cut is
made where the bottom fits too, so the last line goes on with it, or the
box goes on whole, as in a browser. - A forced page break no longer leaves an empty page:
page-break-before: alwayson the first element used to make page one
blank, andpage-break-afteron one block withpage-break-beforeon
the next made an empty page between them. A break where nothing is on the
page yet does nothing, as in a browser;<pdf:nextpage/>still always
starts a page, andleft/rightstill add the page their parity
needs. - A long table inside a block with a background, padding or border runs on
across pages again, rather than being shrunk to one page or raising
LayoutError: Splitting error(:issue:854). - A table in a flex item lays its columns out by their content, as a
browser does, instead of in equal shares of the item. The equal shares
were narrower than a column's content, so a long table's cells wrapped
once its numbers grew, and each page held fewer rows than the last. - An
ltasignature withoutvalidation_context.trust_rootsis
refused with aValueError, where pyHanko quietly fell back to the
operating system's trust list, which it deprecates.extra_trust_roots
is added totrust_rootsinstead of being passed on as the deprecated
key. line-height: 2and the other whole numbers from 1 to 7 multiply the
font size; they were read as the sizes of HTML's<font size>, so
line-height: 2gave 0.75em.HttpConfig(timeout=30)keeps the timeout it is given; the default of
5 seconds only fills in a missing one.
๐งน Cleanup
- The signing tests are skipped when pyHanko is not installed, so a plain
pytestrun, as Debian's autopkgtest does, no longer stops at
collection. - The test workflow runs on Ubuntu 26.04:
testrenderreads ImageMagick
7'scompareoutput, and the 3.13 and 3.14 jobs installlibxml2-dev
(:pr:856). - Tests for
HttpConfig(:pr:855).
| Thanks to the following people on GitHub for contributing to this release:
| gaborbernat and arifahmedozturk