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

4450 Commits

Author SHA1 Message Date
Guillaume Ayoub
87e4765f26 Update documentation 2021-12-11 18:23:04 +01:00
Guillaume Ayoub
21484fafba Merge branch 'master' into footnotes 2021-12-11 17:05:33 +01:00
Guillaume Ayoub
3f596ce21f Fix footnotes for repaginated documents 2021-12-10 17:51:10 +01:00
Guillaume Ayoub
1800bb5ed6 Add test for footnotes margins 2021-12-09 16:40:02 +01:00
Guillaume Ayoub
d4574862c5 Use the margin height to translate the footnote_area 2021-12-09 16:36:02 +01:00
Guillaume Ayoub
8cc6b258a0 Handle footnote-policy 2021-12-09 16:20:39 +01:00
Guillaume Ayoub
f54da35dc7 Report footnotes when previous footnotes are already reported 2021-12-08 21:00:21 +01:00
Guillaume Ayoub
7126f1b804 Remove useless color from tests 2021-12-08 20:29:31 +01:00
Lucie Anglade
7c8c291d96 Add reported footnote test 2021-12-08 17:43:19 +01:00
Guillaume Ayoub
5e6b21cec8 Fix last tests for footnotes 2021-12-08 15:35:54 +01:00
Guillaume Ayoub
ed0916d55c Fix more tests for footnotes 2021-12-08 15:16:45 +01:00
Guillaume Ayoub
a702292a1a Fix inline footnotes test 2021-12-08 15:02:46 +01:00
Guillaume Ayoub
313a09d10e Handle footnote-display
Handling footnote-display requires the footnote area children to be recreated
each time one footnote is added: as footnotes can be blocks or inlines, we have
to create anonymous boxes each time, and thus to do the whole footnote area
layout.
2021-12-07 15:58:27 +01:00
Guillaume Ayoub
232d9eff3b Don’t test twice that footnotes are in the list 2021-12-07 15:14:37 +01:00
Guillaume Ayoub
7aa0860185 Make footnote call’s style inherit from the footnote’s parent
There’s nothing in the specification about that, but here’s what we do now:

- The style of a footnote inherits from its parent’s style, it doesn’t inherit
from the footnote area’s style. That’s how cascade works for real elements, and
there’s no real reason or way to avoid this.

- The style of a footnote marker inherits from the footnote style. The marker
is just like a ::before block regarding to its style, even if it is actually
put before the footnote element in the footnote body.

- The style of a footnote call inherits from the footnote parent’s style. It
doesn’t inherit from the footnote’s style, that’s actually applied to the
footnote and inherited by its marker.

This way, we keep the "normal" cascade for "normal" elements, and have
everything else being quite obvious.

The 1st point is annoying in real-life use cases, because we’d really like to
see the footnote’s style inherit from the footnote area’s style. But we really
don’t want to break the cascade. Do we? No, we don’t.

