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

333 Commits

Author SHA1 Message Date
Guillaume Ayoub
11bc920910 Merge branch '56.x' 2022-07-10 20:38:07 +02:00
Guillaume Ayoub
f2cecc78ea Fix gradients with opacity set
Fix #1678.
2022-07-10 20:37:33 +02:00
Guillaume Ayoub
99b6d301da Merge branch '56.x' 2022-07-07 17:26:13 +02:00
Guillaume Ayoub
9ce65478b2 Fix default vertical position of out-of-flow split elements
Fix #1673.
2022-07-07 17:18:12 +02:00
Guillaume Ayoub
76d174f578 Fix split table headers’ top border when rows are split 2022-07-07 15:43:51 +02:00
Guillaume Ayoub
cb9540ba3b Correctly detect empty split lines at the end of tables
The previous detection was failing when some cells were empty (or fully
rendered) and when the current rendering position was not overflowing the page.
In this case, the line with empty cells was rendered and was visible for
example when cells had padding.
2022-07-07 10:45:24 +02:00
Guillaume Ayoub
c028c672d7 Merge branch '56.x' 2022-07-05 16:14:17 +02:00
Guillaume Ayoub
3bd9a8e014 Don’t limit the opacity groups to the original box size
It doesn’t work when elements are displayed outside or when the box is
transformed.
2022-07-05 16:06:46 +02:00
Guillaume Ayoub
2484ca2cc7 Rotate images with EXIF rotation
Fix #1667.
2022-07-02 15:01:16 +02:00
Guillaume Ayoub
bcf40367d7 Merge branch '56.x' 2022-07-01 09:43:09 +02:00
Guillaume Ayoub
1a4d2a70ef Fix and test nth selector for pages
Fix #1668.
2022-07-01 09:42:24 +02:00
Guillaume Ayoub
5feaf5e084 Fix and add failing test
We still have a lot of corner cases to fix for floats, judging from the number
of xfail tests in this file…
2022-06-30 16:12:02 +02:00
Guillaume Ayoub
902bde7d9c Take care of floats when removing placeholders
Removing placeholders is something we have to do when we must discard a part of
the layout that has already been done. It currently removes absolutely
positioned placeholders and footnotes.

The same has to be done with split floats, that’s what this commit is about.

We have to change the structure of the broken_out_of_flow attribute, as we have
to get a reliable way to reach the saved data using from the real element in
the tree. The new structure is thus a dictionary whose keys are the boxes in
the tree (placeholder for absolutes, partial elements for floats) and whose
values are the original_box+parent+resume_at.

Fix #1669.
2022-06-30 15:29:50 +02:00
Guillaume Ayoub
74f367c2a3 Merge branch '56.x' 2022-06-29 19:06:58 +02:00
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
5d9e5f7040 Update and fix URLs in comments and documentation 2022-06-28 15:59:06 +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