1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 08:27:22 +03:00
Commit Graph

711 Commits

Author SHA1 Message Date
Guillaume Ayoub
4cb6045784 Fix typo introduced in previous commit 2019-09-06 17:12:18 +02:00
Guillaume Ayoub
615e298ade Don't include floating elements each time we try to render a column 2019-09-06 16:40:17 +02:00
Guillaume Ayoub
789b80e684 Only use in flow children to set columns height 2019-09-06 11:31:03 +02:00
Guillaume Ayoub
87d9e84f28 Avoid infinite loops when rendering columns 2019-09-05 15:45:17 +02:00
Guillaume Ayoub
d0c9a75e53 Fix table rendering with empty lines and rowspans
Fix #937.
2019-09-05 15:27:40 +02:00
Guillaume Ayoub
29fcb45f0e Merge branch 'master' of github.com:Kozea/WeasyPrint 2019-09-04 16:21:39 +02:00
Guillaume Ayoub
4dc0b119f6 Don't crash when small columns are wrapped in absolute blocks
Fix #897.
2019-09-04 16:20:07 +02:00
Guillaume Ayoub
359536e6e3 Merge branch 'master' into perf 2019-08-14 18:34:51 +02:00
Guillaume Ayoub
cd925bc76c Revert "Fix tests for Pango 1.44"
This reverts commit d6da699f91.
2019-08-14 18:34:42 +02:00
Guillaume Ayoub
440070b8da Fix padding and margin management for column flex boxes
Nothing more than a stupid typo. Fix #919.
2019-08-14 16:29:45 +02:00
Guillaume Ayoub
554225b4f7 Fix typo in comment 2019-08-14 14:50:06 +02:00
Guillaume Ayoub
91d8c0fbec Don't remove repeated headers when line groups avoid breaks
When no table content is small enough to fit in one page, we remove repeated
headers and footers to give table content more space. This is a good idea for
complicated situations, but not adapted when line groups avoid page breaks
inside.

This commit keeps headers and footers when the next line group avoids page
breaks, by forcing to render at least one line of the table, like if the page
was empty.
2019-08-14 14:37:49 +02:00
Guillaume Ayoub
d6da699f91 Fix tests for Pango 1.44
Fix #917.

One test fails with current 1.44.3 version, because of bug 397 [1] fixed
in 1.44.4 (not released yet).

[1] https://gitlab.gnome.org/GNOME/pango/issues/397
2019-08-08 16:47:05 +02:00
Guillaume Ayoub
2ee4516786 Handle the ::marker pseudo-element
Fix #700.
2019-08-07 23:01:41 +02:00
Guillaume Ayoub
7efd1e135f Fix width of replaced boxes with no intrinsic width
Fix #901.
2019-07-24 15:18:38 +02:00
Guillaume Ayoub
ba2b4542e8 Merge branch 'master' into perf 2019-07-24 10:54:20 +02:00
Guillaume Ayoub
8d10c011d9 Don't respect table cell width when content doesn't fit
Fix #906.
2019-07-24 10:47:55 +02:00
Guillaume Ayoub
620e0754f4 Fix lint 2019-07-23 18:07:14 +02:00
Guillaume Ayoub
328de5e67e
Merge pull request #907 from makeleaps/nowrap
Refactor LayoutContext building
2019-07-23 18:01:56 +02:00
Raphael Gaschignard
afc7dabc1b Refactor LayoutContext building
this will provide a simpler API for testing context-using functions inside tests
2019-07-23 14:12:08 +09:00
grewn0uille
a86627943f Fix margin collapsing between caption and table wrapper. 2019-07-19 18:31:17 +02:00
Guillaume Ayoub
abcd386e2f Remove useless TODO
This TODO has been fixed with #771.
2019-07-18 16:40:42 +02:00
Guillaume Ayoub
0142689fd9 Merge branch 'master' into perf 2019-07-18 16:33:22 +02:00
grewn0uille
135dc06c9a Handle recto/verso on page break. 2019-07-18 14:34:45 +02:00
Guillaume Ayoub
7071e36ce4 Remove device_size parameter everywhere
The device_size parameter was passed to many layout features, but it was only
used to set default size of replaced boxes with no implicit or explicit size
set. As this case is really rare for printed documents, and as it's also rare
to have printed supports that small, we can remove this "feature".

