diff --git a/tests/layout/test_inline.py b/tests/layout/test_inline.py index 6ff60efa8..7f2dd841e 100644 --- a/tests/layout/test_inline.py +++ b/tests/layout/test_inline.py @@ -1102,3 +1102,17 @@ def test_bidi_position_x_invariant(): assert block_ltr.position_x == block_rtl.position_x assert line_ltr.position_x == line_rtl.position_x assert text_ltr.position_x == text_rtl.position_x + + +@assert_no_logs +def test_nested_waiting_children_width(): + # Regression test for https://github.com/Kozea/WeasyPrint/issues/2275 + page, = render_pages( + '
' + 'a bc') + html, = page.children + body, = html.children + line1, line2 = body.children + assert line1.children[0].children[0].children[0].text == 'a' + assert line2.children[0].children[0].children[0].text == 'b' + assert line2.children[0].children[1].text == 'c' diff --git a/weasyprint/layout/inline.py b/weasyprint/layout/inline.py index 4dc24b533..d67806d2e 100644 --- a/weasyprint/layout/inline.py +++ b/weasyprint/layout/inline.py @@ -782,7 +782,7 @@ def split_inline_box(context, box, position_x, max_x, bottom_space, skip_stack, if new_position_x > max_x and not trailing_whitespace: previous_resume_at = _break_waiting_children( - context, box, max_x, bottom_space, initial_skip_stack, + context, containing_block, max_x, bottom_space, initial_skip_stack, absolute_boxes, fixed_boxes, line_placeholders, waiting_floats, line_children, children, waiting_children) if previous_resume_at: