kumiori 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/CHANGELOG.en.md +201 -2
  2. package/CHANGELOG.md +202 -3
  3. package/NOTICE +2 -0
  4. package/README.en.md +58 -18
  5. package/README.md +58 -18
  6. package/THIRD_PARTY_NOTICES.md +364 -26
  7. package/dist-browser/NOTICE +2 -0
  8. package/dist-browser/THIRD_PARTY_NOTICES.md +364 -26
  9. package/dist-browser/chunks/{UTIF-DJ2yEO_P.js → UTIF-Br536cfi.js} +4 -4
  10. package/dist-browser/chunks/ccitt-DuYpUkox.js +1640 -0
  11. package/dist-browser/chunks/cgm-Blvzv6Sp.js +2103 -0
  12. package/dist-browser/chunks/{el-monoton-Bh-cSidd.js → el-monoton-vcesHl--.js} +4 -4
  13. package/dist-browser/chunks/{en-gb-DLCXyvjY.js → en-gb-DAIgCw5-.js} +4 -4
  14. package/dist-browser/chunks/{en-us-BBLcTX9N.js → en-us-BzUSGdOw.js} +4 -4
  15. package/dist-browser/chunks/eps-BFOW93N0.js +5237 -0
  16. package/dist-browser/chunks/epsInfo-D7b8OFlX.js +565 -0
  17. package/dist-browser/chunks/{export-contract-DDGE_g3K.js → export-contract-J-x2aLjv.js} +3 -3
  18. package/dist-browser/chunks/{la-D46x91kc.js → la-DRKqnbhl.js} +4 -4
  19. package/dist-browser/chunks/load-ftVKpJYM.js +16686 -0
  20. package/dist-browser/chunks/matrix-DxjvN-4S.js +48 -0
  21. package/dist-browser/chunks/metafile-CdWE2Vpy.js +1867 -0
  22. package/dist-browser/chunks/{pako-CeDDB8tF.js → pako-BwlM3ygd.js} +6 -6
  23. package/dist-browser/chunks/pixels-BvYSA32R.js +714 -0
  24. package/dist-browser/chunks/{rolldown-runtime-BXCUS5Bd.js → rolldown-runtime-BV67vctc.js} +2 -2
  25. package/dist-browser/chunks/{ru-CkmoNumx.js → ru-C-K8QVC6.js} +4 -4
  26. package/dist-browser/chunks/sniff-CqYWlxhA.js +8779 -0
  27. package/dist-browser/chunks/strokeOutline-yLvGVz8Y.js +1107 -0
  28. package/dist-browser/chunks/{uk-DIZr4Urv.js → uk-DsJ1E5t7.js} +4 -4
  29. package/dist-browser/kumiori.js +41493 -52444
  30. package/dist-cli/NOTICE +2 -0
  31. package/dist-cli/THIRD_PARTY_NOTICES.md +364 -26
  32. package/dist-cli/assets/cgm-DNhYr9YE.js +3239 -0
  33. package/dist-cli/assets/drawioStencil-FTgn0IEy.js +991 -0
  34. package/dist-cli/assets/eps-L8amQ51W.js +7496 -0
  35. package/dist-cli/assets/load-O0H7f7JT.js +39125 -0
  36. package/dist-cli/assets/metafile-xjD5AdL9.js +2522 -0
  37. package/dist-cli/cli.js +51358 -47290
  38. package/dist-lib/NOTICE +2 -0
  39. package/dist-lib/THIRD_PARTY_NOTICES.md +364 -26
  40. package/dist-lib/{api-CQ3aOtc5.js → api-DG-iGARW.js} +38568 -37973
  41. package/dist-lib/cgm-CAP3l6Ps.js +2103 -0
  42. package/dist-lib/eps-BVpP3M6Z.js +5236 -0
  43. package/dist-lib/epsInfo-D7b8OFlX.js +565 -0
  44. package/dist-lib/index.js +11 -12
  45. package/dist-lib/load-WPgVW8G9.js +15328 -0
  46. package/dist-lib/metafile-DIpYelkX.js +1867 -0
  47. package/dist-lib/node.js +4 -5
  48. package/dist-lib/pixels-BvYSA32R.js +714 -0
  49. package/dist-lib/types/api.d.ts +61 -2
  50. package/dist-lib/types/areaResources.d.ts +9 -1
  51. package/dist-lib/types/areaTree.d.ts +3 -1
  52. package/dist-lib/types/assets.d.ts +78 -3
  53. package/dist-lib/types/base64.d.ts +7 -0
  54. package/dist-lib/types/ccitt.d.ts +1 -1
  55. package/dist-lib/types/cgm.d.ts +2 -2
  56. package/dist-lib/types/color.d.ts +13 -4
  57. package/dist-lib/types/colorGlyphPdf.d.ts +11 -1
  58. package/dist-lib/types/compat.d.ts +23 -2
  59. package/dist-lib/types/cssCascade.d.ts +35 -1
  60. package/dist-lib/types/cssSelector.d.ts +80 -2
  61. package/dist-lib/types/cssText.d.ts +23 -0
  62. package/dist-lib/types/documentResources.d.ts +2 -1
  63. package/dist-lib/types/drawio/base64.d.ts +6 -0
  64. package/dist-lib/types/drawio/drawio.d.ts +137 -0
  65. package/dist-lib/types/drawio/drawioCanvas.d.ts +156 -0
  66. package/dist-lib/types/drawio/drawioEdges.d.ts +89 -0
  67. package/dist-lib/types/drawio/drawioJs/archimate.d.ts +33 -0
  68. package/dist-lib/types/drawio/drawioJs/arrows.d.ts +37 -0
  69. package/dist-lib/types/drawio/drawioJs/aws3d.d.ts +18 -0
  70. package/dist-lib/types/drawio/drawioJs/basic.d.ts +29 -0
  71. package/dist-lib/types/drawio/drawioJs/bpmn.d.ts +35 -0
  72. package/dist-lib/types/drawio/drawioJs/edges.d.ts +19 -0
  73. package/dist-lib/types/drawio/drawioJs/electrical.d.ts +29 -0
  74. package/dist-lib/types/drawio/drawioJs/misc.d.ts +34 -0
  75. package/dist-lib/types/drawio/drawioJs/mockup.d.ts +27 -0
  76. package/dist-lib/types/drawio/drawioJs/mockupIos.d.ts +2 -0
  77. package/dist-lib/types/drawio/drawioJs/ui.d.ts +34 -0
  78. package/dist-lib/types/drawio/drawioShapes.d.ts +51 -0
  79. package/dist-lib/types/drawio/drawioShapesA.d.ts +23 -0
  80. package/dist-lib/types/drawio/drawioShapesB.d.ts +26 -0
  81. package/dist-lib/types/drawio/drawioSketch.d.ts +50 -0
  82. package/dist-lib/types/drawio/drawioStencil.d.ts +159 -0
  83. package/dist-lib/types/drawio/drawioTapered.d.ts +67 -0
  84. package/dist-lib/types/drawio/drawioText.d.ts +27 -0
  85. package/dist-lib/types/drawio/drawioXml.d.ts +40 -0
  86. package/dist-lib/types/drawio/index.d.ts +37 -0
  87. package/dist-lib/types/drawio/inflate.d.ts +12 -0
  88. package/dist-lib/types/drawio/load.d.ts +35 -0
  89. package/dist-lib/types/drawio/messages.d.ts +12 -0
  90. package/dist-lib/types/drawio/options.d.ts +44 -0
  91. package/dist-lib/types/drawio/prefixSums.d.ts +9 -0
  92. package/dist-lib/types/drawio/sniff.d.ts +16 -0
  93. package/dist-lib/types/eps.d.ts +2 -28
  94. package/dist-lib/types/epsInfo.d.ts +36 -0
  95. package/dist-lib/types/foContext.d.ts +19 -0
  96. package/dist-lib/types/foExpr.d.ts +7 -0
  97. package/dist-lib/types/fontMapping.d.ts +14 -0
  98. package/dist-lib/types/fontSanity.d.ts +15 -0
  99. package/dist-lib/types/footnotes.d.ts +17 -1
  100. package/dist-lib/types/geometry.d.ts +5 -0
  101. package/dist-lib/types/gridTracks.d.ts +51 -0
  102. package/dist-lib/types/hebrewMarks.d.ts +11 -3
  103. package/dist-lib/types/htmlImport.d.ts +84 -15
  104. package/dist-lib/types/htmlPaged.d.ts +20 -2
  105. package/dist-lib/types/htmlParserStack.d.ts +26 -0
  106. package/dist-lib/types/htmlPrepare.d.ts +14 -3
  107. package/dist-lib/types/imageFormats.d.ts +138 -0
  108. package/dist-lib/types/imageInfo.d.ts +6 -1
  109. package/dist-lib/types/imageLimits.d.ts +4 -4
  110. package/dist-lib/types/index.d.ts +9 -3
  111. package/dist-lib/types/inflateFast.d.ts +12 -0
  112. package/dist-lib/types/inlineLayout.d.ts +34 -1
  113. package/dist-lib/types/jis.d.ts +19 -0
  114. package/dist-lib/types/layoutEngine.d.ts +191 -6
  115. package/dist-lib/types/linearText.d.ts +69 -0
  116. package/dist-lib/types/lnode.d.ts +36 -0
  117. package/dist-lib/types/pageFlow.d.ts +34 -0
  118. package/dist-lib/types/paint.d.ts +3 -1
  119. package/dist-lib/types/pdfCheck.d.ts +36 -0
  120. package/dist-lib/types/pdfFlatten.d.ts +165 -0
  121. package/dist-lib/types/pdfLibPatches.d.ts +29 -5
  122. package/dist-lib/types/pdfRenderer.d.ts +61 -12
  123. package/dist-lib/types/pdfStandard.d.ts +88 -0
  124. package/dist-lib/types/pdfxVerify.d.ts +4 -0
  125. package/dist-lib/types/pixels.d.ts +21 -3
  126. package/dist-lib/types/psFilters.d.ts +4 -14
  127. package/dist-lib/types/psShading.d.ts +1 -24
  128. package/dist-lib/types/resources.d.ts +2 -2
  129. package/dist-lib/types/sourceRef.d.ts +20 -1
  130. package/dist-lib/types/strokeOutline.d.ts +32 -0
  131. package/dist-lib/types/svg.d.ts +236 -10
  132. package/dist-lib/types/svgFilterRaster.d.ts +88 -0
  133. package/dist-lib/types/svgFilterSubregion.d.ts +46 -0
  134. package/dist-lib/types/tableBorders.d.ts +33 -4
  135. package/dist-lib/types/types.d.ts +396 -11
  136. package/package.json +5 -1
  137. package/dist-lib/api-CQ3aOtc5.js.map +0 -1
  138. package/dist-lib/index.js.map +0 -1
  139. package/dist-lib/node.js.map +0 -1
package/CHANGELOG.en.md CHANGED
@@ -4,6 +4,205 @@
4
4
 