The 3rd point is probably the most disturbing one, mainly because
.footnote::footnote-call doesn’t match the call: to match a footnote call in a
paragraph, for example, we have to use p::footnote-call instead.
2021-12-07 14:46:26 +01:00
Guillaume Ayoub
6f190a2f20 Add missing underlines and empty strings 2021-12-07 14:46:07 +01:00
Guillaume Ayoub
8ae09175eb Typo 2021-12-06 16:39:25 +01:00
Guillaume Ayoub
d0f30fcb8a Fix tests for floats 2021-12-06 16:14:55 +01:00
Guillaume Ayoub
dd14bb968b Save images in tests when there’s the wrong number of pages 2021-12-06 15:50:55 +01:00
Lucie Anglade
22efdc832b More text in normal flow for absolute/float split tests 2021-12-05 20:08:04 +01:00
Guillaume Ayoub
64797e77f4 Fix test 2021-12-05 19:57:17 +01:00
Guillaume Ayoub
c101e0c6a8 Merge branch 'master' of github.com:Kozea/WeasyPrint 2021-12-05 19:17:05 +01:00
Guillaume Ayoub
379be1e575 Include non-printable characters width during rendering
Fix #1515. Related to #1508.
2021-12-05 19:15:39 +01:00
Lucie Anglade
06fe73d54b Move length check 2021-12-04 23:48:44 +01:00
Lucie Anglade
f0384d1fcf Check if the expected result and the computed one have the same number of pixels. 2021-12-04 17:45:53 +01:00
Lucie Anglade
be71cc6e66 Add xfail on failing tests 2021-12-04 17:44:35 +01:00
Lucie Anglade
7f9503470a Fix expected pixels and add xfails 2021-12-04 17:44:10 +01:00
Lucie Anglade
c761879ade Test absolute split 2021-12-04 16:56:50 +01:00
Lucie Anglade
fcea5f02df Test floats split 2021-12-04 16:56:39 +01:00
Lucie Anglade
2c77f5f2f9 Fix indent 2021-12-04 16:53:50 +01:00
Lucie Anglade
fb12d2ca83 Test floats split 2021-12-04 16:33:54 +01:00
Lucie Anglade
dfc3d0a7d9 Remove useless import 2021-12-04 15:29:45 +01:00
Lucie Anglade
c5f03c2c89 More footnotes tests 2021-11-30 11:24:25 +01:00
Lucie Anglade
d42b0fabfe Some footnotes tests 2021-11-29 16:30:10 +01:00
Lucie Anglade
e6da2c93f9 Merge branch 'footnotes' of github.com:Kozea/WeasyPrint into footnotes 2021-11-29 15:41:46 +01:00
Guillaume Ayoub
5ce71e48fe Merge branch 'master' of github.com:Kozea/WeasyPrint 2021-11-29 15:08:51 +01:00
Guillaume Ayoub
80b88db154 Don’t crash when the font size is really small
Fix #1499.
2021-11-29 15:08:18 +01:00
Guillaume Ayoub
b5d3475eee Fix current position tested when footnotes are added 2021-11-29 12:37:03 +01:00
Guillaume Ayoub
677b083d78
Merge pull request #1505 from ColinKinloch/woff_cache
Reuse decompressed woff files based on hash
2021-11-29 12:24:43 +01:00
Lucie Anglade
8f60b81b56 Add style for footnotes testing 2021-11-29 12:18:53 +01:00
Lucie Anglade
f5e520eae8 Don’t use AnonymousStyle, because it’s not computed style 2021-11-29 12:18:30 +01:00
Colin Kinloch
82f98b16ab Correct comment on woff font test 2021-11-28 20:41:27 +00:00
Colin Kinloch
a273b08a59 Fix woff cache read and add woff cache test 2021-11-28 20:30:55 +00:00
Guillaume Ayoub
5ebb9db93f Merge branch 'parallel-out-of-flow' 2021-11-28 20:06:05 +01:00
Guillaume Ayoub
424f080311 Don’t draw empty glyphs at all
Fix #1508.
2021-11-28 19:47:37 +01:00
Guillaume Ayoub
36b74524bf Insert footnotes after the layout of each line 2021-11-27 17:40:09 +01:00
Guillaume Ayoub
6a9dac4861 Replace max_position_y by bottom_space
As the bottom of the page is now dynamic (because it changes with footnotes),
passing the max_position_y is difficult: it would require the value to be
passed to layout functions, and returned (possibly updated) by these functions.

The new solution is to store the page bottom in the context, and to update it
when a footnote is included. The new max position y is calculated when needed,
using the updated position of the page bottom.

To handle extra bottom spaces (bottom padding/border/margin of a parent box for
example), a bottom_space parameter is given when needed. This value can be set
to -inf when we don’t want to take care of the page bottom (that’s equivalent
to max_position_y=inf).
2021-11-27 17:01:16 +01:00
Guillaume Ayoub
a3b7f7fa71 Display footnotes on the next page when they don’t fit 2021-11-27 14:42:09 +01:00
Guillaume Ayoub
b633bef1a7 Fix footnote style test condition 2021-11-26 11:14:30 +01:00
Colin Kinloch
4549913644 Add test to make sure woff fonts load and fix typo 2021-11-24 20:10:28 +00:00