1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 00:21:15 +03:00

Merge branch 'master' of github.com:Kozea/WeasyPrint

This commit is contained in:
Guillaume Ayoub 2019-09-18 15:08:44 +02:00
commit 3af0d73be2
2 changed files with 17 additions and 0 deletions

View File

@ -647,6 +647,11 @@ def block_container_layout(context, box, max_position_y, skip_stack,
# http://www.w3.org/TR/CSS21/visudet.html#normal-block
# TODO: See float.float_layout
if new_box.height == 'auto':
if context.excluded_shapes and new_box.style['overflow'] != 'visible':
max_float_position_y = max(
float_box.position_y + float_box.margin_height()
for float_box in context.excluded_shapes)
position_y = max(max_float_position_y, position_y)
new_box.height = position_y - new_box.content_box_y()
if new_box.style['position'] == 'relative':

View File

@ -705,3 +705,15 @@ def test_box_decoration_break_slice_bottom_padding():
assert article.height == 20
div, = article.children
assert div.position_y == 0
@assert_no_logs
def test_overflow_auto():
page, = parse('''
<article style="overflow: auto">
<div style="float: left; height: 50px; margin: 10px">bla bla bla</div>
toto toto''')
html, = page.children
body, = html.children
article, = body.children
assert article.height == 50 + 10 + 10