You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c7feafa
Browse filesBrowse the repository at this point in the historyBrowse files
Render the new selectors and shorthand resets as before in cssMode legacy (#633)
* Render the new selectors and shorthand resets as before in cssMode legacy
Legacy mode compiles no rule, so a rule whose selector mPDF v7 could not read is dropped, as it was before the selector matcher: child and sibling combinators, structural pseudo-classes outside tables, attribute selectors other than [lang], :lang() through an ancestor, descendant rules through inline ancestors, and :not(), :is() and :where(). The font, border and background shorthands leave the longhands they do not name.
With nothing compiled in legacy mode, the matching of legacy rules through the ancestors the legacy engine skips is gone: the legacy flag on compiled rules, the rule set's legacy index, the matcher's legacy view and the level mark on open elements.
Fixes to how values and selectors are read apply in both modes. Rendered in legacy mode, 137 of the 142 snapshot documents match the tree before the matcher (258839c) byte for byte; the other five differ by the shorthand resets, the small-caps fix of #581, the selector list split of #619 and the cell count of #629.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Make the kept-block cascade context unwind and check that it does
The kept-block context wrote so much filler that its block started on the second page and was never put back, so
it did not test a block laid out twice. The filler is now a fixed height that leaves the block starting on the first
page and running over it. Every case in the cascade and legacy-mode context tests now asserts where its text is
drawn: put back once and drawn on the second page for the kept block, on the second page after the forced page
break, and in the header, the footer or the positioned block for those. TextRecordingMpdf counts unwinds and records
which of those it is drawing in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG-GRAVITYPDF.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Read this section before upgrading from upstream mPDF. Each entry says what chan
29
29
***`<annotation file="...">` is off by default.** Set `allowHtmlAnnotationFiles` to `true` to read the `file` attribute. [#375]
30
30
***A `<select>` without `size` is written as a combo box**, as browsers draw it. [#419]
31
31
***A `<select multiple>` without `size` is four rows tall instead of one**, as in browsers. Content after it on the page moves down. Add `size="1"` to keep the old height. [#437]
32
-
***The `border` and `background` shorthands reset the longhands they do not name**, as in a browser. [#552][#614]
32
+
***The `border` and `background` shorthands reset the longhands they do not name**, as in a browser, in standard mode. [#552][#614]
33
33
*`border`, or one side such as `border-top`, sets the width, style and colour of each side it covers. `p { border-top-color: red } p { border: 1px solid blue }` used to draw a red top and now draws a blue one.
34
34
*`background` sets the colour, image, repeat, position, size, origin and clip. A `background-position`, `-repeat` or `-size` given before a `background` no longer applies to its image.
35
35
* To keep the old look, restate the longhand after the shorthand, in the same rule or a later one.
@@ -41,6 +41,7 @@ Read this section before upgrading from upstream mPDF. Each entry says what chan
41
41
* Each element takes, in order: the values it inherits; the built-in defaults and the rules of the default stylesheet (`defaultCssFile`), which any author rule beats; HTML attributes such as `<hr color>`, `width` and `vspace`, as author rules of no specificity; the stylesheets; then `style=""`.
42
42
* Class and id names still match whatever their case.
43
43
* An author's `a { }` rule now reaches the links of the table of contents and the index too. Style `a.mpdf_toc_a` and `a.mpdf_index_link` to keep them plain.
44
+
* In legacy mode, a rule whose selector mPDF v7 could not read is dropped: child and sibling combinators, structural pseudo-classes outside tables, attribute selectors other than `[lang]`, `:lang()` through an ancestor, descendant rules through inline ancestors, and `:not()`, `:is()` and `:where()`. The `font`, `border` and `background` shorthands leave the longhands they do not name, as mPDF v7 did. Fixes to how values and selectors are read apply in both modes. [#633]
44
45
45
46
New features
46
47
------------
@@ -176,7 +177,7 @@ Bugfixes
176
177
* With several layers, mPDF still draws only the first, now over the colour given in the last.
177
178
* A `border` or `background` shorthand with a part that is none of its parts, such as `border: 1px solid bogus`, is dropped, as a browser drops it, so the value it would have replaced still applies. `border: 1px solid bogus` used to draw a black border. [#552][#583]
178
179
*`tr:nth-child()` counted the rows of the whole table less its header and footer rows, so a second `<tbody>` carried on the count of the first, and `tr:first-child` missed the first footer row when `<tfoot>` came after the body. Rows are now counted within their `<thead>`, `<tbody>` or `<tfoot>`, or within the run of rows written straight into the table. [#528][#582]
179
-
*`font: small-caps 14pt serif` drew the text in full-size capitals, as `text-transform: uppercase` does. It is now drawn in small capitals, as `font-variant: small-caps` draws it. The `font` shorthand also kept a `line-height` and a `font-variant` it inherited; like the style and weight, they are now reset to `normal` when the shorthand does not name them, as in a browser. To keep a line height, give it in the shorthand, as in `font: 14pt/1.5 serif`, or declare `line-height` after it. A `font` shorthand with a negative line height, such as `font: 12pt/-1 serif`, is dropped whole. `font-variant: normal` now resets `font-variant-position` as well. [#552][#581]
180
+
*`font: small-caps 14pt serif` drew the text in full-size capitals, as `text-transform: uppercase` does. It is now drawn in small capitals, as `font-variant: small-caps` draws it. The `font` shorthand also kept a `line-height` and a `font-variant` it inherited; like the style and weight, in standard mode they are now reset to `normal` when the shorthand does not name them, as in a browser. To keep a line height, give it in the shorthand, as in `font: 14pt/1.5 serif`, or declare `line-height` after it. A `font` shorthand with a negative line height, such as `font: 12pt/-1 serif`, is dropped whole. `font-variant: normal` now resets `font-variant-position` as well. [#552][#581]
180
181
* A percentage `width`, `min-width` or `max-width` on an image in a table cell was resolved against the block around the table, not the cell. In a 60mm cell, `max-width: 20%` came out as 36mm. [#223][#505]
181
182
* An `@page :left` or `@page :right` rule was ignored unless the style sheet also had a plain `@page` rule. With one, the margins of a `:right` rule were applied to left pages too. [#555][#556]
182
183
* When a later `WriteHTML()` call turned the document right to left, the text on the page already started was set between the swapped side margins. That page now keeps its margins, and the swap starts with the next page. [#554][#558]
@@ -829,3 +830,4 @@ These changes do not change output.
0 commit comments