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

156 Commits

Author SHA1 Message Date
Guillaume Ayoub
19365e824e Fix all crashes with W3C test suite 2018-02-24 04:41:11 +01:00
Guillaume Ayoub
092b03bac6 Don't translate rtl columns twice
Fix #574.
2018-02-20 02:11:45 +01:00
Guillaume Ayoub
5341031162 Merge branch 'master' into flexbox 2018-02-19 14:32:19 +01:00
Guillaume Ayoub
2ef988ca20 Fix string-set logic 2018-01-23 01:55:16 +01:00
Guillaume Ayoub
6caec1ab4f Use content(first-letter) as defined for ::first-letter 2018-01-23 00:52:49 +01:00
Guillaume Ayoub
838933f428 Handle content(first-letter) 2018-01-23 00:45:28 +01:00
Guillaume Ayoub
c6e54d77f0 Remove pylint comments 2018-01-14 01:52:49 +01:00
Guillaume Ayoub
16e8186568 Drop Python 2 support 2018-01-14 01:48:17 +01:00
Guillaume Ayoub
ad11edfff2 Remove StyleDict objects 2018-01-13 17:41:08 +01:00
Guillaume Ayoub
724565f27a Don't allow attribute access to StyleDict objects 2018-01-13 17:05:23 +01:00
Guillaume Ayoub
359d42c641 Remove style's anonymous attribute 2018-01-13 16:34:14 +01:00
Guillaume Ayoub
0821148124 Handle align-items and align-self 2018-01-11 23:40:14 +01:00
Guillaume Ayoub
ce342cf0a2 Don't strip non-breaking spaces during flex layout 2018-01-11 00:45:42 +01:00
Guillaume Ayoub
f868abfdb2 Handle floats and inline-level boxes in flex boxes 2018-01-09 00:41:07 +01:00
Guillaume Ayoub
e9fdb0d843 Don't consider the flex container box as a block container box 2018-01-09 00:40:06 +01:00
Guillaume Ayoub
4f60ba9173 Initial support of baseline alignments for flex layout 2017-12-29 01:23:41 +01:00
Guillaume Ayoub
3027417f88 Merge branch 'master' into flexbox 2017-12-27 01:07:27 +01:00
Guillaume Ayoub
d62bfec60b Keep track of removed collapsing spaces for wrap opportunities 2017-12-26 12:39:20 +01:00
Guillaume Ayoub
69b64d2bd0 First working version of flex layout 2017-12-23 00:19:32 +01:00
Guillaume Ayoub
878cc41c51 Add a keywoard to translate boxes ignoring floating children 2017-12-12 18:20:00 +01:00
Guillaume Ayoub
ce70354488 Don't cross the whole tree when translating boxes by (0, 0) 2017-12-12 18:18:18 +01:00
lucien
34b825033d WIP: Flexbox - Step 1 and 2 of flexbox layout 2017-12-07 17:34:28 +01:00
Guillaume Ayoub
d4357e5a4a Copy styles for split boxes
This fixes blocks split between pages and inlines boxes split by block boxes.

Increases memory usage, related to #70.
2017-08-17 07:54:14 +02:00
Guillaume Ayoub
c41b55eb93 Don't crash when there's no displayed root element 2017-08-14 14:11:20 +02:00
Guillaume Ayoub
9a44e2f469 Copy the style of the wrapper as it will be modified
Sould be needed where the style is inherited and modified
2017-08-14 14:10:24 +02:00
Guillaume Ayoub
86be0e9287 Return the next page value in block_level_page_break 2017-08-04 11:51:35 +02:00
Guillaume Ayoub
84bdee14c3 Revert "Change table and table-* elements' style before creating StyleDicts"
This reverts commit ca8bc3e578.

