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

130 Commits

Author SHA1 Message Date
Guillaume Ayoub
31cd0d7233 Fix the "contents" value of bookmark-label 2021-08-31 16:38:51 +02:00
Guillaume Ayoub
d3e39055cf Merge branch '53.x' 2021-08-27 14:48:59 +02:00
Guillaume Ayoub
c51bc60764 Re-add make_bookmark_tree method
Fix #1428.
2021-08-27 14:43:17 +02:00
Guillaume Ayoub
bb29eca337 Transform text-align into shorthand
text-align is now a shorthand, setting text-align-all and text-align-last.

Related to #1389.
2021-08-24 13:27:59 +02:00
Guillaume Ayoub
61ff7f0e1c Handle full "display" property
In CSS Display Module Level 3, the "display" property gets a long
representation allowing:

- a clear separation between inner and outer display type,
- new supported types (contents, run-in, flow-root…),
- inline list items.

This commit allows the (retrocompatible) new long syntax for "display". It also
supports the "flow-root" value. It doesn’t support values related to ruby, and
it doesn’t support the new "contents" and "run-in" display types.

This work gives the possibility to simplify the code in the block_*_layout
functions, and to improve the overall layout.

Related to #36.
2021-08-23 21:54:28 +02:00
Guillaume Ayoub
3aca9f1f84 Change the resume_at and skip_stack structure
Many operations, including page breaks, require a pointer to a specific
position of the box tree. For example, we used to have this structure to point
to the beginning of the first child of the second child:

(1, (2, None))

We now use:

{1: {2: None}}

