(node, context)
Implements S10.6
Implements S10.6
Implements S10 . 6
def calculate_height_and_margins(node, context):
    "Implements S10.6"
    if is_float_positioned_element(node):
        if node.intrinsic.is_replaced:  # 10.6.6
            calculate_floating_replaced_height(node, context)
        else:  # 10.6.5
            calculate_floating_non_replaced_height(node, context)
    elif is_absolute_positioned_element(node):
        if node.intrinsic.is_replaced:  # 10.6.8
            calculate_absolute_position_replaced_height(node, context)
        else:  # 10.6.7
            calculate_absolute_position_non_replaced_height(node, context)
    elif is_inline_element(node):
        if node.intrinsic.is_replaced:  # 10.6.2
            calculate_inline_replaced_height(node, context)
        else:  # 10.6.1
            calculate_inline_non_replaced_height(node, context)
    else:  # Normal flow
        if is_block_level_element(node):
            if node.intrinsic.is_replaced:  # 10.6.4
                calculate_block_replaced_normal_flow_height(node, context)
            else:  # 10.6.3
                calculate_block_non_replaced_normal_flow_height(node, context)
        elif is_inline_block_element(node):
            if node.intrinsic.is_replaced:  # 10.6.10
                calculate_inline_block_replaced_normal_flow_height(node, context)
            else:  # 10.6.9
                calculate_inline_block_non_replaced_normal_flow_height(node, context)
        else:
            # This branch should never execute.
            # If it does, we've missed something along the way.
            raise Exception("Unknown normal flow height calculation")
def calculate_height_and_margins ( node , context ) : if is_float_positioned_element ( node ) : if node . intrinsic . is_replaced : # 10.6.6 calculate_floating_replaced_height ( node , context ) else : # 10.6.5 calculate_floating_non_replaced_height ( node , context ) elif is_absolute_positioned_element ( node ) : if node . intrinsic . is_replaced : # 10.6.8 calculate_absolute_position_replaced_height ( node , context ) else : # 10.6.7 calculate_absolute_position_non_replaced_height ( node , context ) elif is_inline_element ( node ) : if node . intrinsic . is_replaced : # 10.6.2 calculate_inline_replaced_height ( node , context ) else : # 10.6.1 calculate_inline_non_replaced_height ( node , context ) else : # Normal flow if is_block_level_element ( node ) : if node . intrinsic . is_replaced : # 10.6.4 calculate_block_replaced_normal_flow_height ( node , context ) else : # 10.6.3 calculate_block_non_replaced_normal_flow_height ( node , context ) elif is_inline_block_element ( node ) : if node . intrinsic . is_replaced : # 10.6.10 calculate_inline_block_replaced_normal_flow_height ( node , context ) else : # 10.6.9 calculate_inline_block_non_replaced_normal_flow_height ( node , context ) else : # This branch should never execute. # If it does, we've missed something along the way. raise Exception ( "Unknown normal flow height calculation" )