(node, context)
Implements S10.6.2
Implements S10.6.2
Implements S10 . 6 . 2
def calculate_inline_replaced_height(node, context):
    "Implements S10.6.2"
    if node.layout.margin_top is AUTO:  # P1
        node.layout.margin_top = 0

    if node.layout.margin_bottom is AUTO:  # P1
        node.layout.margin_bottom = 0

    if node.style.width is AUTO and node.style.height is AUTO and node.intrinsic.height is not None:  # P2
        content_height = node.intrinsic.height
    elif node.style.height is AUTO and node.intrinsic.ratio:  # P3
        content_height = node.layout.content_width * node.intrinsic.ratio
    elif node.style.height is AUTO and node.intrinsic.height:  # P4
        content_height = node.intrinsic.height
    elif node.style.height is AUTO:  # P5
        content_height = min(node.layout.content_width // 2, 150)
    else:
        content_height = node.style.height.px(**context)

    node.layout.content_height = content_height
    node.layout.content_top += node.layout.margin_top + node.layout.border_top_width + node.layout.padding_top
def calculate_inline_replaced_height ( node , context ) : if node . layout . margin_top is AUTO : # P1 node . layout . margin_top = 0 if node . layout . margin_bottom is AUTO : # P1 node . layout . margin_bottom = 0 if node . style . width is AUTO and node . style . height is AUTO and node . intrinsic . height is not None : # P2 content_height = node . intrinsic . height elif node . style . height is AUTO and node . intrinsic . ratio : # P3 content_height = node . layout . content_width * node . intrinsic . ratio elif node . style . height is AUTO and node . intrinsic . height : # P4 content_height = node . intrinsic . height elif node . style . height is AUTO : # P5 content_height = min ( node . layout . content_width // 2 , 150 ) else : content_height = node . style . height . px ( * * context ) node . layout . content_height = content_height node . layout . content_top += node . layout . margin_top + node . layout . border_top_width + node . layout . padding_top