1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 07:57:52 +03:00
Commit Graph

318 Commits

Author SHA1 Message Date
Guillaume Ayoub
00d5b03587 Don’t break reproducible PDF creation when using images
Fix #1666.

Note that the added test doesn’t test this problem, because the "hash" function
is stable when we use the same process. If someone finds a nice way to solve
this…
2022-06-29 19:03:58 +02:00
Guillaume Ayoub
c031a40439
Merge pull request #1660 from Kozea/line-clamp
Support nested line-clamp
2022-06-17 10:09:38 +02:00
Guillaume Ayoub
d8533dad9c
Merge pull request #1644 from Kozea/bitmap-fonts
Bitmap fonts
2022-06-17 10:08:49 +02:00
Guillaume Ayoub
e38bff8b99 Don’t crash when inherited SVG attributes are not set on the parent 2022-06-17 10:07:28 +02:00
Guillaume Ayoub
eadd5c0c7b Remove xfail for passing tests about opacity 2022-06-16 17:23:09 +02:00
Guillaume Ayoub
d3883c4428 Test nested line-clamp 2022-06-13 16:36:05 +02:00
Guillaume Ayoub
191e015f89 Test bitmap fonts 2022-06-13 16:23:44 +02:00
Guillaume Ayoub
358b9469bf
Merge pull request #1651 from Kozea/pdfa
Support PDF/A
2022-06-13 14:52:12 +02:00
Guillaume Ayoub
04e1ff2f7a Fix chained variables in the same selector block
As a side effect, fix also the case when a variable is missing in the root
element.

Fix #1656.
2022-06-10 20:10:33 +02:00
Guillaume Ayoub
e4885f9cff Don’t crash when @font-face’s src ends with a comma
That was the only @comma_separated_list function to assume "tokens" is not
empty.

Fix #1653.
2022-06-01 16:59:30 +02:00
Guillaume Ayoub
3211163f8c Add and fix tests for custom metadata 2022-05-27 11:26:24 +02:00
Guillaume Ayoub
bff1dd5b22 Add option to set PDF version
Related to #1131.
2022-05-27 11:26:24 +02:00
Guillaume Ayoub
ed84e5a8ea Test PDF/A 2022-05-27 11:26:24 +02:00
Guillaume Ayoub
09364c254e Refactor PDF generation 2022-05-27 11:26:15 +02:00
Guillaume Ayoub
e212c83b50 Remove useless parameters from testing utils 2022-05-23 23:09:32 +02:00
Guillaume Ayoub
a001af7c33 Remove useless parameters from tests helpers 2022-05-23 12:01:11 +02:00
Guillaume Ayoub
56b79ba375 Fix test name 2022-05-23 09:55:13 +02:00
Guillaume Ayoub
6ade02b234 Use f-strings when possible 2022-05-17 16:40:30 +02:00
Guillaume Ayoub
1545a45092 Merge branch '55.x' 2022-05-10 14:34:25 +02:00
Guillaume Ayoub
50ad4d1ac0 Fix relative paths for SVG files stored as data URLs
Fix #1641.
2022-05-10 14:31:25 +02:00
Guillaume Ayoub
96f26504ce Use the original box when breaking waiting children
Before this commit, when we had to break previously rendered waiting children
in a line, we re-rendered the already-rendered children. That was bad, because
the tree of the children that were already rendered were different from the
original tree, that may include leading spaces for example. It also required a
complex mix of the original resume-at with the original skip-stack.

This new solution includes both the original child (to render it from a fresh
start) and the already-rendered child (to get the previous positions). The
skip-stack mix is now useless, removing a lot of complex code.

This change is scary and will probably break some corner cases. But tests pass,
and a new one has been added to avoid future regressions.

Fix #1638.
2022-05-09 22:39:31 +02:00
Guillaume Ayoub
c53528753b Merge branch '55.x' 2022-05-05 16:29:26 +02:00
Guillaume Ayoub
bc4053510a Fix absolute position for rtl
Fix #1637. Related to #1613.
2022-05-05 16:28:55 +02:00
Guillaume Ayoub
a4d52533ec Add and improve tests for the "html" module 2022-05-05 15:47:43 +02:00
Guillaume Ayoub
733815c96b Test invalid images 2022-05-04 16:01:40 +02:00
Guillaume Ayoub
491503c482 Handle "footnote-policy: auto" footnotes correctly 2022-05-03 09:48:17 +02:00
Guillaume Ayoub
eb489e5847 Minor cleanups 2022-05-03 09:33:14 +02:00
Guillaume Ayoub
7fe5e43a2d Minor cleanups 2022-05-02 22:34:51 +02:00
aschmitz
2f207d13ab fix: sequential footnotes could disappear when overflowing
Previously, if a footnote triggered an overflow (that is, it was too
large for the containing space), but footnote-policy didn't make us push
down the line containing it, any subsequent footnotes in the same
linebox would not be set into a footnote area, because they would never
be passed to layout_footnote and report_footnote. (Their call sites
would be set, but their content would not be.)