Moreover, in CSS3-images, another definition called "default object size" is
used to set replaced box size when no size is defined. This size doesn't seem
to be defined for images.
2019-07-11 17:17:28 +02:00
Guillaume Ayoub
9831a1ba40 Remove and fix some TODOs 2019-07-11 16:48:53 +02:00
Guillaume Ayoub
4e80f4cccf Remove enumerate_skip
It used to be really slow, at least on large inline containers.
2019-07-09 17:58:20 +02:00
Guillaume Ayoub
2497d605ee Remove useless line break 2019-07-09 17:16:09 +02:00
Guillaume Ayoub
2ab52a7c8c Deactivate layout created for justified text 2019-07-08 16:34:44 +02:00
Guillaume Ayoub
8db46ff25d Merge branch 'master' into perf 2019-07-08 14:42:14 +02:00
Guillaume Ayoub
31c29cdb1f Just create a layout when justification is needed
Spliting the line again is useless here.
2019-07-05 17:57:23 +02:00
Guillaume Ayoub
1be85621a5 Don't calculate linebox width and height when not needed
Float clearance requires to calculate the line minimum width and height before
setting the linebox position. When there are no floating boxes in the context,
there's no need to calculate these sizes.

We thus avoid a call to inline_min_content_width per text line. This call
required a lot of time as it needed to go through the whole line breaking
algorithm to render the first word.

We save 15% of the rendering time when generating our Odyssey sample.
2019-07-05 17:33:30 +02:00
Guillaume Ayoub
adb521643c Support column-span
Fix #719.

We also used the real rendering stack to find the columns heights, fix #696.
2019-06-28 17:33:35 +02:00
Guillaume Ayoub
a2ec8567a1 Merge branch 'master' into column-span 2019-06-28 15:04:28 +02:00
Guillaume Ayoub
5e0f6d494f Actually use the content box to resolve flex items percentages
Fix #885.
2019-06-22 21:37:27 +02:00
grewn0uille
497a0b54dd Add partial support for column-span property.
Related to #719.
2019-06-04 18:03:32 +02:00
Guillaume Ayoub
9f442be640 Move percentage function into percentages module 2019-06-02 18:06:25 +02:00
Manuel Barkhau
ce8ab0f4f0 use object-position for layout of images 2019-06-02 16:16:51 +02:00
Manuel Barkhau
20afa51175 refactor: factor out "precentage" function 2019-06-01 01:39:40 +02:00
Guillaume Ayoub
ec4504d23f Set a minimum height for empty list elements with outside marker
The spec says that we can do what we want to improve the rendering in such
cases. Adding a line would probably give exactly the same rendering as if there
were text, but the difference is so small that there's no need to hack the
formatting structure and keep the fix in 3 small lines during the layout.

Fix #873.
2019-05-31 16:56:52 +02:00
Guillaume Ayoub
d753b301a1 Always set outside_list_marker property on boxes 2019-05-31 07:18:25 +02:00
Guillaume Ayoub
a23d4658fc Set marker layout only when needed 2019-05-31 06:36:41 +02:00
Guillaume Ayoub
76479de01f Don't align lines larger than their parents
Related to #867.
2019-05-17 16:19:42 +02:00
Guillaume Ayoub
9012888df2 Set inline table baseline
"The baseline of an 'inline-table' is the baseline of the first row of the
table."

Related to #867.
2019-05-17 15:49:13 +02:00
Guillaume Ayoub
58770563be Set row baseline when no cells are baseline-aligned
"If a row has no cell box aligned to its baseline, the baseline of that row is
the bottom content edge of the lowest cell in the row."

Related to #867.
2019-05-17 13:03:02 +02:00
Guillaume Ayoub
99f85beac6 Don't use translations to align flex items
As the children's layout has not been done yet, their own children are not yet
positioned and thus can't be translated. We have to change the child position
instead and let the child layout move its own children.

Fix #811.
2019-05-16 11:06:28 +02:00
Guillaume Ayoub
36630ab532 Don't change position of block children to avoid rounded float error
To fix #860 and #851, we decided to move block children a little bit to keep
them in the page. It's a bad idea, because children position is altered (and it
breaks many tests, by the way).

Increasing the allowed max_position_y is a better workaround as it doesn't
move blocks.
2019-05-15 13:39:05 +02:00
Guillaume Ayoub
75cf2b61eb Don't cut pages when content overflows a very little bit
Here's another floating point rounding error we have to deal with. The original
issue comes from flex layout, but there are probably plenty of rounding
problems in other flows, so it's safe to put the workaround here.

Fix #851.
2019-05-15 12:02:04 +02:00
Guillaume Ayoub
fc7db276e5 Add page declarations on demand
With the previous system, we were listing all page types as the cartesian
product of page names and pseudo selectors. Declarations were added for all
these possible page types.

The nth() page selector makes this system impossible, as we can't make the
cartesian product with a number of pages we don't know at the beginning of the
rendering. We now add declarations before rendering each page, based on the
properties of the page.

This new way is faster when the total number of pages is lower than the
cartesian product of possible pages. For long documents, we could improve speed
by detecting CSS rules based on page index or page name, and use cached results
for all pages that don't rely on such rules.
2019-04-02 12:39:00 +02:00
Guillaume Ayoub
3e953b457e Simplify page style declaration 2019-04-02 12:00:47 +02:00