#NEWLINE# @ handle_min_max_width #NEWLINE# def absolute_width( box , context , containing_block ) : #NEWLINE# #INDENT# margin_l = box . margin_left #NEWLINE# margin_r = box . margin_right #NEWLINE# padding_l = box . padding_left #NEWLINE# padding_r = box . padding_right #NEWLINE# border_l = box . border_left_width #NEWLINE# border_r = box . border_right_width #NEWLINE# width = box . width #NEWLINE# left = box . left #NEWLINE# right = box . right #NEWLINE# ( cb_x , cb_y , cb_width , cb_height ) = containing_block #NEWLINE# padding_plus_borders_x = ( ( ( padding_l + padding_r ) + border_l ) + border_r ) #NEWLINE# translate_x = 0 #NEWLINE# translate_box_width = False #NEWLINE# default_translate_x = ( cb_x - box . position_x ) #NEWLINE# if ( left == right == width == 'auto' ) : #NEWLINE# #INDENT# if ( margin_l == 'auto' ) : #NEWLINE# #INDENT# box . margin_left = 0 #NEWLINE# #UNINDENT# if ( margin_r == 'auto' ) : #NEWLINE# #INDENT# box . margin_right = 0 #NEWLINE# #UNINDENT# available_width = ( cb_width - ( ( padding_plus_borders_x + box . margin_left ) + box . margin_right ) ) #NEWLINE# box . width = shrink_to_fit ( context , box , available_width ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( left != 'auto' ) and ( right != 'auto' ) and ( width != 'auto' ) ) : #NEWLINE# #INDENT# width_for_margins = ( cb_width - ( ( right + left ) + padding_plus_borders_x ) ) #NEWLINE# if ( margin_l == margin_r == 'auto' ) : #NEWLINE# #INDENT# if ( ( ( ( width + padding_plus_borders_x ) + right ) + left ) <= cb_width ) : #NEWLINE# #INDENT# box . margin_left = box . margin_right = ( width_for_margins / 2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# box . margin_left = 0 #NEWLINE# box . margin_right = width_for_margins #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( margin_l == 'auto' ) : #NEWLINE# #INDENT# box . margin_left = width_for_margins #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( margin_r == 'auto' ) : #NEWLINE# #INDENT# box . margin_right = width_for_margins #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# box . margin_right = width_for_margins #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# translate_x = ( left + default_translate_x ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( margin_l == 'auto' ) : #NEWLINE# #INDENT# box . margin_left = 0 #NEWLINE# #UNINDENT# if ( margin_r == 'auto' ) : #NEWLINE# #INDENT# box . margin_right = 0 #NEWLINE# #UNINDENT# spacing = ( ( padding_plus_borders_x + box . margin_left ) + box . margin_right ) #NEWLINE# if ( left == width == 'auto' ) : #NEWLINE# #INDENT# box . width = shrink_to_fit ( context , box , ( ( cb_width - spacing ) - right ) ) #NEWLINE# translate_x = ( ( ( cb_width - right ) - spacing ) + default_translate_x ) #NEWLINE# translate_box_width = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( left == right == 'auto' ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( width == right == 'auto' ) : #NEWLINE# #INDENT# box . width = shrink_to_fit ( context , box , ( ( cb_width - spacing ) - left ) ) #NEWLINE# translate_x = ( left + default_translate_x ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( left == 'auto' ) : #NEWLINE# #INDENT# translate_x = ( ( ( ( cb_width + default_translate_x ) - right ) - spacing ) - width ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( width == 'auto' ) : #NEWLINE# #INDENT# box . width = ( ( ( cb_width - right ) - left ) - spacing ) #NEWLINE# translate_x = ( left + default_translate_x ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( right == 'auto' ) : #NEWLINE# #INDENT# translate_x = ( left + default_translate_x ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return ( translate_box_width , translate_x )