Skip to content

Commit

Permalink
Fix Acid2 test
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Jun 24, 2016
1 parent 570034a commit 52d5c9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion weasyprint/layout/float.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
5 changes: 4 additions & 1 deletion weasyprint/tests/test_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('''<div style="top:100%; float:left">''')


@assert_no_logs
Expand Down

0 comments on commit 52d5c9a

Please sign in to comment.