This change is the first step to handle parallel flows (see #36). It doesn’t
change anything to the layout for now, but it allows us to store multiple
pointers in the same structure.

The next step is to handle multiple pointers in skip_stack during boxes layout.
It means that most of the *_layout() function need an extra for-loop to manage
multiple skip stacks.

We’ll then need to split new types of boxes: table cells, floats, absolutes…
2021-08-22 12:10:48 +02:00
Guillaume Ayoub
c191372e07 Test empty links and relative links with base 2021-08-06 20:04:57 +02:00
Guillaume Ayoub
35d20308e0 Test absolute tables and remove dead code
Table translation’s (dx, dy) can’t be (0, 0), because the table is in a table wrapper
that already takes care of (0, 0) values.
2021-08-06 19:32:49 +02:00
Guillaume Ayoub
f162d1b762 Fix and test line-clamp 2021-08-06 19:05:03 +02:00
Guillaume Ayoub
f16b4c32d5 Test media queries 2021-08-06 18:38:06 +02:00
Guillaume Ayoub
ebd1064984 Test deprecated -o option 2021-08-06 18:14:13 +02:00
Guillaume Ayoub
143565e08d Test object-fit and object-position 2021-08-06 11:19:47 +02:00
Guillaume Ayoub
ccbe420d35 Fix optimization test 2021-08-04 17:14:52 +02:00
Guillaume Ayoub
c5590dd86d Test CLI optimizations 2021-08-04 16:54:09 +02:00
Guillaume Ayoub
0a1b2e9c64 Remove useless helper 2021-08-04 10:48:50 +02:00
Guillaume Ayoub
2e96bdee35 Simplify API to get intrinsic size of images
The previous API wasn’t stateless, as it sometimes required to call
get_intrinsic_size before accessing intrinsic_ratio. The new API offers a
single method to get width, height and ratio.
2021-08-03 18:39:14 +02:00
Guillaume Ayoub
694eddbc71 Embed images once
Images were already embedded once when included in the same stream.
Unfortunately, patterns have their own streams, meaning that a pattern used
multiple times includes the image each time. That’s especially bad for
different boxes using the same background, as backgrounds are drawn as
patterns.

Fix #1414.
2021-08-03 18:39:02 +02:00
Guillaume Ayoub
f327a9e353 Don’t crash when leaders are in floats
Fix #1409.
2021-08-01 19:06:13 +02:00
Guillaume Ayoub
2a8e23d3c4 Fix tests failing beacause of Ghostscript roundings 2021-07-27 22:55:19 +02:00
Guillaume Ayoub
5a53e11608 Clean and fix some cases of SVG gradients 2021-07-25 18:30:32 +02:00
Guillaume Ayoub
6417023f3d Fix translation when viewBox’s origin is not 0,0
Related to #1400.
2021-07-23 23:59:14 +02:00
Guillaume Ayoub
a9cc75d0b9 Remove empty lines 2021-07-23 23:23:00 +02:00
Guillaume Ayoub
a0ad94b143 Don’t stroke when stroke-width is 0
Related to #1403.
2021-07-23 22:36:05 +02:00
Guillaume Ayoub
8d7bcead0a Fix how x and y attributes are handled
Fix #1403.
2021-07-23 22:17:37 +02:00
Guillaume Ayoub
56910a84e7 Take care of ratio when calculating min/max widths of replaced boxes 2021-07-19 19:49:20 +02:00
Guillaume Ayoub
5fba476370 Test and fix text-anchor 2021-07-18 10:09:03 +02:00
Guillaume Ayoub
c7b97fa3bf Handle simple cases of clip-path
Fix #1374.
2021-07-18 09:36:14 +02:00
Guillaume Ayoub
d8526d4b41 Fix and test resized SVG files
The SVG sample is 10 years old, and viewbox was lowercase. That’s viewBox, not
viewbox. Our new renderer is case-sensitive for attributes.
2021-07-17 00:53:39 +02:00
Guillaume Ayoub
1111f7d57e Handle stacking contexts put in contexts by previous generations
Fix #880 and fix #1396.
2021-07-13 16:33:42 +02:00
Guillaume Ayoub
cef8cf109d Fix and simplify image size management 2021-07-12 15:07:31 +02:00
Guillaume Ayoub
010f40adeb Fix padding for columns 2021-07-11 17:40:02 +02:00
Guillaume Ayoub
a267735f31 Parametrize some tests 2021-06-13 08:12:33 +02:00
Guillaume Ayoub
23dbd70c1f Fix crash with borders whose widths are in em
Fix #1378.
2021-06-13 08:07:46 +02:00
Guillaume Ayoub
c0c9879bc5 Handle stroke-opacity and fill-opacity
This commit also cleans a lot of things about the way opacity is handled,
with many small bug fixes.

Fix #1371.
2021-06-02 20:35:06 +02:00
Guillaume Ayoub
a3028945fc Handle visibility and display attributes
Fix #1362.
2021-05-25 15:01:07 +02:00
Guillaume Ayoub
d4561b13af Sort anchors
Name trees, used to store PDF destinations (HTML anchors) have to be sorted
according to section 7.9.6 of the PDF 1.7 specification.

Fix #1352.
2021-05-12 18:24:04 +02:00
Guillaume Ayoub
b17b08dae7 Don’t crash with ex units in spacing properties 2021-05-07 16:38:51 +02:00
Guillaume Ayoub
2d19becf19 Improve SVG support 2021-04-30 18:13:08 +02:00
Guillaume Ayoub
becd494f91 Add an option to optimize fonts
Fix #359.
2021-04-28 14:55:52 +02:00
Guillaume Ayoub
c931d1639b Remove useless xfail 2021-04-28 14:45:53 +02:00
Guillaume Ayoub
3ec32732aa Fix gradients and tests 2021-04-26 17:36:18 +02:00
Guillaume Ayoub
d1c1e9e69f Fix tests 2021-04-26 11:31:07 +02:00
Guillaume Ayoub
eae3540c55 Merge branch 'pydyfsvg' 2021-04-22 12:29:04 +02:00
Guillaume Ayoub
8cf54c56c6 Remove TODOS about PDF checks in tests
Testing PNG rendering is enough
2021-04-20 15:40:39 +02:00
Guillaume Ayoub
a90119d14a Remove TODO 2021-04-20 15:36:30 +02:00
Guillaume Ayoub
fdcdcef006 Fix test 2021-04-20 08:48:44 +02:00
Guillaume Ayoub
dc861c785a Add more tests for SVG images 2021-04-19 17:52:25 +02:00
Guillaume Ayoub
111191f7bc Rename folders and imports in tests 2021-04-19 17:15:53 +02:00
Guillaume Ayoub
e00e027c9c Fix SVG arcs 2021-04-18 18:01:56 +02:00
Guillaume Ayoub
3fc7273756 Test SVG bounding boxes 2021-04-18 17:20:07 +02:00