This also fixes a potential infinite loop where using footnote-policy
could have forced the first line of a page to be pushed to the next
page: that will just result in an infinite loop, so instead we set the
line and move on if we are on the first line of a page. (This behavior
is not specified in GCPM, but no other behavior seems practical: the
only alternative would be to expand the page, which is almost certainly
less desirable.)
2022-05-02 21:50:31 +02:00
aschmitz
29bd8f932f fix: sequential footnotes could disappear when overflowing
Previously, if a footnote triggered an overflow (that is, it was too
large for the containing space), but footnote-policy didn't make us push
down the line containing it, any subsequent footnotes in the same
linebox would not be set into a footnote area, because they would never
be passed to layout_footnote and report_footnote. (Their call sites
would be set, but their content would not be.)

This also fixes a potential infinite loop where using footnote-policy
could have forced the first line of a page to be pushed to the next
page: that will just result in an infinite loop, so instead we set the
line and move on if we are on the first line of a page. (This behavior
is not specified in GCPM, but no other behavior seems practical: the
only alternative would be to expand the page, which is almost certainly
less desirable.)
2022-05-02 14:27:51 -05:00
Guillaume Ayoub
aa348dabe7 Add failing test about floats
Related to #1629.
2022-04-28 16:48:46 +02:00
Guillaume Ayoub
bc1770f97b Rename tests 2022-04-28 16:48:46 +02:00
Lucie Anglade
185ea5380f Make test pass indenpently of default font size 2022-04-28 12:12:09 +02:00
Guillaume Ayoub
67075b4c46 Merge branch '55.x' 2022-04-25 23:43:37 +02:00
Guillaume Ayoub
3ad6982f4e Fix available height for absolute boxes with "bottom" property set
Fix #1626.
2022-04-25 23:42:36 +02:00
Guillaume Ayoub
3802f8857a Fix the y position of split absolute boxes 2022-04-25 23:42:24 +02:00
Guillaume Ayoub
2a8ca143c0 Revert and test "Remove useless condition"
This reverts commit 34944e06c4.
2022-04-25 19:07:33 +02:00
Guillaume Ayoub
e5e6b88203 Reset the bottom space even when we don’t fill the columns 2022-04-25 19:07:23 +02:00
Guillaume Ayoub
964109867f Stop rendering when column content doesn’t fit in the page 2022-04-25 19:07:13 +02:00
Guillaume Ayoub
f5b970eb26 Revert and test "Remove useless condition"
This reverts commit 34944e06c4.
2022-04-25 19:05:53 +02:00
Guillaume Ayoub
e1de59af96 Reset the bottom space even when we don’t fill the columns 2022-04-25 18:30:27 +02:00
Guillaume Ayoub
6bd5a59a04 Stop rendering when column content doesn’t fit in the page 2022-04-25 18:26:04 +02:00
Guillaume Ayoub
1e4fde4ee0 Clean font management 2022-04-19 00:01:50 +02:00
Guillaume Ayoub
709255bc44 Test overconstrained relative blocks 2022-04-18 14:43:22 +02:00
Guillaume Ayoub
1b8ba2c3ab Test string(…, start) 2022-04-18 13:08:32 +02:00
Guillaume Ayoub
ee19c6af9c Test break-before: page on root boxes 2022-04-18 12:51:21 +02:00
Guillaume Ayoub
c2b2457f54 Test reset page counters 2022-04-18 12:06:36 +02:00
Guillaume Ayoub
a869831740 Add drawing tests 2022-04-18 11:48:35 +02:00
Guillaume Ayoub
aa4df152e9 Remove more and more white backgrounds 2022-04-17 09:32:15 +02:00
Guillaume Ayoub
d4f3fcfd71 Clean, fix and test backgrounds 2022-04-17 09:22:13 +02:00