Codebase list weasyprint / b2892d3
New upstream release * New upstream release - Drop d/p/0002-Revert-upstream-simplify-line-breaking.patch, alternate fix incorporated upstream Scott Kitterman 4 years ago
4 changed file(s) with 13 addition(s) and 97 deletion(s). Raw diff Collapse all Expand all
0 weasyprint (51-1) unstable; urgency=medium
1
2 * New upstream release
3 - Drop d/p/0002-Revert-upstream-simplify-line-breaking.patch, alternate
4 fix incorporated upstream
5
6 -- Scott Kitterman <scott@kitterman.com> Wed, 25 Dec 2019 01:16:42 -0500
7
08 weasyprint (50-2) unstable; urgency=medium
19
210 [ Ondřej Nový ]
88 1 file changed, 8 insertions(+), 8 deletions(-)
99
1010 diff --git a/setup.cfg b/setup.cfg
11 index 7697430..9452a47 100644
11 index f18b709..9a599a7 100644
1212 --- a/setup.cfg
1313 +++ b/setup.cfg
14 @@ -52,8 +52,8 @@ install_requires =
14 @@ -53,8 +53,8 @@ install_requires =
1515 tests_require =
1616 pytest-runner
1717 pytest-cov
2222 python_requires = >= 3.5
2323
2424 [options.entry_points]
25 @@ -71,8 +71,8 @@ doc =
25 @@ -72,8 +72,8 @@ doc =
2626 test =
2727 pytest-runner
2828 pytest-cov
3333
3434 [bdist_wheel]
3535 python-tag = py3
36 @@ -85,7 +85,7 @@ build-dir = docs/_build
36 @@ -86,7 +86,7 @@ build-dir = docs/_build
3737 test = pytest
3838
3939 [tool:pytest]
4242 norecursedirs = build dist .cache .eggs .git
4343
4444 [coverage:run]
45 @@ -100,9 +100,9 @@ exclude_lines =
45 @@ -101,9 +101,9 @@ exclude_lines =
4646 omit =
4747 .*
4848
+0
-91
debian/patches/0002-Revert-upstream-simplify-line-breaking.patch less more
0 From: Scott Kitterman <scott@kitterman.com>
1 Date: Fri, 18 Oct 2019 11:57:19 -0400
2 Subject: Revert upstream simplify line breaking
3
4 ---
5 weasyprint/layout/inlines.py | 68 ++++++++++++++++++++++++++++++--------------
6 1 file changed, 46 insertions(+), 22 deletions(-)
7
8 diff --git a/weasyprint/layout/inlines.py b/weasyprint/layout/inlines.py
9 index 4d3f9fd..e474e71 100644
10 --- a/weasyprint/layout/inlines.py
11 +++ b/weasyprint/layout/inlines.py
12 @@ -853,28 +853,36 @@ def split_inline_box(context, box, position_x, max_x, skip_stack,
13 else:
14 children += [(child_index, child_new_child)]
15
16 - # As this child has already been broken
17 - # following the original skip stack, we have to
18 - # add the original skip stack to the partial
19 - # skip stack we get after the new rendering.
20 -
21 - # We have to do:
22 - # resume_at + initial_skip_stack
23 - # but adding skip stacks is a bit complicated
24 - current_skip_stack = initial_skip_stack
25 - current_resume_at = (child_index, child_resume_at)
26 - stack = []
27 - while current_skip_stack and current_resume_at:
28 - skip, current_skip_stack = (
29 - current_skip_stack)
30 - resume, current_resume_at = (
31 - current_resume_at)
32 - stack.append(skip + resume)
33 - if resume != 0:
34 - break
35 - resume_at = current_resume_at
36 - while stack:
37 - resume_at = (stack.pop(), resume_at)
38 + # We have to check whether the child we're breaking
39 + # is the one broken by the initial skip stack.
40 + broken_child = same_broken_child(
41 + initial_skip_stack,
42 + (child_index, child_resume_at))
43 + if broken_child:
44 + # As this child has already been broken
45 + # following the original skip stack, we have to
46 + # add the original skip stack to the partial
47 + # skip stack we get after the new rendering.
48 +
49 + # We have to do:
50 + # child_resume_at += initial_skip_stack[1]
51 + # but adding skip stacks is a bit complicated
52 + current_skip_stack = initial_skip_stack[1]
53 + current_resume_at = child_resume_at
54 + stack = []
55 + while current_skip_stack and current_resume_at:
56 + skip_stack, current_skip_stack = (
57 + current_skip_stack)
58 + resume_at, current_resume_at = (
59 + current_resume_at)
60 + stack.append(skip_stack + resume_at)
61 + child_resume_at = (
62 + current_skip_stack or current_resume_at)
63 + while stack:
64 + child_resume_at = (
65 + stack.pop(), child_resume_at)
66 +
67 + resume_at = (child_index, child_resume_at)
68 break
69 if break_found:
70 break
71 @@ -1284,3 +1292,19 @@ def can_break_inside(box):
72 else:
73 return False
74 return False
75 +
76 +
77 +def same_broken_child(original_skip_stack, relative_skip_stack):
78 + """Check that the skip stacks design the same text box."""
79 + while (isinstance(original_skip_stack, tuple) and
80 + isinstance(relative_skip_stack, tuple)):
81 + if original_skip_stack[1] is None and relative_skip_stack[1] is None:
82 + # The last levels of the two skip_stack are the same
83 + return True
84 + if relative_skip_stack[0] != 0:
85 + # If at the current level the skip_stack is not 0, it means that
86 + # it is not the first child that has been cut
87 + return False
88 + original_skip_stack = original_skip_stack[1]
89 + relative_skip_stack = relative_skip_stack[1]
90 + return False
00 0001-test_fixup.patch
1 0002-Revert-upstream-simplify-line-breaking.patch