From 52d5c9a225b41bca24f5cb2d156611bb2933e2b4 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sat, 25 Jun 2016 01:35:23 +0200 Subject: [PATCH] Fix Acid2 test --- weasyprint/layout/float.py | 3 ++- weasyprint/tests/test_layout.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/weasyprint/layout/float.py b/weasyprint/layout/float.py index 55b5d7d4..9a5e0e65 100644 --- a/weasyprint/layout/float.py +++ b/weasyprint/layout/float.py @@ -34,13 +34,14 @@ def float_layout(context, box, containing_block, device_size, absolute_boxes, from .inlines import inline_replaced_box_width_height cb_width, cb_height = (containing_block.width, containing_block.height) + resolve_percentages(box, (cb_width, cb_height)) + # TODO: This is only handled later in blocks.block_container_layout # http://www.w3.org/TR/CSS21/visudet.html#normal-block if cb_height == 'auto': cb_height = ( containing_block.position_y - containing_block.content_box_y()) - resolve_percentages(box, (cb_width, cb_height)) resolve_position_percentages(box, (cb_width, cb_height)) if box.margin_left == 'auto': diff --git a/weasyprint/tests/test_layout.py b/weasyprint/tests/test_layout.py index 83e281a9..f710468e 100644 --- a/weasyprint/tests/test_layout.py +++ b/weasyprint/tests/test_layout.py @@ -4927,7 +4927,10 @@ def test_floats(): div, anon_block = body.children line, = anon_block.children img_2, = line.children - assert outer_area(img_2) == (0, 0, 50, 50) + + # Regression test + # https://github.com/Kozea/WeasyPrint/issues/263 + page, = parse('''
''') @assert_no_logs