The main change is the creation of StyleDicts removed from style_for, for
memory consumption problems.
2017-08-02 20:21:34 +02:00
Guillaume Ayoub
c779977271 Unfreeze StyleDict 2017-08-02 16:32:37 +02:00
Guillaume Ayoub
033f4738ab Remove first-letter style being calculated twice 2017-08-02 13:21:15 +02:00
Guillaume Ayoub
4aa7bb49f7 Change the signature of root_style_for 2017-08-02 13:18:58 +02:00
Guillaume Ayoub
f7903925fd Use a separate variable for justification spacing 2017-08-01 10:07:36 +02:00
Guillaume Ayoub
ca8bc3e578 Change table and table-* elements' style before creating StyleDicts 2017-07-31 13:48:58 +02:00
Guillaume Ayoub
0dc1bf6f8c Remove useless margin for inline markers 2017-07-31 11:28:23 +02:00
Guillaume Ayoub
b3865c811c Re-add a copy method for StyleDict 2017-07-28 22:28:29 +02:00
Guillaume Ayoub
56f27885f4 Remove StyleDict mutations and copies 2017-07-28 19:56:14 +02:00
Guillaume Ayoub
a2a29d7b6f Clean the way the anonymous attribute is set to tables and wrappers 2017-07-28 18:59:43 +02:00
Guillaume Ayoub
a3e2c474f0 Transform StyleDict into a kind of frozen dict
This forces to use a copy when changes are needed. Internal mutable structures
have also been changed into immutable ones (i.e. lists have been turned into
tuples).

This change is a really useful first step to greatly optimize memory and time
needed to render large documents, as allows us to cache style dicts more
safely. It's been already done in StyleDict.inherit_from, with a ~5-10% memory
benefice.
2017-07-28 13:35:06 +02:00
Guillaume Ayoub
344cb08f60 Don't copy styles when copying boxes, improve memory management
Style is not copied anymore when boxes are duplicated. Style dicts are not
modified anymore during the layout, as it was before for some properties:

- margins, borders and paddings when the box was split between two
  pages (useless as these computed values are stored directly in the box),
- top borders were changed in tables (useless for the same reason),
- bookmark labels and string sets are now stored in the box.

This commit can introduce very subtle bugs that are hard to debug. In the
future, we should try to freeze the style dicts before the layout.

Related to #70.
2017-07-22 13:51:03 +02:00
Guillaume Ayoub
ba26fa34a9 Use ElementTree's elements as much as possible 2017-07-03 15:19:05 +02:00
Guillaume Ayoub
df50204f3e Remove unsupported source lines 2017-07-01 00:28:14 +02:00
Guillaume Ayoub
4a5fa84f9f Use cssselect2 instead of cssselect 2017-06-30 17:54:02 +02:00
Guillaume Ayoub
b4a95c1fbe Why did isort decide to become this intolerant? 2017-06-03 16:05:33 +02:00
Guillaume Ayoub
10ee68d432 Fix imports for this crazy nazisort 2017-06-03 15:46:37 +02:00
Hugh Secker-Walker
376bf0fd73 Fix mutable default-argument in MarginBox constructor 2017-05-01 17:54:03 -04:00
Simon Sapin
0aa62e249e Switch to tinycss2 2017-03-26 18:44:21 +02:00
Guillaume Ayoub
4f4b4ed598 Use isort in tests 2017-03-25 00:33:36 +01:00
Guillaume Ayoub
ae040e1c71 Respect flake8 everywhere 2017-03-25 00:24:27 +01:00
Guillaume Ayoub
5c9a07bf1a Create first-letter box after white space handling
As ::first-letter depends on white space handling, we must create the
box after collapsing spaces, not during the build of the box tree.

This commit makes WeasyPrint pass most of the W3C tests related to
first-letter (and never crash). Known problems left include:

- list markers are considered as the first letter,
- lines may break between the first letter and the rest of the text
  (see #163 and #301),
- the CSS attributes are all kept, some should probably be removed (the
  spec doesn't give a whole list).

Even if W3C tests makes me quite confident (some of them are crazy),
tests must be added in WeasyPrint too.
2017-01-02 13:23:42 +01:00
Guillaume Ayoub
b9699688f6 Don't pass skip_stack to insert_first_letter 2016-12-04 16:55:29 +01:00
Guillaume Ayoub
4e8379cb90 Always use two colons for pseudo-elements
Tests now mix one and two colons in CSS, but the user agent stylesheet
and internal representation of the pseudo-elements now awlays use two
colons.
2016-12-04 16:43:49 +01:00