5
5
  Version numbers follow [Semantic Versioning](https://semver.org/). During 0.x, incompatible changes may also be released in a minor version (such as 0.2.0).
6
6
 
7
+ ## 0.4.0 (2026-11-19)
8
+
9
+ - **Centring with `auto` left and right margins** (HTML, every style. **Typesetting results change**): the margins were made lengths from the estimate of the containing block width at import time, so inside a table cell (where the estimate is close to the whole table width) the margins went into the content width that decides the column widths, and that column took most of the table while the other columns shrank to their minimum width (the same for boxes with a fixed width inside `<td align="center">` and `<center>`). When the place was narrower than the estimate, the margins did not shrink and the box overflowed. The margins are now shared out from the width of the place at layout time, and count as 0 when measuring the content width (CSS 2.1 §10.3.3, §10.3.7, §17.4, CSS Sizing 3 §5.1). Other changes: (1) a table with a fixed width and collapsed borders (`border-collapse: collapse`; tables in the default style `kumiori` are collapsed too) centred with `margin: 0 auto` or `align="center"` moves right by the width of its outer border, and the space left and right is now equal (it was shifted left by the part of the border that sticks out; 0.75pt for a table with `border="1"`, 6pt for a 6pt outer border) (2) a table with only `margin-left: auto`, and absolutely or fixed positioned boxes with `left`, `right` and `width` all set, go to the right (they stayed on the left) (3) floated tables and `display: inline-table` tables are not centred by `auto` margins (they were centred; in CSS 2.1 §10.3.5 and §10.3.9 `auto` margins are 0) (4) inside right-to-left text (`direction: rtl`), a box or table wider than its place overflows to the left (it overflowed to the right; by the rule of §10.3.3 the `auto` margins become 0 and `margin-left` is solved again, as in Chrome) (5) a box inside a vertical parent is centred top to bottom by `auto` in `margin-top` and `margin-bottom` (the left and right `auto` were read) (6) a box or the rest of a table that runs onto a page of a different width (such as after `:first`) is centred again for the width of that page (it kept the margins of the first page)
10
+ - **The base of percentages** (HTML, every style. **Typesetting results change**): percentages in `width`, `max-width`, `min-width`, `padding`, `margin` and `text-indent` (and `calc()` with percentages) were made lengths from the estimate of the containing block width at import time (which takes off only what normal-flow blocks take), so inside floats, inline-blocks, absolutely positioned boxes, flex and grid items, columns of a multi-column box and table cells the width of the outer box was the base, and boxes overflowed (a `width: 50%` box in a column of `columns: 2` took the full column width; `width: 50%` in a 100pt grid column was 150pt). For an element that names a page with `page` (`@page body { margin: … }`), the base was also the page area of the unnamed `@page`. They are now resolved at layout time against the actual containing block where the box is placed (CSS 2.1 §10.2, §8.3, §8.4, §10.4, CSS Paged Media 3 §10.1; in vertical text the base of `padding` and `margin` is the height of the containing block, CSS Writing Modes 4 §7.2; inside a page-margin box the base is the margin box). When measuring the content width, percentage widths count as `auto`, `padding`, `margin` and minimums as 0, and maximums as none (CSS Sizing 3 §5.2.1). Also: (1) percentages in `width` and `max-width` of images are resolved against the width of the box that sets the line (the default style's `img { max-width: 100% }` now works inside grid columns and columns of a multi-column box; it was resolved against the body width and the image overflowed the column) (2) a table or image with `width="100%"` in a cell of an auto-layout table does not widen the outer table (it widened the column of that cell nearly to the page width; as in browsers) (3) the column count from `column-width` and percentages in `column-gap` are decided by the width at layout time too (`columns: 40pt` in a cell about 110pt wide: 3 columns → 2) (4) percentages of normal-flow blocks in the body are the same as before
11
+ - **Pages with different margins, and fixed boxes** (HTML, every style. **Typesetting results change**: only documents with pages whose margins or sizes differ by `:first`, `:left`, `:right` or named pages): percentage widths and margins, and the position and size of fixed boxes (`position: fixed`), were decided on the page area of the unnamed `@page`, so on a `:first` page with wider margins a `width: 100%` box and fixed boxes overflowed the body area. They are now decided on the page area of the page where the box is placed, and a box that runs over pages is resolved for each fragment with the width of its page (CSS Paged Media 3 §3, CSS Fragmentation 3 §5.1; fixed boxes are placed again on each page)
12
+ - **Content widths (min-content and max-content)** (HTML, every style. **Typesetting results change**): boxes sized by their content (columns of auto-layout tables, floats, inline-blocks, `width: max-content` and so on) counted the following wrongly. (1) A block whose width is given as a length inside a cell of an auto-layout table was counted by the length of its lines, not by the width of the box (the box overflowed the cell). The outer width of the box (width and margins) is now counted. Percentage widths count as `auto`, and `max-width` and `min-width` given as lengths limit the content width (CSS Sizing 3 §5.1, §5.2.1) (2) the max-content width of a list (`ul`, `ol`, elements with `display: list-item`) in a cell was counted as the full length of the measuring line (the whole table width), so the other columns shrank to their minimum width. The indent plus the content width of the items is now counted (the same with or without markers) (3) the width of an inline-block is decided by shrink-to-fit, as for floats (a list inside took the full page width) (4) the content width of a grid container is decided by its length columns and the content widths of its `fr` and `auto` columns (a grid inside a float took the full page width) (5) the content width of a paragraph with `text-align-last: justify` or `text-align: justify-all` does not count the length added by justification (a cell with a heading spread by justification took the whole table width) (6) a vertical inline-block with `auto` height is as long as its content (it was longer than its content). Column widths of XSL-FO tables do not change
13
+ - **Propagation of breaks (`break-before`, `break-after`, `break-inside`)** (HTML, every style. **Typesetting results change**: only documents with breaks): as in CSS Fragmentation 3 §3.1.1, they now propagate out of tables, rows of flex and grid containers, and multi-column boxes. (1) Tables: `break-before` on the first child and `break-after` on the last child of a cell become the break before and after the row (they were not read; as in Chrome), and the break before the first row and after the last row becomes the break before and after the table. Breaks on `tr` and on `thead`, `tbody` and `tfoot`, and `break-inside: avoid` on them, are read too (`break-before` on the first row or the first `tbody`, `break-after` on the last row, and breaks between `tbody` elements did not work). In a table with a `thead`, a forced break at the first body row (on `tr`, `tbody` or the first child of a cell) starts the table, header included, on the next page (`tr` and `tbody` did not break, and the first child of a cell left only the header on the previous page) (2) flex and grid: `break-before` and `break-after` on an item break before and after the row of that item (`break-before` on a grid item sent only that item to the next page, and `break-after` on a flex item did not work). `break-inside: avoid` on an item and `break-after: avoid` on the last item work too (3) multi-column boxes: `page`, `left` and `right` in `break-before` and `break-after` inside go to the first column of the next page (before, `page` went to the next column on the same page, and `left` and `right` went to the next page without a blank page (landing on the wrong side) when the current page was already on the requested side, and to the next column on the same page otherwise). A break on the first child becomes the break before the multi-column box. In a balanced multi-column box, the column height stays within the rest of the page even when an unbreakable block falls on the boundary between columns (the first column overflowed the bottom of the page) (4) `left` and `right` at the same break point take the value of the later element, once (CSS Fragmentation 3 §4.3; both used to apply and an extra blank page went in: `break-after: left` with `break-before: right` gave 4 pages, now 3)
14
+ - **Named pages (`page`) and renumbering pages** (HTML, every style. **Typesetting results change**: only documents written as below): (1) `page` on `body` and `html` is read, and the document starts on that page (CSS Paged Media 3 §8.1; it was not read) (2) `page` on list items (`li`) switches the page too (3) `page` where the page cannot be switched (table rows, flex and grid items, boxes inside multi-column boxes and table cells, and so on) is reported in the warnings as unsupported CSS instead of being ignored silently (4) `counter-reset: page` on `body` and `html` gives the number of the first page (it was not read) (5) where pages of the same name follow each other, a box whose `page` names the same page and that has a forced page break and `counter-reset: page` renumbers the pages too (it did not; `counter-reset: page` on a box without `page`, inside unnamed pages, still does not renumber) (6) also in documents without `page`, when the first content of `body` was text not wrapped in an element, the next block was sent to the second page (it is now set on one page) (7) in HTML, no blank page is inserted for renumbering pages (the page counter of CSS Paged Media 3 §6.1 has no rule that inserts blank pages; blank pages come only from `left`, `right`, `recto` and `verso` of `break-before` and `break-after`: CSS Fragmentation 3 §3.1), and left and right pages (the choice of `@page :left` and `:right`, the blank pages of `left`, `right`, `recto` and `verso` breaks, and `inside` and `outside` of `float` and `text-align`) are decided not by the parity of the page number but by the order of the pages from the start of the document (which sheet it is; a blank page counts as one) (CSS Paged Media 3 §3.3: left and right pages alternate, and the first page is a right page; in a vertical (`vertical-rl`) document it is a left page; right-to-left horizontal (`direction: rtl`) documents also start on a right page, while in §3.3 they start on a left page). Renumbering the pages does not change the left and right of the spreads. When 0.3.0 switched to a page of another name and renumbered the pages, it inserted a blank page at the end of the previous pages to match the parity of the new number (making the page after page 1 page 5 gave "1 | blank | 5", now "1 | 5"; page 5 is the second sheet, so it is a left page), and it decided left and right by the parity of the page number. **Typesetting results change**: documents that renumber pages no longer get blank pages for the renumbering, and the `:left` and `:right` of the pages after the renumbering and the blank pages of `left` and `right` breaks change (usually there are fewer pages, but there can be more; `break-before: right` that renumbers to 4 gave "1 | blank | blank | 5", now "1 | blank | 4"). In documents whose first page number is even (`counter-reset: page 2` on the first element, and so on), the left and right of every page are swapped (the first page is set as a right page instead of a left page, and the pages alternate from there). A `break-before: right` at the start of the document gets no blank page before it, and the blank pages of later `left` and `right` breaks move (a document with `counter-reset: page 2` on the first element and a later `break-before: right` goes from 2 pages to 3). Documents that do not renumber pages do not change. The compatibility styles (`--style ah`, `weasyprint`, `vivliostyle`) and XSL-FO are as before (they insert the blank page before renumbering, and decide left and right by the parity of the page number)
15
+ - **Grid columns (`grid-template-columns`)** (HTML, every style. **Typesetting results change**: only documents with grids. How column widths are decided is detailed in section 13.2 of the HTML and CSS volume of the Conformance Guide):
16
+ - `em`, `rem` and `calc()` in column sizes, and relative lengths inside `minmax()`, are made absolute in the computed value (such a column was treated as `1fr` and shared equally: with 10pt text, `5em 1fr` 300pt wide went from 150 + 150pt to 50 + 250pt; CSS Values 4 §6)
17
+ - `0fr` is no longer made `1fr`, and when the `fr` factors add up to less than 1, only that share of the remaining space is divided (`0.2fr 0.3fr` 300pt wide went from 120 + 180pt to 60 + 90pt; CSS Grid 1 §12.7.1)
18
+ - the number of repetitions of `repeat(auto-fill, minmax(100px, 1fr))` is counted from the container width (300pt wide: 3 columns of 100pt → 4 columns of 75pt; CSS Grid 1 §7.2.3.2)
19
+ - line names (such as `[a]`) are not counted as columns (they were counted as `1fr` columns: the two items of `[a] 100pt [b] 1fr` 300pt wide went from 50pt and 100pt to 100pt and 200pt). `minmax()` with a function holding commas, such as `minmax(min(100%, 200px), 1fr)`, is read too (CSS Grid 1 §7.2)
20
+ - a `minmax()` column whose maximum is a length is grown up to that length first, and the rest goes to the other columns (`minmax(100px, 200px) 1fr` 400pt wide went from 200 + 200pt to 150 + 250pt; CSS Grid 1 §12.6). The factor of `minmax(0, 2fr)` is 2 (it was 1: `minmax(0, 2fr) 1fr` 300pt wide went from 150 + 150pt to 200 + 100pt)
21
+ - invalid track lists (negative lengths, nested `repeat()`, `minmax()` with an `fr` minimum, `auto-fill` with `fr`, and so on) drop the whole declaration, and the previous declaration stays (CSS Grid 1 §7.2, CSS 2.1 §4.2; a negative column was read as 0: `-10px 1fr` after `100pt 100pt` went from a 0pt column and a column with the rest to 100 + 100pt)
22
+ - a column whose math function (`min()`, `calc()` and so on) gives a negative result becomes a 0 column, without dropping the declaration (CSS Values 4 §10.12; `min(10px, -5px) 1fr` 300pt wide was not read and the previous declaration (`100pt 100pt`) stayed → 0 + 300pt)
23
+ - very large `fr` factors and percentages (`1e307fr`, `1e400%` and so on) are clamped to values that can be handled (the column widths became Infinity or NaN; CSS Values 4 §10.9)
24
+ - the column widths are decided from the actual content width of the container at layout time (they were decided from the width estimated while importing (the body width and so on), so inside flex items, table cells and grid items the columns overflowed the container: `1fr 1fr` in a `flex: 1` item next to a 250pt sibling in a 400pt flex container went from 200 + 200pt to 75 + 75pt)
25
+ - the width of a grid inside a box sized by its content, such as a float or an inline-block, is decided from the content widths (max-content) of the items of all the rows (it took the full body width: `1fr 1fr` with one letter in each item inside a float went from 240.9 + 240.9pt to 5 + 5pt; items spanning columns with `grid-column: span 2` are counted too; CSS Grid 1 §12.7.1)
26
+ - `fr` and `auto` columns are not made narrower than the automatic minimum size of their items (the narrowest width of the content, such as a long word or a table) (they were shared equally and the word ran into the next column: in `1fr 1fr` 150pt wide, the column of a long word went from 75pt (the word overflowing by 78.3pt) to 153.3pt; when the minimums add up to more than the container, the grid overflows; CSS Grid 1 §6.6, §12.7.1). Children of an item with `width: 100%` and images with the default `img { max-width: 100% }` do not widen the column
27
+ - the column of an item with `min-width` or a length `width` is not made narrower than that width (the columns were shared equally and the item ran into the next column: in `1fr 1fr` 300pt wide, the column of an item with `width: 200pt` went from 150pt to 200pt, and the next column is 100pt; CSS Grid 1 §6.6)
28
+ - a `minmax(auto, 80px)` column grows up to its maximum of 80px, and the minimum measured from the content is limited to 80px too (it was treated as `1fr` and shared equally: `minmax(auto, 80px) 1fr` 300pt wide went from 150 + 150pt to 60 + 240pt; the column of an item with `min-width: 150px` is 112.5pt, the minimum not being limited; CSS Grid 1 §6.6, §12.5)
29
+ - `auto` columns are still counted as `1fr` and shared, so an image that is itself an item in an `auto` column (with the default `max-width: 100%`) shrinks to the shared column width (a 600×400px image in `auto 1fr` 300pt wide went from 300pt (running into the next column) to 150pt; Chrome widens the `auto` column to the image, 295pt)
30
+ - known limitation: the number of repetitions of `repeat(auto-fill, …)` and `repeat(auto-fit, …)` is still decided from the width estimated while importing, so where the container is narrower than the estimate, the columns may overflow the container (`repeat(auto-fill, minmax(100px, 1fr))` in a `flex: 0 0 110pt` item has 6 columns of 75pt, counted from the 481.9pt body width)
31
+ - large grids take longer to set (a 4-column grid of 3,200 items takes about 1.7 times as long as in 0.3.0; the content widths of the items are measured at layout time to decide the column widths)
32
+ - **Image sizes** (HTML, every style. **Typesetting results change**: only images written as below. How the sizes are decided is detailed in sections 3.5 and 13.1 of the HTML and CSS volume of the Conformance Guide):
33
+ - the `width` and `height` attributes of `img` and `object` are read as presentational hints (HTML §15.4.3), and the author's CSS `width` and `height` take priority over the attributes (an image with 600×400 attributes and `style="height: 100pt"` in a 200pt wide place went from 200×44.4pt to 200×100pt with the default style `kumiori`)
34
+ - an image with attributes whose width is shrunk by the default style's (`kumiori`) `img { max-width: 100% }` shrinks its height by the aspect ratio too, as in 0.3.0 (an image with 600×400 attributes in a 200pt wide place is 200×133.3pt; also inside grid items, multi-column boxes and table cells; CSS 2.1 §10.4)
35
+ - an image with attributes whose width is shrunk by the author's `max-width` (also `max-inline-size`) keeps the height of the attribute (as in browsers: with the author's `img { max-width: 100% }`, an image with 600×400 attributes in a 200pt wide place went from 200×133.3pt to 200×300pt; with `height: auto` in CSS it shrinks by the aspect ratio as before; CSS 2.1 §10.4)
36
+ - flex containers shrink image items (they did not, and the image ran into the next item). The height of the shrunk image stays the height of the attribute (as in Chrome; CSS Flexbox 1 §9.7): in a 200pt wide container, an image with 600×400 attributes and `min-width: 0` next to a 150pt item went from 200×133.3pt to 50×300pt. An image with `flex: 0 0 100pt; min-width: 0` (also `flex-basis: 50%`) went from 200×133.3pt to 100×300pt
37
+ - flex also shrinks images with `overflow: hidden`, images with a length `min-width` (`min-width: 40pt` in the example above gives 50×300pt), and, even without a next item, images with `min-width: 0` whose own padding, border and margin make the item wider than the container (160×300pt with 10pt padding, a 5pt border and a 5pt margin)
38
+ - an image item with a width (also by attributes) in a flex container is placed without shrinking below its automatic minimum size (only the item width was shrunk and the image ran into the next item: in a 200pt wide container, an image with `width: 150pt` next to a 150pt item makes the next item shrink to 50pt; CSS Flexbox 1 §4.5)
39
+ - the automatic minimum size of an image that is itself a flex item is limited by a length `max-width` (it was not, for images whose size is not known while importing, such as `data:` SVG: a 300×200px image with `flex: 0 0 30%; max-width: 50px` went from 225pt (running into the next item) to 37.5pt; as in browsers; CSS Flexbox 1 §4.5)
40
+ - an image with `flex: 1` grows, and its height stays the height of the attribute (it did not grow: in a 200pt wide container, an image with 20×10 attributes went from 15×7.5pt to 200×7.5pt; as in Chrome; CSS Flexbox 1 §9.7)
41
+ - an image with attributes widened by `min-width` or `min-height` keeps the other size of the attribute (it was widened by the aspect ratio: an image with 100×50 attributes and `min-width: 150pt` went from 150×75pt to 150×37.5pt, and with `min-height: 100pt` from 200×100pt to 75×100pt; as in browsers; CSS 2.1 §10.4)
42
+ - an image with attributes for which the author writes only `max-height` has only its height limited (it was shrunk by the aspect ratio: an image with 600×400 attributes and `max-height: 100pt` in a 500pt wide place went from 150×100pt to 450×100pt; as in browsers). When the default style's (`kumiori`) `max-width` shrinks the width too, the aspect ratio is kept as before (150×100pt in a 200pt wide place)
43
+ - for `min-*` and `max-*` on an image with only one size given, the given size is changed only by its own `min-*` and `max-*`, and the other comes from the aspect ratio and then gets its own `min-*` and `max-*` (an image with a 2:1 aspect ratio and `width: 40pt; max-height: 10pt` went from 20×10pt to 40×10pt; CSS 2.1 §10.4, §10.3.2, §10.6.2)
44
+ - images that cannot be read and SVG without a size are sized by the aspect ratio of the attributes (an image with 200×100 attributes and `width: 100pt; height: auto` went from 100×75pt to 100×50pt; HTML §15.4.3)
45
+ - `width="0"` and `height="0"` (and 0 in CSS) are valid sizes (0 was taken as no size, and the image was drawn at its natural size; CSS 2.1 §10.2)
46
+ - **Relative lengths, `calc()` and percentages in values** (HTML, every style. **Typesetting results change**: only documents written as below): values that kept relative units in the computed value, which the reading side could not read and dropped, are now made absolute lengths (`calc()` with percentages becomes a sum of a percentage and a length) and read (CSS Values 4 §6, §10.11; none of them gave a warning). (1) Lengths such as `em` and `rem` in `background-size` (the background image was drawn at its natural size as if no size were given: an icon with `background: url(icon.svg) no-repeat 0.65em center / 1.25em 1.25em` was drawn large over the text; CSS Backgrounds 3 §3.9; percentages and `auto`, `cover`, `contain` stay as they are) (2) lengths in `em`, `rem`, `calc()` and `var()` in `box-shadow` and `filter: drop-shadow()` (the shadow was not drawn) (3) `calc(percentage ± length)` in `border-radius`, `background-position` and `background-size` (they were dropped) (4) percentages, `calc()` and font-size keywords in declarations of page-margin boxes, `@footnote`, `::footnote-call` and `@page` (`@top-center { font-size: 150% }` stayed at 10pt). `em` in a page-margin box is based on the font size of the page context (`@page`) (5) percentages in `letter-spacing` and `word-spacing` are relative to the font size (CSS Text 4 §8.1, §8.2; they were relative to the containing block width, and letters were spaced far apart)
47
+ - **Zero and negative values** (HTML, every style. **Typesetting results change**: only documents written as below): (1) `font-size: 0` is a valid value and the text is set at size 0 (CSS Fonts 4 §2.4; with `line-height: normal` the line height is 0 too. 0 was dropped and the parent font size kept, so a paragraph hidden with `font-size: 0`, such as a paragraph marking a page break, took the height of a line) (2) `rowspan="0"` spans all the remaining rows of the row group (HTML §4.9.11; it spanned 1 row) (3) negative values of properties where they are invalid (`padding`, `width`, `height`, `min-*`, `max-*`, `gap`, `column-width`, `flex-basis`, border widths, `font-size`, `background-size`) drop the whole declaration (they were used, and `padding-left: -10pt` pushed the content out to the left). A negative result of `calc()` becomes 0 (CSS Values 4 §10.12)
48
+ - **Sizes of gradient backgrounds** (HTML, every style. **Typesetting results change**: only documents with `background-size` on a gradient background, or a gradient background on `html` or `body`): percentages in `background-size` of a gradient background are read, and a size of 0 draws nothing (the whole box was painted). Gradient backgrounds of `@page` read `background-size` and repetition too. Gradient backgrounds of `html` and `body` are drawn on the page like other backgrounds (they were not drawn; CSS Backgrounds 3 §2.11.1)
49
+ - **Area Tree types** (typesetting results do not change): to carry the `calc(percentage ± length)` above, the area types were widened. The radii in `corners` of `borderRadius` may now be a sum of a percentage and a length, `{ pct, len }` (`pct` is the percentage number, 10 for 10%; `len` is in pt; they were only lengths or percentage strings; the type is `RadiusLength`). `backgroundImage` (and the images in `under`) gained `xOffset` and `yOffset` (lengths added to percentage positions) and `widthOffset` and `heightOffset` (lengths added to percentage sizes), and `fitPosition` of image areas gained `xOffset` and `yOffset` (lengths added to percentage positions; all in pt). The version of the Area Tree JSON (3) does not change
50
+ - **API**: added `typesetToPdf(text, options, pdfOptions)`, which makes only the PDF, and `Typesetter.typesetToPdf` on the container (the same PDF, warnings and page count as calling `toPdf(pdfOptions)` after `typeset`; the result is `{ pdf, pageCount, warnings, layoutMs }`, of type `TypesetPdfResult`). It turns the pages into area trees one at a time, writes each and releases it, so it never holds the area tree of the whole document, and documents of thousands of pages use less memory. `layoutMs` does not include the time to turn the pages into area trees. The type of the `toPdf` options is now exported as `PdfOptions` (unchanged in content)
51
+ - **Low-memory mode** (the command's `--low-memory`, `lowMemory` of the API's `typesetToPdf`; type `TypesetPdfOptions`): the re-layouts that settle page number references do not reuse the pages of the previous pass, and the intermediate layout tree of each page-sequence is released once it has been laid out. From the second pass on, the static content is laid out and the pages are turned into area trees as each page-sequence is finished, to collect the fonts and images used (collected again if the pass does not settle). After the passes settle, the document is laid out once more to write the PDF. The PDF and the warnings are the same as with reuse. For the FO of the PostgreSQL documentation (3,231 pages), the maximum live heap goes from about 2.3GB to about 0.9GB (the most is used while reading the FO; it can be typeset with a 1GB heap limit), and the time from 160 s to 231 s (with a 4GB limit)
52
+ - **HTML default style** (changes the typeset result only for documents typeset with the default style `kumiori` whose author sets the font or alignment on `html` (`:root`)): the default style's font (`serif`) and alignment (`justify`) are now set on `html` instead of `body`. An author's `html { font-family: … }` or `html { text-align: … }` used to be overridden by the default value on `body` and never reached the document (the browser default style sets neither on `body`, so in a browser the author's value applies; CSS Cascade 4 §6.1, §7.2). Documents that set neither, or set them on `body`, do not change. The Python 3.14 documentation typeset with Sphinx's print CSS (`html { font-family: Fira Sans }`) now has its body text in Fira Sans instead of the default font (Tinos)
53
+ - **vertical-align of inline boxes** (changes the typeset result for HTML documents that set the values below on inline text elements): `vertical-align: top`, `bottom`, `middle`, `text-top` and `text-bottom` are now read for non-replaced inline boxes (`span`, `::before` and so on; CSS 2.1 §10.8.1; horizontal lines. Previously they were all silently aligned to the baseline. `top`, `bottom` and the others were already read for images). An inline box is the line-height box (the first available font's ascent and descent plus the half-leading). `top` and `bottom` align the box of the element and its contents (the aligned subtree, per line fragment) with the top or bottom of the line box, and widen the line if it is taller. `middle` aligns the box's centre with the parent's baseline plus half the x-height, and `text-top` and `text-bottom` align the box's top or bottom with the top or bottom of the parent's content area. The "•" in the table of contents of Sphinx's print CSS (`font-size: 30pt; line-height: 10pt; vertical-align: bottom`) now sits in the middle of the line instead of floating above it, and no longer widens the line (as in WeasyPrint and Chromium). Images and inline-blocks that are themselves `top` or `bottom` inside a `top` or `bottom` element are not put in the outer element's subtree, and each is aligned by its own value
54
+ - **@page padding** (changes the typeset result only for HTML documents that set `padding` in `@page`): the padding of the page box (`padding` and the four sides such as `padding-top`) is read, and the body area shrinks by it. Margin boxes (`@top-center` and so on) sit in the page margin, so they do not move. Before, it was ignored (with `@page { padding-top: 1em }` of the Sphinx print CSS, the body started just below the page margin, about one line higher than WeasyPrint). Percentages are against the page width for left and right, and against the page height for top and bottom. Negative values are invalid
55
+ - **Targets of target-counter()** (changes the typeset result only for HTML documents that refer to targets with two or more `#`, such as `href="#a#b"`): the target id is looked up by the URL fragment (everything after the first `#`; `a#b` for `#a#b`), the same way as link targets. Before, it was looked up by the part after the last `#` (`b`), so table-of-contents entries whose links do not resolve still got page numbers (such as `href="#document-tutorial/interpreter#invoking-the-interpreter"` in the table of contents of Sphinx single-file HTML; such references now give "?" and a warning, like other missing references)
56
+ - **Percentages of top and bottom for relative positioning** (changes the typeset result only for HTML documents that set `top` or `bottom` as a percentage on a `position: relative` box): when the height of the containing block is definite, the box is offset by that percentage of the height. With a containing block of indefinite height, it stays auto (no offset) as before. The height counts as definite for boxes whose `height` is a length, and for flex items stretched to the container height (items with auto height and stretch in a one-line container whose line has the container height). The containing block is the nearest block ancestor (CSS 2.1 §10.1). The `height` of inline elements and of `display: contents` elements is not used (inside inline elements, boxes are still not offset). Flex and grid items, however, are block boxes even when their `display` is an inline value (such as a `span`), so they become containing blocks (CSS Display 3 §2.7). Before, percentages were not read and the box was not offset
57
+ - **WeasyPrint behaviour** (changes the typeset result only for HTML documents typeset with `--style weasyprint`): to match WeasyPrint, (1) lines that hold only empty markers (such as `<span id="…"></span>`) break margin collapsing (the margins before and after are added; the other styles collapse them as the CSS specification says), (2) `target-counter()` references whose target is not found give empty text (the other styles give "?"; both warn), and (3) when a wrapping flex container (`flex-wrap: wrap`) of definite height has a single line, the line gets the container height whatever `align-content` is (the other styles do so only for `align-content` `normal` and `stretch`, as the specification says). In documents with the Sphinx print CSS, the space before headings, the deeper table-of-contents entries and the position of the cover title become the same as in WeasyPrint
58
+ - **Reading declarations of margin boxes and @footnote** (changes the typeset result only for HTML documents written as below): they are read the same way as for document elements. (1) Border longhands of margin boxes (such as `@top-right`): `border-bottom-width`, `-style`, `-color`, and `border-width`, `border-style`, `border-color`. Before, only the shorthands (`border`, `border-bottom` and so on) were read, and borders written with longhands were not drawn (the line under the header of the Sphinx print CSS). (2) Translucent border and background colors of margin boxes are drawn over what is below, instead of as an opaque color mixed with white paper. Background color names (such as `red`) are read too (before, only colors starting with `#`). (3) Longhands of the `@footnote` separator (such as `border-top-width`), and the `margin` and `padding` shorthands
59
+ - **Properties of the page context, margin boxes and @footnote** (changes the typeset result only for HTML documents that use the properties below): properties of CSS Paged Media 3 Appendix A that apply to the page context and margin boxes, and were not read, are read now. (1) `border` of `@page` (shorthands and longhands; the initial width is `medium`; drawn inside the page margin, and the body area shrinks by its width) and `outline`, (2) `background-image` of margin boxes (url() and gradients, also via the `background` shorthand; the initial position is the top left) and `outline`, (3) `min-width`, `max-width`, `min-height` and `max-height` of margin boxes (the widths of the boxes on the top and bottom edges are redistributed with the three boxes together), (4) `max-height` of `@footnote` (the upper limit of the footnote area height in CSS GCPM 3; footnotes beyond it move to the next page. Once a footnote has been moved to the next page by the limit, the footnotes after it move too, so footnotes stay in document order. The limit is not applied on footnote-only pages added after the end of the body; §2.4.2)
60
+ - **Initial width of borders of margin boxes and the footnote separator** (changes the typeset result only for HTML documents that set a border (such as `border: solid`) without a width on margin boxes (such as `@top-center`) or on the `@footnote` separator): a border without a width gets the initial `medium`, the same as for document elements (CSS Backgrounds 3 §3.2). The width goes from 1.5pt to 2.25pt. With `--style ah`, `thin`, `medium` and `thick` of margin boxes are 1, 3 and 5pt (the same as for document elements; the footnote separator is 2.25pt). Borders whose width is given as a length do not change
61
+ - **Nested named pages** (changes the typeset result only for HTML documents that set `page` on blocks deeper than body's children): page names are taken from in-flow blocks at any depth, not only from blocks directly under body (CSS Paged Media 3; `auto` boxes use the parent's name). In documents that wrap everything in one box (such as `div.book` of DocBook HTML), the named pages of the front matter, part title pages and the index (with their running heads and page number styles) now take effect. Enclosing boxes are split at the switch; the start margin and border stay on the first fragment and the end ones on the last. In the split fragments, `height`, `min-height`, `max-height` and `aspect-ratio` apply to the first fragment only, and boxes with `box-decoration-break: clone` also get their border and padding at the splits (CSS Break 3 §5.3, §5.4). Where nesting is too deep and has been flattened (128 levels), the page name does not change
62
+ - **Page number style of target-counter()** (changes the typeset result only for HTML documents that refer with `target-counter(…, page)` to pages numbered in another style, such as roman front matter): without a counter style the number is decimal, and a third argument (such as `lower-roman`) gives that style (CSS GCPM 3; the same as `counter()`). Before, the style argument was not read and the target page's own numbering was used
63
+ - **Page number reference text on pages reused in re-layouts** (changes the typeset result only where the error below appeared, in documents with page number references typeset in the default mode (not `--low-memory`)): in the re-layouts that settle page number references (`fo:page-number-citation` in XSL-FO, `target-counter()` in HTML), when the pages of the previous pass were reused and only the reference text was replaced, characters shifted by one could appear where the value had a different number of digits ("1" and "3" alternating where "13" should be, with the link rectangle one character too narrow). This error was already in 0.3.0. The text is now replaced only when the number of characters, the kinds of characters, the font, the advances and the widths are the same and no character that takes part in kerning is replaced; otherwise that page-sequence is laid out again. References with kerning (`font-kerning`, `axf:kerning-mode`), whose glyph positions could differ from a re-layout, are fixed too. Both now give the same result as `--low-memory`, which does not reuse pages (in a 1,082-page document, the difference in extracted text between the default and `--low-memory` goes from 360 lines to 0)
64
+ - **Border widths in WeasyPrint behaviour** (changes the typeset result only for borders whose width is not a whole number of px, in HTML documents typeset with `--style weasyprint`): border widths are not snapped to pixels (as in WeasyPrint; a `0.3pt` line is drawn 0.3pt wide). Before, as in browsers (Chrome), widths under 1px were rounded up to 1px (0.75pt) and wider ones were floored to pixels
65
+ - **Warning for footnote-display: block** (no change to the typeset result): `footnote-display: block` (the initial value in CSS GCPM 3, and exactly how Kumiori places footnotes) is no longer reported as unsupported CSS. `inline` and `compact` are still reported (the tables in chapter 16 of the conformance document are updated too)
66
+ - **Effort limit for large documents** (changes the typeset result only for large documents with more than 50,000 input nodes): the limit on the number of flows made in one layout pass (the default of `LayoutOptions.maxMeasureFlows`) is now the larger of 100,000 and twice the number of input nodes, instead of a fixed 100,000. Before, documents of thousands of pages hit the limit even without deep nesting, after which content widths were no longer measured and multicol was laid out in one column (the three-column index of the 2781-page PostgreSQL documentation became one column). Inputs whose nesting makes the effort explode are still stopped
67
+ - **break-inside: avoid rows taller than a page** (changes the typeset result only for HTML documents whose table rows or list items with `break-inside: avoid` are taller than a page): a row that does not fit even on a new page is split inside, relaxing avoid (CSS Fragmentation 3). Before, it was not split and overflowed the bottom of the page (long rows of the function tables in the PostgreSQL documentation). The Antenna House compatible style (`--style ah`) is unchanged
68
+ - **Formats of footnote calls and markers** (changes the typeset result only for HTML documents written as below): (1) rules whose pseudo-element follows a selector (such as `span.footnote-body::footnote-call`) are read too (before, only `::footnote-call` and `*::footnote-call` were read, and the size and content of the call were missed). (2) When the contents of `::footnote-call` and `::footnote-marker` differ, the marker at the start of the footnote body uses the `::footnote-marker` format (before, it used the call's format, and the ". " of `counter(footnote) ". "` was lost). Which footnotes a rule naming elements applies to is described in the item "Footnote number formats per footnote" below
69
+ - **Column balancing and lines taller than a column** (changes the typeset result only for multicol with a line taller than the average column height, such as a large inline image): when searching for the smallest column height that fits the column count, a height at which a line did not fit even at the top of an empty column (and overflowed) no longer counts as fitting. Before, a column height lower than that line was chosen, the line overflowed the column, and "a line does not fit on the page" was reported (the three-column index of the PostgreSQL documentation)
70
+ - **Position of background images of @page and margin boxes** (changes the typeset result only for HTML documents with a background image in `@page`, a margin box or the root element (html, body)): the position, the size (percentages, `cover`, `contain`) and the origin of repetition of the `@page` background image are determined inside the page margin and border (the padding area of the page box) (CSS Paged Media 3 §3.1; CSS Backgrounds 3 §2.8, §2.9; it is still painted up to the bleed). Before, the sheet was the reference, so even in documents that give a position, the position was measured from the edges of the sheet (when the top and bottom or left and right margins differ, the `center` position changes too). The background of margin boxes was already relative to the padding area of the box. Without a position the image is placed at the initial top left (`0% 0%`; before, the `@page` background was centered on the sheet). With one value, the other axis is `center` (before, it was the top or left edge). Length positions (such as `10mm 20mm`), positions with offsets from the edges (such as `right 10px bottom 5px`), and `em`, `rem` and `calc()` in positions are read too. Declarations with values that cannot be made into lengths are invalid. Percentages of `background-size` are read too (backgrounds of `@page`, margin boxes and the root element). For a `@page` background with `background-attachment: fixed`, the page box including its margins (the whole trimmed sheet; the trim corners even with bleed) is the reference for the position and size (CSS Paged Media 3 §3.1; both the longhand and `fixed` in the `background` shorthand are read). `fixed` on document elements is still unsupported (painted like `scroll`). When `background-size` (`cover`, `contain`) is given for the background of `@page`, a margin box or the root element without `background-repeat`, the image repeats, as the initial value `repeat` says (CSS Backgrounds 3 §2.4; 0.3.0 did not repeat with `cover` or `contain`). So `@page { background: url(…); background-size: cover }`, which covered the whole sheet with one image in 0.3.0, now repeats an image sized to the area inside the margins over the margins and the bleed as well. To cover the whole sheet with one image, give `background-attachment: fixed` and `no-repeat`
71
+ - **Footnote number formats per footnote** (changes the typeset result only for HTML documents that give different `::footnote-call` and `::footnote-marker` formats to different kinds of footnotes): the formats of the call and the marker at the start of the footnote body (the text around the number and the counter style in content), and the size and so on of the call, come from the rules that match that footnote element (layered by specificity and order; CSS GCPM 3 §2.6, §2.7). Rules that name elements (such as `.a::footnote-call`) apply only to the footnotes they match, and footnotes they do not match get the default format (the same as 0.3.0). Rules without a selector (`::footnote-call`, `*::footnote-call`) apply to all footnotes. How the marker at the start of the footnote body is placed (`list-style-position` of `::footnote-marker`) is also decided per footnote. Before, one format for the whole document was used for every footnote
72
+ - **Continuation pages for footnotes and floats** (changes the typeset result only for documents whose continuation of footnotes and floats after the body runs beyond 50 pages): the pages added after the end of the body for the continuation of footnotes and floats are no longer cut off at 50 pages; pages are added until the continuation has been placed (0.3.0 dropped what went beyond 50 pages; in single-column flows and multicol alike). When no progress is made because footnotes or floats cannot be placed on any page (what is carried over does not change for 3 pages in a row), it stops, with a warning giving the number of footnotes and floats dropped. As a safeguard, the number of pages is limited to twice the sum of the number of indivisible units (lines and boxes without children) of the footnotes carried over and the number of floats carried over (not less than 50 pages). The effort of splitting a long footnote onto continuation pages is now proportional to the size of the footnote (it was quadratic in the number of lines: a footnote of 40,000 lines (200KB) took 218 s, and now takes 2.3 s). Splitting a footnote with a very large number of lines (such as 200,000) no longer stops with an exception (RangeError) (a bug since 0.3.0)
73
+ - **Border widths of the default style** (changes the typeset result for borders whose width is not a whole number of px, in HTML documents typeset with the default style `kumiori`): border widths are not snapped to pixels (a `0.3pt` line is drawn 0.3pt wide and a `1pt` line 1pt; a PDF has no screen pixels). Before, as in browsers (Chrome), widths under 1px were rounded up to 1px (0.75pt) and wider ones were floored to whole px. The styles that follow browsers (`browser`, `browser-margin`, `vivliostyle`) still round. In documents with many thin borders, line positions and page breaks change (the English conformance guide goes from 127 to 125 pages)
74
+ - **hsl() and hsla() in XSL-FO** (changes the typeset result only for XSL-FO documents typeset in compatibility mode (`--compat antenna`) that use `hsl()` or `hsla()` for colors): these Antenna House extension color functions are read (only a hue without a unit (degrees) is read, and values with a unit (`deg`, `turn`, `rad`, `grad`) are reported as unreadable colors; saturation, lightness and alpha are 0%–100% or 0.0–1.0). Before, they were dropped as unsupported colors. In spec mode they are reported as values read only with the compatibility option
75
+ - **The lh unit in XSL-FO** (changes the typeset result only for XSL-FO documents that use `lh` in lengths): in compatibility mode (`--compat antenna`), any length (`space-before`, `space-after`, `margin-*`, positions, sizes and so on) is read relative to the line height of the element (`font-size` is relative to the parent's line height; it cannot be used in `line-height`, which is not read and is reported; before, only border widths were read, and other lengths were dropped as unsupported). As `lh` is not a unit of XSL 1.1, in spec mode it is not read and is reported (before, border widths were read)
76
+ - **Warnings for missing targets** (no change to the typeset result): warnings for missing targets of page number references (`target-counter()`, `fo:page-number-citation`) and bookmarks are grouped into one line per kind (the count and the first 10 ids). Before, one line per id was given, which came to thousands of lines in documents with many references to missing targets
77
+ - **Condensing in XSL-FO (overflow="condense")** (changes the typeset result only for XSL-FO documents typeset in compatibility mode with `overflow="condense"` on `fo:block-container`): this Antenna House extension is read. When the content exceeds the height to fit in, the font size or the line height is reduced to fit, by the methods of `axf:overflow-condense` (`font-size` (default), `line-height`). The height to fit in is the height of a container whose `height` or `max-height` is definite (also in table cells, list item bodies and `fo:static-content`, and in absolutely positioned containers; `min-height` if `max-height` is less than `min-height`). A container of indefinite height is fitted into the body area (one page) if it is a keep-together container in the body flowing onto pages; otherwise it is not condensed and a warning is given. Font sizes given as absolute values inside are not changed (a font size written on the container itself is condensed). Inner condensing containers are not changed by the outer condensing. Nor are the font size and line height of elements with `axf:overflow-condense="none"` (`fo:inline`, `fo:block` and so on) and their content. Lower limits are `axf:overflow-condense-limit-font-size` (a length) and `-limit-line-height` (a ratio to the font size), with an initial value of 0. A method with a lower limit reduces down to the limit, and if the content still does not fit at the end, it is left overflowing with a warning (with `hidden` or `error-if-overflow` after the limit, it is clipped, with the box height set to `height`, or without it to the height to fit in, but not less than `min-height`; `repeat` is reported as unsupported). A method without a lower limit that cannot make the content fit at all does not reduce (if no method makes it fit, it is left overflowing with a warning). `axf:overflow-condense` (except `none`) and `-limit-*` are inherited by child elements. In nested condensing, the result of condensing the same container under the same conditions is reused, and the number of content measurements made for the inner containers is limited per outermost condensing container (the larger of 10,000 and 40 times the number of nodes inside that container; ordinary nesting of two or three levels does not hit it however many inner containers there are). When the limit is hit, the remaining containers inside that container are laid out without condensing, and one warning is given only if containers that do not fit because they were left uncondensed this way remain in the result placed on the pages (other outermost containers are still condensed; condensing containers in static content laid out on every page are counted afresh on each page, so they do not hit the limit however many pages there are). Before, it was unsupported and the content overflowed. Condensing in vertical writing, `font-stretch`, `letter-spacing` and condensing in `fo:inline-container` are reported as unsupported. In spec mode it is not read and is reported
78
+ - **Breaks and span="all" in XSL-FO multi-column containers** (**changes the typeset result** only for XSL-FO documents with `page`, `even-page` or `odd-page` of `break-before` / `break-after`, or `span="all"`, inside an `fo:block-container` with `axf:column-count` (the Antenna House extension for multi-column layout); in spec mode and in compatibility mode): (1) `page`, `even-page` and `odd-page` inside the columns are page breaks (XSL 1.1 §7.20.1, §7.20.2, §4.8: the first (last) area generated by the FO is placed first (last) on a page). Before (since 0.3.0), `page` was a column break to the next column on the same page, and `odd-page` and `even-page` went to the next page without a blank page (of the wrong parity) when the current page already had the requested parity, and to the next column on the same page otherwise. Now the remaining columns are left empty and the content continues in the first column of the next page (a blank page is inserted when the parity does not match, and the page master with `blank-or-not-blank="blank"` applies to it), and the column set before the break is not balanced. Page breaks in `break-before` of the first child and `break-after` of the last child of the multi-column container become breaks before and after the container (before, they had no effect). Inside a multi-column container with a fixed height (which cannot continue across pages), they are column breaks (before, `odd-page` and `even-page` left columns empty for the blank page, and the content after them overflowed the box and was lost) (2) Blocks with `span="all"` are placed across the width of the container and split the columns before and after them also in multi-column containers that continue across pages (before, only containers that fit on one page were split, and in containers that continued across pages they were placed inside a column). `span="all"` inside nested blocks is also brought up directly under the container and takes effect (following the product's samples; before, it had no effect, and in spec mode, where the content of the container is wrapped in a block for the container's indents, `span="all"` on its children did not take effect either). The pieces of the split blocks and containers are treated as continuations of the same FO (`id` is kept on every piece, and `fo:page-number-citation-last` gives the page of the last piece; `text-indent` applies only to the first line of the first piece). `break-before="column"` at the head of the first column of a new column set does not leave a column empty (the break condition is already satisfied) (3) Multi-column layout with `column-count` on `fo:region-body` already followed these rules and does not change
79
+ - **keep-together and the spaces at the start and end of columns in XSL-FO multi-column containers** (**changes the typeset result** mainly for XSL-FO documents that use an `fo:block-container` with `axf:column-count` / `column-count` (the Antenna House extension for multi-column layout), in spec mode and in compatibility mode. The changes for HTML multi-column layout, multi-column layout of `fo:region-body` and XSL-FO documents without multi-column layout say so at the start of the line. How fitting in a single column is measured, and other details, are in the "Multi-Column Layout" section of `docs/en/xslfo-import.md` and section 12.3 of the HTML and CSS volume of the Conformance Guide):
80
+ - when balancing the columns of a multi-column container, a block, block-container or table with `keep-together.within-column="always"` (also `within-page` and `keep-together="always"`) is not split across two columns if it fits in a single column (before, balancing lowered the columns and broke it at the column boundary: a container holding only a four-line block went from 2 + 2 lines to 4 lines in the first column; XSL 1.1 §7.20.3). Content that does not fit in a single column is still split and stays on the page as before
81
+ - `space-before` / `space-after` with `conditionality="discard"` (the default) at the start and end of the columns of a multi-column container are discarded (the columns are treated as reference areas; XSL 1.1 §4.3.1, §6.5.3): in a container starting with `space-before="10pt"`, the first line of the first column sat 10pt lower than that of the second → at the same height. `space-after="20pt"` of the last block of a column is discarded, and the block after the container moves up by 20pt. `retain` spaces, `margin-top` and `margin-bottom` are kept as before
82
+ - the same spaces are discarded at the start and end of the area of a block with `span="all"` in a multi-column container (before, `space-before` / `space-after` around the span block and `space-before` at the head of the following column set were kept: a span block surrounded by 10pt spaces moves up by 10pt, and the first line of the column after it, with `space-before="8pt"`, by 28pt)
83
+ - a `discard` `space-before` of a multi-column container moved to the head of the next page because little room is left on the page is discarded (before, it was kept at the head of the next page: a container with `space-before="10pt"` moves up by 10pt; XSL 1.1 §4.3.1)
84
+ - when checking whether the line at the head of a column of a multi-column container fits, the space discarded there is not counted (before, balancing made the columns taller by that space: a container with three lines and a three-line block with `space-before="20pt"` went from 56pt to 36pt high). This also fixes the last row of a table split across two columns sometimes disappearing (a four-row table in compatibility mode, with `space-before` on the blocks in cells with borders, went from 2 + 1 rows and a warning to 2 + 2 rows)
85
+ - HTML multi-column layout (`columns`; every style): a block or table with `break-inside: avoid` / `avoid-column` is not split across two columns by balancing if it fits in a single column (before, it was split: a four-line block with `break-inside: avoid` went from 2 + 2 lines to 4 lines in the first column; CSS Fragmentation 3 §3.3). Content that does not fit in a single column is still split as before
86
+ - HTML multi-column layout with `--style ah`: the space discarded at the head of a column (`margin-top` of `p` and the like) is not counted when checking whether a line fits in the column (before, lines sometimes overflowed the balanced columns and disappeared, with the warning that the content does not fit in the multi-column container: a nine-line paragraph in three columns went from 2, 3 and 2 lines (two lines lost) to 3, 3 and 3 lines)
87
+ - multi-column layout of `fo:region-body` (`column-count`): `margin-bottom` of a block with `span="all"` is kept in compatibility mode too (it was discarded: after a span block with `margin-bottom="10pt"`, the lines of the columns move down by 10pt; spec mode keeps it as before)
88
+ - XSL-FO documents without multi-column layout: a `space-before` of the first block of the flow, discarded at the head of the page, is not counted when checking whether a line fits on the page (before, the bottom of the page was left empty by that space and lines were moved to the next page: a 16-line paragraph starting with `space-before="100pt"` went from 13 + 3 lines on two pages to one page; XSL 1.1 §4.3.1)
89
+ - **XSL-FO drop caps (`axf:initial-letters`)** (new feature; **changes the typeset result** only for XSL-FO documents with `axf:initial-letters`, in both the spec and the compatibility mode): the Antenna House drop-cap extension is now read (before, it was reported as unsupported, the letter was not enlarged, and a leading image stayed at its own size in the line). The first letter of an `fo:block` (with the punctuation around it; a word-initial Dutch `IJ` counts as two letters) or its first image is set several lines tall at the start of the line, and the following lines flow beside it, with the same mechanism as HTML `initial-letter`. Values read: the number of lines (`<number>`), a length (`<length>`), the number of lines to sink (`<integer>`, `drop`, `raise`), `adjacent` and `<integer2>` (also indent lines after the drop cap) of `axf:initial-letters`; `axf:initial-letters-end-indent` (space after the drop cap per line), `-first-line-head-height` (`cap-height`, `x-height`, `auto`: align to the x-height when lowercase small caps follow), `-width`, `-text-align`, `-color`, `-leading-punctuation="hide"` and `-leading-punctuation-position="hang"` (the `dcem` and `ic` units in these lengths are read in every mode). The `text-indent` of the block holding the drop cap shifts the drop-cap box (the `dcem` unit is read only in the compatibility mode; the spec mode reports and ignores it). Blocks after a block shorter than the drop cap's lines are also indented beside the drop-cap box (with `adjacent` too, as far as the box reaches); a block with a gap (`space-before`, `space-after` and so on) between it and the previous block, and a block with `clear`, is moved below the drop-cap box. Right-to-left horizontal text puts the drop cap at the right edge, and vertical writing is also set. Nothing happens when an `fo:block` with `axf:initial-letters`, an `fo:inline-container` and similar come before the letter, or when `text-align` is other than `start`, `left` or `justify`. Not supported (reported as warnings): the size and color of leading punctuation (`<length>` and `<color>` of `-leading-punctuation`), intruding it (`intrude` and the length of `-leading-punctuation-position`), `-leading-punctuation-shift`, `axf:initial-letters-start-intrusion="first-line"`, and ruby as the first letter. The descender of the letter (the part of g below the baseline) is not counted in the height of the drop-cap box. A `space-before` that is discarded at the head of a page, a column or a table cell (`conditionality="discard"`) is not counted for the position of the drop-cap box either, as for the lines (the box is not placed lower than the lines by the discarded space)
90
+ - **initial-letter and floats at the head of a column** (changes the typeset result only for HTML documents typeset with `--style ah` that have `initial-letter` or a float in a paragraph with `margin-top` at the head of a column in multi-column layout, and HTML documents in any style that have a float in the first paragraph, with `margin-top`, of a list item (`li`)): the `margin-top` discarded at the head of the column or of the list item is not counted for the position of the initial letter box and the float either, as for the lines (before, only the initial letter box and the float were moved down by the discarded margin and did not line up with the lines; in a list item, the item marker was moved down to the height of the float too)
91
+ - **Absolutely positioned boxes in multi-column layouts** (**changes the typeset result** only for documents with an absolutely positioned box inside a multi-column layout: XSL-FO `fo:block-container` with `axf:column-count` or `column-count` and `fo:region-body` with `column-count`, and HTML `position: absolute` inside `columns`): each trial layout that balances the columns added the box to the page, so the same box was drawn many times (about ten) on top of itself; it is now placed once (since 0.3.0)
92
+ - **Speed and memory** (no change to the typeset result): less memory for typesetting XSL-FO documents of thousands of pages. (1) The layout passes repeated to settle page number references (tables of contents and so on) no longer turn the pages into the area tree; only the pass that settles is turned into the area tree (previously every pass built the area tree of the whole document, and the next pass was laid out while the previous tree was still held). (2) When the area tree is built, the intermediate layout tree of each page is released as soon as the page has been turned into areas. (3) When reading FO, the "attributes read" remembered for each element are limited to the attributes written on the element (previously the names of all properties the importer asked for were remembered for every element, including those not written). (4) Leader dots aligned to a grid (`leader-alignment`) no longer copy empty margins and borders for every dot. (5) In the intermediate layout tree, the drawing data of a glyph (character, font, size, colour, position) is shared among glyphs with the same data, and the fields of a glyph node fit inside one object (about 370 → about 200 bytes per glyph). (6) Glyph areas without decorations are built without the fields that have no value (`backgroundColor`, `sourceId`) (about 336 → about 312 bytes per glyph; the Area Tree written as JSON does not change). (7) The Node command, with `typesetToPdf`, writes the PDF page by page and releases the intermediate layout tree of each page once it is written (it never holds the area tree of the whole document; the area tree of a page is built twice, once to collect the fonts and images used and once to draw it). The result of `typeset` (`areaTree`, `toPdf`, `renderPage`) still holds the area tree of the whole document. The command's report "layout N ms" no longer includes the time to turn the pages into area trees (it is part of writing the PDF). Typesetting the FO of the PostgreSQL documentation (37.7MB, 3,231 pages) with the command: previously it stopped at Node's default heap limit, and could be typeset once the limit was raised to 13GB (maximum heap in use, including garbage not yet collected, about 9.4GB; layout time 199 s). Now it can be typeset with a 3GB heap limit (maximum live heap after GC about 2.3GB). With a 4GB limit, the total time is 160 s. The PDF is the same apart from the creation date (and the document ID derived from it). (8) When writing the PDF, the operators of each finished page are turned into the compressed bytes they are saved as, and released (previously the operators of every page were kept as small objects until saving). The PDF is the same, down to the compressed bytes. Typesetting the same document with `typeset` and calling `toPdf`: maximum live heap about 3.2GB → about 2.8GB (what writing the PDF adds goes from about 0.4GB to about 0.03GB). (9) Images: an image in a file passed with the document is no longer kept twice; once it has been copied into the image store, the read contents of the file are dropped (this frees memory for files whose contents are given as a function, as the command does). When only the PDF is made (the command, `typesetToPdf`), the image store's contents of each raster image are also dropped once it has been embedded in the PDF (if the same contents are referred to in other ways, not until the last reference has been embedded; SVG is kept; an image an SVG refers to from inside is kept until that SVG has been embedded, and if there is an SVG with foreignObject or a use pointing at an external SVG, all are kept to the end; a dropped image does not become an unreadable image when laid out again). Typesetting a 240-page FO with 240 images (570MB in all) with the command: maximum resident set size about 2.57GB → about 1.62GB (`--low-memory`: about 2.70GB → about 1.70GB; `typeset` and `toPdf`: about 2.02GB). The PDF is the same
93
+ - **Images embedded in the PDF** (no change to the typeset result): when the same image file is referred to in different ways (upper and lower case, `./`, references with `#…`, paths from other directories, CSS `url()` and `img`, inside and outside SVG), the image is embedded in the PDF only once, and the same image is drawn everywhere (ISO 32000-2 §8.8, §8.9.5). Before, it was embedded again for each reference. The PDF gets smaller, and where and how images are drawn does not change. Different files with the same contents are still embedded separately
94
+ - **Translucent text colors in HTML** (changes the typeset result only for HTML documents that use colors with alpha (`rgba()`, `hsla()`, `#rrggbbaa` and so on) for text, text decoration lines, emphasis marks or ruby): text is drawn with its alpha, over what is below (CSS Color 4 §4.2, §5; ca and CA of the PDF ExtGState). The same goes for the text color of margin boxes. Before, it was drawn as an opaque color mixed with white paper, so on a colored background the background did not show through and the text looked whitish. This is the behavior of PDF/X-4 and output other than PDF/X (how translucent text is drawn in PDF/X-1a and X-3, which do not allow transparency, depends on transparency flattening)
95
+ - **Transparent text color** (changes the typeset result only for HTML documents that set `color: transparent` (or a color with zero opacity, such as `rgba(…, 0)` or `#rrggbb00`, or one whose opacity is 0 in 8 bits, such as `rgba(…, 0.001)`) for text): text in a color with zero opacity is not drawn (it still takes up space, and text positions and line breaks do not change; CSS Color 4 §4.1, §6.3). Text in colors whose opacity becomes 0 in 8 bits (such as `rgba(…, 0.001)` or `rgb(… / 0.1%)`), which would be invisible if drawn, is not drawn either (nor are text decorations, emphasis marks and ruby in such colors). Underlines, borders, emphasis marks and so on that use `currentColor` are not drawn either (§6.4). If a child sets `color` again, it is drawn in that color. Before, a color with zero opacity was treated as not specified, and the text was drawn in the parent's color (an error from before 0.3.0). As `background-clip: text` is not supported, with styles that paint text with the background (such as a gradient), the background fills the whole box and the text is not drawn (before, text in the parent's color appeared over it)
96
+ - **Paint-only effects of fixed-position boxes and margin boxes** (changes the typeset result only for HTML documents that set `transform`, `opacity`, `outline` or `clip` on `position: fixed` boxes, or `outline` on margin boxes or `@page`): the transform, opacity, outline and clip of fixed-position boxes are drawn on every page where the box appears (CSS 2.1 §9.6.1, §11.1.2; CSS Transforms 1; CSS Color 4 §3.3; CSS UI 4 §3). Before, the copies made for each page did not get the effects: transform and opacity were silently dropped, and outline and clip were reported as unsupported. Outlines of margin boxes and `@page` are drawn the same way as for document elements (they follow the rounded corners of margin boxes; before, they were drawn as separate border-only boxes, and margin-box outlines were reported as unsupported although they were drawn)
97
+ - **PDF/X-1a** (`pdfx: { version: 'X-1a' }` and `'X-1a:2003'` in the API, `--pdfx x1a` and `x1a:2003` on the command line): PDF/X-1a (CMYK and spot colors only, no transparency), long used by Japanese printers, can now be written. :2001 is PDF 1.3 (`GTS_PDFXVersion` `PDF/X-1:2001` and `GTS_PDFXConformance` `PDF/X-1a:2001` in Info), :2003 is PDF 1.4. No XMP is written, and a registered printing condition name is enough (a profile, if given, must be CMYK). The written PDF is read back and checked against the rules known from public descriptions (version, encryption, markers, output intent, boxes, color spaces, transparency, font embedding, annotations within the bleed area), and an error is thrown if it does not meet them. Not checked against the text of the PDF/X standards (ISO 15930-1, -4)
98
+ - **Transparency flattening for PDF/X-1a and X-3**: transparency (CSS opacity, colors with alpha, images with alpha, translucency, masks and blend modes in SVG) is replaced with opaque objects, keeping the appearance as far as possible. When only a single-color fill (the background of a rectangular or rounded box, rotated ones included, or the white page) lies under a transparent object, the CMYK color is computed with the Normal compositing formula (ISO 32000-2 §11.3.3) and the object is drawn as an opaque vector object (text stays text). Otherwise the area is rasterized together with what lies under it into a CMYK image (300ppi; 600ppi where text under 12pt is involved), with a warning (images of glyphs on the same line are merged into one; a warning also says when text within rasterized areas loses quality and can no longer be selected as text). An error is thrown if transparency that cannot be flattened remains (such as transparency of color glyphs; PDF/X-4 is suggested). Overlapping areas are composited in CMYK (as in printing), so they look slightly different from screen viewers that composite in RGB. PDF/X-4 and non-PDF/X output keep transparency
99
+ - **Changes in PDF/X-3 output** (only for documents that use transparency or contain grey-only images): transparency is flattened (see above) instead of being kept with a warning. Transparency that cannot be flattened is an error instead of a warning. The written PDF is read back and checked against the PDF/X-1a rules with the ban on device-independent color (ICCBased, Lab, CalRGB, CalGray) lifted, and an error is thrown if it does not meet them
100
+ - **Grey-only images in PDF/X** (only for PDF/X-1a, X-3 and X-4 output of documents with grey-only images): images whose pixels are all R = G = B (RGB and RGBA PNGs, 16-bit and 1-bit grey PNGs, grey + alpha PNGs, RGB JPEGs) are embedded as DeviceGray images instead of DeviceRGB (the same tones; ISO 32000-2 §8.6.4.2). They used to be written as DeviceRGB (a bug since 0.3.0), leaving RGB images in PDF/X
101
+ - **Development** (typesetting results do not change): when run from npm, `npm run ci:local` runs the npm main script (`npm_execpath`) directly with the Node that runs the script, without a shell. On Windows too, `npm.cmd` is not run and the arguments are passed as they are, so the deprecation warning from Node 24 about passing an argument list to a shell does not appear. In the node-min job, npm also runs on the same Node when the lowest supported Node is put first in PATH. When run directly as `node scripts/ci-local.mjs`, the `npm` in PATH is called as before
102
+ - **Security and robustness against crafted input** (protection of time and memory when typesetting documents written by others on a server; typesetting results of valid documents do not change; limits and their grounds are in the source comments):
103
+ - Regular expressions that took time quadratic in the input length now read the text once from the front: `width` and `height` in the start tag of SVG images (long runs of spaces), grid `repeat()` (a `repeat(` without a comma and long runs of spaces), and runs of unclosed `url(` (computed lengths of `filter`, `box-shadow` and the like, `background` of `@page`, `background-position`, and XSL-FO `axf:printer-marks`; an unclosed `url(` ends at the end of the value: CSS Syntax 3 §4.3.6)
104
+ - Deeply nested math functions such as `calc()` (in computed values of `filter`, `box-shadow`, `grid-template-columns` and others) took time proportional to depth × length and overflowed the stack, so the whole document could not be typeset
105
+ - The selector before `::footnote-call` and `::footnote-marker` is matched with the same matcher as the cascade (short selectors over deep nesting or many siblings took exponential time). The memo for matching selectors that mix combinator kinds has a total budget per cascade; once it is spent, such selectors are not applied and a warning is given (valid documents do not reach it)
106
+ - Paragraphs with many line breaks around comments, tables with many `rowspan="0"` cells, documents with many named pages and track lists with large `repeat()` counts are typeset in time proportional to their size
107
+ - Documents with many `span="all"` blocks deep inside nested blocks of a multi-column container (XSL-FO `axf:column-count`): the number of fragments made to lift the spans out is limited; spans beyond the limit are set within the columns and reported by the importer
108
+ - When an SVG filter is approximated with shapes, the number of clipping rectangles for primitive subregions and the number of layers no longer grow exponentially with stacked `feComposite` and `feMerge` (with too many layers, the approximation is dropped and the filter is computed in pixels)
109
+ - When flattening transparency for PDF/X-1a and X-3: the 72 ppi floor of the rasterization resolution is gone, and the pixel limit of one image is always kept (very large pages made images of billions of pixels. **Typesetting results change** only for large pages where rasterizing the whole page exceeds the limit: the resolution goes below 72 ppi, and the lowered resolution is reported in the warning. An area beyond the limit even at 1 ppi is an error, since it cannot be rasterized). The objects under a translucent object are looked up through a grid index of the page (each translucent glyph walked all objects drawn on the page)
110
+
111
+ ## 0.3.0 (2026-11-16)
112
+
113
+ A release that adds draw.io diagrams, plugins that add image formats, PDF/X-4 and more, and widens what SVG can draw. While in 0.x, it is a minor release because it includes fixes that change typesetting results.
114
+
115
+ - **draw.io diagrams**: draw.io (diagrams.net) diagram files (`.drawio`, `.dio`, including compressed pages) are read as images by default. A page is converted to SVG and placed in the PDF as shapes and text (usage: `docs/en/drawio.md`)
116
+ - The page to draw is selected after `#` in the image reference: `#page=N` (counted from 1), `#page-id=ID` or `#<page name>`. Without one, the first page is drawn; for a page that does not exist, the first page is drawn with a warning. `#` references that select the same page reuse the drawn diagram
117
+ - Shapes, edges and arrows are drawn by code ported from the public source code of draw.io and mxGraph: standard shapes, icon frames (AWS, GCP, Cisco and so on), shapes that draw.io draws in JavaScript (about 750), edge routing, line jumps, thick arrows, 34 edge end types, label placement per shape and curved text. Shadows (shapes, text and the whole diagram), the glass effect, gradients with end opacities, the sketch style (`sketch`, rough.js) and jiggled lines (`comic`)
118
+ - Shapes from shape libraries (`mxgraph.*`) and shapes embedded in diagrams (`stencil(…)`) are drawn. The libraries are not included in Kumiori; they are used only when passed with `drawio.stencils` (`--drawio-stencils` on the command line) or when fetching is allowed with `drawio.fetchStencils` (`--fetch-drawio-stencils`, `--drawio-stencils-url`) (draw.io's distributed `stencils.min.js` and library XML are read). The same applies to images from draw.io's distribution, such as the images inside SAP icons and clip art. On the command line, fetched files are saved in the font cache directory
119
+ - API: `TypesetOptions.drawio` (the type `DrawioOptions`: `stencils`, `fetchStencils`, `stencilsUrl` and `provideStencils`; `false` means draw.io diagrams are not read as images). `DRAWIO_MIME`, `isDrawio`, `createDrawioStencilRegistry` (creates the shape library registry `DrawioStencilRegistry` that `provideStencils` returns) and the types are exported. Command line: `--drawio-stencils`, `--fetch-drawio-stencils`, `--drawio-stencils-url` and `--no-drawio`. `--watch` also watches `.drawio` and `.dio` files
120
+ - Images given by URL are fetched under the same rules as the document's images (`resolveResource`, `fetchImages`). Text widths are measured with the fonts Kumiori draws with. When the API reuses the same `drawio` option across documents, an image fetched under one document's rules is not used for another document. Warnings are written in Japanese or English, following `lang` (`--lang` or the environment on the command line)
121
+ - The code that draws diagrams (including rough.js) is loaded only when a draw.io diagram appears (as for CGM, EPS, WMF and EMF; a separate file in the web app and the browser library). roughjs and pako were added as dependencies
122
+ - The shapes from draw.io's `shapes/` (`src/drawio/drawioJs/` and others) are ported from v24.7.5 (Apache License 2.0 only), before draw.io put a restriction of use on `shapes/` (`shapes/LICENSE`: use in Atlassian products; since v29.3.2), and follow the drawing of v24.7.5.
123
+ Shapes added after v24.7.5 are not included: `mxgraph.archimate4.*` (36 shapes), `mxgraph.c4.mobileDeviceContainer`, `mxgraph.bpmn.task2`, `data2`, `conversation2`, `mxgraph.atlassian2.icon` and `mxgraph.networks2.icon`. These shapes get only their text, with a warning that they are not drawn because they were added after v24.7.5 (not a warning that a shape library is missing, and nothing is fetched for them).
124
+ Style keys added later (keys that change colors, such as `strokeColor2`, `fillColor2` and `bodyColor`) are not read either
125
+ - The default version of the shape libraries and distributed images to fetch is also v24.7.5 (CC BY 4.0)
126
+ - The files ported from draw.io and mxGraph carry the copyright notices of the original files and a statement that they were changed (section 4 of the Apache License 2.0), and the chunks of the built JavaScript that include the draw.io code start with the copyright notices. The original files, their versions and notices are listed in section 13 of THIRD_PARTY_NOTICES.md. NOTICE also states that code was ported from draw.io and mxGraph
127
+ - Robustness against crafted diagrams: there are limits for inputs that exhaust time or memory from small files (XML close tags and skipped declarations, path moves, the length of `html=0` and placeholder labels and their total per diagram, the SVG length per diagram (16Mi characters, about 16.8 million), line-jump crossings, the inflated size of embedded shapes, cell coordinates and the diagram size (10 million px) and element nesting depth). Parts beyond a limit are not drawn and a warning is given (a single cell that exceeds the SVG length or the diagram size on its own is not drawn, and the rest of the diagram is). The number of hatch lines of sketch-style (`sketch=1`) fills is estimated from the size of the element drawn, also for shapes that a `style` value (`unitNum` of `rackCabinet`, `textSize` of button bars and so on) draws larger than their cell, and elements larger than 10 million px (width plus height) are drawn without the sketch style. Shapes that lay out `,`-separated items (button bars, menus, breadcrumbs, tab bars, pie charts and so on; eleven shapes) are drawn with work proportional to the number of items
128
+ - **Web app** (demo): a "draw.io の図" (draw.io diagrams) section was added to the settings. "draw.io の図を読む" (Read draw.io diagrams) turns reading diagrams on or off (on by default; the choice is remembered in the browser). When off, the code that draws diagrams is not loaded, and the open document's images are read again and the document is typeset again. Inside the section you can load draw.io shape library files (remembered in the browser), clear them, and choose to fetch them from draw.io only when a diagram needs them. Shape libraries (`stencils.min.js` or library XML) passed together with the opened files are used for that page session only. Diagrams referenced with a page after `#` (`figure.drawio#page=2`) are also redrawn when the settings change and when the diagram file is opened again on the same page
129
+ - **Plugins** (`plugins` in the API, `--plugin` and `--plugin-option` on the command line): plugins that add image formats can be passed (`KumioriPlugin`; the interface version `PLUGIN_API_VERSION` is 1). A format has a content check (`sniff`) and a loader (`load`, which returns SVG and a size), and Kumiori draws the result as an SVG image. `load` receives tools to measure text with the fonts that draw it, to fetch under the same rules as the document's images, to fetch URLs the user allowed through the plugin's options (`fetch`, with the time limit `fetchTimeoutMs`) and to report warnings, the language for warnings (`lang`) and the fragment of the image reference (after `#`; `fragment`, to select which diagram or page of a file to draw). When the same file is referenced with different fragments, it is loaded once per reference (each becomes its own image). A plugin runs with the same rights as Kumiori, so pass only ones you trust. The web app does not run programs supplied by users. The command's `--watch` also watches files with the extensions of plugin formats
130
+ - How the command's `--plugin` is resolved: specs starting with `./` or `../`, absolute paths and `file:` URLs are taken as file paths. Any other spec is first resolved as a package name, as `import()` does, from the current directory with the same conditions as `import()` (`import`, `node`, `default`) (including `@scope/name`, `name/sub` and ones ending in an extension, such as `kp/dist/plugin.js` or `chart.js`; an ESM package whose `exports` has only the `import` condition is loaded too). If it cannot be loaded as a package (no such package, and also when the package does not export that subpath in `exports` or its entry file is missing), the file of that name in the current directory is loaded (`--plugin myplugin.js`). Whenever it can be loaded as a package, the package is loaded (even when a file or directory of that name exists in the current directory), so write `./` to be sure of pointing to the file. When nothing is found, the error message says what was searched, in order
131
+ - When a plugin that cannot be loaded is given (also with `--watch`), the command prints only the error message and exits with code 1
132
+ - **PDF/X-4** (`pdfx: { version: 'X-4', profile }` in the API, `--pdfx x4 --output-profile <ICC>` on the command line): PDF/X-4 output is now available (PDF/X-3:2003 remains; X-3 is the default). X-4 requires an embedded output CMYK ICC profile (an error if it is missing or not CMYK), writes XMP metadata (`GTS_PDFXVersion`, dates, title, `Trapped`, IDs) consistent with the Info dictionary (ISO 32000-2 §14.3.2), keeps transparency as is, and writes PDF 1.6. The command-line options `--pdfx x3|x4`, `--output-profile` and `--output-condition` (the printing condition name; default JC200103) are added. Not checked against the text of the PDF/X standards (ISO 15930-6, -7)
133
+ - **Changes in PDF/X output** (both X-3 and X-4; non-PDF/X output is unchanged, and so are the positions of text, lines and images): only TrimBox is written on pages (no ArtBox). **Links, annotations and form fields on the pages are not written** (any that overlaps the area up to the bleed (BleedBox) even slightly is left out, and their number is reported in the warnings. The BleedBox encloses the whole artwork of the page, so practically all links on the pages are lost, both internal ones such as those of a table of contents and those to external URLs. 0.2.0 wrote them in PDF/X-3. Bookmarks are not annotations and are still written. Write PDFs for reading on screen without PDF/X). Without a title, Untitled is used. Following the recommendations of the GWG 2022-R1 submission specification, grey (R = G = B) text, lines and fills are written as K-only CMYK (grey images stay DeviceGray), and K 100% body text under 12pt (including text in the page margins) and lines and rules under 2pt get overprint (OP, op, OPM 1; ISO 32000-2 §8.6.7; text and lines inside images such as SVG and EPS do not). Of the GWG 2022-R1 requirements, differing trim sizes (R0004), spot colours (R0020) and image resolution (R0031; 149ppi or less is required, 224ppi or less recommended) are checked and reported in the warnings (the output is not changed)
134
+ - **SVG** (typesetting results change: SVG that previously could not be drawn and was rasterized or shown as a placeholder frame is now drawn as shapes):
135
+ - Selectors with combinators (descendant, child, next-sibling, subsequent-sibling), attributes and pseudo-classes in `<style>` now match (Selectors 4; the same matching as for HTML)
136
+ - text: `font-style` (upright glyphs are slanted if there is no italic face), per-character lists of `x`, `y`, `dx`, `dy` and `rotate`, `baseline-shift`, `dominant-baseline` and `alignment-baseline`, `word-spacing`, `paint-order`
137
+ - `objectBoundingBox` for `clipPathUnits` and `maskContentUnits`, `slice` in `preserveAspectRatio` of image, and images referring to external files (PNG and JPEG among the document's files; if missing, only that image is not drawn, with a warning)
138
+ - Gradients, opacity, clipping, blend modes and nested patterns in pattern contents; all 15 values of `mix-blend-mode`
139
+ - `systemLanguage` in switch and the conditional processing attributes, matched against the language where the image is placed (`lang`, `xml:lang`, `language`; the environment's language if none is given). Elements outside switch whose conditions are not met are not drawn either
140
+ - The filter approximation in Node (the CLI and the API) now also handles `feColorMatrix` and `feComponentTransfer` (changing the shapes' colors) and compositing with `feComposite` and `feBlend` (all 16 blend modes) (shadows exported by Figma are drawn too). The result of a filter is clipped to the filter region. When a filter primitive has a subregion (`x`, `y`, `width`, `height`; Filter Effects 1 §9.4), the primitive's result is clipped to that subregion (previously the subregion was ignored and drawn outside it too; a blurred result that must be clipped is computed in pixels)
141
+ - Elements with `opacity`, elements with children such as `g` with `mix-blend-mode`, and elements with `isolation: isolate` are drawn as a transparency group of their children (previously the opacity was applied to each child, so overlapping parts got darker and, for shapes with both fill and stroke, the fill showed through under the stroke). `visibility` is inherited, and children set back to `visible` are drawn (previously the children of a `hidden` element were not drawn at all)
142
+ - CSS syntax: `transform` with units (`rotate(45deg)` and so on), `transform`, `transform-origin` and `transform-box` in `style` and `<style>`, `var()` and `calc()`, basic shapes in `clip-path` (`circle()`, `inset()`, `polygon()`, `path()` and so on) with reference boxes, and `@media` in `<style>` (matched as a print medium)
143
+ - use draws elements of other files (`icons.svg#a`; a missing file is reported as a warning). Links of `a` become PDF links
144
+ - text: `letter-spacing`, `word-spacing` and `text-decoration` on tspan, `side` and `baseline-shift` on textPath, `font-weight` and `font-style` of `@font-face`, and vertical text (`writing-mode`, `text-orientation`; glyph orientation and vertical glyph forms are decided as for vertical body text)
145
+ - `mask-type: alpha`, the mask region and nested masks (previously only the inner one took effect), `context-fill` and `context-stroke`, and GIF, BMP and WebP in image
146
+ - text: `textLength` on tspan, `textLength` and `text-decoration` in vertical text, SVG 2 `inline-size` (automatic wrapping), and SVG fonts (glyphs of the `font` element)
147
+ - Node (the CLI and the API) computes filters that cannot be approximated with shapes (`feTurbulence`, `feMorphology`, `feDiffuseLighting`, `feSpecularLighting`, `feDisplacementMap`, `feConvolveMatrix`, `feImage`, `feTile`, `arithmetic` of `feComposite`, `in`, `out` and `atop` of `feComposite` that cannot be drawn with shapes (such as inner shadows), and so on) in pixels and places them as an image (as specified in Filter Effects 1; previously a placeholder frame)
148
+ - The content of foreignObject (HTML and MathML) is typeset with the same HTML layout as the body and drawn (backgrounds, borders, tables, images and math too; previously a placeholder frame). The rules of the SVG's `<style>` (including selectors such as `#id p` that use the ids and classes of the SVG ancestors) and the formatting inherited from the SVG ancestors (`font-family`, `font-size`, `font-weight`, `font-style`, `color`, `letter-spacing`, `word-spacing` and `visibility`) apply to the content (SVG 2 §23.2, CSS 2.1 §6.2). The body's default style sheet (`--style`, `style`) and the CSS files applied to the body (`--css`, CSS in `files` that the document does not reference) do not apply; the content is typeset with the browser default style sheet. When the typeset content draws nothing inside the foreignObject box (for example when it lies outside the box), a warning is given and only the text is approximated. When it is not typeset through the API (such as when calling `renderPdf` directly), only the text of the HTML is approximated
149
+ - SVG with a clipPath of many points applied to many shapes (such as maps) is drawn as shapes. Previously the clip outline was written again for each shape, exceeded the segment budget, and a placeholder frame was drawn. The same clip shared by consecutive shapes is now written once (ISO 32000-2 §8.4.2, §8.5.4)
150
+ - `svgLanguages` in the API and `--svg-lang` in the CLI: the languages to match SVG `systemLanguage` against (when the place of the SVG has no language)
151
+ - **Fonts**: When the document contains emoji not found in the symbol font (Noto Sans Symbols 2) either (faces such as 😀, flags, skin tone modifiers, etc.), the emoji font Noto Emoji (monochrome outline emoji; SIL Open Font License 1.1; about 870KB) is loaded. Previously no default font had emoji, so those characters were set as the missing-glyph box and the warning "no loaded font has a glyph for these characters" was given. **Typesetting results change** only for documents with such emoji (characters the symbol font has, such as ✈ and ❤, are set in the symbol font as before). For colour emoji, pass a font such as Noto Color Emoji, as before. `emoji` was added to `DEFAULT_FONTS`
152
+ - **`.minimum` and `.maximum` of XSL-FO `word-spacing`** (spec mode only): now read (they used to be reported as unsupported). In justified lines, word spaces are shrunk down to `.minimum` to fit a character or word, and are widened only up to `.maximum` (XSL 1.1 §7.17.8: “The minimum and maximum values specify the limits of the adjustment.”; the `<space>` datatype in §5.11). Compatibility mode still does not read them and reports a warning
153
+ - **Warnings raised while writing the PDF**: notices about glyphs that cannot be drawn, the limits for color glyphs, glyphs in the SVG table, form fields that cannot be made and so on are added to `result.warnings` after `result.toPdf()` (previously they only went to the console, or came after `warnings` was built). The notice for glyphs that cannot be drawn is given once per font. The warnings follow the `lang` used for typesetting. The web app lists them with the other warnings
154
+ - **Warnings**: warnings that stayed in Japanese with `lang: 'en'` (`--lang en` on the command line) are now written in English: three image warnings (a placeholder frame is drawn, part of the image cannot be drawn, the image is not found or cannot be read) and the reasons for placeholder frames of unreadable images; in the notices of unsupported CSS and XSL-FO, the reasons attached to items (`a value read only with --style ah`, `unit xx (length …)` and so on) and the separators of the list; the PDF/X warnings on transparency and the ICC profile; the overflow warnings of the layout (lines, boxes, floats, footnotes, table rows and so on that do not fit on the page); the separators of the list of characters without glyphs; the errors when reading EPUB; the error for too deeply nested transforms; the notes inside image formats (elements of CGM, WMF and EMF that cannot be drawn and their limits, and names of EPS features that cannot be drawn); the errors when reading Area Tree JSON (`parseAreaTree`); and errors in the content of fonts and images (CFF, WebP, PNG)
155
+ - **Reporting vulnerabilities**: added the procedure for reporting vulnerabilities privately (`SECURITY.md`, `SECURITY.en.md`), linked from the "Reporting vulnerabilities" section of the README
156
+ - **flex**: The width of an item (the estimate of its max-content width) now includes the spacing between ideographs and Latin letters or digits (`text-autospace`; CSS Text 4 §8.4). **Typesetting results change**: when a table-of-contents line lays out the entry title, the leader and the page number with flex, the last character of a title mixing Japanese and Latin text, such as “ecoモードの使い方”, is no longer pushed to the next line (previously the estimate lacked the spacing, so the laid-out line did not fit in the item's width)
157
+ - **flex**: The width of an item with no specified width (`flex-basis` and `width` are `auto` or a content-based sizing keyword) is now measured by laying out its content at typesetting time (Flexbox 1 §9.2, step 3 E; previously it was estimated at import by adding up character widths, and only items with a page-number citation were measured at typesetting time). If the line does not fit, the items are shrunk again at typesetting time by their `flex-shrink` ratios (§9.7; the min-content width used as the `min-width: auto` lower bound is also measured at typesetting time). **Typesetting results change**: when a table-of-contents line lays out the entry title, the leader and the page number with flex, the estimate was narrower than the laid-out line and the last word or character of the title was pushed to the next line in the following cases, which are now fixed: white space between elements (`<b>1.2</b> <b>Overview</b>`), the left and right margins, borders and padding of inline elements, the content of descendants' `::before` and `::after` (such as chapter numbers from counters), the item's own `::before` and `::after`, `word-spacing`, the width and margins of an `inline-block`, the space between a superscript and the next word, and `letter-spacing` on a child element. The same applies to lines with `justify-content: space-between` or `flex-wrap: wrap` and to `flex: auto` items. The width of an image set by `-ah-image-resolution` and of an item containing a table are now the laid-out sizes (previously the intrinsic size or the estimate was used, and the table overflowed the item). The content width (max-content and min-content) of a row flex container inside a box sized by its content (such as a flex item or a table cell) is measured as the sum of its items' content widths (Flexbox 1 §9.9.1)
158
+ - **flex**: In a column (`flex-direction: column`) container, items that are inline elements (such as `span`), runs of text directly in the container, and `::before` and `::after` are now blockified (Flexbox 1 §4, CSS Display 3 §2.7). **Typesetting results change**: previously the items were placed side by side on one line instead of being stacked
159
+ - **flex**: The estimate of an item's content width (used as a guide for splitting `flex-wrap` lines and for the box width of aligned items in a column container) now counts white space between elements, the left and right margins, borders and padding of inline boxes, the content of `::before` and `::after`, `word-spacing`, and the width of an `inline-block`. For the ways of writing table-of-contents titles that were examined, it matches the laid-out width within 0.02pt
160
+ - **flex**: Borders, padding and backgrounds of items made from inline elements (`span`, `a` and so on) are now applied only to the item's box (items are blockified; Flexbox 1 §4, CSS Display 3 §2.7). **Typesetting results change**: a `span` item with a border or padding no longer pushes its last character to the next line, even for short Japanese-only content, and its border is no longer drawn twice (previously the inline box of the content also got the same border and padding)
161
+ - **HTML white space**: White space at the edges of inline elements is no longer removed (CSS Text 3 §4.1.1, §4.1.2). **Typesetting results change**: previously “`word <b>bold </b>word`” became “boldword” and “`Over<b> B </b>view`” became “OverBview”, and white space at the edges of `::before` and `::after` of an empty element was also removed (such as the space after a chapter number “第1章 ” in a table of contents). This also affected entry titles mixing English and Japanese split into elements (`<b>eco </b>モード`). Spaces that meet across the boundaries of inline elements are collapsed to one, and spaces at the start and end of a line are removed. In Japanese text, whether a line break in the source becomes a space or is removed is also decided by the characters before and after it across the boundaries of inline elements, and a line break between Japanese characters is removed (CSS Text 3 §4.1.3, §1.5). A line break just inside a tag (`これは<b>\n強調\n</b>です`) gives “これは強調です” as in 0.2.0, and **typesetting results change**: a line break just outside a tag (`これは\n<b>強調</b>\nです`), which gave a space in 0.2.0, no longer gives one. If either side is not Japanese, the line break becomes a space as before. Forced line breaks, images, inline-blocks, ruby and block boundaries are not crossed
162
+ - **Blocks inside inline elements in HTML** (all styles; **typesetting results change**): the blocks inside `<span><p>…</p></span>`, `<a><div>…</div></a>` (card links and the like), `<b><div>`, `<span><ul>`, `<span><table>`, `<label><div>`, `display: block` elements inside inline elements and so on are now typeset (inline boxes containing block boxes, CSS 2.1 §9.2.1.1). The inline box is split before and after the block; the block is laid out as a block, and the inline content before and after it goes on the lines before and after. The inline element's text formatting (color, font, weight and so on) and its link also apply to the block inside, and no border or padding is drawn on the edges where the box is split. Previously the content of the inner block disappeared without a warning, and so did the bookmark targets of headings inside it (the labels of Mermaid 10+ flowcharts, `<span class="nodeLabel"><p>…</p></span>`, have this shape). A block that remains inside an inline box and cannot be placed is reported as a warning. Elements with `display: inline-flex` or `inline-grid` are inline-level boxes (Flexbox 1 §3, CSS Grid 1 §5.1), so block items inside them (buttons and links whose icon and label are written as `div`s, such as `<a style="display: inline-flex"><div>…</div><div>…</div></a>`) no longer split the line of the surrounding paragraph. Block items (and items that are inline elements containing blocks) are placed side by side in the line as unbreakable boxes (the same as `inline-block`; their width is the width of the content); previously the text of these items disappeared. In such a container, each run of text directly inside it also becomes one item in the same kind of box, and runs that are only white space (the line breaks and indentation between items and at the start and end of the container) are not rendered, whatever the value of `white-space` (Flexbox 1 §4, CSS Grid 1 §6). Items that are only inline elements are laid out in the line as before. In neither case is the element laid out as an inline flex or grid container, so the gap between items (`gap`), column direction (`flex-direction: column`), alignment (`align-items`, `justify-content`) and grid columns (`grid-template-columns`) have no effect (the items are aligned on the baseline of the line)
163
+ - **Control-character escapes in CSS `content` strings** (every HTML style; **typesetting results change**): escapes of control characters such as `\A` (line feed) and `\9` (tab) in the `content` of `::before` and `::after` became the letters “n” and “t” (`content: "X\A Y"` gave “XnY”; since 0.1.0). The computed value is now written as a CSS string (CSSOM §2.1 serialize a string; `"X\a Y"`). Strings in generated content are also now handled by `white-space` like the document's text (CSS 2.1 §12.2, CSS Text 3 §4.1): a line feed is a forced line break with `pre`, `pre-wrap`, `pre-line` and `break-spaces`, and with `normal` and `nowrap` it becomes a space or is removed by the same rule as line breaks in the document (removed between Japanese characters). A tab becomes a space with `normal`, and a CR (`\D`) is treated as a space. The `content` of page-margin boxes is handled the same way by the box's `white-space` (previously `\A` in a margin box always broke the line, whatever `white-space` was). As a result, a run of spaces in the `content` of a margin box now also collapses to one space when `white-space` is `normal` (the default; CSS Text 3 §4.1.1; previously margin boxes kept runs of spaces). **Typesetting results change**: the two spaces in `content: counter(page) " | " string(chapter)` become one. To keep the spaces, use U+00A0 (`\A0`) or U+3000, or write `white-space: pre` in the margin box. Other escapes such as `\"`, `\\`, `\2014` and `\000041 B` are unchanged. A “`\`” followed by a line break inside a string (the way to continue a string on the next line; CSS Syntax 3 §4.3.5) is now dropped without adding anything (previously the “`\`” and the line break remained; a CRLF counts as one line break). The white space dropped after a hex escape is now only CSS white space (space, tab, line breaks); previously a U+3000 or U+00A0 after `\25A0` was dropped too
164
+ - **HTML print colours when the same property is declared twice** (**typesetting results change**): within a rule, a later print-colour declaration now wins (CSS Cascade 4 §6.1). Previously, when an earlier declaration of the same property existed, a later `rgb-icc()`, `cmyk()` or `device-cmyk()` declaration was set aside and the earlier colour kept (`.r { color: #00f; color: rgb-icc(255,0,0,#CMYK,0,1,1,0) }` stayed blue even with `--style ah`). With `--style ah`, `rgb-icc()` and `cmyk()` are read as colours, so the later declaration wins; `device-cmyk()` (CSS Color 5 §12.1) wins in every style. In the other styles, `rgb-icc()` and `cmyk()` are still dropped as invalid values (and reported), so the earlier colour remains. Inside a `style` attribute, too, the later declaration of a property wins (previously an earlier print colour beat a later screen colour such as `color: #00f`). In *CSS Page Composition Primer* 4th edition (`--style ah`, with spot-colour values), the borders of the border samples (`.BorderSample`) change from RGB green to the spot colour (PANTONE 627 PC), as in the reference
165
+ - **Characters that get the spacing between Japanese and Latin text** (HTML with the default style sheet; **typesetting results change**): the `text-autospace` spacing is now inserted, as defined in CSS Text 4 §8.4.1, between Japanese characters and characters of the Unicode general categories L and M (besides Latin, also Greek, Cyrillic, Arabic, Hebrew, Indic and Thai letters, even a single letter) and Nd digits (including Arabic and Indic digits). Before, only Latin letters, digits and words of two or more Greek or Cyrillic letters got it. It is not inserted next to characters with East Asian Width W or F (Hangul, fullwidth letters and digits), symbols, punctuation, or characters set upright in vertical text (`text-orientation: upright`). The class of a character is that of the base character of its grapheme cluster. Between Japanese characters and right-to-left characters, the space goes at the visual boundary after reordering (§8.4.2). The compatibility settings (`--style ah`, `vivliostyle`, `weasyprint`) and `axf:text-autospace` in XSL-FO are unchanged (the samples cannot confirm the behaviour; the 4th edition of the CSS page layout book has no place where Japanese characters and Greek or other letters are adjacent in running text).
166
+ - **Position of page-margin boxes with a specified height or width** (HTML with all styles; **typesetting results change**): as in CSS Paged Media 3 §5.3.3, a top or bottom box with a specified height and a left or right box (and a corner box) with a specified width are placed against the page area, because in the over-constrained case the margin on the page-edge side is treated as auto (with both margins auto, the box is centred). Before, the box was positioned by vertical-align, centred by default. vertical-align now only aligns the content inside the box (§6.3). A specified `height` or `width` is the content size, and borders and padding are added to it (with `box-sizing: border-box`, it includes them). Found by comparison with the WeasyPrint samples (WeasyPrint 65.1 also follows §5.3.3).
167
+ - **Propagation of break-avoiding values** (HTML; **typesetting results change**): the avoid values (`avoid`, `avoid-page`, `avoid-column`) of `break-before` on the first child of a box and of `break-after` on its last child are now propagated to the breaks before and after the parent box, as forced breaks already were (CSS Fragmentation 3 §3.1.1; followed through nested children). Previously only forced breaks (`page` etc.) were propagated and avoid values were only seen between adjacent siblings, so a page break could occur between a section and the paragraph before it in `<section><h2 style="break-before: avoid">`. When a forced break applies at the same point, the forced break wins (§4.3; the avoid value is not propagated, and the box's own avoid value is dropped). `avoid-column` stops before the multi-column container (§3.1.1). The same applies where a list is set as a table (the values of an item's first and last children are combined with the item's row and with the list's edges) and to lists without markers (set as a sequence of ordinary blocks). Values are not yet propagated to flex and grid containers or from table rows. XSL-FO keeps are unchanged. The output of the 4th edition of *CSS Page Composition Primer* (`--style ah`) and of the four conformance documents does not change (if `break-before` of `.TOC li.TocLevel1 > ul` in its table of contents is reset to `auto` in a user style sheet, the page used to break between the 「第5章」 line and 5.1; now the `avoid-page` of `li.TocLevel2:first-child` propagates and 「第5章」 moves to the next page)
168
+ - **Placement of collapsed table borders of different widths** (every XSL-FO mode, and HTML tables with `border-collapse: collapse`; **typesetting results change**): on a side where the table itself has no border and the cells hold the table's outer border, lines of different widths (5pt and 15pt, for example) are now centered on the same grid line (the table edge). Previously the thinner lines were aligned with the outer edge of the thickest line on that side, so the thinner lines and the contents of their cells stuck out beyond the grid line (into the margin). Inner lines in the XSL-FO compatibility mode (`--compat antenna`, where the following cell holds the line) are also centered when widths differ along the same line (previously the thinner lines were aligned with the edge of the following cell's box). Cell contents are placed half of the cell's own line width inside the grid line. This follows CSS 2.1 §17.6.2 (borders are centered on the grid lines between the cells), XSL 1.1 §6.7.10 and §7.28.3; the Antenna House sample (`table-border-conflict-resolution-1` in the sample FO collection) also centers them. Cell backgrounds are painted from the outer edge of the shifted line. The Area Tree version is now 3 (sides whose `collapse.paintWidth` is smaller than `width` were added; version 1 and 2 trees are still read). In the sample FO collection four samples change (`table-border-conflict-resolution-1`, `table-omit-header-footer-1`, `table-within-page-1`, `axf-form-field-event-1`); in the conformance documents only the page with the `border-collapse` example in the HTML and CSS volume changes (page 93 in Japanese, 97 in English). The column widths of `table-layout="fixed"` tables without column specifications are fixed by the next entry
169
+ - **Column widths of collapsed-border tables with fixed layout and no column specifications** (every XSL-FO mode, and HTML tables with `table-layout: fixed` and `border-collapse: collapse` under `--style ah` (Antenna House compatibility); **typesetting results change**): columns without a specified width now share the table width so that their widths excluding the borders of the first row's cells (the content and padding widths) are equal. Previously the column boxes, including the halves of the borders that stick out of the table, were divided equally, so columns with thick borders had narrower contents, and the outer columns were narrower by the width of the thick borders. This follows CSS 2.1 §17.5.2.1 (referenced by `table-layout="fixed"` in XSL 1.1 §7.28.16): "any remaining columns equally divide the remaining horizontal table space (minus borders or cell spacing)". The fixed layout looks only at the cells of the first row, so the borders excluded are those of the first row's cells. The Antenna House sample (`table-border-conflict-resolution-1` in the sample FO collection; a 5-column table whose first-row borders are 5, 10, 5, 5 and 15pt) also gives all five columns the same content width (about 86.4pt). In that sample the text of the 15pt cell no longer wraps onto two lines, and the output has two pages like the sample. In the sample FO collection five samples change in the specification mode and nine in the compatibility mode (`--compat antenna`) (each is closer to the sample, or the same to within 0.01%). The conformance documents (all four) do not change. With the other HTML styles (`kumiori`, `browser`, `browser-margin`, `vivliostyle` and `weasyprint`) the column boxes are still divided equally, as before (reading "borders or cell spacing" in the same sentence as the table's borders and the cell spacing; browsers (Chromium) also divide the column boxes equally)
170
+ - **Specified widths of the edge columns of collapsed-border tables** (every XSL-FO mode, and HTML tables with `table-layout: fixed` and `border-collapse: collapse`; **typesetting results change**): a specified column width (`column-width`, or `width` on `col`) is now the distance between the grid lines for the columns at the edges of the table as well. Previously, in the specification mode the first and last columns were narrower by half of the outer border that sticks out (or wider by the inner half of the table's border when the table holds the outer border), and in the compatibility mode (`--compat antenna`) the last column was narrower by the width of the outer line (inner columns also shifted when the inner lines had different widths). The table width is the distance between the outer grid lines (row-width in CSS 2.1 §17.6.2), so the specified column widths add up to the table width. The Antenna House sample (`axf-form-field-event-1` in the sample FO collection: four columns of 30, 30, 30 and 40mm) also makes the distance between the grid lines equal to the specified width, for the edge columns and the last column too. Automatic-layout tables, whose column widths are measured from their contents, do not change. In the sample FO collection ten samples change in the specification mode and nine in the compatibility mode (in the compatibility mode the difference of `table-spanned-1` from the sample falls from 0.39% to 0.02%, and the right edge line of `table-within-page-1` is now at the same position as in the sample). In the conformance documents, table lines and text move by about a pixel on two pages of the XSL-FO volume (pages 43 and 71 in Japanese, 46 and 74 in English) and one page of the HTML and CSS volume (page 94 in Japanese, 97 in English). The CSS-Print book does not change
171
+ - **Fixed column widths without column specifications in separated-border tables** (XSL-FO tables with `border-collapse="separate"` in every mode, and HTML tables with `table-layout: fixed` and `border-collapse: separate` under `--style ah` (Antenna House compatibility); **typesetting results change**): columns without a specified width now share the width so that their widths excluding the borders of the first row's cells are equal, as for collapsed-border tables (see "Column widths of collapsed-border tables with fixed layout and no column specifications" above; CSS 2.1 §17.5.2.1). Previously the cell boxes, including their borders, were divided equally. With the other HTML styles the cell boxes are still divided equally, as before (as in browsers (Chromium)). The sample FO collection, the conformance documents and the CSS-Print book have no such tables and do not change
172
+ - **XSL-FO orthogonal `fo:block-container` without an inline-direction size** (all modes; **typesetting results change**): a container whose writing mode is orthogonal to its parent's (such as `writing-mode="tb-rl"` inside horizontal body text) and that has no `inline-progression-dimension` (the height for vertical text) used the body width as its line length, so the box exceeded the page height, was pushed to the next page and overflowed at the bottom, cutting off characters. XSL 1.1 §6.5.3 says this size may not be auto and does not define how to lay it out (auto in §7.15.7 is "determined by the formatter taking all other constraints into account"), so, as for orthogonal blocks (E-16 in BACKLOG), the line length is now the remaining page height (the page height from the next page on), lines are stacked up to the parent's width, and lines that do not fit continue on the next page. A box that fits on one page fills the parent's width, as before. A bordered (border or padding) container rotated by 90° or 270° with no size specified was laid out as a single box whose lines, stacked beyond the body width in its local block direction, overflowed the box; it is now stacked up to the body width and continued on the next page, like a container without borders (the borders at the breaks follow `conditionality`, as for block fragments)
173
+ - **Word spaces in justified lines in the XSL-FO spec mode (`--compat spec`, `compat: 'spec'`, the default)** (**typesetting results change**): Latin word spaces are no longer compressed to pull a character or word into the line in justified lines either (the non-final lines of a paragraph with `text-align="justify"`, and lines set with `text-align-last="justify"`). Spaces never become narrower than their natural width; the word that used to fit by compression goes to the next line, and the line is filled by widening the word spaces (previously spaces could be compressed to 1/3 to take one more word). In XSL 1.1 §7.17.8, a word space for `word-spacing="normal"` or a length has `.minimum = .optimum` (no room to shrink). This continues the change in 0.2.0 that stopped compressing word spaces in lines that are not justified. Some paragraphs gain a line, so page breaks may move (the English XSL-FO conformance guide goes from 102 to 104 pages). Pulling in by compressing the space of punctuation (commas, brackets), compressing the quarter-em space between Japanese and Latin text (in documents with `axf:text-autospace`), compatibility mode (`--compat antenna`) and HTML are unchanged. Paragraphs with `inter-word` in `axf:text-justify-trim` still compress word spaces
174
+ - **XSL-FO footnote separators** (every mode; **typesetting results change**): when there is an `fo:static-content` with `flow-name="xsl-footnote-separator"`, its content is always formatted and placed at the start of the footnote area. In XSL 1.1 §6.12.1.3 the separator is the areas returned by formatting this static-content, and there is no default separator rule. Changes from 0.2.0:
175
+ - Separators whose border is written with `border-after-style`, `border-bottom-style`, `border-style` and so on, and separators made only of space (`padding-before`, an `fo:block-container` with a height, etc.), are formatted as written. Previously they were taken as having no content, and Kumiori's default separator rule (a solid line 1/3 of the body width) was used instead, with the note “replaced by the default separator rule”
176
+ - When the content is empty (no text, `fo:leader`, image, background, border or space; for example only an empty block), nothing is drawn and no space is taken (the same as when there is no such static-content). Previously the default separator rule was used here too
177
+ - The `space-before` of the first block of the separator (and of the first block inside a block that has no border or padding on its before side) is set to 0, because it begins the footnote reference area (XSL 1.1 §4.3.1; `space-before.conditionality="retain"` and space coming from `margin-top` and the like are kept). **Even for a separator with content, a `space-before` written at its start now makes the footnote area lower by that amount and moves the separator** (how much body text fits can change too). Previously that space was kept above the separator
178
+ - **Indent inheritance in XSL-FO** (spec mode only; **typesetting results change**): start-indent and end-indent are inherited into table cells and into list item labels and bodies as XSL 1.1 specifies (§5.3.2, §7.11.7, §7.11.8). (1) Blocks without indents inside a cell also inherit the indent of the table (and values written on the row groups, rows and cells), and are indented by that amount from the cell's content edge (previously they were placed at the cell's edge). (2) Labels and bodies are not reference areas (§6.8.4, §6.8.5), so a start-indent written as a length inside them is measured from the edge of the same reference area as the list (previously from the start edge of the body). (3) `from-parent()` and `inherited-property-value()` in start-indent and end-indent are read (§5.10.4; previously they were ignored with a warning). (4) The indent inherited into a block-container that has only margin-left or margin-right also includes the value inherited from outside (§5.3.2; previously only the margin, border and padding). Compatibility mode (`--compat antenna`) is unchanged. In both modes, when the start-indent of a nested list's label lies beyond the position of `label-end()`, the label no longer becomes 0 wide with its characters split vertically (the label ends provisional-label-separation before the start of the body). The sample for checking this is `samples/check/fo/indent-inheritance-1.fo`
179
+ - **Tolerance when balancing columns** (HTML and XSL-FO multi-column layouts; **typesetting results change**): the column height is now raised to make "the first column the longest and later columns shorter" only when a later column is at least 1em (of the multi-column box) longer than the one before it (it used to be raised whenever the difference exceeded 0.5pt). A difference under 1em is treated as equal height and left as is. In graphics-cgm-1 of the Antenna House sample FO collection, the two-column comparison of images (the image box in the second column is 1.24pt taller) no longer pulls the heading into the first column and matches the reference, so the document has 2 pages like the reference instead of 3. CSS-Print 4th edition and the other multi-column samples do not change
180
+ - **Whether a line fits on the page, in AH Formatter compatibility** (HTML `--style ah` and XSL-FO `--compat antenna`; **typesetting results change**): a line is now placed on the page even if its bottom exceeds the bottom of the body minus the footnotes by up to 0.05pt (previously only calculation error, up to 0.01pt). This matches the sample PDF (on page 75 of CSS-Print 4th edition, a figure caption that exceeds it by about 0.03pt is placed on that page; Kumiori moved it to the next page). In CSS-Print only pages 75 and 76 change (both closer to the sample). None of the 151 XSL-FO samples changes
181
+ - **Multi-column floats in multi-column boxes with a line grid** (HTML; **typesetting results change**): the contents of a `float: multicol top` box inside a multi-column box whose `-ah-baseline-grid` is `new` or `root` now form a line grid area like table cells, with no half-leading before the first line or after the last (with `new`, em boxes are stacked). The body text of the columns below the float sits on the line grid drawn from the top of the multi-column box's content (previously the grid was redrawn from the bottom of the float). This matches AH Formatter's samples (the multi-column float box in 9.3.6 of CSS-Print 4th edition is now 22pt instead of 30pt, as in the sample). Spanning only some of the columns is not supported yet (E-21 in `docs/BACKLOG.md`)
182
+ - **Captions of tables with a line grid** (HTML; **typesetting results change**): captions of tables whose `-ah-baseline-grid` is `new` or `root` now form a line grid area like the cells, with no half-leading before the first line or after the last (with `new`, em boxes are stacked). This matches AH Formatter's samples (in CSS-Print 4th edition, captions of tables with `table { line-height: 21q; -ah-baseline-grid: new }` have no half-leading above or below; in 10.2 the caption and the table were each 3.2pt too low)
183
+ - **Page breaks after headings with `--style ah`** (HTML; **typesetting results change**): `h1, h2, h3, h4, h5, h6 { page-break-after: avoid }` from the `@media print` block of CSS 2.1 Appendix D is added to the default style sheet. Headings without a page-break rule in the author CSS are no longer left alone at the bottom of a page; they move to the next page with the following paragraph (in the "はじめに" section of CSS-Print 4th edition, the heading "Antenna House CSS Formatter" was left at the bottom of page 3; the sample has it at the top of page 4). The other two rules of that block (a page break before `h1`, and no page break before lists) are not added because the sample is not typeset that way
184
+ - **Antenna House compatible squeezing** (`--style ah` only; **typesetting results change**): when a line would fit by squeezing more than the per-line limit (half an em), it is now still squeezed in if the amount to squeeze is no more than the space the line would be left with if the overflowing part were pushed to the next line (the smaller adjustment is chosen). Previously lines needing more than half an em were always pushed out, so the vertical example in 17.9 of *CSS Page Composition Primer* 4th edition (`hanging-punctuation: first`) was set as “『行人』/『こゝろ』” (the sample squeezes a full em: “『行人』『こ/ゝろ』”). In the sample PDF, among the lines that would fit by squeezing more than half an em (232 places whose line starts match the sample), 17 of the 22 the sample squeezed and 205 of the 210 it pushed out follow this rule. Places in the whole book where lines differ from the sample: 575 → 482 (1227 → 1158 when the examples use the same fonts as the sample). Spec mode, the other styles and XSL-FO compatibility mode (`--compat antenna`) are unchanged
185
+ - **Light and dark shades of 3D borders in spot colours** (HTML with `--style ah` and XSL-FO, when spot-colour values (`--spot-colors`) are given; **typesetting results change**): for `groove`, `ridge`, `inset` and `outset` borders drawn in a spot colour (`rgb-icc(r, g, b, #Separation, 'name')`), the light and dark shades are now made from the alternate RGB the author wrote in `rgb-icc()`. Previously they were made from the spot colour's alternate CMYK converted to RGB, which came out darker than the reference. The shades are now the same as for the border without spot-colour values (drawn in that RGB colour). How the shades are made (half-way to white for the light side, a third of the way to black for the dark side) and painting them in RGB are unchanged (CSS Backgrounds 3 §3.2 leaves the colours of 3D borders to the implementation). A spot colour without an alternate RGB (`rgb-icc(#Separation, 'name')`) still uses its alternate CMYK. In *CSS Page Composition Primer* 4th edition (`--style ah`, with spot-colour values), the shades of the border samples (`.BorderSample`) on page 26 become (0, 41, 17) and (128, 158, 140), against the reference's RGB (0, 40, 16) and (128, 158, 140) (previously (2, 20, 12) and (129, 143, 137))
186
+ - **Reading CGM character sets** (every mode; **typesetting results change**): when CHARACTER CODING ANNOUNCER is basic 8-bit and CHARACTER SET INDEX selects a 96-character set (such as the right half of ISO 8859-1), the characters 0x20–0x7E were read as characters of the 96-character set (right-half characters). They are now read as characters of the 94-character set (ISO 646 and so on), and the 96-character set is used for 0xA0–0xFF (in the 8-bit code of ISO/IEC 2022 a 96-character set can only be placed in the right half; WebCGM 2.1 T.16.14 and T.14.5). The text in the table of the WebCGM test BIGCGM01 (the Antenna House sample graphics-cgm-1), which was garbled like “ÃÇÍïðåî”, now reads “CGMopen” as in the sample
187
+ - **Soft hyphens in SVG text** (every mode; **typesetting results change**): soft hyphens (U+00AD) and other characters that are not drawn (Default_Ignorable_Code_Point) in SVG text (including SVG made from CGM) are not drawn and are no longer passed to the font's layout. Previously, with fonts whose soft hyphen shares the hyphen's glyph (Arimo, Noto Serif JP and others), drawing a soft hyphen first polluted the font's glyph memo (fontkit), so later “-” in the same font became a zero-width space glyph, vanished and overlapped the following characters (PDF)
188
+ - **Bundle size and what is loaded at start** (no change to the typeset result): the CGM, EPS (the PostScript interpreter), WMF and EMF processing is now loaded only when a document contains such an image. In the web app (`npm run build`) and the browser library (`kumiori/browser`) it is in separate files (`cgm-….js`, `eps-….js`, `metafile-….js`) that are not loaded for documents without these images. The JavaScript loaded at start went from about 3,649KB to about 3,367KB for the browser library (about 1,203KB to about 1,126KB gzipped; in this release, with the other changes, about 3,414KB, about 1,138KB gzipped), from about 2,815KB to about 2,609KB for the web app, and from about 2,199KB to about 1,917KB for the entry of `npm run build:lib`. How you use Kumiori (the `typeset` API, the command and the web app) does not change: CGM, EPS, WMF and EMF are read as before, with nothing to add. The per-document time budget for EPS is also unchanged. In the npm package, the library JavaScript grew because the draw.io processing is now built in, but the source maps of the library (`dist-lib`; the `.js.map` files, 9 files and about 10.6MB, which contained the full source) are no longer included. The package went from 170 files and a tarball of about 5.6MB (about 18.6MB unpacked) in 0.2.0 to 228 files and about 4.5MB (about 16.0MB unpacked) (with the source maps it would have been 236 files and about 7.2MB (about 26.4MB unpacked)). The distributed JavaScript is not squeezed onto fewer lines and keeps the names of class methods (only the names of functions, variables and parameters are shortened), so the location of an error can be found from the `dist-lib` JavaScript lines and method names in the stack trace. The source can be viewed at the tag of that version on GitHub
189
+ - **Memory** (no change to the typeset result): the memo of line-breaking results (reused when the same paragraph is laid out again at the same width: column balancing, keep-with-next trials, measuring table cells) now has a size limit and drops the oldest entries. Previously the atoms, lines and line positions of every paragraph in the document were kept until layout finished. Memory still live when layout finishes (after GC): plain text 1MB 657MB → 486MB, a 1MB table (100,000 cells) 1458MB → 592MB. Maximum resident set size: text 934MB → 837MB, table 1971MB → 1671MB (layout time unchanged). The limit is `LayoutOptions.lineMemoAtoms` (default 50,000). The layout counters (`LayoutEngine.stats`) gain the largest memo size (`lineMemoPeak`) and the number of reuses (`lineMemoHits`)
190
+ - **Speed and memory** (no change to the typeset result): lighter parsing, cascade and import for HTML with many elements nested beyond the nesting limit (128 levels). (1) The computed-value table of each element keeps only the values that differ from the parent or from the initial value (previously every element held all ~200 properties). (2) Descendant-combinator matching remembers the answers for ancestors more than 16 levels up. (3) The ancestor walk for `text-align: inside`/`outside` (`--style ah`) remembers its answers. (4) The lists of open elements in the HTML parser used on Node (htmlparser2, used by linkedom) are replaced with a container whose additions and removals at the front are cheap (previously the work grew with the square of the depth). If htmlparser2 uses these lists in ways the container does not cover (for example after a version change), it is left as is. htmlparser2 is now also a direct dependency (`^10.1.0`, the same range as linkedom), so that the patched copy is the one linkedom uses. `<b><i><a><font>` × 30,000 (474KB): 24.3 s / 1.8GB → 14.1 s / 1.2GB; `<h1><button>` × 50,000 (600KB): 39.3 s / 1.8GB → 20.0 s / 1.2GB (Node's maximum resident set size)
191
+ - **Parsing cost**: the remaining twelve regular expressions applied to input whose cost was quadratic or worse in the input length now take linear time, with the same results. HTML: the `::first-letter` letter (a run of newlines with no letter), trimming spaces when measuring line widths (a long run of spaces in the middle), splitting `string-set` at commas (a run of commas), spaces around newlines (a run of spaces without a newline), and the resolution of `image-resolution` (`-ah-image-resolution`) (close to cubic for a long run of digits). The SVG table of fonts (a document with many unclosed `<` or `<svg`, and an unclosed run after a palette color `var(--colorN, …)`; the latter took more than two minutes for 20,000 characters). The DOCTYPE of `fo:instream-foreign-object` and of MathML files in XSL-FO (a run of spaces in an unclosed declaration). Each took 0.3 to 0.5 seconds for about 20,000 characters. When expanding internal entities of XML (XSL-FO and so on), finding the internal subset of the DOCTYPE (a run of unclosed `<!DOCTYPE a`; 4.3 seconds for 220,000 characters) and skipping comments and CDATA sections (a run of unclosed `<!--` or `<![CDATA[`; 0.9 seconds for 80,000 characters)
192
+ - **Collapsed table borders**: cells that span columns (`colspan`, `number-columns-spanned`) are now handled as ranges rather than one grid slot per column, both when collapsing borders (`border-collapse: collapse`) and when placing cells on the table grid. The work is proportional to the number of cells and the rows they span, not to the number of columns they span. A table of 150 rows × 150 cells with `colspan="1000"` (564 KB, 150,000 columns) now takes 7.9 s instead of 12.6 s to typeset (local measurement; the rest is typesetting the 22,500 cells themselves). The typeset result is unchanged
193
+ - **Large images**: images at the pixel limits (100 million pixels per image, and the per-document totals) are now typeset faster without changing the result (the limits themselves are unchanged). In local measurements, putting a 100-megapixel RLE BMP (about 800 KB) into a PDF went from 16 s to 3 s, a 64-megapixel CGM TILE from 17 s to 5 s, and an EPS drawing three 25-megapixel images from 14 s to 2 s. (1) zlib decompression now uses table-driven code lookup and writes into byte arrays (checking PNG pixel data, CGM TILE, font tables and so on). (2) 8-bit PNGs with alpha are decompressed by Kumiori itself when put into a PDF, producing the same RGB and alpha images as pdf-lib. (3) Opaque images that Kumiori decodes (GIF, BMP, TIFF, WebP, images in EPS and so on) are now encoded as RGB PNGs and put into the PDF without decompression (the image streams in the PDF change, but the pixels are the same). (4) Faster copying and checksums for uncompressed PNGs (CRC-32 and Adler-32), base64 decoding of data: URIs (using built-in conversion), and pixel conversion of DeviceGray and DeviceRGB PostScript images
194
+ - **Fonts**: Damaged fonts no longer make the whole document fail (the remaining two kinds of tables that could only be found unreadable while typesetting). (1) A font whose layout tables (such as GPOS) have a reference to nothing only for particular character sequences (shaping the registration sample still works): only those sequences are shaped again without the layout tables (cmap glyphs, hmtx advances; shaping stays on for the font, so other sequences are set as before). Previously the characters of those sequences silently disappeared from the PDF, and where the text is encoded for the PDF the whole document failed. (2) A glyph whose data cannot be read (for example in a font whose loca offsets are shifted): it becomes a glyph without an outline in the PDF subset font (advance from hmtx), instead of failing the whole PDF. Both are reported once per font in the result's warnings. Results for valid fonts do not change
195
+ - **Robustness against broken or crafted input**: Fixed the remaining places where a name such as `constructor`, `__proto__` or `toString` written in the input picked something from Object.prototype out of a table looked up by name (a follow-up to the 0.2.0 fix). An SVG element name (`<svg><constructor/></svg>`) made the whole document fail with a `TypeError`. MathML `linethickness="constructor"` made the fraction rule thickness NaN, and `lspace="__proto__"` and the like made spacing NaN. `@constructor { … }` inside `@page` was treated as a margin box and not reported as an unknown name. `axf:column-rule-width="constructor"` made the column rule width not a number. The tables for `target-counter()` counter names, the values of `font-variant-numeric`, `-ligatures` and `-east-asian`, position keywords (`background-position`, `transform-origin`, `at` in gradients), system colour names, `font-size` and `font-stretch` keywords (CSS and XSL-FO) and MathML `mathsize` also no longer have a prototype. Typesetting results of valid documents do not change
196
+ - **Security and robustness against crafted input** (limits and their grounds are in the source comments; beyond a limit only that image, declaration or glyph is left out, or it is drawn up to that point with a warning, and the rest of the document is typeset):
197
+ - Node command: with `--no-outside-files`, files inside the input directory whose real path is outside it (symbolic links pointing outside) are not used (a link `a.png → ../secret/s.png` placed in the directory got the outside image drawn into the PDF). When a loaded plugin never finishes, the command reports an error and exits with code 1
198
+ - Rasterized SVG filters (Node): for `feMorphology`, the window maximum and minimum are computed with constant work per pixel, however large the `radius`. `feTurbulence` `numOctaves` is computed up to 24 (later octaves do not change 8-bit colors). For `feGaussianBlur`, the work is bounded by the image size, however large the `stdDeviation`. Named results (`result`) that are not referenced later are not kept, and when many results are waiting to be referenced, the resolution is lowered. Each SVG has a computation budget: filters beyond it are computed at a lower resolution, and once it runs out the SVG is treated as unsupported (a placeholder frame and a warning; SVGs with many filtered elements, nested patterns or masks, chains of feImage)
199
+ - SVG: the length of `var()` substitution is limited (2 MiB per value, 16 MiB per SVG; the same idea as on the HTML side). `calc()` is evaluated in time linear in the length of the value, nested at most 32 levels. Attribute selectors in `<style>` are looked up through an index, and selector matching is capped at 500,000 matches. SVG font ligatures are looked up with a trie (up to 64 characters), and glyph outlines count toward the path segment limit. Nested foreignObject elements are not typeset again. An SVG is reused across languages that give the same `systemLanguage` result. Writing an SVG text with very many characters no longer fails in PDF output. SVG links are capped at 5,000 per page
200
+ - Results from image formats (plugins and draw.io diagrams) are checked: a finite size up to 10 million px, a limit on the SVG length, a load time limit (150 s by default), and at most 64 distinct `#` references per file
201
+ - CSS: matching a selector with many descendant (whitespace) or subsequent-sibling (`~`) combinators (60 chained `div`s, for example) tried every choice of non-matching ancestors and took over 30 seconds. A selector whose combinators are all descendant or all subsequent-sibling combinators is now matched in time linear in the number of elements, remembering one number per element (how many compound selectors, from the left, can be matched in order by its ancestors or preceding siblings); a selector of 20,000 `i`s chained with `~` against 20,000 `<i>` elements (240KB) takes 2 seconds. A selector mixing kinds of combinators (`a ~ b c`, for example) memoizes intermediate results, taking time proportional to the number of compound selectors times the number of elements; one with more than 64 compound selectors is not matched against any element and is reported in a warning (real stylesheets have no selectors that long). Apart from selectors over that limit, the rules that apply are unchanged
202
+ - **Development** (typesetting results do not change):
203
+ - Added `npm run ci:local` (`scripts/ci-local.mjs`), which runs the CI steps locally. It runs the steps of the build, node-min and e2e jobs of CI (`.github/workflows/ci.yml`) and of the web app build for GitHub Pages (`.github/workflows/pages.yml`; the pages job) in order and lists the result of each step. With `--worktree`, the current commit is checked out to a temporary place and tested there
204
+ - Chromium for the integration tests: `npm run e2e` (`playwright.config.ts`) now also uses the Chromium executable that the environment variable `KUMIORI_CHROMIUM` points at, like the comparison scripts (the reading is shared in `scripts/chromium.mjs`). This lets the tests run without a temporary config where the Playwright version and the installed Chromium do not match. Without it, the Chromium Playwright downloaded is used as before
205
+
7
206
  ## 0.2.0 (2026-11-12)
8
207
 
9
208
  A release that adds flex features, WOFF/WOFF2, an API for loading referenced files, and more. While in 0.x, it is a minor release because it includes fixes that change typesetting results.
@@ -51,7 +250,7 @@ A release that adds flex features, WOFF/WOFF2, an API for loading referenced fil
51
250
  - List items, table rows and forced breaks inside them (CSS Fragmentation 3 §2.1, §3.1 and §4.3). **The layout result changes**: `break-before` and `break-after` (`page` and so on) now take effect on blocks inside an `li`, on the `li` of a nested list, and on blocks inside a table cell (the item or row is split at that point; previously they were ignored). `left`, `right`, `recto` and `verso` on an `li` in the middle of a list or a `tr` in the middle of a table insert a blank page until the parity matches (previously they only started a new page). `column` on such an `li` or `tr` inside a multi-column context takes effect. `page` on such an `li` or `tr` in a document whose pages are set in columns starts a new page, not the next column. `break-before: column` and `break-after: column` outside a multi-column context have no effect (previously they started a new page even where there were no columns). In XSL-FO too, `break-before` and `break-after` on a block inside a table cell or a list item body split the row at that point (XSL 1.1 §4.8; previously ignored)
52
251
  - Containing blocks of absolutely positioned boxes (CSS 2.1 §10.1, CSS Position 3 §2.1). **The layout result changes**: a `position: absolute` box inside a table, table cell, list item or vertical-writing box with `position: relative` (or `transform`) is placed relative to the padding box of that box. When a table or list item lies between the box and its reference block, that block is still the reference (previously the body region of the page was used in all these cases, and the position was far off). The `position: relative` offset of a block in vertical writing is now applied in physical directions (`left` horizontally, `top` vertically). An element within a line (`span`, `inline-block`) with `position: relative` is also a reference (the rectangle around its padding boxes). A `position: absolute` box inside an inline element is no longer dropped. An absolutely positioned box in the middle of the text of a paragraph no longer splits the line. The `position: relative` offset (`top`, `left` and so on) of elements within a line (`span`, `inline-block`, `img`) now takes effect (CSS 2.1 §9.4.3; previously ignored)
53
252
  - Percentages for `top`, `bottom` and `height` of absolutely positioned boxes (CSS 2.1 §10.5, CSS Position 3 §3.1). **The layout result changes**: `top: 50%`, `top: 100%` (the drop-down pattern), `bottom: 10%`, `inset: 10%` and `height: 50%` are read as fractions of the height of the padding box of the containing block (when the height of that box depends on its content, the height after layout; with no positioned ancestor, and for `position: fixed`, the height of the page content area; also for absolutely positioned `::before` and `::after`). Before, percentages for `top` and `bottom` were treated as absent (the box appeared at the top of the reference box or where it was found), and percentages for `height` were taken from the content height of the parent
54
- - Positions of absolutely positioned boxes (NC-28). **The layout result changes**: an absolutely positioned box in the middle of a line of a paragraph whose `left` and `right` (and `top` and `bottom`) are `auto` is placed where it was found in the line (the static position; CSS 2.1 §10.3.7, §10.6.4). Before, it was placed at the start of the first line of the paragraph and overlapped the preceding text. Boxes found inside table cells are handled the same way. An absolutely positioned box inside a flex or grid container (horizontal writing) with `position: relative` (or `transform`) is placed relative to the padding box of the container (CSS Flexbox 1 §4.1, CSS Grid 1 §9.1; before, the body region was the reference). A `position: static` flex or grid container whose height depends on its content lets the reference pass through to an outer containing box. The `position: relative` offsets (`left`, `top`, etc.) of list items (`li`) and table cells (`td`, `th`) now take effect (CSS 2.1 §9.4.3; a list item moves together with its marker, and row heights and the positions of other cells do not change; before, they had no effect)
253
+ - Positions of absolutely positioned boxes. **The layout result changes**: an absolutely positioned box in the middle of a line of a paragraph whose `left` and `right` (and `top` and `bottom`) are `auto` is placed where it was found in the line (the static position; CSS 2.1 §10.3.7, §10.6.4). Before, it was placed at the start of the first line of the paragraph and overlapped the preceding text. Boxes found inside table cells are handled the same way. An absolutely positioned box inside a flex or grid container (horizontal writing) with `position: relative` (or `transform`) is placed relative to the padding box of the container (CSS Flexbox 1 §4.1, CSS Grid 1 §9.1; before, the body region was the reference). A `position: static` flex or grid container whose height depends on its content lets the reference pass through to an outer containing box. The `position: relative` offsets (`left`, `top`, etc.) of list items (`li`) and table cells (`td`, `th`) now take effect (CSS 2.1 §9.4.3; a list item moves together with its marker, and row heights and the positions of other cells do not change; before, they had no effect)
55
254
  - Tables with `writing-mode` (CSS Writing Modes 3 §2.1, CSS 2.1 §17). **The layout result changes**: a table (`table`, `display: table`) with `writing-mode: vertical-rl` or `vertical-lr` in a horizontal document is laid out vertically (rows run from right to left and the cells in a row from top to bottom; previously the `writing-mode` of the table was ignored and it was laid out horizontally). The same applies to a `horizontal-tb` table in a vertical document. The size of a table with separated borders (`border-spacing`) whose writing mode differs from its parent now includes the cell spacing
56
255
  - Anonymous table rows and cells (CSS 2.1 §17.2.1). **The layout result changes**: content that is not a table part (text or other elements) directly inside a table (`display: table`, `inline-table`) or a row (`table-row`) is wrapped in an anonymous row and an anonymous cell (previously it was dropped, for example the text of `<span style="display: inline-table">text</span>`)
57
256
  - `text-indent` on tables (CSS Text 3 §8.1 and the HTML default style sheet). **The layout result changes**: `text-indent` specified on a table now applies to the lines in its cells (previously ignored). `text-indent` from outside a table (`body`, `div` and so on) does not enter the table (`table { text-indent: initial }`; previously the outer indent applied to the lines in cells; this matches browsers)
@@ -216,7 +415,7 @@ A release that adds flex features, WOFF/WOFF2, an API for loading referenced fil
216
415
  - `font-variant="small-caps"` and `word-spacing` (a length added to inter-word spaces) are now read (XSL 1.1 §7.9.8, §7.17.8)
217
416
  - `auto`, `0deg` (all glyphs upright) and `90deg` (all glyphs rotated sideways) of `glyph-orientation-vertical` are now read (XSL 1.1 §7.29.3). 180 and 270 degrees, and values other than 0 degrees of `glyph-orientation-horizontal`, are not read and are reported
218
417
  - `relative-position="relative"` (an `fo:block` in horizontal writing is drawn shifted), `hidden` and `collapse` of `visibility` (the space is kept but nothing is drawn) and a negative `z-index` on an absolutely positioned `fo:block-container` (drawn behind the body text) are now read (XSL 1.1 §7.13.5, §7.30.17, §7.30.18)
219
- - The kinds of `break-before` and `break-after` (`odd-page`, `even-page`, `page`, `column`) on `fo:table-row` and `fo:list-item` are kept, as for `fo:block` (XSL 1.1 §7.20.1, §7.20.2; NC-28). **The layout result changes**: `odd-page` and `even-page` on a row or item start it on an odd or even page, inserting a blank page when needed (before, every kind only moved it to the next column or page). In a multi-column region, `page` moves to the next page instead of the next column
418
+ - The kinds of `break-before` and `break-after` (`odd-page`, `even-page`, `page`, `column`) on `fo:table-row` and `fo:list-item` are kept, as for `fo:block` (XSL 1.1 §7.20.1, §7.20.2). **The layout result changes**: `odd-page` and `even-page` on a row or item start it on an odd or even page, inserting a blank page when needed (before, every kind only moved it to the next column or page). In a multi-column region, `page` moves to the next page instead of the next column
220
419
  - Digit grouping of page numbers (`grouping-separator` and `grouping-size` on `fo:page-sequence`) is read (XSL 1.1 §7.26.2, §7.26.3; "1,234"). The values of `letter-value` are accepted (§7.26.4)
221
420
  - Table-of-contents lines: `last-line-end-indent` is read (XSL 1.1 §7.16.3), so wrapped lines can stop short of `end-indent` while only the last line, with the page number, runs to the edge (`text-align-last="justify"` + `end-indent` + a negative `last-line-end-indent`). `reference-area` and `page` of `leader-alignment` are read (§7.22.1): the cycles of a dotted leader are aligned to a grid from the edge of the body region (column, table cell) or of the page
222
421
  - `fo:initial-property-set` is read (XSL 1.1 §6.6.4): the font properties, `color`, `letter-spacing`, `word-spacing`, `text-decoration` and `background-color` are applied to the first line of an `fo:block` only. `text-transform`, `font-variant`, `line-height`, borders, `padding` and the like are not read and are reported