weasyprint 65.0__tar.gz → 65.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {weasyprint-65.0 → weasyprint-65.1}/PKG-INFO +1 -1
- {weasyprint-65.0 → weasyprint-65.1}/docs/changelog.rst +51 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_flex.py +78 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_page.py +68 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/__init__.py +1 -1
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/html5_ua.css +8 -4
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/flex.py +14 -8
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/page.py +20 -14
- {weasyprint-65.0 → weasyprint-65.1}/LICENSE +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/README.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/api_reference.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/common_use_cases.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/conf.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/contribute.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/first_steps.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/going_further.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/index.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/manpage.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/docs/support.rst +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/pyproject.toml +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/conftest.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_common.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_counters.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_descriptors.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_errors.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_expanders.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_fonts.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_nesting.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_pages.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_target.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_ua.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_validation.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/css/test_variables.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_bounding_box.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_clip.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_defs.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_gradients.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_images.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_markers.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_opacity.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_paths.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_patterns.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_shapes.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_text.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_transform.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_units.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/svg/test_visibility.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_absolute.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_background.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_before_after.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_box.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_column.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_current_color.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_float.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_footnote.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_footnote_column.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_gradient.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_image.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_leader.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_list.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_opacity.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_overflow.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_page.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_table.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_text.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_transform.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_visibility.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/draw/test_whitespace.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_block.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_column.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_float.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_footnotes.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_grid.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_image.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_inline.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_inline_block.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_list.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_position.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_shrink_to_fit.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/layout/test_table.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/acid2-reference.html +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/acid2-test.html +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/blue.jpg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/border.svg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/border2.svg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/doc1.html +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/doc1_UTF-16BE.html +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/icon.png +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/latin1-test.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/logo_small.png +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/mask.svg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/mini_ua.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/not-optimized-exif.jpg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/not-optimized.jpg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/pattern-transparent.svg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/pattern.gif +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/pattern.palette.png +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/pattern.png +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/pattern.svg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/really-a-png.svg +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/really-a-svg.png +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/sheet2.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/sub_directory/sheet1.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/tests_ua.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/user.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/utf8-test.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/weasyprint.otb +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/weasyprint.otf +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/resources/weasyprint.woff +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_acid2.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_api.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_boxes.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_fonts.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_pdf.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_presentational_hints.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_stacking.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_text.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_unicode.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/test_url.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/tests/testing_utils.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/__main__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/anchors.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/computed_values.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/counters.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/html5_ph.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/html5_ua_form.css +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/media_queries.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/properties.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/targets.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/utils.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/validation/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/validation/descriptors.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/validation/expanders.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/css/validation/properties.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/document.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/draw/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/draw/border.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/draw/color.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/draw/stack.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/draw/text.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/formatting_structure/boxes.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/formatting_structure/build.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/html.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/images.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/absolute.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/background.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/block.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/column.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/float.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/grid.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/inline.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/leader.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/min_max.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/percent.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/preferred.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/replaced.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/layout/table.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/logger.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/matrix.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/anchors.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/debug.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/fonts.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/metadata.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/pdfa.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/pdfua.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/sRGB2014.icc +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/pdf/stream.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/stacking.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/__init__.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/bounding_box.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/css.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/defs.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/images.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/path.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/shapes.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/text.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/svg/utils.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/text/constants.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/text/ffi.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/text/fonts.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/text/line_break.py +0 -0
- {weasyprint-65.0 → weasyprint-65.1}/weasyprint/urls.py +0 -0
|
@@ -2,6 +2,57 @@ Changelog
|
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
Version 65.1
|
|
6
|
+
------------
|
|
7
|
+
|
|
8
|
+
Released on 2025-04-14.
|
|
9
|
+
|
|
10
|
+
Bug fixes:
|
|
11
|
+
|
|
12
|
+
* `#2414 <https://github.com/Kozea/WeasyPrint/issues/2414>`_:
|
|
13
|
+
Correctly handle flex columns split between pages
|
|
14
|
+
* `1b24ad9 <https://github.com/Kozea/WeasyPrint/commit/1b24ad9>`_:
|
|
15
|
+
Include padding in outer size of item elements
|
|
16
|
+
* `#2419 <https://github.com/Kozea/WeasyPrint/issues/2419>`_:
|
|
17
|
+
Set main tag as block by default
|
|
18
|
+
* `#2415 <https://github.com/Kozea/WeasyPrint/issues/2415>`_:
|
|
19
|
+
Fix support of replaced block box as flex items
|
|
20
|
+
* `83da2fe0 <https://github.com/Kozea/WeasyPrint/commit/83da2fe0>`_:
|
|
21
|
+
Fix margins and padding for rtl lists
|
|
22
|
+
* `#2429 <https://github.com/Kozea/WeasyPrint/issues/2429>`_,
|
|
23
|
+
`#1076 <https://github.com/Kozea/WeasyPrint/issues/1076>`_,
|
|
24
|
+
`#2431 <https://github.com/Kozea/WeasyPrint/pull/2431>`_:
|
|
25
|
+
Fix page groups
|
|
26
|
+
|
|
27
|
+
Contributors:
|
|
28
|
+
|
|
29
|
+
* Guillaume Ayoub
|
|
30
|
+
|
|
31
|
+
Backers and sponsors:
|
|
32
|
+
|
|
33
|
+
* Spacinov
|
|
34
|
+
* Kobalt
|
|
35
|
+
* Grip Angebotssoftware
|
|
36
|
+
* Syslifters
|
|
37
|
+
* Simon Sapin
|
|
38
|
+
* Manuel Barkhau
|
|
39
|
+
* Simonsoft
|
|
40
|
+
* Menutech
|
|
41
|
+
* KontextWork
|
|
42
|
+
* TrainingSparkle
|
|
43
|
+
* Healthchecks.io
|
|
44
|
+
* Hammerbacher
|
|
45
|
+
* DocRaptor
|
|
46
|
+
* Yanal-Yves Fargialla
|
|
47
|
+
* Method B
|
|
48
|
+
* FieldHub
|
|
49
|
+
* Morntag
|
|
50
|
+
* Xavid
|
|
51
|
+
* Kai DeLorenzo
|
|
52
|
+
* Charlie S.
|
|
53
|
+
* Alan Villalobos
|
|
54
|
+
|
|
55
|
+
|
|
5
56
|
Version 65.0
|
|
6
57
|
------------
|
|
7
58
|
|
|
@@ -1753,3 +1753,81 @@ def test_flex_collapsing_margin():
|
|
|
1753
1753
|
assert p.height == 100
|
|
1754
1754
|
assert article.position_y == 110
|
|
1755
1755
|
assert div.position_y == 120
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
@assert_no_logs
|
|
1759
|
+
def test_flex_direction_column_next_page():
|
|
1760
|
+
# Regression test for issue #2414.
|
|
1761
|
+
page1, page2 = render_pages('''
|
|
1762
|
+
<style>
|
|
1763
|
+
@page { size: 4px 5px }
|
|
1764
|
+
html { font: 2px/1 weasyprint }
|
|
1765
|
+
</style>
|
|
1766
|
+
<div>1</div>
|
|
1767
|
+
<article style="display: flex; flex-direction: column">
|
|
1768
|
+
<div>A</div>
|
|
1769
|
+
<div>B</div>
|
|
1770
|
+
<div>C</div>
|
|
1771
|
+
</article>
|
|
1772
|
+
''')
|
|
1773
|
+
html, = page1.children
|
|
1774
|
+
body, = html.children
|
|
1775
|
+
div, article = body.children
|
|
1776
|
+
assert div.children[0].children[0].text == '1'
|
|
1777
|
+
assert div.children[0].children[0].position_y == 0
|
|
1778
|
+
assert article.children[0].children[0].children[0].text == 'A'
|
|
1779
|
+
assert article.children[0].children[0].children[0].position_y == 2
|
|
1780
|
+
html, = page2.children
|
|
1781
|
+
body, = html.children
|
|
1782
|
+
article, = body.children
|
|
1783
|
+
assert article.children[0].children[0].children[0].text == 'B'
|
|
1784
|
+
assert article.children[0].children[0].children[0].position_y == 0
|
|
1785
|
+
assert article.children[1].children[0].children[0].text == 'C'
|
|
1786
|
+
assert article.children[1].children[0].children[0].position_y == 2
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
@assert_no_logs
|
|
1790
|
+
def test_flex_1_item_padding():
|
|
1791
|
+
page, = render_pages('''
|
|
1792
|
+
<article style="display: flex; width: 100px; font: 2px weasyprint">
|
|
1793
|
+
<div>abc</div>
|
|
1794
|
+
<div style="flex: 1; padding-right: 5em">def</div>
|
|
1795
|
+
</article>
|
|
1796
|
+
''')
|
|
1797
|
+
html, = page.children
|
|
1798
|
+
body, = html.children
|
|
1799
|
+
article, = body.children
|
|
1800
|
+
div1, div2 = article.children
|
|
1801
|
+
assert div1.border_width() + div2.border_width() == article.width
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
@assert_no_logs
|
|
1805
|
+
def test_flex_1_item_padding_direction_column():
|
|
1806
|
+
page, = render_pages('''
|
|
1807
|
+
<article style="display: flex; flex-direction: column; height: 100px;
|
|
1808
|
+
font: 2px weasyprint">
|
|
1809
|
+
<div>abc</div>
|
|
1810
|
+
<div style="flex: 1; padding-top: 5em">def</div>
|
|
1811
|
+
</article>
|
|
1812
|
+
''')
|
|
1813
|
+
html, = page.children
|
|
1814
|
+
body, = html.children
|
|
1815
|
+
article, = body.children
|
|
1816
|
+
div1, div2 = article.children
|
|
1817
|
+
assert div1.border_height() + div2.border_height() == article.height
|
|
1818
|
+
|
|
1819
|
+
|
|
1820
|
+
@assert_no_logs
|
|
1821
|
+
def test_flex_item_replaced():
|
|
1822
|
+
page, = render_pages('''
|
|
1823
|
+
<div style="display: flex">
|
|
1824
|
+
<svg style="display: block" height="100" width="100" xmlns="http://www.w3.org/2000/svg">
|
|
1825
|
+
<circle r="45" cx="50" cy="50" fill="red" />
|
|
1826
|
+
</svg>
|
|
1827
|
+
</div>
|
|
1828
|
+
''')
|
|
1829
|
+
html, = page.children
|
|
1830
|
+
body, = html.children
|
|
1831
|
+
div, = body.children
|
|
1832
|
+
svg, = div.children
|
|
1833
|
+
assert svg.width == svg.height == 100
|
|
@@ -969,6 +969,74 @@ def test_page_groups():
|
|
|
969
969
|
assert section.element_tag == 'section'
|
|
970
970
|
|
|
971
971
|
|
|
972
|
+
@assert_no_logs
|
|
973
|
+
def test_page_groups_blank_inside():
|
|
974
|
+
# Regression test for #1076.
|
|
975
|
+
pages = render_pages('''
|
|
976
|
+
<style>
|
|
977
|
+
@page { size: 100px }
|
|
978
|
+
@page div { size: 50px }
|
|
979
|
+
div { page: div }
|
|
980
|
+
p { break-before: right }
|
|
981
|
+
</style>
|
|
982
|
+
<div>
|
|
983
|
+
<p>1</p>
|
|
984
|
+
<p>2</p>
|
|
985
|
+
</div>
|
|
986
|
+
''')
|
|
987
|
+
assert len(pages) == 3
|
|
988
|
+
for page in pages:
|
|
989
|
+
assert (page.width, page.height) == (50, 50)
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
@assert_no_logs
|
|
993
|
+
def test_page_groups_blank_outside():
|
|
994
|
+
pages = render_pages('''
|
|
995
|
+
<style>
|
|
996
|
+
@page { size: 100px }
|
|
997
|
+
@page p { size: 50px }
|
|
998
|
+
p { page: p; break-before: right }
|
|
999
|
+
</style>
|
|
1000
|
+
<div>
|
|
1001
|
+
<p>1</p>
|
|
1002
|
+
<p>2</p>
|
|
1003
|
+
</div>
|
|
1004
|
+
''')
|
|
1005
|
+
page1, page2, page3 = pages
|
|
1006
|
+
for page in (page1, page3):
|
|
1007
|
+
assert (page.width, page.height) == (50, 50)
|
|
1008
|
+
assert (page2.width, page2.height) == (100, 100)
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
@assert_no_logs
|
|
1012
|
+
def test_page_groups_first_nth():
|
|
1013
|
+
# Regression test for #2429.
|
|
1014
|
+
pages = render_pages('''
|
|
1015
|
+
<style>
|
|
1016
|
+
@page { size: 100px }
|
|
1017
|
+
@page div { size: 50px }
|
|
1018
|
+
@page :nth(2n+1 of div) { size: 30px }
|
|
1019
|
+
div { page: div; break-before: right }
|
|
1020
|
+
p { break-before: page }
|
|
1021
|
+
</style>
|
|
1022
|
+
<div>
|
|
1023
|
+
<p>1</p>
|
|
1024
|
+
<p>2</p>
|
|
1025
|
+
<p>3</p>
|
|
1026
|
+
</div>
|
|
1027
|
+
<div>
|
|
1028
|
+
<p>4</p>
|
|
1029
|
+
<p>5</p>
|
|
1030
|
+
</div>
|
|
1031
|
+
''')
|
|
1032
|
+
page1, page2, page3, page4, page5, page6 = pages
|
|
1033
|
+
for page in (page1, page3, page5):
|
|
1034
|
+
assert (page.width, page.height) == (30, 30)
|
|
1035
|
+
for page in (page2, page6):
|
|
1036
|
+
assert (page.width, page.height) == (50, 50)
|
|
1037
|
+
assert (page4.width, page4.height) == (100, 100)
|
|
1038
|
+
|
|
1039
|
+
|
|
972
1040
|
@assert_no_logs
|
|
973
1041
|
@pytest.mark.parametrize('style, line_counts', (
|
|
974
1042
|
('orphans: 2; widows: 2', [4, 3]),
|
|
@@ -15,7 +15,7 @@ import cssselect2
|
|
|
15
15
|
import tinycss2
|
|
16
16
|
import tinyhtml5
|
|
17
17
|
|
|
18
|
-
VERSION = __version__ = '65.
|
|
18
|
+
VERSION = __version__ = '65.1'
|
|
19
19
|
|
|
20
20
|
#: Default values for command-line and Python API options. See
|
|
21
21
|
#: :func:`__main__.main` to learn more about specific options for
|
|
@@ -20,7 +20,7 @@ a[href] { -weasy-link: attr(href) }
|
|
|
20
20
|
/* Display and visibility */
|
|
21
21
|
|
|
22
22
|
[hidden], area, base, basefont, command, datalist, head, input[type=hidden i], link, menu[type=context i], meta, noembed, noframes, param, rp, script, source, style, template, title, track { display: none }
|
|
23
|
-
address, article, aside, blockquote, body, center, dd, details, dir, div, dl, dt, frame, frameset, fieldset, figure, figcaption, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, html, legend, listing, menu, nav, ol, p, plaintext, pre, section, summary, ul, xmp { display: block }
|
|
23
|
+
address, article, aside, blockquote, body, center, dd, details, dir, div, dl, dt, frame, frameset, fieldset, figure, figcaption, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, html, legend, listing, main, menu, nav, ol, p, plaintext, pre, section, summary, ul, xmp { display: block }
|
|
24
24
|
button, input, keygen, select, textarea { display: inline-block }
|
|
25
25
|
li { display: list-item }
|
|
26
26
|
table { display: table }
|
|
@@ -62,14 +62,18 @@ dd { margin-left: 40px }
|
|
|
62
62
|
[dir] [dir=rtl i] dd { margin-left: 40px; margin-right: 0 }
|
|
63
63
|
[dir] [dir] [dir=ltr i] dd { margin-left: 0; margin-right: 40px }
|
|
64
64
|
[dir] [dir] [dir=rtl i] dd { margin-left: 40px; margin-right: 0 }
|
|
65
|
+
dd[dir=ltr i][dir][dir] { margin-left: 0; margin-right: 40px }
|
|
66
|
+
dd[dir=rtl i][dir][dir] { margin-left: 40px; margin-right: 0 }
|
|
65
67
|
|
|
66
68
|
dir, menu, ol, ul { padding-left: 40px }
|
|
67
|
-
[dir=rtl i] :is(dir, menu, ol, ul) { padding-left: 0; padding-right: 40px }
|
|
68
69
|
[dir=ltr i] :is(dir, menu, ol, ul) { padding-left: 40px; padding-right: 0 }
|
|
69
|
-
[dir
|
|
70
|
+
[dir=rtl i] :is(dir, menu, ol, ul) { padding-left: 0; padding-right: 40px }
|
|
70
71
|
[dir] [dir=ltr i] :is(dir, menu, ol, ul) { padding-left: 40px; padding-right: 0 }
|
|
71
|
-
[dir] [dir
|
|
72
|
+
[dir] [dir=rtl i] :is(dir, menu, ol, ul) { padding-left: 0; padding-right: 40px }
|
|
72
73
|
[dir] [dir] [dir=ltr i] :is(dir, menu, ol, ul) { padding-left: 40px; padding-right: 0 }
|
|
74
|
+
[dir] [dir] [dir=rtl i] :is(dir, menu, ol, ul) { padding-left: 0; padding-right: 40px }
|
|
75
|
+
:is(dir, menu, ol, ul)[dir=ltr i][dir][dir] { padding-left: 40px; padding-right: 0 }
|
|
76
|
+
:is(dir, menu, ol, ul)[dir=rtl i][dir][dir] { padding-left: 0; padding-right: 40px }
|
|
73
77
|
|
|
74
78
|
table { border-spacing: 2px; border-collapse: separate }
|
|
75
79
|
td, th { padding: 1px }
|
|
@@ -167,9 +167,9 @@ def flex_layout(context, box, bottom_space, skip_stack, containing_block, page_i
|
|
|
167
167
|
content_size = min_content_width(context, new_child, outer=False)
|
|
168
168
|
transferred_size = None
|
|
169
169
|
if isinstance(child, boxes.ReplacedBox):
|
|
170
|
-
image =
|
|
170
|
+
image = child.replacement
|
|
171
171
|
_, intrinsic_height, intrinsic_ratio = image.get_intrinsic_size(
|
|
172
|
-
|
|
172
|
+
child.style['image_resolution'], child.style['font_size'])
|
|
173
173
|
if intrinsic_ratio and intrinsic_height:
|
|
174
174
|
transferred_size = intrinsic_height * intrinsic_ratio
|
|
175
175
|
if specified_size != 'auto':
|
|
@@ -195,9 +195,9 @@ def flex_layout(context, box, bottom_space, skip_stack, containing_block, page_i
|
|
|
195
195
|
content_size = new_child.height if new_child else 0
|
|
196
196
|
transferred_size = None
|
|
197
197
|
if isinstance(child, boxes.ReplacedBox):
|
|
198
|
-
image =
|
|
198
|
+
image = child.replacement
|
|
199
199
|
intrinsic_width, _, intrinsic_ratio = image.get_intrinsic_size(
|
|
200
|
-
|
|
200
|
+
child.style['image_resolution'], child.style['font_size'])
|
|
201
201
|
if intrinsic_ratio and intrinsic_width:
|
|
202
202
|
transferred_size = intrinsic_width / intrinsic_ratio
|
|
203
203
|
if specified_size != 'auto':
|
|
@@ -221,14 +221,16 @@ def flex_layout(context, box, bottom_space, skip_stack, containing_block, page_i
|
|
|
221
221
|
child.flex_base_size = flex_basis
|
|
222
222
|
if main == 'width':
|
|
223
223
|
child.main_outer_extra = (
|
|
224
|
-
child.border_left_width + child.border_right_width
|
|
224
|
+
child.border_left_width + child.border_right_width +
|
|
225
|
+
child.padding_left + child.padding_right)
|
|
225
226
|
if child.margin_left != 'auto':
|
|
226
227
|
child.main_outer_extra += child.margin_left
|
|
227
228
|
if child.margin_right != 'auto':
|
|
228
229
|
child.main_outer_extra += child.margin_right
|
|
229
230
|
else:
|
|
230
231
|
child.main_outer_extra = (
|
|
231
|
-
child.border_top_width + child.border_bottom_width
|
|
232
|
+
child.border_top_width + child.border_bottom_width +
|
|
233
|
+
child.padding_top + child.padding_bottom)
|
|
232
234
|
if child.margin_top != 'auto':
|
|
233
235
|
child.main_outer_extra += child.margin_top
|
|
234
236
|
if child.margin_bottom != 'auto':
|
|
@@ -250,8 +252,12 @@ def flex_layout(context, box, bottom_space, skip_stack, containing_block, page_i
|
|
|
250
252
|
new_child = block.block_level_layout(
|
|
251
253
|
context, new_child, bottom_space, child_skip_stack, parent_box,
|
|
252
254
|
page_is_empty, absolute_boxes, fixed_boxes)[0]
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
if new_child:
|
|
256
|
+
child.flex_base_size = new_child.height
|
|
257
|
+
child.main_outer_extra = (
|
|
258
|
+
new_child.margin_height() - new_child.height)
|
|
259
|
+
else:
|
|
260
|
+
child.flex_base_size = child.main_outer_extra = 0
|
|
255
261
|
|
|
256
262
|
if main == 'width':
|
|
257
263
|
position_x += child.flex_base_size + child.main_outer_extra
|
|
@@ -799,6 +799,8 @@ def set_page_type_computed_styles(page_type, html, style_for):
|
|
|
799
799
|
|
|
800
800
|
|
|
801
801
|
def _includes_resume_at(resume_at, page_group_resume_at):
|
|
802
|
+
if not page_group_resume_at:
|
|
803
|
+
return True
|
|
802
804
|
(page_child_index, page_child_resume_at), = page_group_resume_at.items()
|
|
803
805
|
if resume_at is None or page_child_index not in resume_at:
|
|
804
806
|
return False
|
|
@@ -807,7 +809,7 @@ def _includes_resume_at(resume_at, page_group_resume_at):
|
|
|
807
809
|
return _includes_resume_at(resume_at[page_child_index], page_child_resume_at)
|
|
808
810
|
|
|
809
811
|
|
|
810
|
-
def _update_page_groups(page_groups, resume_at, next_page, root_box):
|
|
812
|
+
def _update_page_groups(page_groups, resume_at, next_page, root_box, blank):
|
|
811
813
|
# https://www.w3.org/TR/css-gcpm-3/#document-sequence-selectors
|
|
812
814
|
|
|
813
815
|
# Remove or increment page groups.
|
|
@@ -819,35 +821,40 @@ def _update_page_groups(page_groups, resume_at, next_page, root_box):
|
|
|
819
821
|
page_groups.pop(i - page_groups_length)
|
|
820
822
|
|
|
821
823
|
# Add page groups.
|
|
822
|
-
if
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
824
|
+
if not blank:
|
|
825
|
+
if (resume_at and next_page['break'] == 'any') or not next_page['page']:
|
|
826
|
+
# We don’t have a forced page break or a named page.
|
|
827
|
+
return next_page['page']
|
|
828
|
+
if page_groups and page_groups[-1][0] == next_page['page']:
|
|
829
|
+
# We’re already in an element whose page name is the next page name.
|
|
830
|
+
return next_page['page']
|
|
828
831
|
|
|
829
832
|
# Find the box that has the named page. It is a first in-flow child of the
|
|
830
833
|
# element corresponding to resume_at.
|
|
831
834
|
|
|
832
835
|
# Find element corrensponding to resume_at.
|
|
833
|
-
page_group_resume_at = copy.deepcopy(resume_at)
|
|
834
|
-
current_resume_at = page_group_resume_at
|
|
836
|
+
current_resume_at = page_group_resume_at = copy.deepcopy(resume_at) or {0: None}
|
|
835
837
|
current_element = root_box
|
|
836
838
|
while True:
|
|
837
839
|
child_index, child_resume_at = tuple(current_resume_at.items())[-1]
|
|
840
|
+
parent_element = current_element
|
|
838
841
|
current_element = current_element.children[child_index]
|
|
839
842
|
if child_resume_at is None:
|
|
840
843
|
break
|
|
841
844
|
current_resume_at = child_resume_at
|
|
842
845
|
|
|
846
|
+
if blank:
|
|
847
|
+
# Page is blank, don’t create a new page group and return parent’s page name.
|
|
848
|
+
return parent_element.style['page']
|
|
849
|
+
|
|
843
850
|
# Find the descendant with named page.
|
|
844
851
|
while True:
|
|
845
852
|
if current_element.style['page'] == next_page['page']:
|
|
846
853
|
page_groups.append([next_page['page'], 0, page_group_resume_at])
|
|
847
|
-
return
|
|
854
|
+
return next_page['page']
|
|
848
855
|
if not isinstance(current_element, boxes.ParentBox):
|
|
849
856
|
# Shouldn’t happen.
|
|
850
|
-
return
|
|
857
|
+
return next_page['page']
|
|
851
858
|
for i, child in enumerate(current_element.children):
|
|
852
859
|
if not child.is_in_normal_flow():
|
|
853
860
|
continue
|
|
@@ -858,7 +865,7 @@ def _update_page_groups(page_groups, resume_at, next_page, root_box):
|
|
|
858
865
|
break
|
|
859
866
|
else:
|
|
860
867
|
# Shouldn’t happen.
|
|
861
|
-
return
|
|
868
|
+
return next_page['page']
|
|
862
869
|
|
|
863
870
|
|
|
864
871
|
def remake_page(index, page_groups, context, root_box, html):
|
|
@@ -891,9 +898,8 @@ def remake_page(index, page_groups, context, root_box, html):
|
|
|
891
898
|
(next_page_side == 'left' and right_page) or
|
|
892
899
|
(next_page_side == 'right' and not right_page) or
|
|
893
900
|
(context.reported_footnotes and resume_at is None))
|
|
894
|
-
name = '' if blank else next_page['page']
|
|
895
901
|
side = 'right' if right_page else 'left'
|
|
896
|
-
_update_page_groups(page_groups, resume_at, next_page, root_box)
|
|
902
|
+
name = _update_page_groups(page_groups, resume_at, next_page, root_box, blank)
|
|
897
903
|
groups = tuple((name, index) for name, index, _ in page_groups)
|
|
898
904
|
page_type = PageType(side, blank, name, index, groups)
|
|
899
905
|
set_page_type_computed_styles(page_type, html, context.style_for)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|