1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 16:07:57 +03:00

Fix the available width for shrink-to-fit on absolutes.

This commit is contained in:
Simon Sapin 2012-05-30 19:06:09 +02:00
parent 773700dd73
commit c8d6066ace
2 changed files with 5 additions and 1 deletions

View File

@ -117,7 +117,8 @@ def absolute_block(document, box, containing_block):
box.margin_left = 0
if margin_r == 'auto':
box.margin_right = 0
available_width = cb_width
available_width = cb_width - (
padding_plus_borders_x + box.margin_left + box.margin_right)
box.width = shrink_to_fit(box, available_width)
elif left != 'auto' and right != 'auto' and width != 'auto':
width_for_margins = cb_width - (

View File

@ -21,6 +21,9 @@ from ..text import TextFragment
def shrink_to_fit(box, available_width):
"""Return the shrink-to-fit width of ``box``.
*Warning:* both available_outer_width and the return value are
for width of the *content area*, not margin area.
http://www.w3.org/TR/CSS21/visudet.html#float-width
"""